Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(990)

Unified Diff: Source/core/rendering/RenderBox.cpp

Issue 347393007: Fix shadow repaint issue in vertical-rl mode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix bug first. Refactor later. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/box-shadow/shadow-box-resize-writing-mode-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index c7f17b7a3cf47f342fe92f19fc1eed63e10b236a..269aa5dd75c1e3ea9c534c88a53874b1cd77c4b5 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -4070,9 +4070,6 @@ void RenderBox::addVisualEffectOverflow()
if (!style()->boxShadow() && !style()->hasBorderImageOutsets() && !style()->hasOutline())
return;
- bool isFlipped = style()->isFlippedBlocksWritingMode();
- bool isHorizontal = isHorizontalWritingMode();
-
LayoutRect borderBox = borderBoxRect();
LayoutUnit overflowMinX = borderBox.x();
LayoutUnit overflowMaxX = borderBox.maxX();
@@ -4087,23 +4084,21 @@ void RenderBox::addVisualEffectOverflow()
LayoutUnit shadowBottom;
style()->getBoxShadowExtent(shadowTop, shadowRight, shadowBottom, shadowLeft);
- // In flipped blocks writing modes such as vertical-rl, the physical right shadow value is actually at the lower x-coordinate.
- overflowMinX = borderBox.x() + ((!isFlipped || isHorizontal) ? shadowLeft : -shadowRight);
- overflowMaxX = borderBox.maxX() + ((!isFlipped || isHorizontal) ? shadowRight : -shadowLeft);
- overflowMinY = borderBox.y() + ((!isFlipped || !isHorizontal) ? shadowTop : -shadowBottom);
- overflowMaxY = borderBox.maxY() + ((!isFlipped || !isHorizontal) ? shadowBottom : -shadowTop);
+ // Note that box-shadow extent's left and top are negative when extends to left and top, respectively.
+ overflowMinX = borderBox.x() + shadowLeft;
+ overflowMaxX = borderBox.maxX() + shadowRight;
+ overflowMinY = borderBox.y() + shadowTop;
+ overflowMaxY = borderBox.maxY() + shadowBottom;
}
// Now compute border-image-outset overflow.
if (style()->hasBorderImageOutsets()) {
LayoutBoxExtent borderOutsets = style()->borderImageOutsets();
- // In flipped blocks writing modes, the physical sides are inverted. For example in vertical-rl, the right
- // border is at the lower x coordinate value.
- overflowMinX = std::min(overflowMinX, borderBox.x() - ((!isFlipped || isHorizontal) ? borderOutsets.left() : borderOutsets.right()));
- overflowMaxX = std::max(overflowMaxX, borderBox.maxX() + ((!isFlipped || isHorizontal) ? borderOutsets.right() : borderOutsets.left()));
- overflowMinY = std::min(overflowMinY, borderBox.y() - ((!isFlipped || !isHorizontal) ? borderOutsets.top() : borderOutsets.bottom()));
- overflowMaxY = std::max(overflowMaxY, borderBox.maxY() + ((!isFlipped || !isHorizontal) ? borderOutsets.bottom() : borderOutsets.top()));
+ overflowMinX = std::min(overflowMinX, borderBox.x() - borderOutsets.left());
+ overflowMaxX = std::max(overflowMaxX, borderBox.maxX() + borderOutsets.right());
+ overflowMinY = std::min(overflowMinY, borderBox.y() - borderOutsets.top());
+ overflowMaxY = std::max(overflowMaxY, borderBox.maxY() + borderOutsets.bottom());
}
if (style()->hasOutline()) {
« no previous file with comments | « LayoutTests/fast/box-shadow/shadow-box-resize-writing-mode-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698