Title: [235864] trunk
Revision
235864
Author
[email protected]
Date
2018-09-10 14:48:55 -0700 (Mon, 10 Sep 2018)

Log Message

Remove isOrphan check in ShadowRoot::setInnerHTML
https://bugs.webkit.org/show_bug.cgi?id=189449

Reviewed by Darin Adler.

Removed isOrphan() check in ShadowRoot::setInnerHTML needed for webkit.org/b/88834.

The only reason this check was kept in the code was because the fix for V8 couldn't be landed
due to a perf regression but V8 binding isn't even a thing in WebKit anymore.

* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::setInnerHTML):
* dom/ShadowRoot.h:

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Extensions-to-Event-Interface.html (235863 => 235864)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Extensions-to-Event-Interface.html	2018-09-10 21:42:45 UTC (rev 235863)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Extensions-to-Event-Interface.html	2018-09-10 21:48:55 UTC (rev 235864)
@@ -64,7 +64,7 @@
 
         var expectedPath = ['A1a', 'A1-SR', 'A1', 'A-SR', 'A'];
         assert_array_equals(log.eventPath, expectedPath);
-        assert_array_equals(log.eventPath.length, log.pathAtTargets.length);
+        assert_equals(log.eventPath.length, log.pathAtTargets.length);
         assert_array_equals(log.pathAtTargets[0], expectedPath);
         assert_array_equals(log.pathAtTargets[1], expectedPath);
         assert_array_equals(log.pathAtTargets[2], mode == 'open' ? expectedPath : ['A1', 'A-SR', 'A'],
@@ -92,7 +92,7 @@
 
         var expectedPath = ['A1a', 'A1-SR'];
         assert_array_equals(log.eventPath, expectedPath);
-        assert_array_equals(log.eventPath.length, log.pathAtTargets.length);
+        assert_equals(log.eventPath.length, log.pathAtTargets.length);
         assert_array_equals(log.pathAtTargets[0], expectedPath);
         assert_array_equals(log.pathAtTargets[1], expectedPath);
     }, 'The event must not propagate out of ' + mode + ' mode shadow boundaries when the composed flag is unset');
@@ -118,7 +118,7 @@
 
         var expectedPath = ['A1a', 'A1-SR'];
         assert_array_equals(log.eventPath, expectedPath);
-        assert_array_equals(log.eventPath.length, log.pathAtTargets.length);
+        assert_equals(log.eventPath.length, log.pathAtTargets.length);
         assert_array_equals(log.pathAtTargets[0], expectedPath);
         assert_array_equals(log.pathAtTargets[1], expectedPath);
         assert_array_equals(log.relatedTargets, ['A2-S', 'A2-S']);
@@ -146,7 +146,7 @@
         var expectedPath = ['B1a', 'B1c-S', 'B1-SR', 'B1', 'B-SR'];
         var pathExposedToB1a = ['B1a', 'B1', 'B-SR'];
         assert_array_equals(log.eventPath, expectedPath);
-        assert_array_equals(log.eventPath.length, log.pathAtTargets.length);
+        assert_equals(log.eventPath.length, log.pathAtTargets.length);
         assert_array_equals(log.pathAtTargets[0], mode == 'open' ? expectedPath : pathExposedToB1a);
         assert_array_equals(log.pathAtTargets[1], expectedPath);
         assert_array_equals(log.pathAtTargets[2], expectedPath);
@@ -177,7 +177,7 @@
         var expectedPath = ['A1a', 'A1-SR', 'A1', 'A-SR'];
         var pathExposedToA1 = ['A1', 'A-SR'];
         assert_array_equals(log.eventPath, expectedPath);
-        assert_array_equals(log.eventPath.length, log.pathAtTargets.length);
+        assert_equals(log.eventPath.length, log.pathAtTargets.length);
         assert_array_equals(log.pathAtTargets[0], expectedPath);
         assert_array_equals(log.pathAtTargets[1], expectedPath);
         assert_array_equals(log.pathAtTargets[2], mode == 'open' ? expectedPath : pathExposedToA1);
@@ -212,7 +212,7 @@
         var pathExposedToA1 =       [                                       'B', 'A2-S', 'A-SR', 'A'];
 
         assert_array_equals(log.eventPath, expectedPath);
-        assert_array_equals(log.eventPath.length, log.pathAtTargets.length);
+        assert_equals(log.eventPath.length, log.pathAtTargets.length);
         assert_array_equals(log.pathAtTargets[0], mode == 'open' ? expectedPath : pathExposedToB1a);
         assert_array_equals(log.pathAtTargets[1], mode == 'open' ? expectedPath : pathExposedToB1cS);
         assert_array_equals(log.pathAtTargets[2], mode == 'open' ? expectedPath : pathExposedToB1cS);

Modified: trunk/Source/WebCore/ChangeLog (235863 => 235864)


--- trunk/Source/WebCore/ChangeLog	2018-09-10 21:42:45 UTC (rev 235863)
+++ trunk/Source/WebCore/ChangeLog	2018-09-10 21:48:55 UTC (rev 235864)
@@ -1,3 +1,19 @@
+2018-09-08  Ryosuke Niwa  <[email protected]>
+
+        Remove isOrphan check in ShadowRoot::setInnerHTML
+        https://bugs.webkit.org/show_bug.cgi?id=189449
+
+        Reviewed by Darin Adler.
+
+        Removed isOrphan() check in ShadowRoot::setInnerHTML needed for webkit.org/b/88834.
+
+        The only reason this check was kept in the code was because the fix for V8 couldn't be landed
+        due to a perf regression but V8 binding isn't even a thing in WebKit anymore.
+
+        * dom/ShadowRoot.cpp:
+        (WebCore::ShadowRoot::setInnerHTML):
+        * dom/ShadowRoot.h:
+
 2018-09-10  Simon Fraser  <[email protected]>
 
         Many textarea tests leak documents because Document::removeFocusNavigationNodeOfSubtree() can trigger a Document retain cycle

Modified: trunk/Source/WebCore/dom/ShadowRoot.cpp (235863 => 235864)


--- trunk/Source/WebCore/dom/ShadowRoot.cpp	2018-09-10 21:42:45 UTC (rev 235863)
+++ trunk/Source/WebCore/dom/ShadowRoot.cpp	2018-09-10 21:48:55 UTC (rev 235864)
@@ -134,8 +134,6 @@
 
 ExceptionOr<void> ShadowRoot::setInnerHTML(const String& markup)
 {
-    if (isOrphan())
-        return Exception { InvalidAccessError };
     auto fragment = createFragmentForInnerOuterHTML(*host(), markup, AllowScriptingContent);
     if (fragment.hasException())
         return fragment.releaseException();

Modified: trunk/Source/WebCore/dom/ShadowRoot.h (235863 => 235864)


--- trunk/Source/WebCore/dom/ShadowRoot.h	2018-09-10 21:42:45 UTC (rev 235863)
+++ trunk/Source/WebCore/dom/ShadowRoot.h	2018-09-10 21:48:55 UTC (rev 235864)
@@ -95,9 +95,6 @@
 
     ShadowRoot(Document&, std::unique_ptr<SlotAssignment>&&);
 
-    // FIXME: This shouldn't happen. https://bugs.webkit.org/show_bug.cgi?id=88834
-    bool isOrphan() const { return !m_host; }
-
 private:
     bool childTypeAllowed(NodeType) const override;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to