[WebIDL] Swap a custom attribute for a custom mark function for HTMLTemplateElement
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Aug 2017 14:23:29 +0000 (14:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Aug 2017 14:23:29 +0000 (14:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=175006

Patch by Sam Weinig <sam@webkit.org> on 2017-08-01
Reviewed by Chris Dumez.

Use the standard way of augmenting GC, visitAdditionalChildren, rather
than using a private name to create ownership.

* bindings/js/JSHTMLTemplateElementCustom.cpp:
(WebCore::JSHTMLTemplateElement::visitAdditionalChildren):
(WebCore::JSHTMLTemplateElement::content const): Deleted.
* html/HTMLTemplateElement.idl:

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

Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSHTMLTemplateElementCustom.cpp
Source/WebCore/html/HTMLTemplateElement.idl

index 4d24973c312fcc8a80e6a51471bfb83edb10d2d7..fd0a315aab428afe4f51d0246ce3df7e3213d8f4 100644 (file)
@@ -1,3 +1,18 @@
+2017-08-01  Sam Weinig  <sam@webkit.org>
+
+        [WebIDL] Swap a custom attribute for a custom mark function for HTMLTemplateElement
+        https://bugs.webkit.org/show_bug.cgi?id=175006
+
+        Reviewed by Chris Dumez.
+
+        Use the standard way of augmenting GC, visitAdditionalChildren, rather
+        than using a private name to create ownership.
+
+        * bindings/js/JSHTMLTemplateElementCustom.cpp:
+        (WebCore::JSHTMLTemplateElement::visitAdditionalChildren):
+        (WebCore::JSHTMLTemplateElement::content const): Deleted.
+        * html/HTMLTemplateElement.idl:
+
 2017-08-01  Zan Dobersek  <zdobersek@igalia.com>
 
         [GCrypt] Gather crypto constants in a single location
index ff91eada095fb2b9edd5affb24830e794ea114ae..1dc13123cc10063161b0dfc117e4c9ef53b36ded 100644 (file)
 #include "config.h"
 #include "JSHTMLTemplateElement.h"
 
-#include "HTMLTemplateElement.h"
 #include "JSDocumentFragment.h"
-#include <runtime/JSObject.h>
-#include <runtime/PrivateName.h>
 
 using namespace JSC;
 
 namespace WebCore {
 
-JSValue JSHTMLTemplateElement::content(ExecState& state) const
+void JSHTMLTemplateElement::visitAdditionalChildren(JSC::SlotVisitor& visitor)
 {
-    JSLockHolder lock(&state);
-
-    auto wrapper = wrap(&state, globalObject(), wrapped().content());
-
-    PrivateName propertyName;
-    const_cast<JSHTMLTemplateElement*>(this)->putDirect(globalObject()->vm(), propertyName, wrapper);
-    return wrapper;
+    visitor.addOpaqueRoot(root(&wrapped().content()));
 }
 
 } // namespace WebCore
index c6cfd50288d2fad04ba21ce4af1f19be35ba232c..d73d060bca22247eb1611843f3f687d49629e72c 100644 (file)
@@ -28,7 +28,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-interface HTMLTemplateElement : HTMLElement {
-    [Custom] readonly attribute DocumentFragment content;
+[
+    JSCustomMarkFunction,
+] interface HTMLTemplateElement : HTMLElement {
+    readonly attribute DocumentFragment content;
 };
-