[Webkit-unassigned] [Bug 113276] [CSSRegions] Implement offsetParent for elements inside named flow

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 30 09:38:13 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=113276


Radu Stavila <stavila at adobe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #200117|                            |commit-queue?
               Flag|                            |




--- Comment #8 from Radu Stavila <stavila at adobe.com>  2013-04-30 09:36:35 PST ---
(From update of attachment 200117)
View in context: https://bugs.webkit.org/attachment.cgi?id=200117&action=review

>> LayoutTests/fast/regions/offsetParent-in-flow-thread.html:6
>>      <body>
> 
> I would like to see more tests for this, not only for the elements that are at the flow thread boundary, but also for other elements inside the flow thread that do not reach the flow thread boundary.
> Also, what happens if you collect the body element of a document in a flow thread and then you call offsetParent on that element, and offsetParent for other elements for such case.

Ok, I will add more tests.

>> Source/WebCore/ChangeLog:12
>> +        end up calling curr->parent()->offsetForColumns(referencePoint) while curr->parent() was returning NULL.
> 
> It is not very clear to me - from your description - why you reached that. I suspect you were climbing up the RenderObject tree until you reached 0 for a curr object but you should not get there in the algorithm, you should probably stop the traversal sooner.

The WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent method contains this algorithm which climbs up the tree until it reaches the offsetParent. However, it does not account for the fact that the returned offsetParent could now be obtained by "jumping" directly to the BODY element. As such, before reaching the actual offsetParent, this simple algorithm will get to an object (RenderView I believe) which has no parent. As a consequence, calling curr->parent()->offsetForColumns(referencePoint) was causing a crash.

>> Source/WebCore/rendering/RenderObject.cpp:3001
>> +            return (document ? document->body() : 0);
> 
> When is document null? Also, as a preference, instead of returning from this loop, i would set node = document->body() and the loop will exit when will hit node->hasTagName(HTMLNames::bodyTag) condition.

I considered it would be safer to check for NULL before using the pointer returned by the document() method. 

As for not interrupting the algorithm and just setting node = document->body(), I did not see the point in doing that since the spec states the body element will be returned, without any other checks. If you think this to be the better way (not using return), I will change it.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list