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

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

Issue 22576002: Paint region based columns correctly in non-default writing-modes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Simplify comment, address code review minor issue raised with lgtm. Created 7 years, 3 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/multicol/newmulticol/hide-box-vertical-rl-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderMultiColumnSet.cpp
diff --git a/Source/core/rendering/RenderMultiColumnSet.cpp b/Source/core/rendering/RenderMultiColumnSet.cpp
index e9687251ebba5c0bd55dea1a271d82d6e1c2e57c..340ac12de4819575d09f9dd8af05b09acb439c9b 100644
--- a/Source/core/rendering/RenderMultiColumnSet.cpp
+++ b/Source/core/rendering/RenderMultiColumnSet.cpp
@@ -429,14 +429,25 @@ void RenderMultiColumnSet::repaintFlowThreadContent(const LayoutRect& repaintRec
void RenderMultiColumnSet::collectLayerFragments(LayerFragments& fragments, const LayoutRect& layerBoundingBox, const LayoutRect& dirtyRect)
{
- // Put the layer bounds into flow thread-local coordinates by flipping it first.
+ // The two rectangles passed to this method are physical, except that we pretend that there's
+ // only one long column (that's how a flow thread works).
+ //
+ // Then there's the output from this method - the stuff we put into the list of fragments. The
+ // fragment.paginationOffset point is the actual physical translation required to get from a
+ // location in the flow thread to a location in a given column. The fragment.paginationClip
+ // rectangle, on the other hand, is in the same coordinate system as the two rectangles passed
+ // to this method (flow thread coordinates).
+ //
+ // All other rectangles in this method are sized physically, and the inline direction coordinate
+ // is physical too, but the block direction coordinate is "logical top". This is the same as
+ // e.g. RenderBox::frameRect(). These rectangles also pretend that there's only one long column,
+ // i.e. they are for the flow thread.
+
+ // Put the layer bounds into flow thread-local coordinates by flipping it first. Since we're in
+ // a renderer, most rectangles are represented this way.
LayoutRect layerBoundsInFlowThread(layerBoundingBox);
flowThread()->flipForWritingMode(layerBoundsInFlowThread);
- // Do the same for the dirty rect.
- LayoutRect dirtyRectInFlowThread(dirtyRect);
- flowThread()->flipForWritingMode(dirtyRectInFlowThread);
-
// Now we can compare with the flow thread portions owned by each column. First let's
// see if the rect intersects our flow thread portion at all.
LayoutRect clippedRect(layerBoundsInFlowThread);
@@ -488,11 +499,11 @@ void RenderMultiColumnSet::collectLayerFragments(LayerFragments& fragments, cons
// multicolumn block as well. This won't be an issue until we start creating multiple multicolumn sets.
// Shift the dirty rect to be in flow thread coordinates with this translation applied.
- LayoutRect translatedDirtyRect(dirtyRectInFlowThread);
+ LayoutRect translatedDirtyRect(dirtyRect);
translatedDirtyRect.moveBy(-translationOffset);
// See if we intersect the dirty rect.
- clippedRect = layerBoundsInFlowThread;
+ clippedRect = layerBoundingBox;
clippedRect.intersect(translatedDirtyRect);
if (clippedRect.isEmpty())
continue;
@@ -503,7 +514,8 @@ void RenderMultiColumnSet::collectLayerFragments(LayerFragments& fragments, cons
fragment.paginationOffset = translationOffset;
LayoutRect flippedFlowThreadOverflowPortion(flowThreadOverflowPortion);
- flipForWritingMode(flippedFlowThreadOverflowPortion);
+ // Flip it into more a physical (RenderLayer-style) rectangle.
+ flowThread()->flipForWritingMode(flippedFlowThreadOverflowPortion);
fragment.paginationClip = flippedFlowThreadOverflowPortion;
fragments.append(fragment);
}
« no previous file with comments | « LayoutTests/fast/multicol/newmulticol/hide-box-vertical-rl-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698