summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/RenderBoxModelObject.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2010-11-04 12:00:17 -0700
committerJohn Reck <jreck@google.com>2010-11-09 11:35:04 -0800
commite14391e94c850b8bd03680c23b38978db68687a8 (patch)
tree3fed87e6620fecaf3edc7259ae58a11662bedcb2 /WebCore/rendering/RenderBoxModelObject.cpp
parent1bd705833a68f07850cf7e204b26f8d328d16951 (diff)
downloadexternal_webkit-e14391e94c850b8bd03680c23b38978db68687a8.zip
external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.tar.gz
external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.tar.bz2
Merge Webkit at r70949: Initial merge by git.
Change-Id: I77b8645c083b5d0da8dba73ed01d4014aab9848e
Diffstat (limited to 'WebCore/rendering/RenderBoxModelObject.cpp')
-rw-r--r--WebCore/rendering/RenderBoxModelObject.cpp240
1 files changed, 152 insertions, 88 deletions
diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp
index ec065a6..e83b709 100644
--- a/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/WebCore/rendering/RenderBoxModelObject.cpp
@@ -524,10 +524,23 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
IntSize topLeft, topRight, bottomLeft, bottomRight;
style()->getBorderRadiiForRect(borderRect, topLeft, topRight, bottomLeft, bottomRight);
- context->addRoundedRectClip(borderRect, includeLeftEdge ? topLeft : IntSize(),
- includeRightEdge ? topRight : IntSize(),
- includeLeftEdge ? bottomLeft : IntSize(),
- includeRightEdge ? bottomRight : IntSize());
+ if (!includeLeftEdge) {
+ topLeft = IntSize();
+ if (box->isVertical())
+ topRight = IntSize();
+ else
+ bottomLeft = IntSize();
+ }
+
+ if (!includeRightEdge) {
+ if (box->isVertical())
+ bottomLeft = IntSize();
+ else
+ topRight = IntSize();
+ bottomRight = IntSize();
+ }
+
+ context->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
clippedToBorderRadius = true;
}
@@ -1002,7 +1015,7 @@ static bool borderWillArcInnerEdge(const IntSize& firstRadius, const IntSize& se
}
void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx, int ty, int w, int h,
- const RenderStyle* style, bool begin, bool end)
+ const RenderStyle* style, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
{
if (paintNinePieceImage(graphicsContext, tx, ty, w, h, style, style->borderImage()))
return;
@@ -1025,10 +1038,12 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
EBorderStyle leftStyle = style->borderLeftStyle();
EBorderStyle rightStyle = style->borderRightStyle();
- bool renderTop = topStyle > BHIDDEN && !topTransparent;
- bool renderLeft = leftStyle > BHIDDEN && begin && !leftTransparent;
- bool renderRight = rightStyle > BHIDDEN && end && !rightTransparent;
- bool renderBottom = bottomStyle > BHIDDEN && !bottomTransparent;
+ bool horizontal = style->isHorizontalWritingMode();
+
+ bool renderTop = topStyle > BHIDDEN && !topTransparent && (horizontal || includeLogicalLeftEdge);
+ bool renderLeft = leftStyle > BHIDDEN && !leftTransparent && (!horizontal || includeLogicalLeftEdge);
+ bool renderRight = rightStyle > BHIDDEN && !rightTransparent && (!horizontal || includeLogicalRightEdge);
+ bool renderBottom = bottomStyle > BHIDDEN && !bottomTransparent && (horizontal || includeLogicalRightEdge);
bool renderRadii = false;
Path roundedPath;
@@ -1039,32 +1054,52 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
IntSize topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius;
style->getBorderRadiiForRect(borderRect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
- IntRect innerBorderRect = borderInnerRect(borderRect, style->borderTopWidth(), style->borderBottomWidth(),
- style->borderLeftWidth(), style->borderRightWidth());
+ int leftWidth = (!horizontal || includeLogicalLeftEdge) ? style->borderLeftWidth() : 0;
+ int rightWidth = (!horizontal || includeLogicalRightEdge) ? style->borderRightWidth() : 0;
+ int topWidth = (horizontal || includeLogicalLeftEdge) ? style->borderTopWidth() : 0;
+ int bottomWidth = (horizontal || includeLogicalRightEdge) ? style->borderBottomWidth() : 0;
+ IntRect innerBorderRect = borderInnerRect(borderRect, topWidth, bottomWidth, leftWidth, rightWidth);
IntSize innerTopLeftRadius, innerTopRightRadius, innerBottomLeftRadius, innerBottomRightRadius;
- style->getInnerBorderRadiiForRectWithBorderWidths(innerBorderRect, style->borderTopWidth(), style->borderBottomWidth(),
- style->borderLeftWidth(), style->borderRightWidth(), innerTopLeftRadius, innerTopRightRadius,
- innerBottomLeftRadius, innerBottomRightRadius);
+
+ style->getInnerBorderRadiiForRectWithBorderWidths(innerBorderRect, topWidth, bottomWidth, leftWidth, rightWidth, innerTopLeftRadius, innerTopRightRadius, innerBottomLeftRadius, innerBottomRightRadius);
+
+ IntSize innerTopLeft, innerTopRight, innerBottomLeft, innerBottomRight;
- if (begin) {
+ if (includeLogicalLeftEdge) {
topLeft = topLeftRadius;
- bottomLeft = bottomLeftRadius;
+ innerTopLeft = innerTopLeftRadius;
+ if (horizontal) {
+ bottomLeft = bottomLeftRadius;
+ innerBottomLeft = innerBottomLeftRadius;
+ } else {
+ topRight = topRightRadius;
+ innerTopRight = innerTopRightRadius;
+ }
}
- if (end) {
- topRight = topRightRadius;
+
+ if (includeLogicalRightEdge) {
+ if (horizontal) {
+ topRight = topRightRadius;
+ innerTopRight = innerTopRightRadius;
+ } else {
+ bottomLeft = bottomLeftRadius;
+ innerBottomLeft = innerBottomLeftRadius;
+ }
bottomRight = bottomRightRadius;
+ innerBottomRight = innerBottomRightRadius;
}
- renderRadii = true;
-
- // Clip to the inner and outer radii rects.
- graphicsContext->save();
- graphicsContext->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
- graphicsContext->clipOutRoundedRect(innerBorderRect, innerTopLeftRadius, innerTopRightRadius, innerBottomLeftRadius, innerBottomRightRadius);
-
- roundedPath.addRoundedRect(borderRect, topLeft, topRight, bottomLeft, bottomRight);
- graphicsContext->addPath(roundedPath);
+ renderRadii = !topLeft.isZero() || !topRight.isZero() || !bottomLeft.isZero() || !bottomRight.isZero();
+
+ if (renderRadii) {
+ // Clip to the inner and outer radii rects.
+ graphicsContext->save();
+ graphicsContext->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
+ graphicsContext->clipOutRoundedRect(innerBorderRect, innerTopLeft, innerTopRight, innerBottomLeft, innerBottomRight);
+ roundedPath.addRoundedRect(borderRect, topLeft, topRight, bottomLeft, bottomRight);
+ graphicsContext->addPath(roundedPath);
+ }
}
bool upperLeftBorderStylesMatch = renderLeft && (topStyle == leftStyle) && (topColor == leftColor);
@@ -1078,7 +1113,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
if (renderRadii && borderWillArcInnerEdge(topLeft, topRight, style->borderLeftWidth(), style->borderRightWidth(), style->borderTopWidth())) {
graphicsContext->save();
- clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSTop, upperLeftBorderStylesMatch, upperRightBorderStylesMatch, style);
+ clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSTop, upperLeftBorderStylesMatch, upperRightBorderStylesMatch, style, includeLogicalLeftEdge, includeLogicalRightEdge);
float thickness = max(max(style->borderTopWidth(), style->borderLeftWidth()), style->borderRightWidth());
drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderTopWidth(), thickness, BSTop, style, topColor, topStyle);
graphicsContext->restore();
@@ -1099,7 +1134,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
if (renderRadii && borderWillArcInnerEdge(bottomLeft, bottomRight, style->borderLeftWidth(), style->borderRightWidth(), style->borderBottomWidth())) {
graphicsContext->save();
- clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSBottom, lowerLeftBorderStylesMatch, lowerRightBorderStylesMatch, style);
+ clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSBottom, lowerLeftBorderStylesMatch, lowerRightBorderStylesMatch, style, includeLogicalLeftEdge, includeLogicalRightEdge);
float thickness = max(max(style->borderBottomWidth(), style->borderLeftWidth()), style->borderRightWidth());
drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderBottomWidth(), thickness, BSBottom, style, bottomColor, bottomStyle);
graphicsContext->restore();
@@ -1122,7 +1157,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
if (renderRadii && borderWillArcInnerEdge(bottomLeft, topLeft, style->borderBottomWidth(), style->borderTopWidth(), style->borderLeftWidth())) {
graphicsContext->save();
- clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSLeft, upperLeftBorderStylesMatch, lowerLeftBorderStylesMatch, style);
+ clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSLeft, upperLeftBorderStylesMatch, lowerLeftBorderStylesMatch, style, includeLogicalLeftEdge, includeLogicalRightEdge);
float thickness = max(max(style->borderLeftWidth(), style->borderTopWidth()), style->borderBottomWidth());
drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderLeftWidth(), thickness, BSLeft, style, leftColor, leftStyle);
graphicsContext->restore();
@@ -1141,7 +1176,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
if (renderRight) {
if (renderRadii && borderWillArcInnerEdge(bottomRight, topRight, style->borderBottomWidth(), style->borderTopWidth(), style->borderRightWidth())) {
graphicsContext->save();
- clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSRight, upperRightBorderStylesMatch, lowerRightBorderStylesMatch, style);
+ clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSRight, upperRightBorderStylesMatch, lowerRightBorderStylesMatch, style, includeLogicalLeftEdge, includeLogicalRightEdge);
float thickness = max(max(style->borderRightWidth(), style->borderTopWidth()), style->borderBottomWidth());
drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderRightWidth(), thickness, BSRight, style, rightColor, rightStyle);
graphicsContext->restore();
@@ -1168,7 +1203,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
}
#else
void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx, int ty, int w, int h,
- const RenderStyle* style, bool begin, bool end)
+ const RenderStyle* style, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
{
// FIXME: This old version of paintBorder should be removed when all ports implement
// GraphicsContext::clipConvexPolygon()!! This should happen soon.
@@ -1190,10 +1225,11 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
EBorderStyle leftStyle = style->borderLeftStyle();
EBorderStyle rightStyle = style->borderRightStyle();
- bool renderTop = topStyle > BHIDDEN && !topTransparent;
- bool renderLeft = leftStyle > BHIDDEN && begin && !leftTransparent;
- bool renderRight = rightStyle > BHIDDEN && end && !rightTransparent;
- bool renderBottom = bottomStyle > BHIDDEN && !bottomTransparent;
+ bool horizontal = style->isHorizontalWritingMode();
+ bool renderTop = topStyle > BHIDDEN && !topTransparent && (horizontal || includeLogicalLeftEdge);
+ bool renderLeft = leftStyle > BHIDDEN && !leftTransparent && (!horizontal || includeLogicalLeftEdge);
+ bool renderRight = rightStyle > BHIDDEN && !rightTransparent && (!horizontal || includeLogicalRightEdge);
+ bool renderBottom = bottomStyle > BHIDDEN && !bottomTransparent && (horizontal || includeLogicalRightEdge);
bool renderRadii = false;
IntSize topLeft, topRight, bottomLeft, bottomRight;
@@ -1204,20 +1240,29 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
IntSize topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius;
style->getBorderRadiiForRect(borderRect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
- if (begin) {
+ if (includeLogicalLeftEdge) {
topLeft = topLeftRadius;
- bottomLeft = bottomLeftRadius;
+ if (horizontal)
+ bottomLeft = bottomLeftRadius;
+ else
+ topRight = topRightRadius;
}
- if (end) {
- topRight = topRightRadius;
+
+ if (includeLogicalRightEdge) {
+ if (horizontal)
+ topRight = topRightRadius;
+ else
+ bottomLeft = bottomLeftRadius;
bottomRight = bottomRightRadius;
}
- renderRadii = true;
-
- // Clip to the rounded rectangle.
- graphicsContext->save();
- graphicsContext->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
+ renderRadii = !topLeft.isZero() || !topRight.isZero() || !bottomLeft.isZero() || !bottomRight.isZero();
+
+ if (renderRadii) {
+ // Clip to the rounded rectangle.
+ graphicsContext->save();
+ graphicsContext->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
+ }
}
int firstAngleStart, secondAngleStart, firstAngleSpan, secondAngleSpan;
@@ -1519,7 +1564,9 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
}
#endif
-void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContext, const IntRect& box, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style)
+void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContext, const IntRect& box, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight,
+ const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style,
+ bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
{
FloatPoint quad[4];
int tx = box.x();
@@ -1527,47 +1574,37 @@ void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContex
int w = box.width();
int h = box.height();
+ bool horizontal = style->isHorizontalWritingMode();
+ int leftWidth = (!horizontal || includeLogicalLeftEdge) ? style->borderLeftWidth() : 0;
+ int rightWidth = (!horizontal || includeLogicalRightEdge) ? style->borderRightWidth() : 0;
+ int topWidth = (horizontal || includeLogicalLeftEdge) ? style->borderTopWidth() : 0;
+ int bottomWidth = (horizontal || includeLogicalRightEdge) ? style->borderBottomWidth() : 0;
+
// For each side, create an array of FloatPoints where each point is based on whichever value in each corner
// is larger -- the radius width/height or the border width/height -- as appropriate.
switch (side) {
case BSTop:
quad[0] = FloatPoint(tx, ty);
- quad[1] = FloatPoint(
- tx + max(topLeft.width(), (int) style->borderLeftWidth()),
- ty + max(topLeft.height(), (int) style->borderTopWidth()));
- quad[2] = FloatPoint(
- tx + w - max(topRight.width(), (int) style->borderRightWidth()),
- ty + max(topRight.height(), (int)style->borderTopWidth()));
+ quad[1] = FloatPoint(tx + max(topLeft.width(), leftWidth), ty + max(topLeft.height(), topWidth));
+ quad[2] = FloatPoint(tx + w - max(topRight.width(), rightWidth), ty + max(topRight.height(), topWidth));
quad[3] = FloatPoint(tx + w, ty);
break;
case BSLeft:
quad[0] = FloatPoint(tx, ty);
- quad[1] = FloatPoint(
- tx + max(topLeft.width(), (int) style->borderLeftWidth()),
- ty + max(topLeft.height(), (int) style->borderTopWidth()));
- quad[2] = FloatPoint(
- tx + max(bottomLeft.width(), (int) style->borderLeftWidth()),
- ty + h - max(bottomLeft.height(), (int)style->borderBottomWidth()));
+ quad[1] = FloatPoint(tx + max(topLeft.width(), leftWidth), ty + max(topLeft.height(), topWidth));
+ quad[2] = FloatPoint(tx + max(bottomLeft.width(), leftWidth), ty + h - max(bottomLeft.height(), bottomWidth));
quad[3] = FloatPoint(tx, ty + h);
break;
case BSBottom:
quad[0] = FloatPoint(tx, ty + h);
- quad[1] = FloatPoint(
- tx + max(bottomLeft.width(), (int) style->borderLeftWidth()),
- ty + h - max(bottomLeft.height(), (int)style->borderBottomWidth()));
- quad[2] = FloatPoint(
- tx + w - max(bottomRight.width(), (int) style->borderRightWidth()),
- ty + h - max(bottomRight.height(), (int)style->borderBottomWidth()));
+ quad[1] = FloatPoint(tx + max(bottomLeft.width(), leftWidth), ty + h - max(bottomLeft.height(), bottomWidth));
+ quad[2] = FloatPoint(tx + w - max(bottomRight.width(), rightWidth), ty + h - max(bottomRight.height(), bottomWidth));
quad[3] = FloatPoint(tx + w, ty + h);
break;
case BSRight:
quad[0] = FloatPoint(tx + w, ty);
- quad[1] = FloatPoint(
- tx + w - max(topRight.width(), (int) style->borderRightWidth()),
- ty + max(topRight.height(), (int) style->borderTopWidth()));
- quad[2] = FloatPoint(
- tx + w - max(bottomRight.width(), (int) style->borderRightWidth()),
- ty + h - max(bottomRight.height(), (int)style->borderBottomWidth()));
+ quad[1] = FloatPoint(tx + w - max(topRight.width(), rightWidth), ty + max(topRight.height(), topWidth));
+ quad[2] = FloatPoint(tx + w - max(bottomRight.width(), rightWidth), ty + h - max(bottomRight.height(), bottomWidth));
quad[3] = FloatPoint(tx + w, ty + h);
break;
default:
@@ -1610,7 +1647,7 @@ static inline void uniformlyExpandBorderRadii(int delta, IntSize& topLeft, IntSi
bottomRight.clampNegativeToZero();
}
-void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int ty, int w, int h, const RenderStyle* s, ShadowStyle shadowStyle, bool begin, bool end)
+void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int ty, int w, int h, const RenderStyle* s, ShadowStyle shadowStyle, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
{
// FIXME: Deal with border-image. Would be great to use border-image as a mask.
@@ -1624,36 +1661,53 @@ void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int
IntSize bottomRight;
bool hasBorderRadius = s->hasBorderRadius();
- if (hasBorderRadius && (begin || end)) {
+ bool isHorizontal = s->isHorizontalWritingMode();
+ if (hasBorderRadius && (includeLogicalLeftEdge || includeLogicalRightEdge)) {
IntSize topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius;
s->getBorderRadiiForRect(rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
- if (begin) {
+ if (includeLogicalLeftEdge) {
if (shadowStyle == Inset) {
topLeftRadius.expand(-borderLeft(), -borderTop());
topLeftRadius.clampNegativeToZero();
- bottomLeftRadius.expand(-borderLeft(), -borderBottom());
- bottomLeftRadius.clampNegativeToZero();
+ if (isHorizontal) {
+ bottomLeftRadius.expand(-borderLeft(), -borderBottom());
+ bottomLeftRadius.clampNegativeToZero();
+ } else {
+ topRightRadius.expand(-borderRight(), -borderTop());
+ topRightRadius.clampNegativeToZero();
+ }
}
topLeft = topLeftRadius;
- bottomLeft = bottomLeftRadius;
+ if (isHorizontal)
+ bottomLeft = bottomLeftRadius;
+ else
+ topRight = topRightRadius;
}
- if (end) {
+ if (includeLogicalRightEdge) {
if (shadowStyle == Inset) {
- topRightRadius.expand(-borderRight(), -borderTop());
- topRightRadius.clampNegativeToZero();
+ if (isHorizontal) {
+ topRightRadius.expand(-borderRight(), -borderTop());
+ topRightRadius.clampNegativeToZero();
+ } else {
+ bottomLeftRadius.expand(-borderLeft(), -borderBottom());
+ bottomLeftRadius.clampNegativeToZero();
+ }
bottomRightRadius.expand(-borderRight(), -borderBottom());
bottomRightRadius.clampNegativeToZero();
}
- topRight = topRightRadius;
+ if (isHorizontal)
+ topRight = topRightRadius;
+ else
+ bottomLeft = bottomLeftRadius;
bottomRight = bottomRightRadius;
}
}
if (shadowStyle == Inset) {
- rect.move(begin ? borderLeft() : 0, borderTop());
- rect.setWidth(rect.width() - (begin ? borderLeft() : 0) - (end ? borderRight() : 0));
- rect.setHeight(rect.height() - borderTop() - borderBottom());
+ rect.move(includeLogicalLeftEdge || !isHorizontal ? borderLeft() : 0, includeLogicalLeftEdge || isHorizontal ? borderTop() : 0);
+ rect.setWidth(rect.width() - ((includeLogicalLeftEdge || !isHorizontal) ? borderLeft() : 0) - ((includeLogicalRightEdge || !isHorizontal) ? borderRight() : 0));
+ rect.setHeight(rect.height() - ((includeLogicalLeftEdge || isHorizontal) ? borderTop() : 0) - ((includeLogicalRightEdge || isHorizontal) ? borderBottom() : 0));
}
bool hasOpaqueBackground = s->visitedDependentColor(CSSPropertyBackgroundColor).isValid() && s->visitedDependentColor(CSSPropertyBackgroundColor).alpha() == 255;
@@ -1739,12 +1793,22 @@ void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int
context->fillRect(rect, shadowColor, s->colorSpace());
continue;
}
- if (!begin) {
- holeRect.move(-max(shadowOffset.width(), 0) - shadowBlur, 0);
- holeRect.setWidth(holeRect.width() + max(shadowOffset.width(), 0) + shadowBlur);
+
+ if (!includeLogicalLeftEdge) {
+ if (isHorizontal) {
+ holeRect.move(-max(shadowOffset.width(), 0) - shadowBlur, 0);
+ holeRect.setWidth(holeRect.width() + max(shadowOffset.width(), 0) + shadowBlur);
+ } else {
+ holeRect.move(0, -max(shadowOffset.height(), 0) - shadowBlur);
+ holeRect.setHeight(holeRect.height() + max(shadowOffset.height(), 0) + shadowBlur);
+ }
+ }
+ if (!includeLogicalRightEdge) {
+ if (isHorizontal)
+ holeRect.setWidth(holeRect.width() - min(shadowOffset.width(), 0) + shadowBlur);
+ else
+ holeRect.setHeight(holeRect.height() - min(shadowOffset.height(), 0) + shadowBlur);
}
- if (!end)
- holeRect.setWidth(holeRect.width() - min(shadowOffset.width(), 0) + shadowBlur);
Color fillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), 255);