Changeset 157567 in webkit
- Timestamp:
- Oct 17, 2013 2:02:19 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r157564 r157567 1 2013-10-17 Mihnea Ovidenie <mihnea@adobe.com> 2 3 [CSS Regions] Anonymous nested regions 4 https://bugs.webkit.org/show_bug.cgi?id=119135 5 6 Reviewed by David Hyatt. 7 8 Add new tests for making a table-cell and a table-caption a region. 9 Change expected results for repaint tests of fixed elements since the parent of the region gets layer. 10 11 * fast/regions/element-in-named-flow-absolute-from-fixed-expected.txt: 12 * fast/regions/element-in-named-flow-fixed-from-absolute-expected.txt: 13 * fast/regions/element-inflow-fixed-from-outflow-static-expected.txt: 14 * fast/regions/element-outflow-static-from-inflow-fixed-expected.txt: 15 * fast/regions/table-caption-as-region-expected.html: Added. 16 * fast/regions/table-caption-as-region.html: Added. 17 * fast/regions/table-cell-as-region-expected.html: Added. 18 * fast/regions/table-cell-as-region.html: Added. 19 1 20 2013-10-17 Krzysztof Czech <k.czech@samsung.com> 2 21 -
trunk/LayoutTests/fast/regions/element-in-named-flow-absolute-from-fixed-expected.txt
r155026 r157567 1 1 (repaint rects 2 2 (rect 50 100 50 50) 3 (rect 100 100 200 200)4 3 (rect 150 200 50 50) 5 4 ) -
trunk/LayoutTests/fast/regions/element-in-named-flow-fixed-from-absolute-expected.txt
r155026 r157567 1 1 (repaint rects 2 2 (rect 150 200 50 50) 3 (rect 100 100 200 200)4 3 (rect 50 100 50 50) 5 4 ) -
trunk/LayoutTests/fast/regions/element-inflow-fixed-from-outflow-static-expected.txt
r155026 r157567 1 1 (repaint rects 2 2 (rect 300 300 50 50) 3 (rect 100 100 200 200)4 3 (rect 50 100 50 50) 5 4 ) -
trunk/LayoutTests/fast/regions/element-outflow-static-from-inflow-fixed-expected.txt
r155026 r157567 2 2 (rect 50 100 50 50) 3 3 (rect 300 300 50 50) 4 (rect 100 100 200 200)5 4 ) 6 5 -
trunk/Source/WebCore/CMakeLists.txt
r157430 r157567 2132 2132 rendering/RenderMultiColumnFlowThread.cpp 2133 2133 rendering/RenderMultiColumnSet.cpp 2134 rendering/RenderNamedFlowFragment.cpp 2134 2135 rendering/RenderNamedFlowThread.cpp 2135 2136 rendering/RenderObject.cpp -
trunk/Source/WebCore/ChangeLog
r157564 r157567 1 2013-10-17 Mihnea Ovidenie <mihnea@adobe.com> 2 3 [CSS Regions] Anonymous nested regions 4 https://bugs.webkit.org/show_bug.cgi?id=119135 5 6 Reviewed by David Hyatt. 7 8 Tests: fast/regions/table-caption-as-region.html 9 fast/regions/table-cell-as-region.html 10 11 This patch allows any non-replaced block to behave like a region. When an element is styled with the 12 -webkit-flow-from property, instead of making the renderer a RenderRegion, we let the original 13 renderer be created the same way and we add a region as an anonymous child for the renderer. 14 The anonymous block child, modeled by the new RenderNamedFlowFragment class, will be responsible 15 for the fragmentation of the named flow thread content. 16 17 A RenderBlockFlow object will keep a reference to a RenderNamedFlowFragment(RenderRegion) inside its 18 rare data structures. 19 20 Contains code contributed by Catalin Badea. 21 22 * CMakeLists.txt: 23 * GNUmakefile.list.am: 24 * WebCore.vcxproj/WebCore.vcxproj: 25 * WebCore.xcodeproj/project.pbxproj: 26 * dom/Element.cpp: Changed to take the anonymous region into account. 27 (WebCore::Element::renderRegion): 28 (WebCore::Element::webkitGetRegionFlowRanges): 29 * dom/WebKitNamedFlow.cpp: Ditto. 30 (WebCore::WebKitNamedFlow::firstEmptyRegionIndex): 31 (WebCore::WebKitNamedFlow::getRegionsByContent): 32 (WebCore::WebKitNamedFlow::getRegions): 33 * inspector/InspectorOverlay.cpp: Take into account the new model for regions, with an anonymous region inside a block. 34 (WebCore::buildObjectForRegionHighlight): 35 (WebCore::buildObjectForElementInfo): 36 * rendering/RenderBlock.cpp: 37 (WebCore::RenderBlock::computeShapeSize): For a render named flow fragment, there is no need to recompute the shape inside 38 we can take it from the parent. 39 (WebCore::RenderBlock::renderName): Make the block that contains a render named flow fragment (region) report RenderRegion. 40 A future patch that will change this will need to rebase a lot of tests. 41 * rendering/RenderBlockFlow.cpp: 42 (WebCore::RenderBlockFlow::insertedIntoTree): Create the anonymous region if needed (change of -webkit-flow-from determines Node reattach). 43 (WebCore::RenderBlockFlow::willBeDestroyed): Clean-up the anonymous region if necessary. 44 (WebCore::RenderBlockFlow::clearFloats): Small style change to make sure that check-webkit-style reports 0 failures on RenderBlockFlow.cpp. 45 (WebCore::RenderBlockFlow::layoutBlock): 46 (WebCore::RenderBlockFlow::styleDidChange): Update the style of the anonymous region too. 47 (WebCore::RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded): Helper function to create the anonymous region 48 and to add it as a child to the block. 49 (WebCore::RenderBlockFlow::canHaveChildren): 50 (WebCore::RenderBlockFlow::canHaveGeneratedChildren): 51 (WebCore::RenderBlockFlow::namedFlowFragmentNeedsUpdate): Force a layout of the anonymous region if the 52 parent block has percentage height (similar to RenderBlock::updateBlockChildDirtyBitsBeforeLayout) 53 (WebCore::RenderBlockFlow::updateLogicalHeight): Update the logical height of anonymous region when the height of parent is updated. 54 (WebCore::RenderBlockFlow::setRenderNamedFlowFragment): 55 * rendering/RenderBlockFlow.h: 56 (WebCore::RenderBlockFlow::RenderBlockFlowRareData::RenderBlockFlowRareData): 57 (WebCore::RenderBlockFlow::renderNamedFlowFragment): 58 * rendering/RenderElement.cpp: 59 (WebCore::RenderElement::createFor): Remove the direct creation of RenderRegion objects since they will be 60 created as anonymous children of block flow objects. 61 * rendering/RenderElement.h: 62 (WebCore::RenderElement::generatingElement): Account for anonymous region if necessary. 63 * rendering/RenderFlowThread.cpp: 64 (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent): Take anonymous region into account 65 and use the anonymous region parent offset/border. 66 * rendering/RenderLayer.cpp: 67 (WebCore::RenderLayer::shouldBeNormalFlowOnly): Check for style instead of isRenderRegion since 68 the parent of the anonymous region will get the layer. 69 * rendering/RenderListItem.cpp: 70 (WebCore::RenderListItem::insertedIntoTree): Call RenderBlockFlow method instead. 71 * rendering/RenderNamedFlowFragment.cpp: Added. Model the behaviour of the anonymous region. 72 Has RenderRegion as a base class. 73 (WebCore::RenderNamedFlowFragment::RenderNamedFlowFragment): 74 (WebCore::RenderNamedFlowFragment::~RenderNamedFlowFragment): 75 (WebCore::RenderNamedFlowFragment::setStyleForNamedFlowFragment): 76 (WebCore::RenderNamedFlowFragment::styleDidChange): 77 (WebCore::RenderNamedFlowFragment::shouldHaveAutoLogicalHeight): 78 (WebCore::RenderNamedFlowFragment::maxPageLogicalHeight): 79 * rendering/RenderNamedFlowFragment.h: Added. 80 (WebCore::RenderNamedFlowFragment::isPseudoElementRegion): 81 (WebCore::RenderNamedFlowFragment::renderName): 82 (WebCore::toRenderNamedFlowFragment): 83 * rendering/RenderObject.cpp: 84 (WebCore::RenderObject::isRenderNamedFlowFragmentContainer): 85 * rendering/RenderObject.h: 86 (WebCore::RenderObject::isRenderNamedFlowFragment): 87 * rendering/RenderRegion.h: 88 * rendering/RenderTableCaption.cpp: Call RenderBlockFlow method instead. 89 (WebCore::RenderTableCaption::insertedIntoTree): 90 * rendering/RenderTreeAsText.cpp: 91 (WebCore::write): 92 (WebCore::writeRenderRegionList): 93 * rendering/shapes/ShapeInfo.h: 94 (WebCore::ShapeInfo::shapeSize): 95 * style/StyleResolveTree.cpp: 96 (WebCore::Style::elementInsideRegionNeedsRenderer): 97 1 98 2013-10-17 Krzysztof Czech <k.czech@samsung.com> 2 99 -
trunk/Source/WebCore/GNUmakefile.list.am
r157445 r157567 4392 4392 Source/WebCore/rendering/RenderMultiColumnSet.cpp \ 4393 4393 Source/WebCore/rendering/RenderMultiColumnSet.h \ 4394 Source/WebCore/rendering/RenderNamedFlowFragment.cpp \ 4395 Source/WebCore/rendering/RenderNamedFlowFragment.h \ 4394 4396 Source/WebCore/rendering/RenderNamedFlowThread.cpp \ 4395 4397 Source/WebCore/rendering/RenderNamedFlowThread.h \ -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r157445 r157567 10025 10025 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild> 10026 10026 </ClCompile> 10027 <ClCompile Include="..\rendering\RenderNamedFlowFragment.cpp" /> 10027 10028 <ClCompile Include="..\rendering\RenderNamedFlowThread.cpp" /> 10028 10029 <ClCompile Include="..\rendering\RenderObject.cpp"> … … 19472 19473 <ClInclude Include="..\rendering\RenderMultiColumnFlowThread.h" /> 19473 19474 <ClInclude Include="..\rendering\RenderMultiColumnSet.h" /> 19475 <ClInclude Include="..\rendering\RenderNamedFlowFragment.h" /> 19474 19476 <ClInclude Include="..\rendering\RenderNamedFlowThread.h" /> 19475 19477 <ClInclude Include="..\rendering\RenderObject.h" /> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r157524 r157567 2792 2792 8AA61D00144D595B00F37350 /* WebKitCSSRegionRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AA61CFE144D595B00F37350 /* WebKitCSSRegionRule.h */; }; 2793 2793 8AB4BC77126FDB7100DEB727 /* IgnoreDestructiveWriteCountIncrementer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB4BC76126FDB7100DEB727 /* IgnoreDestructiveWriteCountIncrementer.h */; }; 2794 8AC822FC180FC03300FB64D5 /* RenderNamedFlowFragment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AC822FA180FC03300FB64D5 /* RenderNamedFlowFragment.cpp */; }; 2795 8AC822FD180FC03300FB64D5 /* RenderNamedFlowFragment.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AC822FB180FC03300FB64D5 /* RenderNamedFlowFragment.h */; }; 2794 2796 8AD0A59414C88336000D83C5 /* JSWebKitCSSRegionRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8ACC24CD148E24B200EFCC0D /* JSWebKitCSSRegionRule.cpp */; }; 2795 2797 8AD0A59514C88336000D83C5 /* JSWebKitCSSRegionRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 8ACC24CE148E24B200EFCC0D /* JSWebKitCSSRegionRule.h */; }; … … 9376 9378 8AA61CFE144D595B00F37350 /* WebKitCSSRegionRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitCSSRegionRule.h; sourceTree = "<group>"; }; 9377 9379 8AB4BC76126FDB7100DEB727 /* IgnoreDestructiveWriteCountIncrementer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IgnoreDestructiveWriteCountIncrementer.h; sourceTree = "<group>"; }; 9380 8AC822FA180FC03300FB64D5 /* RenderNamedFlowFragment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderNamedFlowFragment.cpp; sourceTree = "<group>"; }; 9381 8AC822FB180FC03300FB64D5 /* RenderNamedFlowFragment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderNamedFlowFragment.h; sourceTree = "<group>"; }; 9378 9382 8ACC24CD148E24B200EFCC0D /* JSWebKitCSSRegionRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitCSSRegionRule.cpp; sourceTree = "<group>"; }; 9379 9383 8ACC24CE148E24B200EFCC0D /* JSWebKitCSSRegionRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitCSSRegionRule.h; sourceTree = "<group>"; }; … … 20630 20634 BCE32B9D1517C22700F542EC /* RenderMultiColumnSet.cpp */, 20631 20635 BCE32B9B1517C0B100F542EC /* RenderMultiColumnSet.h */, 20636 8AC822FA180FC03300FB64D5 /* RenderNamedFlowFragment.cpp */, 20637 8AC822FB180FC03300FB64D5 /* RenderNamedFlowFragment.h */, 20632 20638 BC85F23E1519187300BC17BE /* RenderNamedFlowThread.cpp */, 20633 20639 BC85F23C151915E000BC17BE /* RenderNamedFlowThread.h */, … … 22275 22281 316FE0800E6CCC2800BF6088 /* DOMWebKitCSSKeyframesRule.h in Headers */, 22276 22282 078E091817D14D1C00420AA1 /* MediaStreamTrack.h in Headers */, 22283 8AC822FD180FC03300FB64D5 /* RenderNamedFlowFragment.h in Headers */, 22277 22284 316FE0820E6CCC2800BF6088 /* DOMWebKitCSSKeyframesRuleInternal.h in Headers */, 22278 22285 498391500F1E76B400C23782 /* DOMWebKitCSSMatrix.h in Headers */, … … 27234 27241 43F6FD9613BCD0B100224052 /* SVGAnimatedInteger.cpp in Sources */, 27235 27242 1A3586E115264F950022A659 /* SVGAnimatedIntegerOptionalInteger.cpp in Sources */, 27243 8AC822FC180FC03300FB64D5 /* RenderNamedFlowFragment.cpp in Sources */, 27236 27244 4381763B13A697D4007D1187 /* SVGAnimatedLength.cpp in Sources */, 27237 27245 431A2FD713B7707A007791E4 /* SVGAnimatedLengthList.cpp in Sources */, -
trunk/Source/WebCore/dom/Element.cpp
r157535 r157567 75 75 #include "PointerLockController.h" 76 76 #include "PseudoElement.h" 77 #include "RenderNamedFlowFragment.h" 77 78 #include "RenderRegion.h" 78 79 #include "RenderTheme.h" … … 2706 2707 RenderRegion* Element::renderRegion() const 2707 2708 { 2708 if (renderer() && renderer()->isRender Region())2709 return toRender Region(renderer());2709 if (renderer() && renderer()->isRenderNamedFlowFragmentContainer()) 2710 return toRenderBlockFlow(renderer())->renderNamedFlowFragment(); 2710 2711 2711 2712 return 0; … … 2764 2765 2765 2766 Vector<RefPtr<Range> > rangeObjects; 2766 if (document().cssRegionsEnabled() && renderer() && renderer()->isRender Region()) {2767 Render Region* region = toRenderRegion(renderer());2767 if (document().cssRegionsEnabled() && renderer() && renderer()->isRenderNamedFlowFragmentContainer()) { 2768 RenderNamedFlowFragment* region = toRenderBlockFlow(renderer())->renderNamedFlowFragment(); 2768 2769 if (region->isValid()) 2769 2770 region->getRanges(rangeObjects); -
trunk/Source/WebCore/dom/WebKitNamedFlow.cpp
r156413 r157567 33 33 #include "EventNames.h" 34 34 #include "NamedFlowCollection.h" 35 #include "RenderNamedFlowFragment.h" 35 36 #include "RenderNamedFlowThread.h" 36 37 #include "RenderRegion.h" … … 103 104 RenderRegionList::const_iterator iter = regionList.begin(); 104 105 for (int index = 0; iter != regionList.end(); ++index, ++iter) { 105 const RenderRegion* renderRegion = *iter;106 106 // FIXME: Pseudo-elements are not included in the list. 107 107 // They will be included when we will properly support the Region interface 108 108 // http://dev.w3.org/csswg/css-regions/#the-region-interface 109 if (renderRegion->isPseudoElement()) 109 const RenderNamedFlowFragment* renderRegion = toRenderNamedFlowFragment(*iter); 110 if (renderRegion->isPseudoElementRegion()) 110 111 continue; 111 112 countNonPseudoRegions++; … … 134 135 const RenderRegionList& regionList = m_parentFlowThread->renderRegionList(); 135 136 for (auto iter = regionList.begin(), end = regionList.end(); iter != end; ++iter) { 136 const RenderRegion* renderRegion = *iter;137 137 // FIXME: Pseudo-elements are not included in the list. 138 138 // They will be included when we will properly support the Region interface 139 139 // http://dev.w3.org/csswg/css-regions/#the-region-interface 140 if (renderRegion->isPseudoElement()) 140 const RenderNamedFlowFragment* renderRegion = toRenderNamedFlowFragment(*iter); 141 if (renderRegion->isPseudoElementRegion()) 141 142 continue; 142 143 if (m_parentFlowThread->objectInFlowRegion(contentNode->renderer(), renderRegion)) { … … 164 165 const RenderRegionList& regionList = m_parentFlowThread->renderRegionList(); 165 166 for (auto iter = regionList.begin(), end = regionList.end(); iter != end; ++iter) { 166 const RenderRegion* renderRegion = *iter;167 167 // FIXME: Pseudo-elements are not included in the list. 168 168 // They will be included when we will properly support the Region interface 169 169 // http://dev.w3.org/csswg/css-regions/#the-region-interface 170 if (renderRegion->isPseudoElement()) 170 const RenderNamedFlowFragment* renderRegion = toRenderNamedFlowFragment(*iter); 171 if (renderRegion->isPseudoElementRegion()) 171 172 continue; 172 173 ASSERT(renderRegion->generatingElement()); -
trunk/Source/WebCore/inspector/InspectorOverlay.cpp
r157199 r157567 48 48 #include "RenderFlowThread.h" 49 49 #include "RenderInline.h" 50 #include "RenderNamedFlowFragment.h" 50 51 #include "RenderNamedFlowThread.h" 51 52 #include "RenderRegion.h" … … 391 392 return nullptr; 392 393 393 LayoutRect borderBox = region->borderBoxRect(); 394 borderBox.setWidth(borderBox.width() + region->verticalScrollbarWidth()); 395 borderBox.setHeight(borderBox.height() + region->horizontalScrollbarHeight()); 394 RenderBlockFlow* regionContainer = toRenderBlockFlow(region->parent()); 395 LayoutRect borderBox = regionContainer->borderBoxRect(); 396 borderBox.setWidth(borderBox.width() + regionContainer->verticalScrollbarWidth()); 397 borderBox.setHeight(borderBox.height() + regionContainer->horizontalScrollbarHeight()); 396 398 397 399 // Create incoming and outgoing boxes that we use to chain the regions toghether. … … 408 410 outgoingRectBox.move(0, -linkBoxVerticalOffset); 409 411 410 FloatQuad borderRectQuad = region ->localToAbsoluteQuad(FloatRect(borderBox));411 FloatQuad incomingRectQuad = region ->localToAbsoluteQuad(FloatRect(incomingRectBox));412 FloatQuad outgoingRectQuad = region ->localToAbsoluteQuad(FloatRect(outgoingRectBox));412 FloatQuad borderRectQuad = regionContainer->localToAbsoluteQuad(FloatRect(borderBox)); 413 FloatQuad incomingRectQuad = regionContainer->localToAbsoluteQuad(FloatRect(incomingRectBox)); 414 FloatQuad outgoingRectQuad = regionContainer->localToAbsoluteQuad(FloatRect(outgoingRectBox)); 413 415 414 416 contentsQuadToPage(mainView, containingView, borderRectQuad); … … 561 563 elementInfo->setString("nodeHeight", String::number(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnappedOffsetHeight(), modelObject) : boundingBox.height())); 562 564 563 if (renderer->isRender Region()) {564 Render Region* region = toRenderRegion(renderer);565 if (renderer->isRenderNamedFlowFragmentContainer()) { 566 RenderNamedFlowFragment* region = toRenderBlockFlow(renderer)->renderNamedFlowFragment(); 565 567 RenderFlowThread* flowThread = region->flowThread(); 566 568 if (flowThread && flowThread->isRenderNamedFlowThread()) { -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r157535 r157567 1475 1475 { 1476 1476 ShapeInsideInfo* shapeInsideInfo = this->shapeInsideInfo(); 1477 if (shapeInsideInfo) { 1477 if (!shapeInsideInfo) 1478 return; 1479 1480 if (isRenderNamedFlowFragment()) { 1481 ShapeInsideInfo* parentShapeInsideInfo = toRenderBlock(parent())->shapeInsideInfo(); 1482 ASSERT(parentShapeInsideInfo); 1483 shapeInsideInfo->setShapeSize(parentShapeInsideInfo->shapeSize().width(), parentShapeInsideInfo->shapeSize().height()); 1484 } else { 1478 1485 bool percentageLogicalHeightResolvable = percentageLogicalHeightIsResolvableFromBlock(this, false); 1479 1486 shapeInsideInfo->setShapeSize(logicalWidth(), percentageLogicalHeightResolvable ? logicalHeight() : LayoutUnit()); … … 5868 5875 if (isBody()) 5869 5876 return "RenderBody"; // FIXME: Temporary hack until we know that the regression tests pass. 5870 5877 5878 if (isRenderNamedFlowFragmentContainer()) 5879 return "RenderRegion"; 5871 5880 if (isFloating()) 5872 5881 return "RenderBlock (floating)"; -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r157408 r157567 30 30 #include "RenderFlowThread.h" 31 31 #include "RenderLayer.h" 32 #include "RenderNamedFlowFragment.h" 32 33 #include "RenderView.h" 33 34 #include "VerticalPositionCache.h" … … 94 95 } 95 96 97 void RenderBlockFlow::insertedIntoTree() 98 { 99 RenderBlock::insertedIntoTree(); 100 createRenderNamedFlowFragmentIfNeeded(); 101 } 102 96 103 void RenderBlockFlow::willBeDestroyed() 97 104 { 98 105 if (lineGridBox()) 99 106 lineGridBox()->destroy(renderArena()); 100 107 if (renderNamedFlowFragment()) 108 setRenderNamedFlowFragment(0); 101 109 RenderBlock::willBeDestroyed(); 102 110 } … … 120 128 // Inline blocks are covered by the isReplaced() check in the avoidFloats method. 121 129 if (avoidsFloats() || isRoot() || isRenderView() || isFloatingOrOutOfFlowPositioned() || isTableCell()) { 122 if (m_floatingObjects) {130 if (m_floatingObjects) 123 131 m_floatingObjects->clear(); 124 }125 132 if (!oldIntrudingFloatSet.isEmpty()) 126 133 markAllDescendantsWithFloatsForLayout(); … … 269 276 relayoutChildren = true; 270 277 if (updateShapesBeforeBlockLayout()) 278 relayoutChildren = true; 279 if (namedFlowFragmentNeedsUpdate()) 271 280 relayoutChildren = true; 272 281 … … 1534 1543 parentBlock->markSiblingsWithFloatsForLayout(); 1535 1544 } 1545 1546 if (renderNamedFlowFragment()) 1547 renderNamedFlowFragment()->setStyleForNamedFlowFragment(style()); 1536 1548 } 1537 1549 … … 2352 2364 } 2353 2365 2366 void RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded() 2367 { 2368 if (renderNamedFlowFragment() || isRenderNamedFlowFragment()) 2369 return; 2370 2371 if (document().cssRegionsEnabled() && style()->isDisplayRegionType() && !style()->regionThread().isEmpty()) { 2372 RenderNamedFlowFragment* flowFragment = new RenderNamedFlowFragment(document()); 2373 flowFragment->setStyleForNamedFlowFragment(style()); 2374 setRenderNamedFlowFragment(flowFragment); 2375 addChild(renderNamedFlowFragment()); 2376 } 2377 } 2378 2379 bool RenderBlockFlow::canHaveChildren() const 2380 { 2381 return !renderNamedFlowFragment() ? RenderBlock::canHaveChildren() : renderNamedFlowFragment()->canHaveChildren(); 2382 } 2383 2384 bool RenderBlockFlow::canHaveGeneratedChildren() const 2385 { 2386 return !renderNamedFlowFragment() ? RenderBlock::canHaveGeneratedChildren() : renderNamedFlowFragment()->canHaveGeneratedChildren(); 2387 } 2388 2389 bool RenderBlockFlow::namedFlowFragmentNeedsUpdate() const 2390 { 2391 if (!isRenderNamedFlowFragmentContainer()) 2392 return false; 2393 2394 return hasRelativeLogicalHeight() && !isRenderView(); 2395 } 2396 2397 void RenderBlockFlow::updateLogicalHeight() 2398 { 2399 RenderBlock::updateLogicalHeight(); 2400 2401 if (renderNamedFlowFragment()) 2402 renderNamedFlowFragment()->setLogicalHeight(max<LayoutUnit>(0, logicalHeight() - borderAndPaddingLogicalHeight())); 2403 } 2404 2405 void RenderBlockFlow::setRenderNamedFlowFragment(RenderNamedFlowFragment* flowFragment) 2406 { 2407 if (!m_rareData) 2408 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); 2409 if (m_rareData->m_renderNamedFlowFragment) 2410 m_rareData->m_renderNamedFlowFragment->destroy(); 2411 m_rareData->m_renderNamedFlowFragment = flowFragment; 2412 } 2354 2413 2355 2414 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderBlockFlow.h
r157408 r157567 29 29 30 30 class LineBreaker; 31 class RenderNamedFlowFragment; 31 32 32 33 class RenderBlockFlow : public RenderBlock { … … 39 40 40 41 protected: 42 virtual void insertedIntoTree() OVERRIDE; 41 43 virtual void willBeDestroyed() OVERRIDE; 42 44 … … 57 59 58 60 virtual void dirtyLinesFromChangedChild(RenderObject* child) OVERRIDE FINAL { lineBoxes().dirtyLinesFromChangedChild(this, child); } 59 61 virtual void updateLogicalHeight() OVERRIDE; 60 62 public: 61 63 class MarginValues { … … 94 96 , m_lineBreakToAvoidWidow(-1) 95 97 , m_lineGridBox(0) 98 , m_renderNamedFlowFragment(0) 96 99 , m_discardMarginBefore(false) 97 100 , m_discardMarginAfter(false) … … 120 123 int m_lineBreakToAvoidWidow; 121 124 RootInlineBox* m_lineGridBox; 125 RenderNamedFlowFragment* m_renderNamedFlowFragment; 122 126 123 127 bool m_discardMarginBefore : 1; … … 225 229 bool relayoutToAvoidWidows(LayoutStateMaintainer&); 226 230 231 virtual bool canHaveGeneratedChildren() const OVERRIDE; 232 227 233 RootInlineBox* lineGridBox() const { return m_rareData ? m_rareData->m_lineGridBox : 0; } 228 234 void setLineGridBox(RootInlineBox* box) … … 235 241 } 236 242 void layoutLineGridBox(); 243 244 RenderNamedFlowFragment* renderNamedFlowFragment() const { return m_rareData ? m_rareData->m_renderNamedFlowFragment : 0; } 245 void setRenderNamedFlowFragment(RenderNamedFlowFragment*); 237 246 238 247 bool containsFloats() const OVERRIDE { return m_floatingObjects && !m_floatingObjects->set().isEmpty(); } … … 403 412 404 413 // END METHODS DEFINED IN RenderBlockLineLayout 405 414 415 bool namedFlowFragmentNeedsUpdate() const; 416 virtual bool canHaveChildren() const OVERRIDE; 417 406 418 public: 407 419 // FIXME-BLOCKFLOW: These can be made protected again once all callers have been moved here. 408 420 void adjustLinePositionForPagination(RootInlineBox*, LayoutUnit& deltaOffset, RenderFlowThread*); // Computes a deltaOffset value that put a line at the top of the next page if it doesn't fit on the current page. 409 421 void updateRegionForLine(RootInlineBox*) const; 422 void createRenderNamedFlowFragmentIfNeeded(); 410 423 411 424 protected: -
trunk/Source/WebCore/rendering/RenderElement.cpp
r157535 r157567 148 148 if (element.hasTagName(HTMLNames::rtTag) && style.display() == BLOCK) 149 149 return new RenderRubyText(element); 150 if (document.cssRegionsEnabled() && style.isDisplayRegionType() && !style.regionThread().isEmpty())151 return new RenderRegion(element, nullptr);152 150 switch (style.display()) { 153 151 case NONE: -
trunk/Source/WebCore/rendering/RenderElement.h
r157515 r157567 44 44 Element* element() const { return toElement(RenderObject::node()); } 45 45 Element* nonPseudoElement() const { return toElement(RenderObject::nonPseudoNode()); } 46 Element* generatingElement() const { return toElement(RenderObject::generatingNode()); }46 Element* generatingElement() const; 47 47 48 48 RenderObject* firstChild() const { return m_firstChild; } … … 259 259 } 260 260 261 inline Element* RenderElement::generatingElement() const 262 { 263 if (isRenderNamedFlowFragment() && parent()) 264 return toRenderElement(parent())->generatingElement(); 265 return toElement(RenderObject::generatingNode()); 266 } 267 261 268 // This will catch anyone doing an unnecessary cast. 262 269 void toRenderElement(const RenderElement*); -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r157408 r157567 520 520 if (startRegion) { 521 521 // Take into account the offset coordinates of the region. 522 RenderBoxModelObject* currObject = startRegion; 522 RenderBoxModelObject* startRegionBox = startRegion->isRenderNamedFlowFragment() ? toRenderBoxModelObject(startRegion->parent()) : startRegion; 523 RenderBoxModelObject* currObject = startRegionBox; 523 524 RenderBoxModelObject* currOffsetParent; 524 525 while ((currOffsetParent = currObject->offsetParent())) { … … 574 575 LayoutUnit regionLogicalTop = startRegion->pageLogicalTopForOffset(top); 575 576 LayoutUnit topRelativeToRegion = top - regionLogicalTop; 576 referencePoint.setY(startRegion ->offsetTop() + topRelativeToRegion);577 referencePoint.setY(startRegionBox->offsetTop() + topRelativeToRegion); 577 578 578 579 // Since the top has been overriden, check if the … … 586 587 // Since we're looking for the offset relative to the body, we must also 587 588 // take into consideration the borders of the region. 588 referencePoint.move(startRegion ->borderLeft(), startRegion->borderTop());589 referencePoint.move(startRegionBox->borderLeft(), startRegionBox->borderTop()); 589 590 } 590 591 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r157535 r157567 5949 5949 && !isTransparent() 5950 5950 && !needsCompositedScrolling() 5951 && !renderer(). isRenderRegion()5951 && !renderer().style()->hasStyleRegion() 5952 5952 ; 5953 5953 } -
trunk/Source/WebCore/rendering/RenderListItem.cpp
r157535 r157567 82 82 void RenderListItem::insertedIntoTree() 83 83 { 84 RenderBlock ::insertedIntoTree();84 RenderBlockFlow::insertedIntoTree(); 85 85 86 86 updateListMarkerNumbers(); -
trunk/Source/WebCore/rendering/RenderObject.cpp
r157535 r157567 2559 2559 } 2560 2560 2561 bool RenderObject::isRenderNamedFlowFragmentContainer() const 2562 { 2563 if (!isRenderBlockFlow()) 2564 return false; 2565 2566 return toRenderBlockFlow(this)->renderNamedFlowFragment(); 2567 } 2568 2561 2569 #if ENABLE(SVG) 2562 2570 -
trunk/Source/WebCore/rendering/RenderObject.h
r157535 r157567 330 330 virtual bool isRenderImage() const { return false; } 331 331 virtual bool isRenderRegion() const { return false; } 332 virtual bool isRenderNamedFlowFragment() const { return false; } 332 333 virtual bool isReplica() const { return false; } 333 334 … … 362 363 bool isInFlowRenderFlowThread() const { return isRenderFlowThread() && !isOutOfFlowPositioned(); } 363 364 bool isOutOfFlowRenderFlowThread() const { return isRenderFlowThread() && isOutOfFlowPositioned(); } 365 bool isRenderNamedFlowFragmentContainer() const; 364 366 365 367 virtual bool isRenderMultiColumnBlock() const { return false; } -
trunk/Source/WebCore/rendering/RenderRegion.h
r157408 r157567 46 46 class RenderRegion : public RenderBlockFlow { 47 47 public: 48 RenderRegion(Element&, RenderFlowThread*);49 50 48 virtual bool isRenderRegion() const OVERRIDE FINAL { return true; } 51 49 … … 92 90 virtual LayoutUnit pageLogicalWidth() const; 93 91 virtual LayoutUnit pageLogicalHeight() const; 94 LayoutUnit maxPageLogicalHeight() const;92 virtual LayoutUnit maxPageLogicalHeight() const; 95 93 96 94 LayoutUnit logicalTopOfFlowThreadContentRect(const LayoutRect&) const; … … 149 147 LayoutRect rectFlowPortionForBox(const RenderBox*, const LayoutRect&) const; 150 148 149 virtual bool canHaveChildren() const OVERRIDE { return false; } 150 virtual bool canHaveGeneratedChildren() const OVERRIDE { return true; } 151 151 152 protected: 153 RenderRegion(Element&, RenderFlowThread*); 152 154 RenderRegion(Document&, RenderFlowThread*); 155 153 156 RenderOverflow* ensureOverflowForBox(const RenderBox*); 154 157 … … 174 177 private: 175 178 virtual const char* renderName() const { return "RenderRegion"; } 176 177 virtual bool canHaveChildren() const OVERRIDE { return false; }178 virtual bool canHaveGeneratedChildren() const OVERRIDE { return true; }179 179 180 180 virtual void insertedIntoTree() OVERRIDE; -
trunk/Source/WebCore/rendering/RenderTableCaption.cpp
r157408 r157567 42 42 void RenderTableCaption::insertedIntoTree() 43 43 { 44 RenderBlock ::insertedIntoTree();44 RenderBlockFlow::insertedIntoTree(); 45 45 46 46 table()->addCaption(this); -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r156779 r157567 576 576 } 577 577 } else { 578 for (RenderObject* child = toRenderElement(o).firstChild(); child; child = child->nextSibling()) { 579 if (child->hasLayer()) 580 continue; 581 write(ts, *child, indent + 1, behavior); 578 if (!o.isRenderNamedFlowFragmentContainer()) { 579 for (RenderObject* child = toRenderElement(o).firstChild(); child; child = child->nextSibling()) { 580 if (child->hasLayer()) 581 continue; 582 write(ts, *child, indent + 1, behavior); 583 } 582 584 } 583 585 } … … 669 671 ts << "RenderRegion"; 670 672 if (renderRegion->generatingElement()) { 671 String tagName = getTagName(renderRegion-> element());673 String tagName = getTagName(renderRegion->generatingElement()); 672 674 if (!tagName.isEmpty()) 673 675 ts << " {" << tagName << "}"; -
trunk/Source/WebCore/rendering/shapes/ShapeInfo.h
r156176 r157567 104 104 bool shapeSizeDirty() { return !m_shape.get(); } 105 105 const RenderType* owner() const { return m_renderer; } 106 LayoutSize shapeSize() const { return m_shapeLogicalSize; } 106 107 107 108 protected: -
trunk/Source/WebCore/style/StyleResolveTree.cpp
r157535 r157567 167 167 const RenderObject* parentRenderer = renderingParentNode ? renderingParentNode->renderer() : 0; 168 168 169 bool parentIsRegion = parentRenderer && !parentRenderer->canHaveChildren() && parentRenderer->isRender Region();169 bool parentIsRegion = parentRenderer && !parentRenderer->canHaveChildren() && parentRenderer->isRenderNamedFlowFragmentContainer(); 170 170 bool parentIsNonRenderedInsideRegion = !parentRenderer && element.parentElement() && element.parentElement()->isInsideRegion(); 171 171 if (!parentIsRegion && !parentIsNonRenderedInsideRegion)
Note: See TracChangeset
for help on using the changeset viewer.