Title: [257414] trunk/Source/WebCore
Revision
257414
Author
[email protected]
Date
2020-02-26 00:47:57 -0800 (Wed, 26 Feb 2020)

Log Message

Custom element caching should be aware of different worlds.
https://bugs.webkit.org/show_bug.cgi?id=208228
<rdar://problem/57881013>

Reviewed by Ryosuke Niwa.

Even though a custom element is cached in one world, we should return an unknown
HTMl element in a different world.

Test to be added in https://bugs.webkit.org/show_bug.cgi?id=208229.

* bindings/js/JSElementCustom.cpp:
(WebCore::toJSNewlyCreated):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (257413 => 257414)


--- trunk/Source/WebCore/ChangeLog	2020-02-26 08:38:21 UTC (rev 257413)
+++ trunk/Source/WebCore/ChangeLog	2020-02-26 08:47:57 UTC (rev 257414)
@@ -1,3 +1,19 @@
+2020-02-26  Mark Lam  <[email protected]>
+
+        Custom element caching should be aware of different worlds.
+        https://bugs.webkit.org/show_bug.cgi?id=208228
+        <rdar://problem/57881013>
+
+        Reviewed by Ryosuke Niwa.
+
+        Even though a custom element is cached in one world, we should return an unknown
+        HTMl element in a different world.
+
+        Test to be added in https://bugs.webkit.org/show_bug.cgi?id=208229.
+
+        * bindings/js/JSElementCustom.cpp:
+        (WebCore::toJSNewlyCreated):
+
 2020-02-25  Fujii Hironori  <[email protected]>
 
         [WinCairo] Unreviewed build fix for unified source builds

Modified: trunk/Source/WebCore/bindings/js/JSElementCustom.cpp (257413 => 257414)


--- trunk/Source/WebCore/bindings/js/JSElementCustom.cpp	2020-02-26 08:38:21 UTC (rev 257413)
+++ trunk/Source/WebCore/bindings/js/JSElementCustom.cpp	2020-02-26 08:47:57 UTC (rev 257414)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2007-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -71,8 +71,12 @@
 
 JSValue toJSNewlyCreated(JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref<Element>&& element)
 {
-    if (element->isDefinedCustomElement())
-        return getCachedWrapper(globalObject->world(), element);
+    if (element->isDefinedCustomElement()) {
+        JSValue result = getCachedWrapper(globalObject->world(), element);
+        if (result)
+            return result;
+        ASSERT(!globalObject->vm().exceptionForInspection());
+    }
     ASSERT(!getCachedWrapper(globalObject->world(), element));
     return createNewElementWrapper(globalObject, WTFMove(element));
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to