Changeset 136107 in webkit
- Timestamp:
- Nov 29, 2012 12:35:50 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r136105 r136107 1 2012-11-29 Andrei Bucur <abucur@adobe.com> 2 3 [CSS Regions] Fix content node renderers ordering inside the named flow thread 4 https://bugs.webkit.org/show_bug.cgi?id=103501 5 6 Reviewed by David Hyatt. 7 8 The first two ref tests cover the issue with incorrectly computing the insertion position for a content node renderer. 9 The third ref test covers the issue with nextRenderer and previousRenderer skipping valid nodes. 10 11 * fast/regions/named-flow-content-order-1-expected.html: Added. 12 * fast/regions/named-flow-content-order-1.html: Added. 13 * fast/regions/named-flow-content-order-2-expected.html: Added. 14 * fast/regions/named-flow-content-order-2.html: Added. 15 * fast/regions/named-flow-content-order-3-expected.html: Added. 16 * fast/regions/named-flow-content-order-3.html: Added. 17 1 18 2012-11-28 Mike West <mkwst@chromium.org> 2 19 -
trunk/Source/WebCore/ChangeLog
r136105 r136107 1 2012-11-29 Andrei Bucur <abucur@adobe.com> 2 3 [CSS Regions] Fix content node renderers ordering inside the named flow thread 4 https://bugs.webkit.org/show_bug.cgi?id=103501 5 6 Reviewed by David Hyatt. 7 8 This patch fixes two issues with how content nodes renderers are added to a named flow thread. 9 The first issue was about determining the insertion position of a renderer inside the children list of a named flow thread. Before this patch, the 10 insertion point was based on both the DOM ordering of the elements and insertion order of previous renderers. 11 The patch fixes this and makes the renderer position just a function of the DOM ordering of elements. 12 The second issue appeared when next/previousRenderer methods were skipping nodes because they had the flow-into property as a side effect 13 of copying the style of the parent element (e.g. Text nodes). The patch ensures the skipped nodes are also elements. 14 15 Tests: fast/regions/named-flow-content-order-1.html 16 fast/regions/named-flow-content-order-2.html 17 fast/regions/named-flow-content-order-3.html 18 19 * dom/NodeRenderingContext.cpp: 20 (WebCore::NodeRenderingContext::nextRenderer): Skip only elements. 21 (WebCore::NodeRenderingContext::previousRenderer): Skip only elements. 22 * rendering/RenderNamedFlowThread.cpp: 23 (WebCore::RenderNamedFlowThread::addFlowChild): Insert the renderer in the list based on the DOM position of the owner element. 24 * rendering/RenderNamedFlowThread.h: 25 (RenderNamedFlowThread): 26 * rendering/RenderObject.cpp: 27 (WebCore::RenderObject::renderNamedFlowThreadWrapper): Rename to eliminate the confusion with enclosingRenderFlowThread. 28 (WebCore::RenderObject::insertedIntoTree): 29 (WebCore::RenderObject::willBeRemovedFromTree): 30 * rendering/RenderObject.h: 31 (RenderObject): 32 1 33 2012-11-28 Mike West <mkwst@chromium.org> 2 34 -
trunk/Source/WebCore/dom/NodeRenderingContext.cpp
r136037 r136107 87 87 for (walker.nextSibling(); walker.get(); walker.nextSibling()) { 88 88 if (RenderObject* renderer = walker.get()->renderer()) { 89 // Do not return elements that are attached to a different flow-thread.90 if (renderer-> style() && !renderer->style()->flowThread().isEmpty())89 // Renderers for elements attached to a flow thread should be skipped because they are parented differently. 90 if (renderer->node()->isElementNode() && renderer->style() && !renderer->style()->flowThread().isEmpty()) 91 91 continue; 92 92 return renderer; … … 111 111 for (walker.previousSibling(); walker.get(); walker.previousSibling()) { 112 112 if (RenderObject* renderer = walker.get()->renderer()) { 113 // Do not return elements that are attached to a different flow-thread.114 if (renderer-> style() && !renderer->style()->flowThread().isEmpty())113 // Renderers for elements attached to a flow thread should be skipped because they are parented differently. 114 if (renderer->node()->isElementNode() && renderer->style() && !renderer->style()->flowThread().isEmpty()) 115 115 continue; 116 116 return renderer; -
trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp
r133779 r136107 114 114 } 115 115 116 void RenderNamedFlowThread::addFlowChild(RenderObject* newChild , RenderObject* beforeChild)116 void RenderNamedFlowThread::addFlowChild(RenderObject* newChild) 117 117 { 118 118 // The child list is used to sort the flow thread's children render objects 119 119 // based on their corresponding nodes DOM order. The list is needed to avoid searching the whole DOM. 120 120 121 Node* childNode = newChild->node(); 122 121 123 // Do not add anonymous objects. 122 if (! newChild->node())124 if (!childNode) 123 125 return; 124 126 127 ASSERT(childNode->isElementNode()); 128 129 RenderObject* beforeChild = nextRendererForNode(childNode); 125 130 if (beforeChild) 126 131 m_flowThreadChildList.insertBefore(beforeChild, newChild); -
trunk/Source/WebCore/rendering/RenderNamedFlowThread.h
r130918 r136107 56 56 RenderObject* previousRendererForNode(Node*) const; 57 57 58 void addFlowChild(RenderObject* newChild , RenderObject* beforeChild = 0);58 void addFlowChild(RenderObject* newChild); 59 59 void removeFlowChild(RenderObject*); 60 60 bool hasChildren() const { return !m_flowThreadChildList.isEmpty(); } -
trunk/Source/WebCore/rendering/RenderObject.cpp
r136054 r136107 605 605 } 606 606 607 RenderNamedFlowThread* RenderObject:: enclosingRenderNamedFlowThread() const607 RenderNamedFlowThread* RenderObject::renderNamedFlowThreadWrapper() const 608 608 { 609 609 RenderObject* object = const_cast<RenderObject*>(this); … … 2423 2423 parent()->dirtyLinesFromChangedChild(this); 2424 2424 2425 if (RenderNamedFlowThread* containerFlowThread = parent()-> enclosingRenderNamedFlowThread())2425 if (RenderNamedFlowThread* containerFlowThread = parent()->renderNamedFlowThreadWrapper()) 2426 2426 containerFlowThread->addFlowChild(this); 2427 2427 } … … 2451 2451 removeFromRenderFlowThread(); 2452 2452 2453 if (RenderNamedFlowThread* containerFlowThread = parent()-> enclosingRenderNamedFlowThread())2453 if (RenderNamedFlowThread* containerFlowThread = parent()->renderNamedFlowThreadWrapper()) 2454 2454 containerFlowThread->removeFlowChild(this); 2455 2455 -
trunk/Source/WebCore/rendering/RenderObject.h
r136045 r136107 242 242 RenderFlowThread* enclosingRenderFlowThread() const; 243 243 244 RenderNamedFlowThread* enclosingRenderNamedFlowThread() const;244 RenderNamedFlowThread* renderNamedFlowThreadWrapper() const; 245 245 246 246 virtual bool isEmpty() const { return firstChild() == 0; }
Note: See TracChangeset
for help on using the changeset viewer.