Changeset 157725 in webkit
- Timestamp:
- Oct 21, 2013 12:38:30 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 20 added
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r157724 r157725 1 2013-10-21 Mihai Maerean <mmaerean@adobe.com> 2 3 [CSS Regions] The layers from the flow thread should be collected under the regions' layers. 4 https://bugs.webkit.org/show_bug.cgi?id=120457 5 6 Reviewed by David Hyatt. 7 8 * compositing/regions/crash-transform-inside-region-expected.html: Added. 9 * compositing/regions/crash-transform-inside-region.html: Added. 10 * compositing/regions/floated-region-with-transformed-child-expected.html: Added. 11 * compositing/regions/floated-region-with-transformed-child.html: Added. 12 * compositing/regions/move-layer-from-one-region-to-another-expected.html: Added. 13 * compositing/regions/move-layer-from-one-region-to-another.html: Added. 14 * compositing/regions/propagate-region-box-shadow-border-padding-expected.html: Added. 15 * compositing/regions/propagate-region-box-shadow-border-padding-for-video-expected.html: Added. 16 * compositing/regions/propagate-region-box-shadow-border-padding-for-video.html: Added. 17 * compositing/regions/propagate-region-box-shadow-border-padding.html: Added. 18 * compositing/regions/region-as-layer-in-another-flowthread-expected.html: Added. 19 * compositing/regions/region-as-layer-in-another-flowthread.html: Added. 20 * compositing/regions/transform-transparent-positioned-video-inside-region-expected.html: Added. 21 * compositing/regions/transform-transparent-positioned-video-inside-region.html: Added. 22 * compositing/regions/transformed-layer-inside-transformed-layer-expected.html: Added. 23 * compositing/regions/transformed-layer-inside-transformed-layer.html: Added. 24 * compositing/regions/webkit-flow-renderer-layer-compositing-expected.html: 25 * compositing/regions/webkit-flow-renderer-layer-compositing.html: 26 * compositing/regions/z-index-expected.html: Added. 27 * compositing/regions/z-index-update-expected.html: Added. 28 * compositing/regions/z-index-update.html: Added. 29 * compositing/regions/z-index.html: Added. 30 * fast/multicol/mixed-positioning-stacking-order-expected.html: 31 * fast/multicol/mixed-positioning-stacking-order.html: 32 * fast/repaint/region-painting-composited-element-expected.html: 33 * fast/repaint/region-painting-composited-element.html: 34 * platform/mac-wk2/TestExpectations: 35 1 36 2013-10-21 Oliver Hunt <oliver@apple.com> 2 37 -
trunk/LayoutTests/compositing/regions/webkit-flow-renderer-layer-compositing-expected.html
r129304 r157725 6 6 height:50px; 7 7 width:50px; 8 background-color: green 8 background-color: green; 9 -webkit-transform: scale3d(1, 1, 1);/* Force a composited RenderLayer. */ 9 10 } 10 11 </style> … … 14 15 <p>Test that an element requiring a composited layer, collected in a flow thread, is displayed correctly inside a region.</p> 15 16 <p>On success, you should not see a red rectangle below.</p> 16 <div class="region"> 17 </div> 17 <div class="region">region</div> 18 18 </body> 19 19 </html> -
trunk/LayoutTests/compositing/regions/webkit-flow-renderer-layer-compositing.html
r129304 r157725 25 25 <p>Test that an element requiring a composited layer, collected in a flow thread, is displayed correctly inside a region.</p> 26 26 <p>On success, you should not see a red rectangle below.</p> 27 <div id="div1" class="elementSize"> </div>27 <div id="div1" class="elementSize">region</div> 28 28 <div id="region1" class="elementSize"></div> 29 29 </body> -
trunk/LayoutTests/fast/multicol/mixed-positioning-stacking-order-expected.html
r144318 r157725 1 1 <!doctype html> 2 2 <html> 3 <div style="height:200px; border:5px solid black;position:relative;width:210px">4 <div style="width:210px;height:200px;background-color:purple;">3</div>5 <div style="position:absolute;background-color:gold;left:55px;top:0px;height:200px;width:100px">2</div>6 <div style="position:absolute;background-color:lightblue;width:100px;height:100px;left:0;bottom:0">1</div>7 <div style="position:absolute;background-color:lightblue;width:100px;left:110px;top:0;height:100px"></div>3 <div style="height:200px;width:210px;position:relative;border:5px solid black"> 4 <div style="width:210px;height:200px;background-color:purple;">3</div> 5 <div style="position:absolute;background-color:gold;left:55px;top:0px;height:200px;width:100px">2</div> 6 <div style="position:absolute;background-color:lightblue;width:100px;height:100px;left:0;bottom:0">1</div> 7 <div style="position:absolute;background-color:lightblue;width:100px;left:110px;top:0;height:100px"></div> 8 8 </div> -
trunk/LayoutTests/fast/multicol/mixed-positioning-stacking-order.html
r157458 r157725 7 7 </head> 8 8 <body> 9 <div style="width:210px; height:200px; border:5px solid black; -moz-column-width:100px; -moz-column-gap:10px; -webkit-column-width:100px; -webkit-column-gap:10px; -webkit-column-fill:auto; column-width:100px; column-gap:10px; column-fill:auto;"> 10 11 <div style="position:relative;"> 12 <div style="position:absolute;top:0;left:0; height:400px; width:100px"> 13 <div style="width:100px;height:100px;background-color:purple;">3</div> 14 <div style="height:200px"></div> 15 <div style="width:100px;height:100px;background-color:purple;">3</div> 9 <div style="-moz-column-width:100px; -moz-column-gap:10px; width:210px; height:200px;border:5px solid black; -webkit-column-width:100px; -webkit-column-gap:10px; -webkit-column-fill:auto; column-width:100px; column-gap:10px; column-fill:auto;"> 10 <div style="position:relative;"> 11 <div style="position:absolute;top:0;left:0; height:400px; width:100px"> 12 <div style="width:100px;height:100px;background-color:purple;">3</div> 13 <div style="height:200px"></div> 14 <div style="width:100px;height:100px;background-color:purple;">3</div> 15 </div> 16 <div style="position:relative; z-index:1; background-color:lightblue; width:100%; height:200px; top:100px">1</div> 17 <div style="position:fixed;background-color:gold;left:68px;top:13px;height:200px;width:100px">2</div> 18 </div> 16 19 </div> 17 <div style="position:relative; z-index:1; background-color:lightblue; width:100%; height:200px; top:100px">1</div>18 19 <div style="position:fixed;background-color:gold;left:68px;top:13px;height:200px;width:100px">2</div>20 </div>21 </div> -
trunk/LayoutTests/fast/repaint/region-painting-composited-element-expected.html
r156767 r157725 13 13 position: relative; z-index: 1; /*create Stacking Context*/ 14 14 } 15 #region1 { 16 -webkit-transform: translate3d(0,0,0); /*activate accelerated compositing*/ 17 } 15 18 </style> 16 19 </head> 17 20 <body> 18 <div id="region1"> </div><br />21 <div id="region1">region</div><br /> 19 22 <div id="region2"></div> 20 23 </body> -
trunk/LayoutTests/fast/repaint/region-painting-composited-element.html
r136037 r157725 41 41 The test should paint two green rectangles. There should be no red. --> 42 42 <div id="content"> 43 <div id="target"> </div>43 <div id="target">region</div> 44 44 </div> 45 45 <div id="region1"></div><br /> -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r157691 r157725 324 324 webkit.org/b/118925 [ Debug ] css3/filters/custom/effect-custom-transform-parameters.html [ ImageOnlyFailure ] 325 325 webkit.org/b/118925 [ Debug ] fast/layers/no-clipping-overflow-hidden-added-after-transition.html [ ImageOnlyFailure ] 326 webkit.org/b/118925 [ Debug ] fast/multicol/mixed-opacity-fixed-test.html [ ImageOnlyFailure ]326 webkit.org/b/118925 [ Debug ] fast/multicol/mixed-opacity-fixed-test.html [ ImageOnlyFailure Pass ] 327 327 webkit.org/b/118925 [ Debug ] fast/regions/fixed-pos-elem-in-region.html [ ImageOnlyFailure ] 328 328 webkit.org/b/118925 [ Debug ] svg/repaint/buffered-rendering-static-image.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r157723 r157725 1 2013-10-21 Mihai Maerean <mmaerean@adobe.com> 2 3 [CSS Regions] The layers from the flow thread should be collected under the regions' layers. 4 https://bugs.webkit.org/show_bug.cgi?id=120457 5 6 Reviewed by David Hyatt. 7 8 This patch is based on the work of Alexandru Chiculita at https://bugs.webkit.org/attachment.cgi?id=203872&action=review 9 10 The composited layers inside the named flow threads are collected as part of the regions (as children of the 11 GraphicsLayer of the layer that corresponds to the region (which is attached to the parent renderer of 12 RenderNameFlowFragment)). 13 When a region displays a layer that needs accelerated compositing we activate the accelerated compositing for 14 that region too (inside RenderLayerCompositor::computeRegionCompositingRequirements). 15 16 This patch has landed before (as http://trac.webkit.org/changeset/156451), but was reverted because 17 fast/multicol/mixed-positioning-stacking-order.html failed. The fix is inside RenderLayerCompositor::canBeComposited 18 that only enables compositing for layers inside flow threads that collect the graphics layers under the regions. 19 20 Another change from changeset #156451 is that now the region renderers are created as anonymous renderers under 21 the element that has the flow-from property. When a composited layer is needed for the region, it sits in it's 22 parent renderer, not in the region renderer (RenderNamedFlowFragment). 23 24 Tests: compositing/regions/crash-transform-inside-region.html 25 compositing/regions/floated-region-with-transformed-child.html 26 compositing/regions/move-layer-from-one-region-to-another.html 27 compositing/regions/propagate-region-box-shadow-border-padding-for-video.html 28 compositing/regions/propagate-region-box-shadow-border-padding.html 29 compositing/regions/region-as-layer-in-another-flowthread.html 30 compositing/regions/transform-transparent-positioned-video-inside-region.html 31 compositing/regions/transformed-layer-inside-transformed-layer.html 32 compositing/regions/z-index-update.html 33 compositing/regions/z-index.html 34 35 * rendering/FlowThreadController.cpp: 36 (WebCore::FlowThreadController::updateRenderFlowThreadLayersIfNeeded): 37 * rendering/RenderElement.cpp: 38 (WebCore::RenderElement::propagateStyleToAnonymousChildren): Not for RenderFlowThreads, as they are updated 39 through the RenderView::styleDidChange function. 40 * rendering/RenderFlowThread.cpp: 41 (WebCore::RenderFlowThread::layout): When the layout of the flow thread is over (including the 2 phase layout), 42 we update all the mappings between the layers inside the flow thread and the regions where those layers will be 43 painted. 44 (WebCore::RenderFlowThread::hasCompositingRegionDescendant): Whether any of the regions has a compositing descendant. 45 (WebCore::RenderFlowThread::getLayerListForRegion): 46 (WebCore::RenderFlowThread::regionForCompositedLayer): 47 (WebCore::RenderFlowThread::cachedRegionForCompositedLayer): 48 (WebCore::RenderFlowThread::collectsGraphicsLayersUnderRegions): 49 (WebCore::RenderFlowThread::updateLayerToRegionMappings): Triggers an update of the layers if a layer has moved 50 from a region to another since the last update. 51 (WebCore::RenderFlowThread::updateAllLayerToRegionMappings): 52 * rendering/RenderFlowThread.h: 53 * rendering/RenderGeometryMap.cpp: 54 (WebCore::RenderGeometryMap::pushRenderFlowThread): 55 * rendering/RenderGeometryMap.h: 56 * rendering/RenderLayer.cpp: 57 (WebCore::RenderLayer::paintList): 58 (WebCore::RenderLayer::enclosingFlowThreadAncestor): 59 (WebCore::RenderLayer::isFlowThreadCollectingGraphicsLayersUnderRegions): 60 (WebCore::RenderLayer::hitTestList): 61 (WebCore::RenderLayer::calculateLayerBounds): When we calculate the bounds of the RenderView, we ignore those 62 flow threads that collect the graphics layers under the regions. 63 (WebCore::RenderLayer::dirtyZOrderLists): 64 (WebCore::RenderLayer::dirtyNormalFlowList): 65 * rendering/RenderLayer.h: 66 * rendering/RenderLayerBacking.cpp: 67 (WebCore::RenderLayerBacking::shouldClipCompositedBounds): Not if it's a flow thread that collects the graphics 68 layers under the regions 69 (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): Now adjusts the ancestorCompositingBounds for the FlowThread. 70 (WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread): Make sure that the region propagates 71 its borders, paddings, outlines or box-shadows to layers inside it. 72 (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer): 73 * rendering/RenderLayerBacking.h: 74 * rendering/RenderLayerCompositor.cpp: 75 (WebCore::RenderLayerCompositor::computeCompositingRequirements): Now calls computeRegionCompositingRequirements. 76 (WebCore::RenderLayerCompositor::computeRegionCompositingRequirements): 77 (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): Do not iterate the RenderFlowThread directly if 78 we are going to collect the composited layers as part of regions. 79 (WebCore::RenderLayerCompositor::rebuildRegionCompositingLayerTree): 80 (WebCore::RenderLayerCompositor::canBeComposited): CSS Regions flow threads do not need to be composited as we 81 use composited RenderRegions to render the background of the RenderFlowThread. 82 (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason): If it's a container of a css region. 83 * rendering/RenderLayerCompositor.h: 84 * rendering/RenderMultiColumnSet.cpp: 85 (WebCore::RenderMultiColumnSet::adjustRegionBoundsFromFlowThreadPortionRect): 86 * rendering/RenderMultiColumnSet.h: 87 * rendering/RenderNamedFlowFragment.h: 88 (WebCore::RenderNamedFlowFragment::layerOwner): When the content inside the region requires the region to have a 89 layer, the layer will be created on the region's parent renderer instead. This method returns that renderer 90 holding the layer. The return value may be null. 91 * rendering/RenderNamedFlowThread.cpp: 92 (WebCore::RenderNamedFlowThread::RenderNamedFlowThread): 93 (WebCore::RenderNamedFlowThread::nextRendererForNode): 94 (WebCore::RenderNamedFlowThread::previousRendererForNode): 95 (WebCore::RenderNamedFlowThread::addFlowChild): 96 (WebCore::RenderNamedFlowThread::removeFlowChild): 97 (WebCore::RenderNamedFlowThread::collectsGraphicsLayersUnderRegions): 98 * rendering/RenderNamedFlowThread.h: m_flowThreadChildList is now allocated through an OwnPtr to keep the render 99 arena under the size limit. 100 * rendering/RenderRegion.cpp: 101 (WebCore::RenderRegion::adjustRegionBoundsFromFlowThreadPortionRect): 102 * rendering/RenderRegion.h: 103 (WebCore::toRenderRegion): 104 * rendering/RenderTreeAsText.cpp: 105 (WebCore::writeLayers): 106 * WebCore.exp.in: WebCore::RenderLayer::isFlowThreadCollectingGraphicsLayersUnderRegions 107 1 108 2013-10-21 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> 2 109 -
trunk/Source/WebCore/rendering/FlowThreadController.cpp
r157535 r157725 271 271 for (RenderNamedFlowThreadList::reverse_iterator iter = m_renderNamedFlowThreadList->rbegin(); iter != m_renderNamedFlowThreadList->rend(); ++iter) { 272 272 RenderNamedFlowThread* flowRenderer = *iter; 273 flowRenderer->update LayerToRegionMappingsIfNeeded();273 flowRenderer->updateAllLayerToRegionMappingsIfNeeded(); 274 274 } 275 275 } -
trunk/Source/WebCore/rendering/RenderElement.cpp
r157665 r157725 756 756 #endif 757 757 758 // RenderFlowThreads are updated through the RenderView::styleDidChange function. 759 if (child->isRenderFlowThread()) 760 continue; 761 758 762 auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(style(), child->style()->display()); 759 763 if (style()->specifiesColumns()) { -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r157683 r157725 42 42 #include "RenderLayer.h" 43 43 #include "RenderLayerCompositor.h" 44 #include "RenderNamedFlowFragment.h" 44 45 #include "RenderRegion.h" 45 46 #include "RenderTheme.h" … … 236 237 // containers, but just adjusting the position of the RenderLayerBacking. 237 238 if (!m_needsTwoPhasesLayout) { 238 updateLayerToRegionMappings(); 239 // FIXME: If we have layers that moved from one region to another, we should trigger 239 // If we have layers that moved from one region to another, we trigger 240 240 // a composited layers rebuild in here to make sure that the regions will collect the right layers. 241 if (updateAllLayerToRegionMappings()) 242 layer()->compositor().setCompositingLayersNeedRebuild(); 241 243 } 242 244 #endif … … 250 252 251 253 #if USE(ACCELERATED_COMPOSITING) 252 RenderRegion* RenderFlowThread::regionForCompositedLayer(RenderLayer* childLayer) 253 { 254 LayoutPoint leftTopLocation = childLayer->renderBox() ? childLayer->renderBox()->flipForWritingMode(LayoutPoint()) : LayoutPoint(); 255 LayoutPoint flowThreadOffset = flooredLayoutPoint(childLayer->renderer().localToContainerPoint(leftTopLocation, this, ApplyContainerFlip)); 256 return regionAtBlockOffset(0, flipForWritingMode(isHorizontalWritingMode() ? flowThreadOffset.y() : flowThreadOffset.x()), true, DisallowRegionAutoGeneration); 257 } 258 259 void RenderFlowThread::updateRegionForRenderLayer(RenderLayer* layer, LayerToRegionMap& layerToRegionMap, RegionToLayerListMap& regionToLayerListMap, bool& needsLayerUpdate) 260 { 261 RenderRegion* region = regionForCompositedLayer(layer); 254 bool RenderFlowThread::hasCompositingRegionDescendant() const 255 { 256 for (RenderRegionList::const_iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) 257 if (RenderLayerModelObject* layerOwner = toRenderNamedFlowFragment(*iter)->layerOwner()) 258 if (layerOwner->hasLayer() && layerOwner->layer()->hasCompositingDescendant()) 259 return true; 260 261 return false; 262 } 263 264 const RenderLayerList* RenderFlowThread::getLayerListForRegion(RenderNamedFlowFragment* region) 265 { 266 if (!m_regionToLayerListMap) 267 return 0; 268 updateAllLayerToRegionMappingsIfNeeded(); 269 RegionToLayerListMap::const_iterator iterator = m_regionToLayerListMap->find(region); 270 return iterator == m_regionToLayerListMap->end() ? 0 : &iterator->value; 271 } 272 273 RenderNamedFlowFragment* RenderFlowThread::regionForCompositedLayer(RenderLayer& childLayer) 274 { 275 if (childLayer.renderBox()) { 276 RenderRegion* startRegion = 0; 277 RenderRegion* endRegion = 0; 278 getRegionRangeForBox(childLayer.renderBox(), startRegion, endRegion); 279 // The video tag is such a box that doesn't have a region range because it's inline (by default). 280 if (startRegion) 281 return toRenderNamedFlowFragment(startRegion); 282 } 283 284 // FIXME: remove this when we'll have region ranges for inlines as well. 285 LayoutPoint flowThreadOffset = flooredLayoutPoint(childLayer.renderer().localToContainerPoint(LayoutPoint(), this, ApplyContainerFlip)); 286 return toRenderNamedFlowFragment(regionAtBlockOffset(0, flipForWritingMode(isHorizontalWritingMode() ? flowThreadOffset.y() : flowThreadOffset.x()), true, DisallowRegionAutoGeneration)); 287 } 288 289 RenderNamedFlowFragment* RenderFlowThread::cachedRegionForCompositedLayer(RenderLayer& childLayer) 290 { 291 if (!m_layerToRegionMap) 292 return 0; 293 updateAllLayerToRegionMappingsIfNeeded(); 294 return m_layerToRegionMap->get(&childLayer); 295 } 296 297 void RenderFlowThread::updateLayerToRegionMappings(RenderLayer& layer, LayerToRegionMap& layerToRegionMap, RegionToLayerListMap& regionToLayerListMap, bool& needsLayerUpdate) 298 { 299 RenderNamedFlowFragment* region = regionForCompositedLayer(layer); 262 300 if (!needsLayerUpdate) { 263 ASSERT(m_layerToRegionMap);264 301 // Figure out if we moved this layer from a region to the other. 265 Render Region* previousRegion = m_layerToRegionMap->get(layer);302 RenderNamedFlowFragment* previousRegion = cachedRegionForCompositedLayer(layer); 266 303 if (previousRegion != region) 267 304 needsLayerUpdate = true; 268 305 } 306 269 307 if (!region) 270 308 return; 271 layerToRegionMap.set(layer, region); 309 310 layerToRegionMap.set(&layer, region); 311 272 312 RegionToLayerListMap::iterator iterator = regionToLayerListMap.find(region); 273 313 RenderLayerList& list = iterator == regionToLayerListMap.end() ? regionToLayerListMap.set(region, RenderLayerList()).iterator->value : iterator->value; 274 list.append(layer); 275 } 276 277 bool RenderFlowThread::updateLayerToRegionMappings() 278 { 279 // We only need to map layers to regions for named flow threads. 280 // Multi-column threads are displayed on top of the regions and do not require 281 // distributing the layers. 282 if (!isOutOfFlowRenderFlowThread()) 314 ASSERT(!list.contains(&layer)); 315 list.append(&layer); 316 } 317 318 bool RenderFlowThread::updateAllLayerToRegionMappings() 319 { 320 if (!collectsGraphicsLayersUnderRegions()) 283 321 return false; 284 322 … … 288 326 289 327 // If the RenderFlowThread had a z-index layer update, then we need to update the composited layers too. 290 bool needsLayerUpdate = m_layersToRegionMappingsDirty || !m_layerToRegionMap.get();328 bool needsLayerUpdate = layer()->isDirtyRenderFlowThread() || m_layersToRegionMappingsDirty || !m_layerToRegionMap.get(); 291 329 layer()->updateLayerListsIfNeeded(); 292 330 … … 294 332 RegionToLayerListMap regionToLayerListMap; 295 333 296 if (Vector<RenderLayer*>* negZOrderList = layer()->negZOrderList()) { 297 size_t listSize = negZOrderList->size(); 298 for (size_t i = 0; i < listSize; ++i) 299 updateRegionForRenderLayer(negZOrderList->at(i), layerToRegionMap, regionToLayerListMap, needsLayerUpdate); 300 } 301 302 if (Vector<RenderLayer*>* normalFlowList = layer()->normalFlowList()) { 303 size_t listSize = normalFlowList->size(); 304 for (size_t i = 0; i < listSize; ++i) 305 updateRegionForRenderLayer(normalFlowList->at(i), layerToRegionMap, regionToLayerListMap, needsLayerUpdate); 306 } 307 308 if (Vector<RenderLayer*>* posZOrderList = layer()->posZOrderList()) { 309 size_t listSize = posZOrderList->size(); 310 for (size_t i = 0; i < listSize; ++i) 311 updateRegionForRenderLayer(posZOrderList->at(i), layerToRegionMap, regionToLayerListMap, needsLayerUpdate); 312 } 334 RenderLayerList* lists[] = { layer()->negZOrderList(), layer()->normalFlowList(), layer()->posZOrderList()}; 335 for (size_t listIndex = 0; listIndex < sizeof(lists) / sizeof(lists[0]); ++listIndex) 336 if (RenderLayerList* list = lists[listIndex]) 337 for (size_t i = 0, listSize = list->size(); i < listSize; ++i) 338 updateLayerToRegionMappings(*list->at(i), layerToRegionMap, regionToLayerListMap, needsLayerUpdate); 313 339 314 340 if (needsLayerUpdate) { … … 316 342 m_layerToRegionMap = adoptPtr(new LayerToRegionMap()); 317 343 m_layerToRegionMap->swap(layerToRegionMap); 344 345 if (!m_regionToLayerListMap) 346 m_regionToLayerListMap = adoptPtr(new RegionToLayerListMap()); 347 m_regionToLayerListMap->swap(regionToLayerListMap); 318 348 } 319 349 … … 323 353 } 324 354 #endif 355 356 bool RenderFlowThread::collectsGraphicsLayersUnderRegions() const 357 { 358 // We only need to map layers to regions for named flow threads. 359 // Multi-column threads are displayed on top of the regions and do not require 360 // distributing the layers. 361 362 return false; 363 } 325 364 326 365 void RenderFlowThread::updateLogicalWidth() -
trunk/Source/WebCore/rendering/RenderFlowThread.h
r157665 r157725 42 42 typedef Vector<LayerFragment, 1> LayerFragments; 43 43 class RenderFlowThread; 44 class RenderNamedFlowFragment; 44 45 class RenderStyle; 45 46 class RenderRegion; 46 47 48 #if USE(ACCELERATED_COMPOSITING) 47 49 typedef ListHashSet<RenderRegion*> RenderRegionList; 48 50 typedef Vector<RenderLayer*> RenderLayerList; 49 typedef HashMap<RenderRegion*, RenderLayerList> RegionToLayerListMap; 50 typedef HashMap<RenderLayer*, RenderRegion*> LayerToRegionMap; 51 typedef HashMap<RenderNamedFlowFragment*, RenderLayerList> RegionToLayerListMap; 52 typedef HashMap<RenderLayer*, RenderNamedFlowFragment*> LayerToRegionMap; 53 #endif 51 54 52 55 // RenderFlowThread is used to collect all the render objects that participate in a … … 117 120 118 121 RenderRegion* regionAtBlockOffset(const RenderBox*, LayoutUnit, bool extendLastRegion = false, RegionAutoGenerationPolicy = AllowRegionAutoGeneration); 119 120 const RenderLayerList* getLayerListForRegion(RenderRegion*) const;121 122 122 123 bool regionsHaveUniformLogicalWidth() const { return m_regionsHaveUniformLogicalWidth; } … … 182 183 183 184 #if USE(ACCELERATED_COMPOSITING) 185 // Whether any of the regions has a compositing descendant. 186 bool hasCompositingRegionDescendant() const; 187 184 188 void setNeedsLayerToRegionMappingsUpdate() { m_layersToRegionMappingsDirty = true; } 185 void update LayerToRegionMappingsIfNeeded()189 void updateAllLayerToRegionMappingsIfNeeded() 186 190 { 187 191 if (m_layersToRegionMappingsDirty) 188 update LayerToRegionMappings();192 updateAllLayerToRegionMappings(); 189 193 } 190 #endif 194 195 const RenderLayerList* getLayerListForRegion(RenderNamedFlowFragment*); 196 197 RenderNamedFlowFragment* regionForCompositedLayer(RenderLayer&); // By means of getRegionRangeForBox or regionAtBlockOffset. 198 RenderNamedFlowFragment* cachedRegionForCompositedLayer(RenderLayer&); 199 200 #endif 201 virtual bool collectsGraphicsLayersUnderRegions() const; 191 202 192 203 void pushFlowThreadLayoutState(const RenderObject*); … … 223 234 224 235 #if USE(ACCELERATED_COMPOSITING) 225 RenderRegion* regionForCompositedLayer(RenderLayer*); 236 bool updateAllLayerToRegionMappings(); 237 238 // Triggers a layers' update if a layer has moved from a region to another since the last update. 239 void updateLayerToRegionMappings(RenderLayer&, LayerToRegionMap&, RegionToLayerListMap&, bool& needsLayerUpdate); 240 RenderNamedFlowFragment* regionForCompositedLayer(RenderLayer*); 226 241 bool updateLayerToRegionMappings(); 227 242 void updateRegionForRenderLayer(RenderLayer*, LayerToRegionMap&, RegionToLayerListMap&, bool& needsLayerUpdate); … … 305 320 306 321 #if USE(ACCELERATED_COMPOSITING) 322 // To easily find the region where a layer should be painted. 307 323 OwnPtr<LayerToRegionMap> m_layerToRegionMap; 324 325 // To easily find the list of layers that paint in a region. 326 OwnPtr<RegionToLayerListMap> m_regionToLayerListMap; 308 327 #endif 309 328 -
trunk/Source/WebCore/rendering/RenderGeometryMap.cpp
r156478 r157725 27 27 #include "RenderGeometryMap.h" 28 28 29 #include "RenderFlowThread.h" 29 30 #include "RenderLayer.h" 30 31 #include "RenderView.h" … … 252 253 } 253 254 255 void RenderGeometryMap::pushRenderFlowThread(const RenderFlowThread* flowThread) 256 { 257 m_mapping.append(RenderGeometryMapStep(flowThread, false, false, false, false)); 258 stepInserted(m_mapping.last()); 259 } 260 254 261 void RenderGeometryMap::popMappingsToAncestor(const RenderLayerModelObject* ancestorRenderer) 255 262 { -
trunk/Source/WebCore/rendering/RenderGeometryMap.h
r156478 r157725 37 37 namespace WebCore { 38 38 39 class RenderFlowThread; 39 40 class RenderLayer; 40 41 class RenderLayerModelObject; … … 111 112 // RenderView gets special treatment, because it applies the scroll offset only for elements inside in fixed position. 112 113 void pushView(const RenderView*, const LayoutSize& scrollOffset, const TransformationMatrix* = 0); 114 void pushRenderFlowThread(const RenderFlowThread*); 113 115 114 116 private: -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r157665 r157725 85 85 #include "RenderMarquee.h" 86 86 #include "RenderNamedFlowThread.h" 87 #include "RenderRegion.h" 87 88 #include "RenderReplica.h" 88 89 #include "RenderSVGResourceClipper.h" … … 4032 4033 for (size_t i = 0; i < list->size(); ++i) { 4033 4034 RenderLayer* childLayer = list->at(i); 4034 if (childLayer->is OutOfFlowRenderFlowThread())4035 if (childLayer->isFlowThreadCollectingGraphicsLayersUnderRegions()) 4035 4036 continue; 4036 4037 … … 4444 4445 ASSERT_NOT_REACHED(); 4445 4446 return 0; 4447 } 4448 4449 RenderLayer* RenderLayer::enclosingFlowThreadAncestor() const 4450 { 4451 RenderLayer* curr = parent(); 4452 for (; curr && !curr->isRenderFlowThread(); curr = curr->parent()) { 4453 if (curr->isStackingContainer() && curr->isComposited()) { 4454 // We only adjust the position of the first level of layers. 4455 return 0; 4456 } 4457 } 4458 return curr; 4459 } 4460 4461 bool RenderLayer::isFlowThreadCollectingGraphicsLayersUnderRegions() const 4462 { 4463 return renderer().isRenderFlowThread() && toRenderFlowThread(renderer()).collectsGraphicsLayersUnderRegions(); 4446 4464 } 4447 4465 … … 4891 4909 for (int i = list->size() - 1; i >= 0; --i) { 4892 4910 RenderLayer* childLayer = list->at(i); 4893 if (childLayer->is OutOfFlowRenderFlowThread())4911 if (childLayer->isFlowThreadCollectingGraphicsLayersUnderRegions()) 4894 4912 continue; 4895 4913 RenderLayer* hitLayer = 0; … … 5498 5516 for (size_t i = 0; i < listSize; ++i) { 5499 5517 RenderLayer* curLayer = posZOrderList->at(i); 5500 if (flags & IncludeCompositedDescendants || !curLayer->isComposited()) { 5518 // The RenderNamedFlowThread is ignored when we calculate the bounds of the RenderView. 5519 if ((flags & IncludeCompositedDescendants || !curLayer->isComposited()) && !curLayer->isFlowThreadCollectingGraphicsLayersUnderRegions()) { 5501 5520 LayoutRect childUnionBounds = curLayer->calculateLayerBounds(this, 0, descendantFlags); 5502 5521 unionBounds.unite(childUnionBounds); … … 5511 5530 // RenderView will always return the size of the document, before reaching this point, 5512 5531 // so there's no way we could hit a RenderNamedFlowThread here. 5513 ASSERT(!curLayer->is OutOfFlowRenderFlowThread());5532 ASSERT(!curLayer->isFlowThreadCollectingGraphicsLayersUnderRegions()); 5514 5533 if (flags & IncludeCompositedDescendants || !curLayer->isComposited()) { 5515 5534 LayoutRect curAbsBounds = curLayer->calculateLayerBounds(this, 0, descendantFlags); … … 5734 5753 #if USE(ACCELERATED_COMPOSITING) 5735 5754 if (!renderer().documentBeingDestroyed()) { 5736 if ( renderer().isOutOfFlowRenderFlowThread())5755 if (isFlowThreadCollectingGraphicsLayersUnderRegions()) 5737 5756 toRenderFlowThread(renderer()).setNeedsLayerToRegionMappingsUpdate(); 5738 5757 compositor().setCompositingLayersNeedRebuild(); … … 5760 5779 #if USE(ACCELERATED_COMPOSITING) 5761 5780 if (!renderer().documentBeingDestroyed()) { 5762 if ( renderer().isOutOfFlowRenderFlowThread())5781 if (isFlowThreadCollectingGraphicsLayersUnderRegions()) 5763 5782 toRenderFlowThread(renderer()).setNeedsLayerToRegionMappingsUpdate(); 5764 5783 compositor().setCompositingLayersNeedRebuild(); -
trunk/Source/WebCore/rendering/RenderLayer.h
r157653 r157725 751 751 #if USE(ACCELERATED_COMPOSITING) 752 752 bool isComposited() const { return m_backing != 0; } 753 bool hasCompositingDescendant() const { return m_hasCompositingDescendant; } 753 754 bool hasCompositedMask() const; 754 755 RenderLayerBacking* backing() const { return m_backing.get(); } … … 814 815 #endif 815 816 817 bool isRenderFlowThread() const { return renderer().isRenderFlowThread(); } 816 818 bool isOutOfFlowRenderFlowThread() const { return renderer().isOutOfFlowRenderFlowThread(); } 819 bool isInsideFlowThread() const { return renderer().flowThreadState() != RenderObject::NotInsideFlowThread; } 820 bool isInsideOutOfFlowThread() const { return renderer().flowThreadState() == RenderObject::InsideOutOfFlowThread; } 821 bool isDirtyRenderFlowThread() const 822 { 823 ASSERT(isRenderFlowThread()); 824 return m_zOrderListsDirty || m_normalFlowListDirty; 825 } 826 827 bool isFlowThreadCollectingGraphicsLayersUnderRegions() const; 828 829 RenderLayer* enclosingFlowThreadAncestor() const; 817 830 818 831 private: … … 1083 1096 1084 1097 #if USE(ACCELERATED_COMPOSITING) 1085 bool hasCompositingDescendant() const { return m_hasCompositingDescendant; }1086 1098 void setHasCompositingDescendant(bool b) { m_hasCompositingDescendant = b; } 1087 1099 -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r157378 r157725 49 49 #include "PluginViewBase.h" 50 50 #include "ProgressTracker.h" 51 #include "RenderFlowThread.h" 51 52 #include "RenderIFrame.h" 52 53 #include "RenderImage.h" 53 54 #include "RenderLayerCompositor.h" 54 55 #include "RenderEmbeddedObject.h" 56 #include "RenderNamedFlowFragment.h" 57 #include "RenderRegion.h" 55 58 #include "RenderVideo.h" 56 59 #include "RenderView.h" … … 407 410 408 411 if (layerOrAncestorIsTransformedOrUsingCompositedScrolling(m_owningLayer)) 412 return false; 413 414 if (m_owningLayer.isFlowThreadCollectingGraphicsLayersUnderRegions()) 409 415 return false; 410 416 … … 645 651 relativeCompositingBounds.moveBy(delta); 646 652 653 adjustAncestorCompositingBoundsForFlowThread(ancestorCompositingBounds, compAncestor); 654 647 655 IntPoint graphicsLayerParentLocation; 648 656 if (compAncestor && compAncestor->backing()->hasClippingLayer()) { … … 842 850 } 843 851 852 void RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread(IntRect& ancestorCompositingBounds, const RenderLayer* compositingAncestor) const 853 { 854 if (!m_owningLayer.isInsideFlowThread()) 855 return; 856 857 RenderLayer* flowThreadLayer = m_owningLayer.isInsideOutOfFlowThread() ? m_owningLayer.stackingContainer() : m_owningLayer.enclosingFlowThreadAncestor(); 858 if (flowThreadLayer && flowThreadLayer->isRenderFlowThread()) { 859 RenderFlowThread& flowThread = toRenderFlowThread(flowThreadLayer->renderer()); 860 if (m_owningLayer.isFlowThreadCollectingGraphicsLayersUnderRegions()) { 861 // The RenderNamedFlowThread is not composited, as we need it to paint the 862 // background layer of the regions. We need to compensate for that by manually 863 // subtracting the position of the flow-thread. 864 IntPoint flowPosition; 865 flowThreadLayer->convertToPixelSnappedLayerCoords(compositingAncestor, flowPosition); 866 ancestorCompositingBounds.moveBy(flowPosition); 867 } 868 869 // Move the ancestor position at the top of the region where the composited layer is going to display. 870 RenderNamedFlowFragment* parentRegion = flowThread.cachedRegionForCompositedLayer(m_owningLayer); 871 if (parentRegion) { 872 IntPoint flowDelta; 873 m_owningLayer.convertToPixelSnappedLayerCoords(flowThreadLayer, flowDelta); 874 parentRegion->adjustRegionBoundsFromFlowThreadPortionRect(flowDelta, ancestorCompositingBounds); 875 RenderBoxModelObject* layerOwner = toRenderBoxModelObject(parentRegion->layerOwner()); 876 if (layerOwner->hasLayer() && layerOwner->layer()->backing()) { 877 // Make sure that the region propagates its borders, paddings, outlines or box-shadows to layers inside it. 878 // Note that the composited bounds of the RenderRegion are already calculated 879 // because RenderLayerCompositor::rebuildCompositingLayerTree will only 880 // iterate on the content of the region after the region itself is computed. 881 ancestorCompositingBounds.moveBy(roundedIntPoint(layerOwner->layer()->backing()->compositedBounds().location())); 882 ancestorCompositingBounds.move(-layerOwner->borderAndPaddingStart(), -layerOwner->borderAndPaddingBefore()); 883 } 884 } 885 } 886 } 887 844 888 void RenderLayerBacking::updateDirectlyCompositedContents(bool isSimpleContainer, bool& didUpdateContentsRect) 845 889 { … … 1571 1615 return false; 1572 1616 1573 if (renderer().isRender Region())1617 if (renderer().isRenderNamedFlowFragmentContainer()) 1574 1618 return false; 1575 1619 -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r157378 r157725 279 279 void paintIntoLayer(const GraphicsLayer*, GraphicsContext*, const IntRect& paintDirtyRect, PaintBehavior, GraphicsLayerPaintingPhase); 280 280 281 // Helper function for updateGraphicsLayerGeometry. 282 void adjustAncestorCompositingBoundsForFlowThread(IntRect& ancestorCompositingBounds, const RenderLayer* compositingAncestor) const; 283 281 284 static CSSPropertyID graphicsLayerToCSSProperty(AnimatedPropertyID); 282 285 static AnimatedPropertyID cssToGraphicsLayerProperty(CSSPropertyID); -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r157333 r157725 47 47 #include "Page.h" 48 48 #include "RenderEmbeddedObject.h" 49 #include "RenderFlowThread.h" 49 50 #include "RenderFullScreen.h" 50 51 #include "RenderGeometryMap.h" 51 52 #include "RenderIFrame.h" 52 53 #include "RenderLayerBacking.h" 54 #include "RenderNamedFlowFragment.h" 53 55 #include "RenderReplica.h" 54 56 #include "RenderVideo.h" … … 932 934 layer.updateLayerListsIfNeeded(); 933 935 934 if (layer.isOutOfFlowRenderFlowThread()) 935 return; 936 if (layer.isFlowThreadCollectingGraphicsLayersUnderRegions()) { 937 RenderFlowThread& flowThread = toRenderFlowThread(layer.renderer()); 938 layer.setHasCompositingDescendant(flowThread.hasCompositingRegionDescendant()); 939 return; 940 } 936 941 937 942 if (overlapMap) … … 1014 1019 } 1015 1020 } 1021 1022 if (layer.renderer().isRenderNamedFlowFragmentContainer()) { 1023 // We are going to collect layers from the RenderFlowThread into the GraphicsLayer of the parent of the 1024 // anonymous RenderRegion, but first we need to make sure that the parent itself of the region is going to 1025 // have a composited layer. We only want to make regions composited when there's an actual layer that we 1026 // need to move to that region. 1027 computeRegionCompositingRequirements(toRenderBlockFlow(layer.renderer()).renderNamedFlowFragment(), overlapMap, childState, layersChanged, anyDescendantHas3DTransform); 1028 } 1029 1016 1030 1017 1031 if (Vector<RenderLayer*>* normalFlowList = layer.normalFlowList()) { … … 1117 1131 } 1118 1132 1133 void RenderLayerCompositor::computeRegionCompositingRequirements(RenderNamedFlowFragment* region, OverlapMap* overlapMap, CompositingState& childState, bool& layersChanged, bool& anyDescendantHas3DTransform) 1134 { 1135 if (!region->isValid()) 1136 return; 1137 1138 RenderFlowThread* flowThread = region->flowThread(); 1139 1140 if (overlapMap) 1141 overlapMap->geometryMap().pushRenderFlowThread(flowThread); 1142 1143 if (const RenderLayerList* layerList = flowThread->getLayerListForRegion(region)) { 1144 for (size_t i = 0, listSize = layerList->size(); i < listSize; ++i) { 1145 RenderLayer& curLayer = *layerList->at(i); 1146 ASSERT(flowThread->regionForCompositedLayer(curLayer) == region); 1147 computeCompositingRequirements(flowThread->layer(), curLayer, overlapMap, childState, layersChanged, anyDescendantHas3DTransform); 1148 } 1149 } 1150 1151 if (overlapMap) 1152 overlapMap->geometryMap().popMappingsToAncestor(region->layerOwner()); 1153 } 1154 1119 1155 void RenderLayerCompositor::setCompositingParent(RenderLayer& childLayer, RenderLayer* parentLayer) 1120 1156 { … … 1160 1196 // have been processed. computeCompositingRequirements() will already have done the repaint if necessary. 1161 1197 1162 if (layer.isOutOfFlowRenderFlowThread()) 1198 // Do not iterate the RenderFlowThread directly. We are going to collect composited layers as part of regions. 1199 if (layer.isFlowThreadCollectingGraphicsLayersUnderRegions()) 1163 1200 return; 1164 1201 … … 1210 1247 childList.append(layerBacking->foregroundLayer()); 1211 1248 } 1249 1250 if (layer.renderer().isRenderNamedFlowFragmentContainer()) 1251 rebuildRegionCompositingLayerTree(toRenderBlockFlow(layer.renderer()).renderNamedFlowFragment(), layerChildren, depth + 1); 1212 1252 1213 1253 if (Vector<RenderLayer*>* normalFlowList = layer.normalFlowList()) { … … 1251 1291 1252 1292 childLayersOfEnclosingLayer.append(layerBacking->childForSuperlayers()); 1293 } 1294 } 1295 1296 void RenderLayerCompositor::rebuildRegionCompositingLayerTree(RenderNamedFlowFragment* region, Vector<GraphicsLayer*>& childList, int depth) 1297 { 1298 if (!region->isValid()) 1299 return; 1300 1301 RenderFlowThread* flowThread = region->flowThread(); 1302 ASSERT(flowThread->collectsGraphicsLayersUnderRegions()); 1303 if (const RenderLayerList* layerList = flowThread->getLayerListForRegion(region)) { 1304 for (size_t i = 0, listSize = layerList->size(); i < listSize; ++i) { 1305 RenderLayer& curLayer = *layerList->at(i); 1306 ASSERT(flowThread->regionForCompositedLayer(curLayer) == region); 1307 rebuildCompositingLayerTree(curLayer, childList, depth + 1); 1308 } 1253 1309 } 1254 1310 } … … 1772 1828 bool RenderLayerCompositor::canBeComposited(const RenderLayer& layer) const 1773 1829 { 1774 // FIXME: We disable accelerated compositing for elements in a RenderFlowThread as it doesn't work properly. 1775 // See http://webkit.org/b/84900 to re-enable it. 1776 return m_hasAcceleratedCompositing && layer.isSelfPaintingLayer() && layer.renderer().flowThreadState() == RenderElement::NotInsideFlowThread; 1830 if (m_hasAcceleratedCompositing && layer.isSelfPaintingLayer()) { 1831 if (!layer.isInsideFlowThread()) 1832 return true; 1833 1834 // CSS Regions flow threads do not need to be composited as we use composited RenderRegions 1835 // to render the background of the RenderFlowThread. 1836 if (layer.isRenderFlowThread()) 1837 return false; 1838 1839 // A faster way of saying layer.enclosingFlowThreadLayer()->isFlowThreadCollectingGraphicsLayersUnderRegions() 1840 return layer.isInsideOutOfFlowThread(); 1841 } 1842 return false; 1777 1843 } 1778 1844 … … 2155 2221 2156 2222 // When a layer has composited descendants, some effects, like 2d transforms, filters, masks etc must be implemented 2157 // via compositing so that they also apply to those composited desc dendants.2158 if (hasCompositedDescendants && (layer.transform() || renderer.createsGroup() || renderer.hasReflection() )) {2223 // via compositing so that they also apply to those composited descendants. 2224 if (hasCompositedDescendants && (layer.transform() || renderer.createsGroup() || renderer.hasReflection() || renderer.isRenderNamedFlowFragmentContainer())) { 2159 2225 reason = RenderLayer::IndirectCompositingForGraphicalEffect; 2160 2226 return true; -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r156622 r157725 41 41 class GraphicsLayerUpdater; 42 42 class RenderEmbeddedObject; 43 class RenderNamedFlowFragment; 43 44 class RenderVideo; 44 45 class RenderWidget; … … 142 143 void scheduleCompositingLayerUpdate(); 143 144 144 // Update the maps that we use to distribute layers to coresponding RenderRegions.145 // Update the maps that we use to distribute layers to coresponding regions. 145 146 void updateRenderFlowThreadLayersIfNeeded(); 146 147 … … 324 325 // Returns true if any layer's compositing changed 325 326 void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer&, OverlapMap*, struct CompositingState&, bool& layersChanged, bool& descendantHas3DTransform); 327 328 void computeRegionCompositingRequirements(RenderNamedFlowFragment*, OverlapMap*, CompositingState&, bool& layersChanged, bool& anyDescendantHas3DTransform); 326 329 327 330 // Recurses down the tree, parenting descendant compositing layers and collecting an array of child layers for the current compositing layer. 328 331 void rebuildCompositingLayerTree(RenderLayer&, Vector<GraphicsLayer*>& childGraphicsLayersOfEnclosingLayer, int depth); 332 333 // Recurses down the RenderFlowThread tree, parenting descendant compositing layers and collecting an array of child 334 // layers for the current compositing layer corresponding to the anonymous region (that belongs to the region's parent). 335 void rebuildRegionCompositingLayerTree(RenderNamedFlowFragment*, Vector<GraphicsLayer*>& childList, int depth); 329 336 330 337 // Recurses down the tree, updating layer geometry only. -
trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp
r157408 r157725 509 509 } 510 510 511 void RenderMultiColumnSet::adjustRegionBoundsFromFlowThreadPortionRect(const IntPoint& layerOffset, IntRect& regionBounds) 512 { 513 LayoutUnit layerLogicalTop = isHorizontalWritingMode() ? layerOffset.y() : layerOffset.x(); 514 unsigned startColumn = columnIndexAtOffset(layerLogicalTop); 515 516 LayoutUnit colGap = columnGap(); 517 LayoutUnit colLogicalWidth = computedColumnWidth(); 518 519 LayoutRect flowThreadPortion = flowThreadPortionRectAt(startColumn); 520 LayoutPoint translationOffset; 521 522 LayoutUnit inlineOffset = startColumn * (colLogicalWidth + colGap); 523 if (!style()->isLeftToRightDirection()) 524 inlineOffset = -inlineOffset; 525 translationOffset.setX(inlineOffset); 526 527 LayoutUnit blockOffset = isHorizontalWritingMode() ? -flowThreadPortion.y() : -flowThreadPortion.x(); 528 if (isFlippedBlocksWritingMode(style()->writingMode())) 529 blockOffset = -blockOffset; 530 translationOffset.setY(blockOffset); 531 532 if (!isHorizontalWritingMode()) 533 translationOffset = translationOffset.transposedPoint(); 534 535 // FIXME: The translation needs to include the multicolumn set's content offset within the 536 // multicolumn block as well. This won't be an issue until we start creating multiple multicolumn sets. 537 538 regionBounds.moveBy(roundedIntPoint(-translationOffset)); 539 } 540 511 541 const char* RenderMultiColumnSet::renderName() const 512 542 { -
trunk/Source/WebCore/rendering/RenderMultiColumnSet.h
r157408 r157725 119 119 virtual void collectLayerFragments(LayerFragments&, const LayoutRect& layerBoundingBox, const LayoutRect& dirtyRect) OVERRIDE; 120 120 121 virtual void adjustRegionBoundsFromFlowThreadPortionRect(const IntPoint& layerOffset, IntRect& regionBounds) OVERRIDE; 122 121 123 virtual const char* renderName() const; 122 124 -
trunk/Source/WebCore/rendering/RenderNamedFlowFragment.h
r157567 r157725 52 52 bool isPseudoElementRegion() const { return parent() && parent()->isPseudoElement(); } 53 53 54 // When the content inside the region requires the region to have a layer, the layer will be created on the region's 55 // parent renderer instead. 56 // This method returns that renderer holding the layer. 57 // The return value may be null. 58 RenderLayerModelObject* layerOwner() const { return parent() && parent()->isRenderLayerModelObject() ? 59 toRenderLayerModelObject(parent()) : nullptr; } 60 54 61 protected: 55 62 virtual bool shouldHaveAutoLogicalHeight() const; -
trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp
r157665 r157725 47 47 RenderNamedFlowThread::RenderNamedFlowThread(Document& document, PassRefPtr<WebKitNamedFlow> namedFlow) 48 48 : RenderFlowThread(document) 49 , m_flowThreadChildList(adoptPtr(new FlowThreadChildList())) 49 50 , m_overset(true) 50 51 , m_namedFlow(namedFlow) … … 100 101 RenderObject* RenderNamedFlowThread::nextRendererForNode(Node* node) const 101 102 { 102 FlowThreadChildList::const_iterator it = m_flowThreadChildList .begin();103 FlowThreadChildList::const_iterator end = m_flowThreadChildList .end();103 FlowThreadChildList::const_iterator it = m_flowThreadChildList->begin(); 104 FlowThreadChildList::const_iterator end = m_flowThreadChildList->end(); 104 105 105 106 for (; it != end; ++it) { … … 116 117 RenderObject* RenderNamedFlowThread::previousRendererForNode(Node* node) const 117 118 { 118 if (m_flowThreadChildList .isEmpty())119 if (m_flowThreadChildList->isEmpty()) 119 120 return 0; 120 121 121 FlowThreadChildList::const_iterator begin = m_flowThreadChildList .begin();122 FlowThreadChildList::const_iterator end = m_flowThreadChildList .end();122 FlowThreadChildList::const_iterator begin = m_flowThreadChildList->begin(); 123 FlowThreadChildList::const_iterator end = m_flowThreadChildList->end(); 123 124 FlowThreadChildList::const_iterator it = end; 124 125 … … 150 151 RenderObject* beforeChild = nextRendererForNode(childNode); 151 152 if (beforeChild) 152 m_flowThreadChildList .insertBefore(beforeChild, newChild);153 m_flowThreadChildList->insertBefore(beforeChild, newChild); 153 154 else 154 m_flowThreadChildList .add(newChild);155 m_flowThreadChildList->add(newChild); 155 156 } 156 157 157 158 void RenderNamedFlowThread::removeFlowChild(RenderObject* child) 158 159 { 159 m_flowThreadChildList .remove(child);160 m_flowThreadChildList->remove(child); 160 161 } 161 162 … … 728 729 } 729 730 730 } 731 #if USE(ACCELERATED_COMPOSITING) 732 bool RenderNamedFlowThread::collectsGraphicsLayersUnderRegions() const 733 { 734 // We only need to map layers to regions for named flow threads. 735 // Multi-column threads are displayed on top of the regions and do not require 736 // distributing the layers. 737 738 return true; 739 } 740 #endif 741 742 } -
trunk/Source/WebCore/rendering/RenderNamedFlowThread.h
r157653 r157725 58 58 void addFlowChild(RenderObject* newChild); 59 59 void removeFlowChild(RenderObject*); 60 bool hasChildren() const { return !m_flowThreadChildList .isEmpty(); }60 bool hasChildren() const { return !m_flowThreadChildList->isEmpty(); } 61 61 #ifndef NDEBUG 62 bool hasChild(RenderObject* child) const { return m_flowThreadChildList .contains(child); }62 bool hasChild(RenderObject* child) const { return m_flowThreadChildList->contains(child); } 63 63 #endif 64 64 … … 80 80 bool isMarkedForDestruction() const; 81 81 void getRanges(Vector<RefPtr<Range>>&, const RenderRegion*) const; 82 83 #if USE(ACCELERATED_COMPOSITING) 84 virtual bool collectsGraphicsLayersUnderRegions() const OVERRIDE; 85 #endif 82 86 83 87 protected: … … 120 124 // Holds the sorted children of a named flow. This is the only way we can get the ordering right. 121 125 typedef ListHashSet<RenderObject*> FlowThreadChildList; 122 FlowThreadChildListm_flowThreadChildList;126 OwnPtr<FlowThreadChildList> m_flowThreadChildList; 123 127 124 128 NamedFlowContentElements m_contentElements; -
trunk/Source/WebCore/rendering/RenderRegion.cpp
r157653 r157725 731 731 } 732 732 733 void RenderRegion::adjustRegionBoundsFromFlowThreadPortionRect(const IntPoint& layerOffset, IntRect& regionBounds) 734 { 735 LayoutRect flippedFlowThreadPortionRect = flowThreadPortionRect(); 736 flowThread()->flipForWritingMode(flippedFlowThreadPortionRect); 737 regionBounds.moveBy(roundedIntPoint(flippedFlowThreadPortionRect.location())); 738 739 UNUSED_PARAM(layerOffset); 740 } 741 742 733 743 RenderOverflow* RenderRegion::ensureOverflowForBox(const RenderBox* box) 734 744 { -
trunk/Source/WebCore/rendering/RenderRegion.h
r157653 r157725 138 138 virtual void collectLayerFragments(LayerFragments&, const LayoutRect&, const LayoutRect&) { } 139 139 140 virtual void adjustRegionBoundsFromFlowThreadPortionRect(const IntPoint& layerOffset, IntRect& regionBounds); // layerOffset is needed for multi-column. 141 140 142 void addLayoutOverflowForBox(const RenderBox*, const LayoutRect&); 141 143 void addVisualOverflowForBox(const RenderBox*, const LayoutRect&); … … 246 248 } 247 249 250 inline RenderRegion& toRenderRegion(RenderObject& object) 251 { 252 ASSERT_WITH_SECURITY_IMPLICATION(object.isRenderRegion()); 253 return static_cast<RenderRegion&>(object); 254 } 255 256 inline const RenderRegion& toRenderRegion(const RenderObject& object) 257 { 258 ASSERT_WITH_SECURITY_IMPLICATION(object.isRenderRegion()); 259 return static_cast<const RenderRegion&>(object); 260 } 261 248 262 // This will catch anyone doing an unnecessary cast. 249 263 void toRenderRegion(const RenderRegion*); 264 void toRenderRegion(const RenderRegion&); 250 265 251 266 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r157567 r157725 778 778 size_t layerCount = 0; 779 779 for (unsigned i = 0; i != posList->size(); ++i) 780 if (!posList->at(i)->is OutOfFlowRenderFlowThread())780 if (!posList->at(i)->isFlowThreadCollectingGraphicsLayersUnderRegions()) 781 781 ++layerCount; 782 782 if (layerCount) { 783 783 int currIndent = indent; 784 if (behavior & RenderAsTextShowLayerNesting) { 785 writeIndent(ts, indent); 786 ts << " positive z-order list(" << layerCount << ")\n"; 787 ++currIndent; 788 } 789 for (unsigned i = 0; i != posList->size(); ++i) { 790 if (!posList->at(i)->isOutOfFlowRenderFlowThread()) 791 writeLayers(ts, rootLayer, posList->at(i), paintDirtyRect, currIndent, behavior); 784 // We only print the header if there's at list a non-RenderNamedFlowThread part of the list. 785 if (!posList->size() || !posList->at(0)->isFlowThreadCollectingGraphicsLayersUnderRegions()) { 786 if (behavior & RenderAsTextShowLayerNesting) { 787 writeIndent(ts, indent); 788 ts << " positive z-order list(" << posList->size() << ")\n"; 789 ++currIndent; 790 } 791 for (unsigned i = 0; i != posList->size(); ++i) { 792 // Do not print named flows twice. 793 if (!posList->at(i)->isFlowThreadCollectingGraphicsLayersUnderRegions()) 794 writeLayers(ts, rootLayer, posList->at(i), paintDirtyRect, currIndent, behavior); 795 } 792 796 } 793 797 }
Note: See TracChangeset
for help on using the changeset viewer.