WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
88748
Use window.WebKitShadowRoot for checking whether a node is shadow root or not.
https://bugs.webkit.org/show_bug.cgi?id=88748
Summary
Use window.WebKitShadowRoot for checking whether a node is shadow root or not.
Takashi Sakamoto
Reported
2012-06-10 21:25:47 PDT
Since ShadowRoot.host will be gone (because of shadow dom spec update), it is not possible to know whether some node is a shadow root or not by using "node.host". So internals should have a method, isShadowRoot.
Attachments
Patch
(5.15 KB, patch)
2012-06-10 22:04 PDT
,
Takashi Sakamoto
no flags
Details
Formatted Diff
Diff
Patch
(1.52 KB, patch)
2012-06-14 03:42 PDT
,
Takashi Sakamoto
no flags
Details
Formatted Diff
Diff
Patch
(1.50 KB, patch)
2012-06-15 01:02 PDT
,
Takashi Sakamoto
no flags
Details
Formatted Diff
Diff
Patch
(1.48 KB, patch)
2012-08-01 00:23 PDT
,
Takashi Sakamoto
no flags
Details
Formatted Diff
Diff
Patch
(4.94 KB, patch)
2012-12-16 22:15 PST
,
Takashi Sakamoto
no flags
Details
Formatted Diff
Diff
Patch
(5.41 KB, patch)
2013-01-07 00:15 PST
,
Takashi Sakamoto
no flags
Details
Formatted Diff
Diff
Patch
(5.24 KB, patch)
2013-01-08 21:36 PST
,
Takashi Sakamoto
no flags
Details
Formatted Diff
Diff
Show Obsolete
(6)
View All
Add attachment
proposed patch, testcase, etc.
Takashi Sakamoto
Comment 1
2012-06-10 22:04:28 PDT
Created
attachment 146781
[details]
Patch
Hajime Morrita
Comment 2
2012-06-11 02:12:32 PDT
Comment on
attachment 146781
[details]
Patch Cannot we use resetStyleInheritance of something?
Hajime Morrita
Comment 3
2012-06-11 02:12:57 PDT
(In reply to
comment #2
)
> (From update of
attachment 146781
[details]
) > Cannot we use resetStyleInheritance of something?
s/of/or/
Hajime Morrita
Comment 4
2012-06-11 02:13:53 PDT
(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.
Takashi Sakamoto
Comment 5
2012-06-14 02:54:06 PDT
(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
Takashi Sakamoto
Comment 6
2012-06-14 03:42:13 PDT
Created
attachment 147549
[details]
Patch
Hajime Morrita
Comment 7
2012-06-14 17:02:28 PDT
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.
Takashi Sakamoto
Comment 8
2012-06-15 01:02:29 PDT
Created
attachment 147769
[details]
Patch
Takashi Sakamoto
Comment 9
2012-06-15 01:03:42 PDT
(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
Takashi Sakamoto
Comment 10
2012-08-01 00:23:00 PDT
Created
attachment 155733
[details]
Patch
WebKit Review Bot
Comment 11
2012-08-01 00:35:52 PDT
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.
Hajime Morrita
Comment 12
2012-08-01 00:37:59 PDT
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.
Takashi Sakamoto
Comment 13
2012-12-16 22:15:18 PST
Created
attachment 179689
[details]
Patch
Takashi Sakamoto
Comment 14
2012-12-16 22:17:27 PST
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
Hajime Morrita
Comment 15
2013-01-06 17:10:54 PST
Comment on
attachment 179689
[details]
Patch and it came back again...
Shinya Kawanaka
Comment 16
2013-01-06 21:49:02 PST
Besides shadow-dom.js, we also should fix resources/dump-as-markup.js. We are inspecting nodeType of ShadowRoot In this file.
Takashi Sakamoto
Comment 17
2013-01-07 00:15:23 PST
Created
attachment 181481
[details]
Patch
Takashi Sakamoto
Comment 18
2013-01-07 00:17:39 PST
I fixed wrong bug description and added LayoutTests/resources/dump-as-markup.js's change. Best regards, Takashi Sakamoto
Takashi Sakamoto
Comment 19
2013-01-08 21:36:48 PST
Created
attachment 181841
[details]
Patch
Takashi Sakamoto
Comment 20
2013-01-08 21:38:40 PST
I modified dump-as-markup.js not to use internals.isShadowRoot and reverted internals' code. Best regards, Takashi Sakamoto
WebKit Review Bot
Comment 21
2013-01-08 23:43:00 PST
Comment on
attachment 181841
[details]
Patch Clearing flags on attachment: 181841 Committed
r139169
: <
http://trac.webkit.org/changeset/139169
>
WebKit Review Bot
Comment 22
2013-01-08 23:43:04 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug