Should remove RuntimeEnabledFeatures::multipleShadowSubtreesEnabled
authorshinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Mar 2012 06:16:44 +0000 (06:16 +0000)
committershinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Mar 2012 06:16:44 +0000 (06:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=79307

Reviewed by Dimitri Glazkov.

Source/WebCore:

Since RuntimeEnabledFeatures::multipleShadowSubtreesEnabled was introduced for
temporal unstability of multiple shadow roots. We should remove it now, and
enable it by default.

Test: fast/dom/shadow/shadow-root-js-api.html should cover this change.
The other shadow related tests should also covers this change.

* WebCore.exp.in:
* bindings/generic/RuntimeEnabledFeatures.cpp:
(WebCore):
* bindings/generic/RuntimeEnabledFeatures.h:
(RuntimeEnabledFeatures):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::create):
* dom/ShadowTree.cpp:
(WebCore::ShadowTree::addShadowRoot):
* testing/Internals.cpp:
* testing/Internals.h:
(Internals):
* testing/Internals.idl:

LayoutTests:

Removed multipleShadowSubtresEnabled from tests.

* fast/dom/shadow/get-element-by-id-in-shadow-root.html:
* fast/dom/shadow/multiple-shadowroot-adopt.html:
* fast/dom/shadow/multiple-shadowroot-rendering.html:
* fast/dom/shadow/multiple-shadowroot.html:
* fast/dom/shadow/shadow-element-rendering-multiple.html:
* fast/dom/shadow/shadow-element-rendering-single.html:
* fast/dom/shadow/shadow-root-js-api-expected.txt:
* fast/dom/shadow/shadow-root-js-api.html:

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

18 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/shadow/get-element-by-id-in-shadow-root.html
LayoutTests/fast/dom/shadow/multiple-shadowroot-adopt.html
LayoutTests/fast/dom/shadow/multiple-shadowroot-rendering.html
LayoutTests/fast/dom/shadow/multiple-shadowroot.html
LayoutTests/fast/dom/shadow/shadow-element-rendering-multiple.html
LayoutTests/fast/dom/shadow/shadow-element-rendering-single.html
LayoutTests/fast/dom/shadow/shadow-root-js-api-expected.txt
LayoutTests/fast/dom/shadow/shadow-root-js-api.html
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h
Source/WebCore/dom/ShadowRoot.cpp
Source/WebCore/dom/ShadowTree.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl

index 7d5e0c7d99b9b755ce896d24116bfbc972acc424..d55e02bc7c1bb90bc7feaa55dedf95ff7edd4f21 100644 (file)
@@ -1,3 +1,21 @@
+2012-03-16  Shinya Kawanaka  <shinyak@chromium.org>
+
+        Should remove RuntimeEnabledFeatures::multipleShadowSubtreesEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=79307
+
+        Reviewed by Dimitri Glazkov.
+
+        Removed multipleShadowSubtresEnabled from tests.
+
+        * fast/dom/shadow/get-element-by-id-in-shadow-root.html:
+        * fast/dom/shadow/multiple-shadowroot-adopt.html:
+        * fast/dom/shadow/multiple-shadowroot-rendering.html:
+        * fast/dom/shadow/multiple-shadowroot.html:
+        * fast/dom/shadow/shadow-element-rendering-multiple.html:
+        * fast/dom/shadow/shadow-element-rendering-single.html:
+        * fast/dom/shadow/shadow-root-js-api-expected.txt:
+        * fast/dom/shadow/shadow-root-js-api.html:
+
 2012-03-18  Keishi Hattori  <keishi@webkit.org>
 
         [chromium] Mark js-late-gradient-creation.svg as flaky
index d19ecdb6ffefc1e2e0ea15a739541daad3951df9..93370f95f3ac9626f0d1763955b9dbed44f33d3c 100644 (file)
@@ -27,8 +27,6 @@ function test()
 {
     if (window.layoutTestController)
         layoutTestController.dumpAsText();
-    if (window.internals)
-        window.internals.setMultipleShadowSubtreesEnabled(true);
 
     prepareDomTree(document.body);
     shouldBeEqualToString("getElementInShadowTreeStack('divA/inputB').id", 'inputB');
@@ -36,9 +34,6 @@ function test()
     shouldBeEqualToString("getElementInShadowTreeStack('divA/divC/inputD').id", 'inputD');
     shouldBeEqualToString("getElementInShadowTreeStack('divA/divC//inputE').id", 'inputE');
     shouldBeEqualToString("getElementInShadowTreeStack('divA/divC///inputF').id", 'inputF');
-
-    if (window.internals)
-        window.internals.setMultipleShadowSubtreesEnabled(false);
 }
 
 test();
index 8b637eeab4707045beb24be6cf879b39354bcdf4..2839ae78251287e6a85a7bbb1334380123283bbe 100644 (file)
 <iframe id="iframe"></iframe>
 
 <script>
-function setUpOnce() {
-    internals.setMultipleShadowSubtreesEnabled(true);
-}
-
-function tearDownOnce() {
-    internals.setMultipleShadowSubtreesEnabled(false);
-}
-
 function doTest() {
     var target = document.createElement('div');
     sr1 = new WebKitShadowRoot(target);
@@ -34,9 +26,7 @@ function doTest() {
     shouldBe('sr2.ownerDocument', 'iframeDoc');
 }
 
-setUpOnce();
 doTest();
-tearDownOnce();
 var successfullyParsed = true;
 </script>
 <script src="../../js/resources/js-test-post.js"></script>
index 5dfcd6be4c37f029c0c7ff900af5abc62b32e96a..4059a3116234dd2d90a1ee562ca4cea4b1586351 100644 (file)
 </style>
 <script src="../resources/shadow-test-driver.js"></script>
 <script>
-function setUpOnce() {
-    internals.setMultipleShadowSubtreesEnabled(true);
-}
-
-function teatDownOnce() {
-    internals.setMultipleShadowSubtreesEnabled(false);
-}
-
 var testFuncs = [];
 
 testFuncs.push(function testDoubleShadowSubtrees(callIfDone) {
index 409bec076ae3b1fcd12e9748443662c80810bdfb..04bf833ec989476b262996ba23d396acece7e122 100644 (file)
@@ -7,8 +7,6 @@
 <script>
 description("This test ensure that the multiple shadow root is available.");
 
-internals.setMultipleShadowSubtreesEnabled(true);
-
 var div = document.createElement('div');
 shouldBe("internals.shadowRoot(div)", "null");
 var shadowRoot1 = new WebKitShadowRoot(div);
@@ -26,8 +24,6 @@ shouldBe("internals.olderShadowRoot(shadowRoot3)", "shadowRoot2");
 internals.removeShadowRoot(div);
 shouldBe("internals.shadowRoot(div)", "null");
 
-internals.setMultipleShadowSubtreesEnabled(false);
-
 var successfullyParsed = true;
 </script>
 <script src="../../js/resources/js-test-post.js"></script>
index 2ede818130b2d3a6d7edcec0cccccd39c8325f7b..a5ddb6315b2fcdca6be67ec584d9d9a5ffafbbb7 100644 (file)
 </style>
 <script src="../resources/shadow-test-driver.js"></script>
 <script>
-function setUpOnce() {
-    internals.setMultipleShadowSubtreesEnabled(true);
-}
-
-function tearDownOnce() {
-    internals.setMultipleShadowSubtreesEnabled(false);
-}
-
 var testFuncs = [];
 
 testFuncs.push(function renderingDoubleShadowRoot(callIfDone) {
index f4e806f95a186c7bc46180803985cf18b97d1a32..e2da70c6d0a6809617d90c0108091e2e8df3e955 100644 (file)
 </style>
 <script src="../resources/shadow-test-driver.js"></script>
 <script>
-function setUpOnce() {
-    internals.setMultipleShadowSubtreesEnabled(true);
-}
-
-function tearDownOnce() {
-    internals.setMultipleShadowSubtreesEnabled(false);
-}
-
 var testFuncs = [];
 
 testFuncs.push(function renderingSingleShadowRoot(callIfDone) {
index 2e37a40bcd60b4d26f76fb039ce7469809c318c3..2e6e26bb83ee0f587f9454d701bbf3d6a2fdf460 100644 (file)
@@ -8,7 +8,6 @@ PASS new WebKitShadowRoot(undefined) threw exception Error: HIERARCHY_REQUEST_ER
 PASS new WebKitShadowRoot(null) threw exception Error: HIERARCHY_REQUEST_ERR: DOM Exception 3.
 PASS new WebKitShadowRoot(1) threw exception Error: HIERARCHY_REQUEST_ERR: DOM Exception 3.
 PASS shadowHost is shadowRoot.host
-PASS new WebKitShadowRoot(shadowHost) threw exception Error: HIERARCHY_REQUEST_ERR: DOM Exception 3.
 The previous test should not have side effects.
 PASS shadowHost is shadowRoot.host
 PASS shadowRoot.getElementById('div1') is div1
@@ -26,6 +25,7 @@ PASS shadowRoot.querySelector('.class2') is div2
 PASS shadowRoot.querySelector('.foo') is null
 PASS shadowRoot.querySelectorAll('div') is [div1, div2]
 PASS shadowRoot.querySelectorAll('foo') is []
+PASS youngerShadowRoot is not shadowRoot
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 6284dd3981a4afb3f753fd6880474bc3aaee378b..5db81ffa6f781884e8e3022ace96768bc534a6f5 100644 (file)
@@ -22,7 +22,6 @@ var shadowHost = document.createElement('div');
 document.body.appendChild(shadowHost);
 var shadowRoot = new WebKitShadowRoot(shadowHost);
 shouldBe("shadowHost", "shadowRoot.host");
-shouldThrow("new WebKitShadowRoot(shadowHost)");
 debug('The previous test should not have side effects.');
 shouldBe("shadowHost", "shadowRoot.host");
 
@@ -58,16 +57,9 @@ shouldBeNull("shadowRoot.querySelector('.foo')");
 shouldBe("shadowRoot.querySelectorAll('div')", "[div1, div2]");
 shouldBe("shadowRoot.querySelectorAll('foo')", "[]");
 
-if (window.internals) {
-   window.internals.setMultipleShadowSubtreesEnabled(true);
+var youngerShadowRoot = new WebKitShadowRoot(shadowHost);
+shouldNotBe("youngerShadowRoot", "shadowRoot");
 
-   // FIXME: Enable this test after Element's setShadowRoot should be replaced with ShadowRootList.
-   // https://bugs.webkit.org/show_bug.cgi?id=78313
-   // var youngerShadowRoot = new WebKitShadowRoot(shadowHost);
-   // shouldNotBe("youngerShadowRoot", "shadowRoot");
-
-   window.internals.setMultipleShadowSubtreesEnabled(false);
-}
 
 </script>
 <script src="../../js/resources/js-test-post.js"></script>
index 68dd8c98a42db6bf793d49815b3031b179f9b982..da89866cbd7cd1bd93a940355432feaa8f3a9a6b 100644 (file)
@@ -1,3 +1,31 @@
+2012-03-16  Shinya Kawanaka  <shinyak@chromium.org>
+
+        Should remove RuntimeEnabledFeatures::multipleShadowSubtreesEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=79307
+
+        Reviewed by Dimitri Glazkov.
+
+        Since RuntimeEnabledFeatures::multipleShadowSubtreesEnabled was introduced for
+        temporal unstability of multiple shadow roots. We should remove it now, and
+        enable it by default.
+
+        Test: fast/dom/shadow/shadow-root-js-api.html should cover this change.
+        The other shadow related tests should also covers this change.
+
+        * WebCore.exp.in:
+        * bindings/generic/RuntimeEnabledFeatures.cpp:
+        (WebCore):
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        (RuntimeEnabledFeatures):
+        * dom/ShadowRoot.cpp:
+        (WebCore::ShadowRoot::create):
+        * dom/ShadowTree.cpp:
+        (WebCore::ShadowTree::addShadowRoot):
+        * testing/Internals.cpp:
+        * testing/Internals.h:
+        (Internals):
+        * testing/Internals.idl:
+
 2012-03-18  Dana Jansens  <danakj@chromium.org>
 
         [chromium] Don't occlude on main-thread behind layers/surfaces with impl-thread animations
index d9cc42685799b662183b03261b89155439a3d353..70550dfc793b7bca5ad1419c3ce87715a1612368 100644 (file)
@@ -2148,6 +2148,5 @@ __ZNK7WebCore20ScrollingCoordinator13scrollingTreeEv
 __ZNK7WebCore4Node31numberOfScopedHTMLStyleChildrenEv
 
 #if ENABLE(SHADOW_DOM)
-__ZN7WebCore22RuntimeEnabledFeatures32setMultipleShadowSubtreesEnabledEb
 __ZN7WebCore22RuntimeEnabledFeatures18isShadowDOMEnabledE
 #endif
index 15f94d4d9d381421b7bebe954f52a97f70a44b9e..cf8ad7889b92f743f32d50ce7f688fdea92b27b1 100644 (file)
@@ -185,13 +185,7 @@ bool RuntimeEnabledFeatures::isMediaSourceEnabled = false;
 #endif
 
 #if ENABLE(SHADOW_DOM)
-void RuntimeEnabledFeatures::setMultipleShadowSubtreesEnabled(bool isEnabled)
-{
-    isMultipleShadowSubtreesEnabled = isEnabled;
-}
-
 bool RuntimeEnabledFeatures::isShadowDOMEnabled = false;
-bool RuntimeEnabledFeatures::isMultipleShadowSubtreesEnabled = false;
 #endif
 
 #if ENABLE(STYLE_SCOPED)
index dd580891c5b81a141e43f1bf6564da63f28f4265..1f8184eb62bf8956129b23deca554061c26976a3 100644 (file)
@@ -211,9 +211,6 @@ public:
 #if ENABLE(SHADOW_DOM)
     static bool shadowDOMEnabled() { return isShadowDOMEnabled; }
     static void setShadowDOMEnabled(bool isEnabled) { isShadowDOMEnabled = isEnabled; }
-
-    static bool multipleShadowSubtreesEnabled() { return isMultipleShadowSubtreesEnabled; }
-    static void setMultipleShadowSubtreesEnabled(bool isEnabled);
 #endif
 
 #if ENABLE(STYLE_SCOPED)
@@ -283,7 +280,6 @@ private:
 
 #if ENABLE(SHADOW_DOM)
     static bool isShadowDOMEnabled;
-    static bool isMultipleShadowSubtreesEnabled;
 #endif
 
 #if ENABLE(STYLE_SCOPED)
index 7a971d5fb50aaacf4655f40f3633fed0e37d1926..97cec95226a8801e673ac22533b8e15a448514bc 100644 (file)
 #include "SVGNames.h"
 #include "markup.h"
 
-#if ENABLE(SHADOW_DOM)
-#include "RuntimeEnabledFeatures.h"
-#endif
-
 namespace WebCore {
 
 ShadowRoot::ShadowRoot(Document* document)
@@ -105,13 +101,7 @@ PassRefPtr<ShadowRoot> ShadowRoot::create(Element* element, ExceptionCode& ec)
 
 PassRefPtr<ShadowRoot> ShadowRoot::create(Element* element, ShadowRootCreationPurpose purpose, ExceptionCode& ec)
 {
-#if ENABLE(SHADOW_DOM)
-    bool isMultipleShadowSubtreesEnabled = RuntimeEnabledFeatures::multipleShadowSubtreesEnabled();
-#else
-    bool isMultipleShadowSubtreesEnabled = false;
-#endif
-
-    if (!element || (!isMultipleShadowSubtreesEnabled && element->hasShadowRoot())) {
+    if (!element) {
         ec = HIERARCHY_REQUEST_ERR;
         return 0;
     }
index 73d5878b83aea4733e9479acbd3d3b4444cfbb1d..1bae3bea7e9ea0ab9eb6246aef2de080c6acc3df 100644 (file)
@@ -80,11 +80,6 @@ void ShadowTree::addShadowRoot(Element* shadowHost, PassRefPtr<ShadowRoot> shado
 {
     ASSERT(shadowHost);
     ASSERT(shadowRoot);
-#if ENABLE(SHADOW_DOM)
-    ASSERT(!hasShadowRoot() || RuntimeEnabledFeatures::multipleShadowSubtreesEnabled());
-#else
-    ASSERT(!hasShadowRoot());
-#endif
 
     if (!validateShadowRoot(shadowHost->document(), shadowRoot.get(), ec))
         return;
index 622b64e3e01e635763c7089b0db67c03e3a28224..3a7dd1b8bff839b7f3e20ff33e8fc6e3229edd4a 100644 (file)
 #include "SpellChecker.h"
 #include "TextIterator.h"
 
-#if ENABLE(SHADOW_DOM)
-#include "RuntimeEnabledFeatures.h"
-#else
-#include <wtf/UnusedParam.h>
-#endif
-
 #if ENABLE(INPUT_COLOR)
 #include "ColorChooser.h"
 #endif
@@ -287,15 +281,6 @@ void Internals::removeShadowRoot(Element* host, ExceptionCode& ec)
         host->shadowTree()->removeAllShadowRoots();
 }
 
-void Internals::setMultipleShadowSubtreesEnabled(bool enabled)
-{
-#if ENABLE(SHADOW_DOM)
-    RuntimeEnabledFeatures::setMultipleShadowSubtreesEnabled(enabled);
-#else
-    UNUSED_PARAM(enabled);
-#endif
-}
-
 Element* Internals::includerFor(Node* node, ExceptionCode& ec)
 {
     if (!node) {
index 9716a3ca4ded6f1617e04b80c2c1c26068374f15..1a52246a36dca27856e88b8c004551f8fba9d62b 100644 (file)
@@ -75,7 +75,6 @@ public:
     ShadowRootIfShadowDOMEnabledOrNode* youngerShadowRoot(Node* shadow, ExceptionCode&);
     ShadowRootIfShadowDOMEnabledOrNode* olderShadowRoot(Node* shadow, ExceptionCode&);
     void removeShadowRoot(Element* host, ExceptionCode&);
-    void setMultipleShadowSubtreesEnabled(bool);
     Element* includerFor(Node*, ExceptionCode&);
     String shadowPseudoId(Element*, ExceptionCode&);
     PassRefPtr<Element> createContentElement(Document*, ExceptionCode&);
index 72bf90790c47f2ee82259348229bb7945e381567..361075700024f470c207473151b740d6b155fd97 100644 (file)
@@ -48,7 +48,6 @@ module window {
         Node oldestShadowRoot(in Element host) raises (DOMException);
         Node youngerShadowRoot(in Node root) raises (DOMException);
 #endif
-        void setMultipleShadowSubtreesEnabled(in boolean enabled);
         Element includerFor(in Node node) raises (DOMException);
         void removeShadowRoot(in Element host) raises (DOMException);
         DOMString shadowPseudoId(in Element element) raises (DOMException);