Changeset 154785 in webkit
- Timestamp:
- Aug 28, 2013, 3:52:53 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 17 added
- 6 edited
- 7 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r154781 r154785 1 2013-08-28 Simon Fraser <simon.fraser@apple.com> 2 3 Fix compositing layers in columns 4 https://bugs.webkit.org/show_bug.cgi?id=120436 5 6 Reviewed by Dave Hyatt. 7 8 Various testcases for compositing in columns. 9 10 * compositing/columns/ancestor-clipped-in-paginated-expected.txt: Added. 11 * compositing/columns/ancestor-clipped-in-paginated.html: Copied from LayoutTests/compositing/columns/composited-in-paginated.html. 12 * compositing/columns/clipped-in-paginated-expected.txt: Added. 13 * compositing/columns/clipped-in-paginated.html: Copied from LayoutTests/compositing/columns/composited-in-paginated.html. 14 * compositing/columns/composited-columns-expected.txt: Added. 15 * compositing/columns/composited-columns-vertical-rl-expected.txt: Added. 16 * compositing/columns/composited-columns-vertical-rl.html: Added. 17 * compositing/columns/composited-columns.html: Added. 18 * compositing/columns/composited-in-paginated-rl-expected.txt: Added. 19 * compositing/columns/composited-in-paginated-rl.html: Copied from LayoutTests/compositing/columns/composited-in-paginated.html. 20 * compositing/columns/composited-in-paginated-writing-mode-rl-expected.txt: Added. 21 * compositing/columns/composited-in-paginated-writing-mode-rl.html: Copied from LayoutTests/compositing/columns/composited-in-paginated.html. 22 * compositing/columns/composited-in-paginated.html: 23 * compositing/columns/composited-lr-paginated-repaint-expected.txt: Added. 24 * compositing/columns/composited-lr-paginated-repaint.html: Added. 25 * compositing/columns/composited-nested-columns-expected.txt: Added. 26 * compositing/columns/composited-nested-columns.html: Added. 27 * compositing/columns/composited-rl-paginated-repaint-expected.txt: Added. 28 * compositing/columns/composited-rl-paginated-repaint.html: Added. 29 * compositing/columns/hittest-composited-in-paginated-expected.txt: Added. 30 * compositing/columns/hittest-composited-in-paginated.html: Copied from LayoutTests/compositing/columns/composited-in-paginated.html. 31 * compositing/columns/rotated-in-paginated-expected.txt: Added. 32 * compositing/columns/rotated-in-paginated.html: Copied from LayoutTests/compositing/columns/composited-in-paginated.html. 33 * compositing/columns/untransformed-composited-in-paginated-expected.txt: Added. 34 * compositing/columns/untransformed-composited-in-paginated.html: Copied from LayoutTests/compositing/columns/composited-in-paginated.html. 35 1 36 2013-08-28 Denis Nomiyama <d.nomiyama@samsung.com> 2 37 -
trunk/LayoutTests/compositing/columns/ancestor-clipped-in-paginated.html
r154784 r154785 3 3 <script> 4 4 if (window.testRunner) 5 testRunner.dumpAsText();5 testRunner.dumpAsText(); 6 6 7 7 if (window.internals) … … 23 23 } 24 24 25 .clipping { 26 height: 100px; 27 width: 100px; 28 border: 1px solid black; 29 overflow: hidden; 30 z-index: 0; 31 } 25 32 .box { 26 height: 100px; 27 width: 100px; 28 margin: 10px; 33 height: 200px; 34 width: 200px; 29 35 background-color: blue; 36 border: 20px solid darkblue; 30 37 } 31 38 .composited { 32 -webkit-transform: translateZ(0) ;39 -webkit-transform: translateZ(0) 33 40 } 34 41 </style> … … 38 45 <div class="spacer"></div> 39 46 <div class="spacer"></div> 40 <div class="composited box"></div> 47 <div class="clipping"> 48 <div class="composited box"></div> 49 </div> 41 50 <pre id="layers">Layer tree goes here in DRT</pre> 42 51 -
trunk/LayoutTests/compositing/columns/clipped-in-paginated.html
r154784 r154785 3 3 <script> 4 4 if (window.testRunner) 5 testRunner.dumpAsText();5 testRunner.dumpAsText(); 6 6 7 7 if (window.internals) … … 17 17 <style> 18 18 .spacer { 19 height: 350px;20 width: 100%;21 margin: 10px;22 background-color: silver;19 height: 350px; 20 width: 100%; 21 margin: 10px; 22 background-color: silver; 23 23 } 24 24 25 .clipping { 26 height: 100px; 27 width: 100px; 28 border: 1px solid black; 29 overflow: hidden; 30 } 25 31 .box { 26 height: 100px;27 width: 100px;28 margin: 10px;29 background-color:blue;32 height: 200px; 33 width: 200px; 34 background-color: blue; 35 border: 20px solid darkblue; 30 36 } 31 37 .composited { 32 -webkit-transform: translateZ(0);38 -webkit-transform: translateZ(0) 33 39 } 34 40 </style> … … 38 44 <div class="spacer"></div> 39 45 <div class="spacer"></div> 40 <div class="composited box"></div> 46 <div class="clipping"> 47 <div class="composited box"></div> 48 </div> 41 49 <pre id="layers">Layer tree goes here in DRT</pre> 42 50 -
trunk/LayoutTests/compositing/columns/composited-in-paginated-rl.html
r154784 r154785 6 6 7 7 if (window.internals) 8 internals.setPagination(document, " LeftToRightPaginated", 0);8 internals.setPagination(document, "RightToLeftPaginated", 0); 9 9 10 10 function dumpLayers() -
trunk/LayoutTests/compositing/columns/composited-in-paginated-writing-mode-rl.html
r154784 r154785 18 18 .spacer { 19 19 height: 350px; 20 width: 100%;20 width: 300px; 21 21 margin: 10px; 22 22 background-color: silver; … … 34 34 </style> 35 35 </head> 36 <body >36 <body style="-webkit-writing-mode: vertical-rl;"> 37 37 38 <div class="spacer"></div> 39 <div class="spacer"></div> 38 40 <div class="spacer"></div> 39 41 <div class="spacer"></div> -
trunk/LayoutTests/compositing/columns/composited-in-paginated.html
r130689 r154785 29 29 background-color: blue; 30 30 } 31 .box:hover { 32 background-color: orange; 33 } 31 34 .composited { 32 35 -webkit-transform: translateZ(0); -
trunk/LayoutTests/compositing/columns/hittest-composited-in-paginated.html
r154784 r154785 3 3 <script> 4 4 if (window.testRunner) 5 testRunner.dumpAsText();5 testRunner.dumpAsText(); 6 6 7 7 if (window.internals) 8 internals.setPagination(document, "LeftToRightPaginated", 0);8 internals.setPagination(document, "LeftToRightPaginated", 10, 400); 9 9 10 10 function dumpLayers() 11 11 { 12 var result = "Element at 500, 200: " + document.elementFromPoint(500, 200).classList + "\n"; 13 12 14 if (window.testRunner) 13 document.getElementById('layers').innerText = window.internals.layerTreeAsText(document); 15 result += window.internals.layerTreeAsText(document); 16 17 document.getElementById('layers').innerText = result; 14 18 } 19 15 20 window.addEventListener('load', dumpLayers, false); 16 21 </script> 17 22 <style> 18 23 .spacer { 19 height: 350px;20 width: 100%;21 margin: 10px;22 background-color: silver;24 height: 350px; 25 width: 100%; 26 margin: 10px; 27 background-color: silver; 23 28 } 24 29 25 30 .box { 26 height: 100px;27 width: 100px;28 margin: 10px;29 background-color: blue;31 height: 100px; 32 width: 100px; 33 margin: 10px; 34 background-color: blue; 30 35 } 31 36 .composited { -
trunk/LayoutTests/compositing/columns/rotated-in-paginated.html
r154784 r154785 17 17 <style> 18 18 .spacer { 19 height: 350px;20 width: 100%;21 margin: 10px;22 background-color: silver;19 height: 350px; 20 width: 100%; 21 margin: 10px; 22 background-color: silver; 23 23 } 24 24 25 25 .box { 26 height: 100px;27 width: 100px;28 margin: 10px;29 background-color: blue;26 height: 100px; 27 width: 100px; 28 margin: 10px; 29 background-color: blue; 30 30 } 31 31 .composited { 32 -webkit-transform: translateZ(0);32 -webkit-transform: rotate3d(0, 0, 1, 45deg); 33 33 } 34 34 </style> -
trunk/LayoutTests/compositing/columns/untransformed-composited-in-paginated.html
r154784 r154785 3 3 <script> 4 4 if (window.testRunner) 5 testRunner.dumpAsText();5 testRunner.dumpAsText(); 6 6 7 7 if (window.internals) … … 17 17 <style> 18 18 .spacer { 19 height: 350px;20 width: 100%;21 margin: 10px;22 background-color: silver;19 height: 350px; 20 width: 100%; 21 margin: 10px; 22 background-color: silver; 23 23 } 24 24 25 25 .box { 26 height: 100px;27 width: 100px;28 margin: 10px;29 background-color: blue;26 height: 100px; 27 width: 100px; 28 margin: 10px; 29 background-color: blue; 30 30 } 31 32 .wrapper { 33 position: relative; 34 border: 1px solid black; 35 padding: 10px; 36 } 37 38 .second { 39 position: relative; 40 top: -10px; 41 background-color: orange; 42 } 43 31 44 .composited { 32 -webkit-transform: translateZ(0);45 -webkit-transform: rotate3d(0, 0, 1, 45deg); 33 46 } 34 47 </style> … … 38 51 <div class="spacer"></div> 39 52 <div class="spacer"></div> 40 <div class="composited box"></div> 53 54 <div class="wrapper"> 55 <div class="composited box"></div> 56 <div class="second box"></div> 57 </div> 58 41 59 <pre id="layers">Layer tree goes here in DRT</pre> 42 60 -
trunk/Source/WebCore/ChangeLog
r154783 r154785 1 2013-08-28 Simon Fraser <simon.fraser@apple.com> 2 3 Fix compositing layers in columns 4 https://bugs.webkit.org/show_bug.cgi?id=120436 5 6 Reviewed by Dave Hyatt. 7 8 Remove the old hack in RenderLayer::updateLayerPosition() for placing 9 layers in columns, which changed the layer position for composited 10 layers; this broke hit-testing. 11 12 Fix a better way by moving compositing layers to the correct 13 positions that take column offsets into account, by fixing 14 RenderLayer::convertToLayerCoords() to optionally apply column 15 adjustment, and using this in the code which positions compositing layers. 16 17 Tests: compositing/columns/ancestor-clipped-in-paginated.html 18 compositing/columns/clipped-in-paginated.html 19 compositing/columns/composited-columns-vertical-rl.html 20 compositing/columns/composited-columns.html 21 compositing/columns/composited-in-paginated-rl.html 22 compositing/columns/composited-in-paginated-writing-mode-rl.html 23 compositing/columns/composited-lr-paginated-repaint.html 24 compositing/columns/composited-rl-paginated-repaint.html 25 compositing/columns/hittest-composited-in-paginated.html 26 compositing/columns/rotated-in-paginated.html 27 compositing/columns/untransformed-composited-in-paginated.html 28 29 * rendering/RenderLayer.cpp: 30 (WebCore::RenderLayer::updateLayerPosition): 31 (WebCore::RenderLayer::convertToPixelSnappedLayerCoords): 32 (WebCore::accumulateOffsetTowardsAncestor): 33 (WebCore::RenderLayer::convertToLayerCoords): 34 * rendering/RenderLayer.h: 35 * rendering/RenderLayerBacking.cpp: 36 (WebCore::RenderLayerBacking::updateCompositedBounds): 37 (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): 38 1 39 2013-08-28 Brent Fulgham <bfulgham@webkit.org> 2 40 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r154583 r154785 1259 1259 } 1260 1260 } else if (parent()) { 1261 if (isComposited()) {1262 // FIXME: Composited layers ignore pagination, so about the best we can do is make sure they're offset into the appropriate column.1263 // They won't split across columns properly.1264 LayoutSize columnOffset;1265 if (!parent()->renderer().hasColumns() && parent()->renderer().isRoot() && renderer().view().hasColumns())1266 renderer().view().adjustForColumns(columnOffset, localPoint);1267 else1268 parent()->renderer().adjustForColumns(columnOffset, localPoint);1269 1270 localPoint += columnOffset;1271 }1272 1273 1261 if (parent()->renderer().hasOverflowClip()) { 1274 1262 IntSize scrollOffset = parent()->scrolledContentOffset(); … … 1892 1880 } 1893 1881 1894 void RenderLayer::convertToPixelSnappedLayerCoords(const RenderLayer* ancestorLayer, IntPoint& roundedLocation ) const1882 void RenderLayer::convertToPixelSnappedLayerCoords(const RenderLayer* ancestorLayer, IntPoint& roundedLocation, ColumnOffsetAdjustment adjustForColumns) const 1895 1883 { 1896 1884 LayoutPoint location = roundedLocation; 1897 convertToLayerCoords(ancestorLayer, location );1885 convertToLayerCoords(ancestorLayer, location, adjustForColumns); 1898 1886 roundedLocation = roundedIntPoint(location); 1899 1887 } 1900 1888 1901 void RenderLayer::convertToPixelSnappedLayerCoords(const RenderLayer* ancestorLayer, IntRect& roundedRect ) const1889 void RenderLayer::convertToPixelSnappedLayerCoords(const RenderLayer* ancestorLayer, IntRect& roundedRect, ColumnOffsetAdjustment adjustForColumns) const 1902 1890 { 1903 1891 LayoutRect rect = roundedRect; 1904 convertToLayerCoords(ancestorLayer, rect );1892 convertToLayerCoords(ancestorLayer, rect, adjustForColumns); 1905 1893 roundedRect = pixelSnappedIntRect(rect); 1906 1894 } 1907 1895 1908 1896 // Returns the layer reached on the walk up towards the ancestor. 1909 static inline const RenderLayer* accumulateOffsetTowardsAncestor(const RenderLayer* layer, const RenderLayer* ancestorLayer, LayoutPoint& location )1897 static inline const RenderLayer* accumulateOffsetTowardsAncestor(const RenderLayer* layer, const RenderLayer* ancestorLayer, LayoutPoint& location, RenderLayer::ColumnOffsetAdjustment adjustForColumns) 1910 1898 { 1911 1899 ASSERT(ancestorLayer != layer); … … 2012 2000 2013 2001 location += toSize(layer->location()); 2002 2003 if (adjustForColumns == RenderLayer::AdjustForColumns) { 2004 if (RenderLayer* parentLayer = layer->parent()) { 2005 LayoutSize layerColumnOffset; 2006 parentLayer->renderer().adjustForColumns(layerColumnOffset, location); 2007 location += layerColumnOffset; 2008 } 2009 } 2010 2014 2011 return parentLayer; 2015 2012 } 2016 2013 2017 void RenderLayer::convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutPoint& location ) const2014 void RenderLayer::convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutPoint& location, ColumnOffsetAdjustment adjustForColumns) const 2018 2015 { 2019 2016 if (ancestorLayer == this) … … 2022 2019 const RenderLayer* currLayer = this; 2023 2020 while (currLayer && currLayer != ancestorLayer) 2024 currLayer = accumulateOffsetTowardsAncestor(currLayer, ancestorLayer, location );2025 } 2026 2027 void RenderLayer::convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutRect& rect ) const2021 currLayer = accumulateOffsetTowardsAncestor(currLayer, ancestorLayer, location, adjustForColumns); 2022 } 2023 2024 void RenderLayer::convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutRect& rect, ColumnOffsetAdjustment adjustForColumns) const 2028 2025 { 2029 2026 LayoutPoint delta; 2030 convertToLayerCoords(ancestorLayer, delta );2027 convertToLayerCoords(ancestorLayer, delta, adjustForColumns); 2031 2028 rect.move(-delta.x(), -delta.y()); 2032 2029 } -
trunk/Source/WebCore/rendering/RenderLayer.h
r154583 r154785 599 599 } 600 600 601 void convertToPixelSnappedLayerCoords(const RenderLayer* ancestorLayer, IntPoint& location) const; 602 void convertToPixelSnappedLayerCoords(const RenderLayer* ancestorLayer, IntRect&) const; 603 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutPoint& location) const; 604 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutRect&) const; 601 // FIXME: adjustForColumns allows us to position compositing layers in columns correctly, but eventually they need to be split across columns too. 602 enum ColumnOffsetAdjustment { DontAdjustForColumns, AdjustForColumns }; 603 void convertToPixelSnappedLayerCoords(const RenderLayer* ancestorLayer, IntPoint& location, ColumnOffsetAdjustment adjustForColumns = DontAdjustForColumns) const; 604 void convertToPixelSnappedLayerCoords(const RenderLayer* ancestorLayer, IntRect&, ColumnOffsetAdjustment adjustForColumns = DontAdjustForColumns) const; 605 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutPoint&, ColumnOffsetAdjustment adjustForColumns = DontAdjustForColumns) const; 606 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutRect&, ColumnOffsetAdjustment adjustForColumns = DontAdjustForColumns) const; 605 607 606 608 int zIndex() const { return renderer().style()->zIndex(); } -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r154715 r154785 437 437 438 438 LayoutPoint delta; 439 m_owningLayer->convertToLayerCoords(rootLayer, delta );439 m_owningLayer->convertToLayerCoords(rootLayer, delta, RenderLayer::AdjustForColumns); 440 440 clippingBounds.move(-delta.x(), -delta.y()); 441 441 … … 636 636 LayoutRect localRawCompositingBounds = compositedBounds(); 637 637 LayoutPoint rawDelta; 638 m_owningLayer->convertToLayerCoords(compAncestor, rawDelta );638 m_owningLayer->convertToLayerCoords(compAncestor, rawDelta, RenderLayer::AdjustForColumns); 639 639 IntPoint delta = flooredIntPoint(rawDelta); 640 640 m_subpixelAccumulation = toLayoutSize(rawDelta.fraction());
Note:
See TracChangeset
for help on using the changeset viewer.