[Webkit-unassigned] [Bug 30555] Provide a way to get counter values with layoutTestContoller

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Oct 25 13:02:49 PDT 2009


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





--- Comment #13 from Darin Adler <darin at apple.com>  2009-10-25 13:02:49 PDT ---
(In reply to comment #11)
> 1. As inserted/removed DOM elements aren't layouted
>    (element->renderer() is NULL) when the element is added, I needed
>    to wait the layout using setTimeout before I obtain counter values
>    by getCounterValueById. Is this unavoidable? I think calling
>    layout() here is not good as same reason as externalRepresentation
>    you mentioned. If there are no way to avoid this limitation,
>    WebCore::getCounterValue should return a warning message like "this
>    element is not layouted yet!" to relax potential confusion?

A call to updateLayout() will solve this problem as I mentioned in my previous.

The problem with externalRepresentation is that it does this while holding a
render object pointer in a local variable, which is illegal. The problem does
not affect your new function since it takes an Element*, although to be 100%
safe the Element* should go into a RefPtr<Element> local variable since
otherwise updateLayout() could have a side effect of deleting the element. So
you should put the element argument into a local variable of type
RefPtr<Element>.

By the way, the issue isn't only the fact that the renderer() returns 0. Even
if it returned a non-0 value, it might be a deallocated object.

>    - WebFrame(WebKitDebug).getCounterValue in WebKit/mac/Misc/WebCoreStatistics

Seems not such a great place for this, but fine to be consistent with the
existing method already there.

>    - WebCore::getCounterValue in WebCore/rendering/RenderTreeAsText

Seems a fine place for this.

> Is this OK?

Sure, fine to do this one platform at a time, but it's important that you land
expected results for each of the other platforms that match the incorrect
results they will get until they implement this DumpRenderTree feature. That
way the tree stays green for all platforms.

-- 
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