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

Issue 643046 link

Starred by 2 users

Issue metadata

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

Blocking:
issue 643030



Sign in to add a comment

attributeChangedCallback gets "" for the namespace URI when it should be null

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

Issue description

Chrome appears to pass empty strings instead of null for old values (when adding) or new values (when removing.) See:

https://dom.spec.whatwg.org/#concept-element-attributes-append
https://dom.spec.whatwg.org/#concept-element-attributes-remove

 
Blockedon: 643030
Project Member

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

Labels: Hotlist-Google
Blocking: 643030
Blockedon: -643030
Labels: -Pri-3 Pri-2
Owner: dominicc@chromium.org
Status: Started (was: Untriaged)
Summary: attributeChangedCallback gets "" for the namespace URI when it should be null (was: Chrome appears to pass empty strings instead of null for old/new values)
Note that DOM says attribute namespaces are null, or a non-empty string:

https://dom.spec.whatwg.org/#concept-attribute-namespace

Chrome passes an empty string, not null, when there is no namespace.

This causes a number of WebKit's tests to fail: LayoutTests/fast/custom-elements/attribute-changed-callback.html.

Cc: kojii@chromium.org
I notice we have to tests for namespaced attributes, either.
Components: Blink>WebComponents
Patch up at https://codereview.chromium.org/2303663004
Project Member

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

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

commit d39405eee528d5cec4edcb6dd9abfdc83b897fe8
Author: dominicc <dominicc@chromium.org>
Date: Sun Sep 04 00:11:52 2016

Pass null to attributeChangedCallback when there's no namespace URI

The DOM spec says attribute namespaces may be null, or non-empty [1].
We should accurately transmit those nulls to the
attributeChangedCallback [2]. We were converting null to empty string.

This also adds a test that non-null namespaces are transmitted, too.

[1] https://dom.spec.whatwg.org/#concept-attribute-namespace
[2] https://dom.spec.whatwg.org/#concept-element-attributes-change , etc.

BUG= 643046 

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

[modify] https://crrev.com/d39405eee528d5cec4edcb6dd9abfdc83b897fe8/third_party/WebKit/LayoutTests/custom-elements/spec/callback.html
[modify] https://crrev.com/d39405eee528d5cec4edcb6dd9abfdc83b897fe8/third_party/WebKit/LayoutTests/custom-elements/spec/upgrade-element.html
[modify] https://crrev.com/d39405eee528d5cec4edcb6dd9abfdc83b897fe8/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp

Status: Fixed (was: Started)

Sign in to add a comment