Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change handling of is="" in element creation and cloning #566

Merged
merged 1 commit into from
Feb 14, 2018

Conversation

domenic
Copy link
Member

@domenic domenic commented Feb 2, 2018

Part of fixing whatwg/html#3402. This changes two things:

  • It fixes the cloning steps to consult the internal is value, instead of the is="" content attribute.
  • It removes the step from createElement()/createElementNS() that would insert an is="" attribute in the created element, as we've now decided that is="" is a way of communicating to the parser, and not a general-purpose indicator of customized built-in-ness.

This is coupled with a HTML change I will be submitting shortly, to the serializer (and to several examples).

@tkent-google, will you be able to help with tests for this? I am happy to review.


Preview | Diff

Part of fixing whatwg/html#3402. This changes two things:

* It fixes the cloning steps to consult the internal is value, instead of the is="" content attribute.
* It removes the step from createElement()/createElementNS() that would insert an is="" attribute in the created element, as we've now decided that is="" is a way of communicating to the parser, and not a general-purpose indicator of customized built-in-ness.
domenic added a commit to whatwg/html that referenced this pull request Feb 2, 2018
This follows the DOM changes in whatwg/dom#566,
and is part of fixing #3402.

The normative changes are to the serialization algorithm, which now
writes out the element's is value as its is="" attribute, if no actual
is="" attribute is present. The rest of the changes are to introductory
text about customized built-in elements.
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized that the other nice thing here is that we don't get non-observable attribute mutation records.

@tkent-google
Copy link
Collaborator

@tkent-google, will you be able to help with tests for this? I am happy to review.

Yes. I'll add/update tests when I'll update Chromium implementation.

tkent-google added a commit to web-platform-tests/wpt that referenced this pull request Feb 14, 2018
This is for whatwg/dom#566.

- document.createElement() and createElementNS() don't add "is" content
 attribute.

- cloneNode() should clone custom elements even if they have no "is"
 content attributes or have "is" content attribute inconsistent with
 "is value."
@tkent-google
Copy link
Collaborator

@tkent-google, will you be able to help with tests for this? I am happy to review.

Yes. I'll add/update tests when I'll update Chromium implementation.

Test PR: web-platform-tests/wpt#9505

@domenic domenic merged commit fc601be into master Feb 14, 2018
@domenic domenic deleted the cbie-is-changes branch February 14, 2018 00:25
domenic pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 14, 2018
This is for whatwg/dom#566.

- document.createElement() and createElementNS() don't add "is" content
 attribute.

- cloneNode() should clone custom elements even if they have no "is"
 content attributes or have "is" content attribute inconsistent with
 "is value."
domenic added a commit to whatwg/html that referenced this pull request Feb 14, 2018
This follows the DOM changes in whatwg/dom#566,
and is part of fixing #3402.

The normative changes are to the serialization algorithm, which now
writes out the element's is value as its is="" attribute, if no actual
is="" attribute is present. The rest of the changes are to introductory
text about customized built-in elements.

Tests: web-platform-tests/wpt#9508
aarongable pushed a commit to chromium/chromium that referenced this pull request Feb 20, 2018
… be cloneable.

This follows a DOM specification change;
whatwg/dom#566

- createElement() and createElementNS() don't add "is" content
  attribute
- cloneNode() should refer "is value" instead of "is" content attribute
  value.

This CL adds a data member for "is value" to ElementRareData, and
initialize it in "create an element" implementation.

Note that new failure for serializing-html-fragments.html is expected.
It will be fixed for crbug.com/813675.

Bug: 807871
Change-Id: Ie7c5f6282dd1a84a3d159b89d0d4efd72b0ddee0
Reviewed-on: https://chromium-review.googlesource.com/925901
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537736}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Apr 1, 2018
…ribute behavior changes, a=testonly

Automatic update from web-platform-tests[custom-elements] Some fixes for "is" attribute behavior changes

This is for whatwg/dom#566.

- document.createElement() and createElementNS() don't add "is" content
 attribute.

- cloneNode() should clone custom elements even if they have no "is"
 content attributes or have "is" content attribute inconsistent with
 "is value."

wpt-commits: 1e4fe87a7f01c0b5c614c8f601ffa68b4a00662a
wpt-pr: 9505
wpt-commits: 1e4fe87a7f01c0b5c614c8f601ffa68b4a00662a
wpt-pr: 9505
@smaug----
Copy link
Collaborator

So if there is definition for custom element (non built-in), is value is set to null, but if there isn't definition yet, is value can be possibly set to non-null. That is weird.

@smaug----
Copy link
Collaborator

When doing something like 'new CustomBuiltIn()', is value isn't set, so cloning the element doesn't work.

domenic added a commit to whatwg/html that referenced this pull request Jun 27, 2018
Fixes #3776.

Tests: already present in
web-platform-tests/wpt@1e4fe87#diff-d2e09155cd799584f19630072186bff5,
as we forgot to update this part of the HTML Standard when we merged
whatwg/dom#566.
domenic added a commit that referenced this pull request Jun 28, 2018
alice pushed a commit to alice/html that referenced this pull request Jan 8, 2019
This follows the DOM changes in whatwg/dom#566,
and is part of fixing whatwg#3402.

The normative changes are to the serialization algorithm, which now
writes out the element's is value as its is="" attribute, if no actual
is="" attribute is present. The rest of the changes are to introductory
text about customized built-in elements.

Tests: web-platform-tests/wpt#9508
alice pushed a commit to alice/html that referenced this pull request Jan 8, 2019
Fixes whatwg#3776.

Tests: already present in
web-platform-tests/wpt@1e4fe87#diff-d2e09155cd799584f19630072186bff5,
as we forgot to update this part of the HTML Standard when we merged
whatwg/dom#566.
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 2, 2019
…ribute behavior changes, a=testonly

Automatic update from web-platform-tests[custom-elements] Some fixes for "is" attribute behavior changes

This is for whatwg/dom#566.

- document.createElement() and createElementNS() don't add "is" content
 attribute.

- cloneNode() should clone custom elements even if they have no "is"
 content attributes or have "is" content attribute inconsistent with
 "is value."

wpt-commits: 1e4fe87a7f01c0b5c614c8f601ffa68b4a00662a
wpt-pr: 9505
wpt-commits: 1e4fe87a7f01c0b5c614c8f601ffa68b4a00662a
wpt-pr: 9505

UltraBlame original commit: a8c46b6a1c20e8302d3adf8e9470037fd58cbb1d
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 2, 2019
…ribute behavior changes, a=testonly

Automatic update from web-platform-tests[custom-elements] Some fixes for "is" attribute behavior changes

This is for whatwg/dom#566.

- document.createElement() and createElementNS() don't add "is" content
 attribute.

- cloneNode() should clone custom elements even if they have no "is"
 content attributes or have "is" content attribute inconsistent with
 "is value."

wpt-commits: 1e4fe87a7f01c0b5c614c8f601ffa68b4a00662a
wpt-pr: 9505
wpt-commits: 1e4fe87a7f01c0b5c614c8f601ffa68b4a00662a
wpt-pr: 9505

UltraBlame original commit: a8c46b6a1c20e8302d3adf8e9470037fd58cbb1d
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 2, 2019
…ribute behavior changes, a=testonly

Automatic update from web-platform-tests[custom-elements] Some fixes for "is" attribute behavior changes

This is for whatwg/dom#566.

- document.createElement() and createElementNS() don't add "is" content
 attribute.

- cloneNode() should clone custom elements even if they have no "is"
 content attributes or have "is" content attribute inconsistent with
 "is value."

wpt-commits: 1e4fe87a7f01c0b5c614c8f601ffa68b4a00662a
wpt-pr: 9505
wpt-commits: 1e4fe87a7f01c0b5c614c8f601ffa68b4a00662a
wpt-pr: 9505

UltraBlame original commit: a8c46b6a1c20e8302d3adf8e9470037fd58cbb1d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants