Intent to Deprecate and Remove Node.namespaceURI and Node.localName

59 views
Skip to first unread message

jinch...@navercorp.com

unread,
Jun 29, 2015, 7:17:46 AM6/29/15
to blin...@chromium.org

It`s my first try and this it is from http://crbug.com/504574
Thanks.

Primary eng (and PM) emails
jincheol dot jo at navercorp dot com, phi...@opera.com

Summary
Remove Node.namespaceURI and node.localName in all files referenced by this APIs.

Motivation
These are no longer on the Node interface in DOM:
https://dom.spec.whatwg.org/#interface-node


Compatibility Risk Node.namespaceURI and Node.localName are shadowed on Element and Attr, so in every case where the attributes on Node are accessed, they will return null. Removing them will instead make any access return undefined. Usage information from UseCounter https://www.chromestatus.com/metrics/feature/timeline/popularity/120 https://www.chromestatus.com/metrics/feature/timeline/popularity/122

Philip Jägenstedt

unread,
Jun 29, 2015, 7:40:16 AM6/29/15
to jinch...@navercorp.com, blink-dev
I added the use counters and filed the bug and so I'm biased, but LGTM.

For nodes other than Attr/Element, namespaceURI and localName will go from returning null to returning undefined. This will usually not matter, because null == undefined, but it's possible to depend on the difference: if (node.localName !== null) { assumeArgumentIsString(node.localName); }.

Use counters can't tell us how the return value is used, so I think we should try making the change soon after a branch point to maximize bake time, and be prepared to revert and change the spec if it doesn't work out. Deprecation does not seem meaningful, since usage of localName is around 0.1% and we're assuming that this is mostly bogus or non-breaking usage to even attempt the change.

Note that Node.prefix was in the same situation and was successfully removed in January 2014:

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

TAMURA, Kent

unread,
Jul 13, 2015, 9:47:12 PM7/13/15
to jinch...@navercorp.com, blink-dev
This is only for Node.namespaceURI and Node.localName, and NOT for Element.namespaceURI and Element.localName, right?

--
TAMURA Kent
Software Engineer, Google


jinch...@navercorp.com

unread,
Jul 13, 2015, 10:40:50 PM7/13/15
to blin...@chromium.org, jinch...@navercorp.com
right!!

we can use Element.namespaceURI and localName continue.

Jincheol.


2015년 7월 14일 화요일 오전 10시 47분 12초 UTC+9, Kent Tamura 님의 말:

TAMURA, Kent

unread,
Jul 13, 2015, 11:01:46 PM7/13/15
to jinch...@navercorp.com, blink-dev
ok, LGTM2

Chris Harrelson

unread,
Jul 16, 2015, 11:36:20 AM7/16/15
to TAMURA, Kent, jinch...@navercorp.com, blink-dev
LGTM3

ok, LGTM2

Reply all
Reply to author
Forward
0 new messages