Bug 159113 - Don't keep all newly created potential custom elements alive when the feature is disabled
Summary: Don't keep all newly created potential custom elements alive when the feature...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-06-24 23:02 PDT by Ryosuke Niwa
Modified: 2016-06-27 20:26 PDT (History)
8 users (show)

See Also:


Attachments
Fixes the bug (1.75 KB, patch)
2016-06-24 23:10 PDT, Ryosuke Niwa
dbates: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2016-06-24 23:02:32 PDT
Custom elements spec has been updated to not upgrade all elements unless they're inserted into a document.
We don't have a time to update the code fully but we should at least avoid queuing them up
and keeping them all alive when the feature is disabled.
Comment 1 Ryosuke Niwa 2016-06-24 23:10:29 PDT
Created attachment 282047 [details]
Fixes the bug
Comment 2 Daniel Bates 2016-06-26 20:15:37 PDT
Comment on attachment 282047 [details]
Fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=282047&action=review

OK

> Source/WebCore/ChangeLog:9
> +        The custom elements spec has also been updated to not do this but we'll implement that behavior later.

Maybe a better way to say this is:

Ideally we want to conform to the behavior in the Custom Elements spec. and only upgrade an element that is inserted into the document.

> Source/WebCore/dom/Document.cpp:900
> +    if (RuntimeEnabledFeatures::sharedFeatures().customElementsEnabled()
> +        && Document::validateCustomElementName(localName) == CustomElementNameValidationStatus::Valid) {

Can we/would it make sense to write a test for this change? I would hope that such a test could be updated once we implement the behavior defined in the spec.
Comment 3 Ryosuke Niwa 2016-06-26 21:14:08 PDT
(In reply to comment #2)
> Comment on attachment 282047 [details]
> Fixes the bug
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=282047&action=review
>
> > Source/WebCore/dom/Document.cpp:900
> > +    if (RuntimeEnabledFeatures::sharedFeatures().customElementsEnabled()
> > +        && Document::validateCustomElementName(localName) == CustomElementNameValidationStatus::Valid) {
> 
> Can we/would it make sense to write a test for this change? I would hope
> that such a test could be updated once we implement the behavior defined in
> the spec.

It's theoretically possible with GCController.collect() but I've never been able to write a test with that successfully with JSC in the past. The test always ends up being either flaky or not functional.
Comment 4 Radar WebKit Bug Importer 2016-06-27 20:24:55 PDT
<rdar://problem/27046824>
Comment 5 Ryosuke Niwa 2016-06-27 20:26:05 PDT
Committed r202537: <http://trac.webkit.org/changeset/202537>