Fix customized built-in element constructor behavior #23072
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This CL implements two changes:
It fixes the implementation to better match the spec for the
"create an element for the token" [1] algorithm. Prior to this CL,
step 7 of that algorithm was skipping directly to step 6 of the
"create an element" [2] algorithm, skipping over step 5 for
customized built-in elements. This is now fixed. This case is
illustrated by the issue and example at [3] and [4]. This becomes
the first test in customized-built-in-constructor-exceptions.html.
It updates the comments to match the new behavior discussed in [3]
and the [5] spec PR, which changes the return value in the case
that a customized built-in element constructor throws an exception.
With the change above, that is actually already the behavior. So
this is just a comment change. Two new tests are added to
customized-built-in-constructor-exceptions.html.
[1] https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token
[2] https://dom.spec.whatwg.org/#concept-create-element
[3] whatwg/html#5084
[4] https://crbug.com/1024866
[5] whatwg/dom#797
Bug: 1071059, 1024866
Change-Id: I814c81991eb5e83501304bcb3d2da476743aef52
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2152986
Commit-Queue: Mason Freed <[email protected]>
Auto-Submit: Mason Freed <[email protected]>
Reviewed-by: Kent Tamura <[email protected]>
Cr-Commit-Position: refs/heads/master@{#760705}