Title: [111155] trunk
Revision
111155
Author
shin...@chromium.org
Date
2012-03-18 23:16:44 -0700 (Sun, 18 Mar 2012)

Log Message

Should remove RuntimeEnabledFeatures::multipleShadowSubtreesEnabled
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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (111154 => 111155)


--- trunk/LayoutTests/ChangeLog	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/LayoutTests/ChangeLog	2012-03-19 06:16:44 UTC (rev 111155)
@@ -1,3 +1,21 @@
+2012-03-16  Shinya Kawanaka  <shin...@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  <kei...@webkit.org>
 
         [chromium] Mark js-late-gradient-creation.svg as flaky

Modified: trunk/LayoutTests/fast/dom/shadow/get-element-by-id-in-shadow-root.html (111154 => 111155)


--- trunk/LayoutTests/fast/dom/shadow/get-element-by-id-in-shadow-root.html	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/LayoutTests/fast/dom/shadow/get-element-by-id-in-shadow-root.html	2012-03-19 06:16:44 UTC (rev 111155)
@@ -27,8 +27,6 @@
 {
     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 @@
     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();

Modified: trunk/LayoutTests/fast/dom/shadow/multiple-shadowroot-adopt.html (111154 => 111155)


--- trunk/LayoutTests/fast/dom/shadow/multiple-shadowroot-adopt.html	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/LayoutTests/fast/dom/shadow/multiple-shadowroot-adopt.html	2012-03-19 06:16:44 UTC (rev 111155)
@@ -10,14 +10,6 @@
 <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 @@
     shouldBe('sr2.ownerDocument', 'iframeDoc');
 }
 
-setUpOnce();
 doTest();
-tearDownOnce();
 var successfullyParsed = true;
 </script>
 <script src=""

Modified: trunk/LayoutTests/fast/dom/shadow/multiple-shadowroot-rendering.html (111154 => 111155)


--- trunk/LayoutTests/fast/dom/shadow/multiple-shadowroot-rendering.html	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/LayoutTests/fast/dom/shadow/multiple-shadowroot-rendering.html	2012-03-19 06:16:44 UTC (rev 111155)
@@ -15,14 +15,6 @@
 </style>
 <script src=""
 <script>
-function setUpOnce() {
-    internals.setMultipleShadowSubtreesEnabled(true);
-}
-
-function teatDownOnce() {
-    internals.setMultipleShadowSubtreesEnabled(false);
-}
-
 var testFuncs = [];
 
 testFuncs.push(function testDoubleShadowSubtrees(callIfDone) {

Modified: trunk/LayoutTests/fast/dom/shadow/multiple-shadowroot.html (111154 => 111155)


--- trunk/LayoutTests/fast/dom/shadow/multiple-shadowroot.html	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/LayoutTests/fast/dom/shadow/multiple-shadowroot.html	2012-03-19 06:16:44 UTC (rev 111155)
@@ -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 @@
 internals.removeShadowRoot(div);
 shouldBe("internals.shadowRoot(div)", "null");
 
-internals.setMultipleShadowSubtreesEnabled(false);
-
 var successfullyParsed = true;
 </script>
 <script src=""

Modified: trunk/LayoutTests/fast/dom/shadow/shadow-element-rendering-multiple.html (111154 => 111155)


--- trunk/LayoutTests/fast/dom/shadow/shadow-element-rendering-multiple.html	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/LayoutTests/fast/dom/shadow/shadow-element-rendering-multiple.html	2012-03-19 06:16:44 UTC (rev 111155)
@@ -15,14 +15,6 @@
 </style>
 <script src=""
 <script>
-function setUpOnce() {
-    internals.setMultipleShadowSubtreesEnabled(true);
-}
-
-function tearDownOnce() {
-    internals.setMultipleShadowSubtreesEnabled(false);
-}
-
 var testFuncs = [];
 
 testFuncs.push(function renderingDoubleShadowRoot(callIfDone) {

Modified: trunk/LayoutTests/fast/dom/shadow/shadow-element-rendering-single.html (111154 => 111155)


--- trunk/LayoutTests/fast/dom/shadow/shadow-element-rendering-single.html	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/LayoutTests/fast/dom/shadow/shadow-element-rendering-single.html	2012-03-19 06:16:44 UTC (rev 111155)
@@ -15,14 +15,6 @@
 </style>
 <script src=""
 <script>
-function setUpOnce() {
-    internals.setMultipleShadowSubtreesEnabled(true);
-}
-
-function tearDownOnce() {
-    internals.setMultipleShadowSubtreesEnabled(false);
-}
-
 var testFuncs = [];
 
 testFuncs.push(function renderingSingleShadowRoot(callIfDone) {

Modified: trunk/LayoutTests/fast/dom/shadow/shadow-root-js-api-expected.txt (111154 => 111155)


--- trunk/LayoutTests/fast/dom/shadow/shadow-root-js-api-expected.txt	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/LayoutTests/fast/dom/shadow/shadow-root-js-api-expected.txt	2012-03-19 06:16:44 UTC (rev 111155)
@@ -8,7 +8,6 @@
 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('.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

Modified: trunk/LayoutTests/fast/dom/shadow/shadow-root-js-api.html (111154 => 111155)


--- trunk/LayoutTests/fast/dom/shadow/shadow-root-js-api.html	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/LayoutTests/fast/dom/shadow/shadow-root-js-api.html	2012-03-19 06:16:44 UTC (rev 111155)
@@ -22,7 +22,6 @@
 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,17 +57,10 @@
 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=""
 </body>

Modified: trunk/Source/WebCore/ChangeLog (111154 => 111155)


--- trunk/Source/WebCore/ChangeLog	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/Source/WebCore/ChangeLog	2012-03-19 06:16:44 UTC (rev 111155)
@@ -1,3 +1,31 @@
+2012-03-16  Shinya Kawanaka  <shin...@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  <dan...@chromium.org>
 
         [chromium] Don't occlude on main-thread behind layers/surfaces with impl-thread animations

Modified: trunk/Source/WebCore/WebCore.exp.in (111154 => 111155)


--- trunk/Source/WebCore/WebCore.exp.in	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/Source/WebCore/WebCore.exp.in	2012-03-19 06:16:44 UTC (rev 111155)
@@ -2148,6 +2148,5 @@
 __ZNK7WebCore4Node31numberOfScopedHTMLStyleChildrenEv
 
 #if ENABLE(SHADOW_DOM)
-__ZN7WebCore22RuntimeEnabledFeatures32setMultipleShadowSubtreesEnabledEb
 __ZN7WebCore22RuntimeEnabledFeatures18isShadowDOMEnabledE
 #endif

Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp (111154 => 111155)


--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp	2012-03-19 06:16:44 UTC (rev 111155)
@@ -185,13 +185,7 @@
 #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)

Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h (111154 => 111155)


--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2012-03-19 06:16:44 UTC (rev 111155)
@@ -211,9 +211,6 @@
 #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 @@
 
 #if ENABLE(SHADOW_DOM)
     static bool isShadowDOMEnabled;
-    static bool isMultipleShadowSubtreesEnabled;
 #endif
 
 #if ENABLE(STYLE_SCOPED)

Modified: trunk/Source/WebCore/dom/ShadowRoot.cpp (111154 => 111155)


--- trunk/Source/WebCore/dom/ShadowRoot.cpp	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/Source/WebCore/dom/ShadowRoot.cpp	2012-03-19 06:16:44 UTC (rev 111155)
@@ -40,10 +40,6 @@
 #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, 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;
     }

Modified: trunk/Source/WebCore/dom/ShadowTree.cpp (111154 => 111155)


--- trunk/Source/WebCore/dom/ShadowTree.cpp	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/Source/WebCore/dom/ShadowTree.cpp	2012-03-19 06:16:44 UTC (rev 111155)
@@ -80,11 +80,6 @@
 {
     ASSERT(shadowHost);
     ASSERT(shadowRoot);
-#if ENABLE(SHADOW_DOM)
-    ASSERT(!hasShadowRoot() || RuntimeEnabledFeatures::multipleShadowSubtreesEnabled());
-#else
-    ASSERT(!hasShadowRoot());
-#endif
 
     if (!validateShadowRoot(shadowHost->document(), shadowRoot.get(), ec))
         return;

Modified: trunk/Source/WebCore/testing/Internals.cpp (111154 => 111155)


--- trunk/Source/WebCore/testing/Internals.cpp	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/Source/WebCore/testing/Internals.cpp	2012-03-19 06:16:44 UTC (rev 111155)
@@ -57,12 +57,6 @@
 #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 @@
         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) {

Modified: trunk/Source/WebCore/testing/Internals.h (111154 => 111155)


--- trunk/Source/WebCore/testing/Internals.h	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/Source/WebCore/testing/Internals.h	2012-03-19 06:16:44 UTC (rev 111155)
@@ -75,7 +75,6 @@
     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&);

Modified: trunk/Source/WebCore/testing/Internals.idl (111154 => 111155)


--- trunk/Source/WebCore/testing/Internals.idl	2012-03-19 06:07:42 UTC (rev 111154)
+++ trunk/Source/WebCore/testing/Internals.idl	2012-03-19 06:16:44 UTC (rev 111155)
@@ -48,7 +48,6 @@
         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);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to