Bug 104995 - [Shadow DOM]: ShadowRoot wrong nodeName attribute
Summary: [Shadow DOM]: ShadowRoot wrong nodeName attribute
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Shinya Kawanaka
URL:
Keywords:
Depends on: 88748
Blocks: 63606 103230
  Show dependency treegraph
 
Reported: 2012-12-13 23:49 PST by Sergey G. Grekhov
Modified: 2013-01-09 09:36 PST (History)
10 users (show)

See Also:


Attachments
Patch (82.59 KB, patch)
2012-12-20 21:56 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (406.19 KB, patch)
2013-01-09 00:08 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey G. Grekhov 2012-12-13 23:49:02 PST
According Shadow DOM specification (https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-root-attributes) "Accordingly, the nodeName attribute of a ShadowRoot instance must return "#document-fragment".". But in Chrome 23.0.1271.97 m ShadowRoot nodeName is "#shadow-root".

Test:

<html>
<head>
<script>
function test() {
	var SR = window.ShadowRoot ||  window.WebKitShadowRoot;
    var host = document.createElement('div');
    document.body.appendChild(host);
    var s = new SR(host);
	alert(s.nodeName);
}
</script>
</head>
<body onload='test()'>
</body>
</html>
Comment 1 Shinya Kawanaka 2012-12-20 21:56:44 PST
Created attachment 180481 [details]
Patch
Comment 2 Shinya Kawanaka 2012-12-20 21:57:37 PST
If a bot became red, maybe I have missed some rebaselineing. Let's see it.
Comment 3 Ryosuke Niwa 2012-12-21 01:19:07 PST
(In reply to comment #2)
> If a bot became red, maybe I have missed some rebaselineing. Let's see it.

Why don't you grep them instead of manually rebaselining them? We know that all instances of "#shadow-root" should simply be replaced by "#document-fragment", right?
Comment 4 WebKit Review Bot 2012-12-21 07:46:00 PST
Comment on attachment 180481 [details]
Patch

Clearing flags on attachment: 180481

Committed r138376: <http://trac.webkit.org/changeset/138376>
Comment 5 WebKit Review Bot 2012-12-21 07:46:03 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Simon Fraser (smfr) 2012-12-21 09:33:09 PST
This broke about 60 tests on Mac:
http://build.webkit.org/results/Apple%20MountainLion%20Debug%20WK2%20(Tests)/r138378%20(5188)/results.html
Comment 7 Dimitri Glazkov (Google) 2012-12-21 09:41:52 PST
(In reply to comment #6)
> This broke about 60 tests on Mac:
> http://build.webkit.org/results/Apple%20MountainLion%20Debug%20WK2%20(Tests)/r138378%20(5188)/results.html

:-( rolling out...
Comment 8 Dimitri Glazkov (Google) 2012-12-21 09:43:36 PST
Reverted r138376 for reason:

Broke a bunch of tests on mac.

Committed r138386: <http://trac.webkit.org/changeset/138386>
Comment 9 Ryosuke Niwa 2012-12-21 10:33:11 PST
(In reply to comment #7)
> (In reply to comment #6)
> > This broke about 60 tests on Mac:
> > http://build.webkit.org/results/Apple%20MountainLion%20Debug%20WK2%20(Tests)/r138378%20(5188)/results.html
> 
> :-( rolling out...

Don’t we need to just rebaseline them all?
Comment 10 Ryosuke Niwa 2012-12-21 10:34:06 PST
This is why I said that you should just run grep in comment #3 so that you can rebaseline all expected results for all platforms.
Comment 11 Csaba Osztrogonác 2012-12-21 11:11:37 PST
This patch broke tests on Qt too - http://build.webkit.sed.hu/results/x86-64%20Linux%20Qt%20Release/r138379%20%2846257%29/results.html
Comment 12 Shinya Kawanaka 2012-12-24 17:14:52 PST
Oops... Very sorry...

Ryosuke, you are very right.
Dimitry, sorry for bothering you.

I'll check all the tests again.
Also I have to have some method to check the Node is ShadowRoot in the port where SHADOW_DOM flag is not enabled. Maybe internals?
Comment 13 Shinya Kawanaka 2013-01-09 00:08:05 PST
Created attachment 181866 [details]
Patch
Comment 14 Dimitri Glazkov (Google) 2013-01-09 09:18:49 PST
I wonder if having #document-fragment in all those test results will just be more confusing. The person looking at the test must make a mental jump to "oh, that's shadow root". Maybe we should present it differently (although that's also problematic, because we're special-casing shadow roots)?
Comment 15 WebKit Review Bot 2013-01-09 09:36:20 PST
Comment on attachment 181866 [details]
Patch

Clearing flags on attachment: 181866

Committed r139198: <http://trac.webkit.org/changeset/139198>
Comment 16 WebKit Review Bot 2013-01-09 09:36:26 PST
All reviewed patches have been landed.  Closing bug.