Summary: | Use window.WebKitShadowRoot for checking whether a node is shadow root or not. | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Takashi Sakamoto <tasak> | ||||||||||||||||
Component: | Tools / Tests | Assignee: | Takashi Sakamoto <tasak> | ||||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||||
Severity: | Normal | CC: | morrita, shinyak, tasak, webkit.review.bot | ||||||||||||||||
Priority: | P2 | ||||||||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||||||
Hardware: | Unspecified | ||||||||||||||||||
OS: | Unspecified | ||||||||||||||||||
Bug Depends on: | |||||||||||||||||||
Bug Blocks: | 104995 | ||||||||||||||||||
Attachments: |
|
Description
Takashi Sakamoto
2012-06-10 21:25:47 PDT
Created attachment 146781 [details]
Patch
Comment on attachment 146781 [details]
Patch
Cannot we use resetStyleInheritance of something?
(In reply to comment #2) > (From update of attachment 146781 [details]) > Cannot we use resetStyleInheritance of something? s/of/or/ (In reply to comment #3) > (In reply to comment #2) > > (From update of attachment 146781 [details] [details]) > > Cannot we use resetStyleInheritance of something? > s/of/or/ Actually, we can just check node.constructor. (In reply to comment #4) > (In reply to comment #3) > > (In reply to comment #2) > > > (From update of attachment 146781 [details] [details] [details]) > > > Cannot we use resetStyleInheritance of something? > > s/of/or/ > Actually, we can just check node.constructor. I see. I quickly checked node.constructor for shadow roots. The result was "function ShadowRoot() { [native code] }". I think, node.constructor looks good enough and we don't need isShadowRoot. So I will change shadow-dom.js's isShadowRoot() to use "node.constructor". Best regards, Takashi Sakamoto Created attachment 147549 [details]
Patch
Comment on attachment 147549 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=147549&action=review > LayoutTests/fast/dom/shadow/resources/shadow-dom.js:44 > + return node && node.constructor == 'function ShadowRoot() { [native code] }'; This should be node.constructor === window.WebKitShadowRoot. string representation of the native function is different between jsc and v8. Created attachment 147769 [details]
Patch
(In reply to comment #7) > (From update of attachment 147549 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=147549&action=review > > > LayoutTests/fast/dom/shadow/resources/shadow-dom.js:44 > > + return node && node.constructor == 'function ShadowRoot() { [native code] }'; > > This should be node.constructor === window.WebKitShadowRoot. > string representation of the native function is different between jsc and v8. I see. I updated the patch. Best regards, Takashi Sakamoto Created attachment 155733 [details]
Patch
Comment on attachment 155733 [details] Patch Rejecting attachment 155733 [details] from review queue. tasak@google.com does not have reviewer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py. - If you do not have reviewer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags. - If you have reviewer rights please correct the error in Tools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). The commit-queue restarts itself every 2 hours. After restart the commit-queue will correctly respect your reviewer rights. Comment on attachment 155733 [details]
Patch
- You cannot set r+. It can be left as a blank. What you need is just to set only cq?.
- You need to "Reviewed by" line manually. "(OOPS!)" prevents the patch from landing.
Created attachment 179689 [details]
Patch
Would you review this patch again? I'm sorry. Before I fix and land this patch, window.webkitShadowRoot is gone (or will be gone soon). So I returned to the first one, i.e. implementing internals.isShadowRoot(). Best regards, Takashi Sakamoto Comment on attachment 179689 [details]
Patch
and it came back again...
Besides shadow-dom.js, we also should fix resources/dump-as-markup.js. We are inspecting nodeType of ShadowRoot In this file. Created attachment 181481 [details]
Patch
I fixed wrong bug description and added LayoutTests/resources/dump-as-markup.js's change. Best regards, Takashi Sakamoto Created attachment 181841 [details]
Patch
I modified dump-as-markup.js not to use internals.isShadowRoot and reverted internals' code. Best regards, Takashi Sakamoto Comment on attachment 181841 [details] Patch Clearing flags on attachment: 181841 Committed r139169: <http://trac.webkit.org/changeset/139169> All reviewed patches have been landed. Closing bug. |