Summary: | Remove IsShadowRootFlag from Node | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Dimitri Glazkov (Google) <dglazkov> | ||||
Component: | DOM | Assignee: | Dimitri Glazkov (Google) <dglazkov> | ||||
Status: | RESOLVED WONTFIX | ||||||
Severity: | Normal | CC: | dominicc, morrita, rolandsteiner | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | OS X 10.5 | ||||||
Bug Depends on: | 48698 | ||||||
Bug Blocks: | 72352, 59802 | ||||||
Attachments: |
|
Description
Dimitri Glazkov (Google)
2011-04-22 14:06:38 PDT
Created attachment 96302 [details]
Patch
Comment on attachment 96302 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=96302&action=review > Source/WebCore/dom/Node.h:213 > - bool isShadowRoot() const { return getFlag(IsShadowRootFlag); } > - // FIXME: Remove this when all shadow roots are ShadowRoots. > - virtual bool isShadowBoundary() const { return false; } > + virtual bool isShadowRoot() const { return false; } A virtual function is not as fast as checking a bit. And in the past we have optimized various code paths by replacing virtual functions with a bit in Node. Are you sure that this does not create a slowdown? (In reply to comment #2) > (From update of attachment 96302 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=96302&action=review > > > Source/WebCore/dom/Node.h:213 > > - bool isShadowRoot() const { return getFlag(IsShadowRootFlag); } > > - // FIXME: Remove this when all shadow roots are ShadowRoots. > > - virtual bool isShadowBoundary() const { return false; } > > + virtual bool isShadowRoot() const { return false; } > > A virtual function is not as fast as checking a bit. And in the past we have optimized various code paths by replacing virtual functions with a bit in Node. > > Are you sure that this does not create a slowdown? I will check. I wrote a microbench for this a while back. Comment on attachment 96302 [details]
Patch
Actually, this patch sucks. I can do better.
This patch has at least two parts. I need to split out the simple ones. |