Commit 89693ac1 authored by philipj@opera.com's avatar philipj@opera.com

Deprecate the Element.prefix setter

Intent to Deprecate and Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/Tu9pL7gMPyo/f-eYf_AkpQMJ

The conclusion of the thread was to deprecate only at this time.

Review URL: https://codereview.chromium.org/301403002

git-svn-id: svn://svn.chromium.org/blink/trunk@175202 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 669a0ae6
CONSOLE WARNING: Setting 'Element.prefix' is deprecated, as it is read-only per DOM (http://dom.spec.whatwg.org/#element).
Test for the implementation of DOM Level 3 Core API on Node Interface: prefix setter. INVALID_CHARACTER_ERR: Raised if the specified prefix contains an illegal character according to the XML version in use specified in the Document.xmlVersion attribute. http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeNSPrefix Test for the implementation of DOM Level 3 Core API on Node Interface: prefix setter. INVALID_CHARACTER_ERR: Raised if the specified prefix contains an illegal character according to the XML version in use specified in the Document.xmlVersion attribute. http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeNSPrefix
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
......
CONSOLE WARNING: Setting 'Element.prefix' is deprecated, as it is read-only per DOM (http://dom.spec.whatwg.org/#element).
CONSOLE WARNING: 'HTMLHeadElement.profile' is deprecated. The reflected attribute has no effect. CONSOLE WARNING: 'HTMLHeadElement.profile' is deprecated. The reflected attribute has no effect.
This test setting various attributes of a elements to JavaScript null. This test setting various attributes of a elements to JavaScript null.
......
CONSOLE WARNING: Setting 'Element.prefix' is deprecated, as it is read-only per DOM (http://dom.spec.whatwg.org/#element).
Test how Node.prefix setter raises NAMESPACE_ERR. Test how Node.prefix setter raises NAMESPACE_ERR.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
......
...@@ -1201,7 +1201,7 @@ String Element::nodeName() const ...@@ -1201,7 +1201,7 @@ String Element::nodeName() const
void Element::setPrefix(const AtomicString& prefix, ExceptionState& exceptionState) void Element::setPrefix(const AtomicString& prefix, ExceptionState& exceptionState)
{ {
UseCounter::count(document(), UseCounter::ElementSetPrefix); UseCounter::countDeprecation(document(), UseCounter::ElementSetPrefix);
if (!prefix.isEmpty() && !Document::isValidName(prefix)) { if (!prefix.isEmpty() && !Document::isValidName(prefix)) {
exceptionState.throwDOMException(InvalidCharacterError, "The prefix '" + prefix + "' is not a valid name."); exceptionState.throwDOMException(InvalidCharacterError, "The prefix '" + prefix + "' is not a valid name.");
......
...@@ -730,6 +730,9 @@ String UseCounter::deprecationMessage(Feature feature) ...@@ -730,6 +730,9 @@ String UseCounter::deprecationMessage(Feature feature)
case HTMLHeadElementProfile: case HTMLHeadElementProfile:
return "'HTMLHeadElement.profile' is deprecated. The reflected attribute has no effect."; return "'HTMLHeadElement.profile' is deprecated. The reflected attribute has no effect.";
case ElementSetPrefix:
return "Setting 'Element.prefix' is deprecated, as it is read-only per DOM (http://dom.spec.whatwg.org/#element).";
// Features that aren't deprecated don't have a deprecation message. // Features that aren't deprecated don't have a deprecation message.
default: default:
return String(); return String();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment