Skip fast/dom/shadow/get-element-id-in-shadow-roots on some ports where SHADOW_DOM...
authorhayato@chromium.org <hayato@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Mar 2012 02:40:19 +0000 (02:40 +0000)
committerhayato@chromium.org <hayato@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Mar 2012 02:40:19 +0000 (02:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81336

Reviewed by Dimitri Glazkov.

* fast/dom/shadow/resources/shadow-dom.js:
(createDOM):
(isShadowRoot):
* platform/efl/Skipped:
* platform/mac/Skipped:
* platform/win/Skipped:
* platform/wincairo/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111149 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/dom/shadow/resources/shadow-dom.js
LayoutTests/platform/efl/Skipped
LayoutTests/platform/mac/Skipped
LayoutTests/platform/win/Skipped
LayoutTests/platform/wincairo/Skipped

index 89dfca42e3ac1bf20ee6d06684fb96410e2a7515..f52b69a8100cb47b833f0fb8462762b7e33769d1 100644 (file)
@@ -1,3 +1,18 @@
+2012-03-18  Hayato Ito  <hayato@chromium.org>
+
+        Skip fast/dom/shadow/get-element-id-in-shadow-roots on some ports where SHADOW_DOM flag is disabled.
+        https://bugs.webkit.org/show_bug.cgi?id=81336
+
+        Reviewed by Dimitri Glazkov.
+
+        * fast/dom/shadow/resources/shadow-dom.js:
+        (createDOM):
+        (isShadowRoot):
+        * platform/efl/Skipped:
+        * platform/mac/Skipped:
+        * platform/win/Skipped:
+        * platform/wincairo/Skipped:
+
 2012-03-18  Keishi Hattori  <keishi@webkit.org>
 
         [chromium] Rebaseline SL results for video-opacity-overlay.html and load-video-in-reflection.html
index 2971b7e2a4a816b66b41818279a4d5815a561fdd..31d601f3061baaf442462d91ada3e46c1ef6deb1 100644 (file)
@@ -5,20 +5,27 @@ function createShadowRoot()
 }
 
 // This function can take optional child elements, which might be a result of createShadowRoot(), as arguments[2:].
+// You must enable SHADOW_DOM flag if you use this fucntion to host multiple ShadowRoots
+// since window.internals does not have a function which can be used to host multiple shadow roots.
+// FIXME: window.internals should have such function and remove the restriction.
 function createDOM(tagName, attributes)
 {
     var element = document.createElement(tagName);
     for (var name in attributes)
         element.setAttribute(name, attributes[name]);
     var childElements = Array.prototype.slice.call(arguments, 2);
+    var shadowRootCount = 0;
     for (var i = 0; i < childElements.length; ++i) {
         var child = childElements[i];
         if (child.isShadowRoot) {
+            ++shadowRootCount;
             var shadowRoot;
             if (window.WebKitShadowRoot)
-              shadowRoot = new WebKitShadowRoot(element);
+                shadowRoot = new WebKitShadowRoot(element);
+            else if (shadowRootcount == 1)
+                shadowRoot = internals.ensureShadowRoot(element);
             else
-              shadowRoot = internals.ensureShadowRoot(element);
+                throw "CreateDOM cannot be used to host multiple ShadowRoots without new WebKitShadowRoot()";
             for (var j = 0; j < child.children.length; ++j)
                 shadowRoot.appendChild(child.children[j]);
         } else
@@ -30,7 +37,7 @@ function createDOM(tagName, attributes)
 function isShadowRoot(node)
 {
     // FIXME: window.internals should have internals.isShadowRoot(node).
-    return node.host;
+    return node.nodeName == "#shadow-root" || node.host;
 }
 
 // You can spefify youngerShadowRoot by consecutive slashes.
index b1b0379d338e8d7b406410197bac7f2a141da737..4d1615cb1aa10407e9f656e21891bf9cf68a3554 100644 (file)
@@ -1938,6 +1938,7 @@ fast/css/style-scoped
 fast/dom/shadow/content-element-api.html
 fast/dom/shadow/content-element-outside-shadow.html
 fast/dom/shadow/content-element-outside-shadow-style.html
+fast/dom/shadow/get-element-by-id-in-shadow-root.html
 fast/dom/shadow/shadow-root-js-api.html
 fast/dom/shadow/shadow-disable.html
 fast/dom/shadow/shadow-root-attached.html
index 0b866f1f6077047c45870ca0e952a048c4b64d03..c90e1d93d12227883c24522a9dfa9aaa5a99cf15 100644 (file)
@@ -435,6 +435,7 @@ fast/css/style-scoped
 fast/dom/shadow/content-element-api.html
 fast/dom/shadow/content-element-outside-shadow.html
 fast/dom/shadow/content-element-outside-shadow-style.html
+fast/dom/shadow/get-element-by-id-in-shadow-root.html
 fast/dom/shadow/shadow-root-js-api.html
 fast/dom/shadow/shadow-disable.html
 fast/dom/shadow/shadow-root-activeElement.html
index b1148602cb624db1960f398f1f426236eeec2124..b87ef2448e6be4ad7d05d93d847fd37f356828e3 100644 (file)
@@ -1460,6 +1460,7 @@ fast/css/style-scoped
 fast/dom/shadow/content-element-api.html
 fast/dom/shadow/content-element-outside-shadow.html
 fast/dom/shadow/content-element-outside-shadow-style.html
+fast/dom/shadow/get-element-by-id-in-shadow-root.html
 fast/dom/shadow/shadow-root-js-api.html
 fast/dom/shadow/shadow-disable.html
 fast/dom/shadow/shadow-root-activeElement.html
index b8c37df2f7d2370a7511c70f99150397a91a6f57..e5d284be635ebeb4a3c308ebd1c2603b90506a4c 100644 (file)
@@ -1972,6 +1972,7 @@ fast/css/style-scoped
 # ENABLE(SHADOW_DOM) is disabled.
 fast/dom/shadow/content-element-api.html
 fast/dom/shadow/content-element-outside-shadow.html
+fast/dom/shadow/get-element-by-id-in-shadow-root.html
 fast/dom/shadow/shadow-root-js-api.html
 fast/dom/shadow/shadow-disable.html
 fast/dom/shadow/shadow-root-activeElement.html