[Webkit-unassigned] [Bug 43044] WebNode should provide access to computedStyle

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 27 13:29:08 PDT 2010


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


James Robinson <jamesr at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jamesr at chromium.org




--- Comment #5 from James Robinson <jamesr at chromium.org>  2010-07-27 13:29:08 PST ---
I doubt the lifetime of the WebRenderStyle is what the caller will expect.  In particular this RenderStyle pointer will be deleted if styles on the node are re-resolved, which will be invisible to users of this API.  They'll just all of a sudden have a WebRenderStyle that points to deleted memory.

WebCore::RenderStyles have very complex lifetimes and are shared between multiple nodes.  I think it makes much more sense to let the caller query specific properties directly from the node and to copy these values out rather than exposing pointers to RenderStyle objects.  In particular, for this case I think all you need is to add these two functions to WebNode:

bool hasComputedStyle();
WebString computedStyleDisplay();

If you end up needing to grab all sorts of different properties off of a node this will get cumbersome, but we should address that when we have a compelling need.

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