New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 647586 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Oct 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 643030



Sign in to add a comment

Document.write() fails parse after calling CustomElementRegistry.define()

Project Member Reported by davaajav@google.com, Sep 16 2016

Issue description

Webkit tests fail.
https://github.com/WebKit/webkit/blob/master/LayoutTests/fast/custom-elements/defined-pseudo-class.html

Running the following code does not parse 'another-node'.

customElements.define('returns-node', class extends HTMLElement {});

document.write('<returns-node></returns-node>');
document.write('<another-node></another-node>');
 

Comment 1 by davaajav@google.com, Sep 16 2016

Blocking: 643030
Project Member

Comment 2 by sheriffbot@chromium.org, Sep 16 2016

Labels: Hotlist-Google
Components: Blink>DOM

Comment 4 by davaajav@google.com, Sep 21 2016

Description: Show this description

Comment 5 by davaajav@google.com, Sep 21 2016

Description: Show this description

Comment 6 by tkent@chromium.org, Sep 23 2016

Components: -Blink>DOM Blink>WebComponents

Comment 7 by davaajav@google.com, Sep 23 2016

Status: Started (was: Untriaged)
Project Member

Comment 9 by bugdroid1@chromium.org, Sep 30 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/89a6eed72ae35c6219934b7a11b61dfc60819b97

commit 89a6eed72ae35c6219934b7a11b61dfc60819b97
Author: davaajav <davaajav@google.com>
Date: Fri Sep 30 06:21:11 2016

HTML parser: implementing throw-on-dynamic-markup-insertion counter

https://html.spec.whatwg.org/#throw-on-dynamic-markup-insertion-counter

Custom Element constructor should not be able to use document.write(),
document.open(), document.close().
https://html.spec.whatwg.org/#dom-document-write
https://html.spec.whatwg.org/#dom-document-open
https://html.spec.whatwg.org/#dom-document-close

Throw-on-dynamic-markup-insertion count is incremented/decremented in
create an element for the token algorithm.
https://html.spec.whatwg.org/#create-an-element-for-the-token

Layout test changes:
Custom Element constructor should not use document.write(), for both
"destructive" and "non-destructive" writes.

BUG= 647586 

Review-Url: https://codereview.chromium.org/2369853002
Cr-Commit-Position: refs/heads/master@{#422042}

[modify] https://crrev.com/89a6eed72ae35c6219934b7a11b61dfc60819b97/third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html
[modify] https://crrev.com/89a6eed72ae35c6219934b7a11b61dfc60819b97/third_party/WebKit/Source/core/dom/BUILD.gn
[modify] https://crrev.com/89a6eed72ae35c6219934b7a11b61dfc60819b97/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/89a6eed72ae35c6219934b7a11b61dfc60819b97/third_party/WebKit/Source/core/dom/Document.h
[add] https://crrev.com/89a6eed72ae35c6219934b7a11b61dfc60819b97/third_party/WebKit/Source/core/dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h
[modify] https://crrev.com/89a6eed72ae35c6219934b7a11b61dfc60819b97/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp

Cc: kojii@chromium.org
Owner: dominicc@chromium.org
Status: Assigned (was: Started)
dominicc@, can we close this bug?
Status: Fixed (was: Assigned)
Davaa's patch should have fixed this. Thanks, Davaa!

Sign in to add a comment