Changeset 150108 in webkit
- Timestamp:
- May 15, 2013, 3:54:24 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 edited
- 1 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/regions/offsetParent-body-in-flow-thread-expected.txt (added)
-
LayoutTests/fast/regions/offsetParent-body-in-flow-thread.html (copied) (copied from trunk/LayoutTests/fast/regions/offsetParent-in-flow-thread.html ) (2 diffs)
-
LayoutTests/fast/regions/offsetParent-in-flow-thread-expected.txt (modified) (1 diff)
-
LayoutTests/fast/regions/offsetParent-in-flow-thread.html (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderBoxModelObject.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderObject.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r150097 r150108 1 2013-05-15 Radu Stavila <stavila@adobe.com> 2 3 [CSSRegions] Implement offsetParent for elements inside named flow 4 https://bugs.webkit.org/show_bug.cgi?id=113276 5 6 Reviewed by Darin Adler. 7 8 In the offsetParent algorithm, the nearest ancestor search skips from the topmost named flow elements directly to the body element. 9 10 Added new test for offsetParent when body is flowed into a region. 11 Updated existing offsetParent test. 12 13 * fast/regions/offsetParent-body-in-flow-thread-expected.txt: Added. 14 * fast/regions/offsetParent-body-in-flow-thread.html: Added. 15 * fast/regions/offsetParent-in-flow-thread-expected.txt: 16 * fast/regions/offsetParent-in-flow-thread.html: 17 1 18 2013-05-14 Hans Muller <hmuller@adobe.com> 2 19 -
trunk/LayoutTests/fast/regions/offsetParent-body-in-flow-thread.html
r150107 r150108 4 4 <script src="../js/resources/js-test-pre.js"></script> 5 5 </head> 6 7 <style> 8 9 #region { 10 -webkit-flow-from: flow; 11 } 12 13 </style> 14 6 15 <body> 7 16 <script> 8 description("Test offsetParent for elements insidea named flow.")17 description("Test offsetParent for body in a named flow.") 9 18 19 document.body.style.webkitFlowInto = "flow"; 20 10 21 var article = document.createElement("div"); 11 22 document.body.appendChild(article); 12 article.style.webkitFlowInto = "flow"; 13 shouldBeNull("article.offsetParent"); 23 shouldBe("article.offsetParent", "document.body"); 14 24 15 25 var chapter = document.createElement("div"); 16 26 article.appendChild(chapter); 17 shouldBe Null("chapter.offsetParent");27 shouldBe("chapter.offsetParent", "document.body"); 18 28 19 29 article.style.position = "relative"; … … 31 41 32 42 tdChild.style.webkitFlowInto = "flow"; 33 shouldBeNull("tdChild.offsetParent"); 43 shouldBe("tdChild.offsetParent", "document.body"); 44 45 shouldBeNull("document.body.offsetParent"); 46 47 document.body.style.webkitFlowInto = null; 34 48 </script> 35 49 <script src="../js/resources/js-test-post.js"></script> 50 51 <div id="region"/> 36 52 </body> 37 53 </html> -
trunk/LayoutTests/fast/regions/offsetParent-in-flow-thread-expected.txt
r146856 r150108 4 4 5 5 6 PASS article.offsetParent is null7 PASS chapter.offsetParent is null6 PASS article.offsetParent is document.body 7 PASS chapter.offsetParent is document.body 8 8 PASS chapter.offsetParent is article 9 9 PASS tdChild.offsetParent is td 10 PASS tdChild.offsetParent is null 10 PASS tdChild.offsetParent is document.body 11 PASS document.body.offsetParent is null 11 12 PASS successfullyParsed is true 12 13 -
trunk/LayoutTests/fast/regions/offsetParent-in-flow-thread.html
r146856 r150108 11 11 document.body.appendChild(article); 12 12 article.style.webkitFlowInto = "flow"; 13 shouldBe Null("article.offsetParent");13 shouldBe("article.offsetParent", "document.body"); 14 14 15 15 var chapter = document.createElement("div"); 16 16 article.appendChild(chapter); 17 shouldBe Null("chapter.offsetParent");17 shouldBe("chapter.offsetParent", "document.body"); 18 18 19 19 article.style.position = "relative"; … … 31 31 32 32 tdChild.style.webkitFlowInto = "flow"; 33 shouldBeNull("tdChild.offsetParent"); 33 shouldBe("tdChild.offsetParent", "document.body"); 34 35 shouldBeNull("document.body.offsetParent"); 34 36 </script> 35 37 <script src="../js/resources/js-test-post.js"></script> -
trunk/Source/WebCore/ChangeLog
r150107 r150108 1 2013-05-15 Radu Stavila <stavila@adobe.com> 2 3 [CSSRegions] Implement offsetParent for elements inside named flow 4 https://bugs.webkit.org/show_bug.cgi?id=113276 5 6 In the offsetParent algorithm, the nearest ancestor search skips from the topmost named flow elements directly to the body element. 7 http://dev.w3.org/csswg/css-regions/#cssomview-offset-attributes 8 9 As a result of this change, the DumpRenderTree tool would crash in 10 WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent when running the selecting-text-through-different-region-flows.html 11 test. The RenderObjects inside a flow are attached to the RenderFlowThread. However, the RenderFlowThread is attached to the 12 RenderView directly, meaning that we are going to bypass the <body>'s RenderObject while iterating the parents. 13 14 Reviewed by Darin Adler. 15 16 Tests: fast/regions/offsetParent-body-in-flow-thread.html 17 fast/regions/offsetParent-in-flow-thread.html 18 19 * rendering/RenderBoxModelObject.cpp: 20 (WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent): 21 * rendering/RenderObject.cpp: 22 (WebCore::RenderObject::offsetParent): 23 1 24 2013-05-15 Darin Adler <darin@apple.com> 2 25 -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r149653 r150108 497 497 else if (isStickyPositioned()) 498 498 referencePoint.move(stickyPositionOffset()); 499 500 // FIXME: The offset position for elements inside named flow threads is not correctly computed when the offsetParent is body 501 // See https://bugs.webkit.org/show_bug.cgi?id=115899 502 503 // CSS regions specification says that region flows should return the body element as their offsetParent. 504 // Since we will bypass the body’s renderer anyway, just end the loop if we encounter a region flow (named flow thread). 505 // See http://dev.w3.org/csswg/css-regions/#cssomview-offset-attributes 499 506 const RenderObject* curr = parent(); 500 while (curr != offsetParent ) {507 while (curr != offsetParent && !curr->isRenderNamedFlowThread()) { 501 508 // FIXME: What are we supposed to do inside SVG content? 502 509 if (curr->isBox() && !curr->isTableRow()) -
trunk/Source/WebCore/rendering/RenderObject.cpp
r149980 r150108 2988 2988 // chain return the nearest ancestor map HTML element and stop this algorithm. 2989 2989 // FIXME: Implement! 2990 2991 // FIXME: Stop the search at the flow thread boundary until we figure out the right2992 // behavior for elements inside a flow thread.2993 // https://bugs.webkit.org/show_bug.cgi?id=1132762994 2990 2995 2991 // Return the nearest ancestor element of A for which at least one of the following is … … 3015 3011 curr = curr->parent(); 3016 3012 } 3017 return curr && curr->isBoxModelObject() && !curr->isRenderNamedFlowThread() ? toRenderBoxModelObject(curr) : 0; 3013 3014 // CSS regions specification says that region flows should return the body element as their offsetParent. 3015 if (curr && curr->isRenderNamedFlowThread()) 3016 curr = document()->body() ? document()->body()->renderer() : 0; 3017 3018 return curr && curr->isBoxModelObject() ? toRenderBoxModelObject(curr) : 0; 3018 3019 } 3019 3020
Note:
See TracChangeset
for help on using the changeset viewer.