Commit 5e2a7d4d authored by philipj's avatar philipj Committed by Commit bot

Remove use counters for Element methods that have been settled in spec

https://dom.spec.whatwg.org/#interface-element

This also moves the non-spec'd webkitMatchesSelector,
insertAdjacentElement and insertAdjacentText.

The use counter for webkitMatchesSelector is left in place, because it
it's somewhat interesting to follow its decline. The usage ought to be
dominated by old versions of jQuery and other libraries, and so it says
something about how long it takes for those libraries to be dropped or
upgraded in the wild. jQuery and other libraries were updated around the
time that the unprefixed matches was shipped in Blink, and usage of
webkitMatchesSelector has roughly halved every year since. (Since it's
now implemented in all engines, it's still unlikely to ever be removed.)

Original commits:
https://crrev.com/d92494c5c13990d8ab8d8cd73b0a20b8b2dee1e9
https://crrev.com/a706ad3cd488d6827cfcc99cd67cc30625296928
https://crrev.com/709823c231eb406d6928938c745effb16d6b3b3c
https://crrev.com/45b5b0427c403ba30d0067921b2639a31f0190df
https://crrev.com/6bcc2fb1c405cca7971ef6f361d94f8e8c63e726

BUG=460722

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

Cr-Commit-Position: refs/heads/master@{#381701}
parent a7c239cc
......@@ -39,7 +39,7 @@ interface Element : Node {
[RuntimeEnabled=PointerEvent, RaisesException] void setPointerCapture (long pointerId);
[RuntimeEnabled=PointerEvent, RaisesException] void releasePointerCapture (long pointerId);
[MeasureAs=HasAttributes] boolean hasAttributes();
boolean hasAttributes();
[SameObject, PerWorldBindings, ImplementedAs=attributesForBindings] readonly attribute NamedNodeMap attributes;
DOMString? getAttribute(DOMString name);
DOMString? getAttributeNS(DOMString? namespaceURI, DOMString localName);
......@@ -50,24 +50,28 @@ interface Element : Node {
boolean hasAttribute(DOMString name);
boolean hasAttributeNS(DOMString? namespaceURI, DOMString localName);
[MeasureAs=ElementGetAttributeNode] Attr? getAttributeNode(DOMString name);
[MeasureAs=ElementGetAttributeNodeNS] Attr? getAttributeNodeNS(DOMString? namespaceURI, DOMString localName);
[RaisesException, CustomElementCallbacks, MeasureAs=ElementSetAttributeNode] Attr? setAttributeNode(Attr attr);
[RaisesException, CustomElementCallbacks, MeasureAs=ElementSetAttributeNodeNS] Attr? setAttributeNodeNS(Attr attr);
[RaisesException, CustomElementCallbacks, MeasureAs=ElementRemoveAttributeNode] Attr removeAttributeNode(Attr attr);
Attr? getAttributeNode(DOMString name);
Attr? getAttributeNodeNS(DOMString? namespaceURI, DOMString localName);
[RaisesException, CustomElementCallbacks] Attr? setAttributeNode(Attr attr);
[RaisesException, CustomElementCallbacks] Attr? setAttributeNodeNS(Attr attr);
[RaisesException, CustomElementCallbacks] Attr removeAttributeNode(Attr attr);
[RaisesException] Element? closest(DOMString selectors);
[RaisesException] boolean matches(DOMString selectors);
[RaisesException, ImplementedAs=matches, MeasureAs=ElementPrefixedMatchesSelector] boolean webkitMatchesSelector(DOMString selectors); // historical alias of .matches
HTMLCollection getElementsByTagName(DOMString localName);
HTMLCollection getElementsByTagNameNS(DOMString? namespaceURI, DOMString localName);
HTMLCollection getElementsByClassName(DOMString classNames);
[RaisesException, CustomElementCallbacks] Element? insertAdjacentElement(DOMString where, Element element);
[RaisesException] void insertAdjacentText(DOMString where, DOMString data);
// DOM Parsing and Serialization
// https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#extensions-to-the-element-interface
[TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] attribute DOMString innerHTML;
[TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] attribute DOMString outerHTML;
[CustomElementCallbacks, RaisesException, MeasureAs=InsertAdjacentHTML] void insertAdjacentHTML(DOMString position, DOMString text);
[CustomElementCallbacks, RaisesException] void insertAdjacentHTML(DOMString position, DOMString text);
// Shadow DOM
// http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-element-interface
......@@ -109,12 +113,8 @@ interface Element : Node {
[RuntimeEnabled=ScrollCustomization] void setApplyScroll(ScrollStateCallback scrollStateCallback, NativeScrollBehavior nativeScrollBehavior);
[RuntimeEnabled=ScrollCustomization] void setDistributeScroll(ScrollStateCallback scrollStateCallback, NativeScrollBehavior nativeScrollBehavior);
// Non-standard APIs
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=19962
[RaisesException, CustomElementCallbacks, MeasureAs=InsertAdjacentElement] Element insertAdjacentElement(DOMString where, Element element);
[RaisesException, MeasureAs=InsertAdjacentText] void insertAdjacentText(DOMString where, DOMString text);
// Non-standard API
[MeasureAs=ElementScrollIntoViewIfNeeded] void scrollIntoViewIfNeeded(optional boolean centerIfNeeded);
[RaisesException, ImplementedAs=matches, MeasureAs=ElementPrefixedMatchesSelector] boolean webkitMatchesSelector(DOMString selectors);
// Experimental accessibility API
[RuntimeEnabled=ComputedAccessibilityInfo] readonly attribute DOMString? computedRole;
......
......@@ -132,10 +132,6 @@ public:
SubFrameBeforeUnloadRegistered = 97,
SubFrameBeforeUnloadFired = 98,
ConsoleMarkTimeline = 102,
ElementGetAttributeNode = 107,
ElementSetAttributeNode = 108,
ElementRemoveAttributeNode = 109,
ElementGetAttributeNodeNS = 110,
DocumentCreateAttribute = 111,
DocumentCreateAttributeNS = 112,
DocumentCreateCDATASection = 113, // Removed from DOM4.
......@@ -157,9 +153,6 @@ public:
PrefixedAndUnprefixedAnimationIterationEvent = 136,
EventReturnValue = 137, // Legacy IE extension.
SVGSVGElement = 138,
InsertAdjacentText = 140,
InsertAdjacentElement = 141,
HasAttributes = 142,
DOMSubtreeModifiedEvent = 143,
DOMNodeInsertedEvent = 144,
DOMNodeRemovedEvent = 145,
......@@ -211,7 +204,6 @@ public:
HTMLElementInnerText = 213,
HTMLElementOuterText = 214,
ReplaceDocumentViaJavaScriptURL = 215,
ElementSetAttributeNodeNS = 216,
ElementPrefixedMatchesSelector = 217,
CSSStyleSheetRules = 219,
CSSStyleSheetAddRule = 220,
......@@ -243,7 +235,6 @@ public:
// The above items are available in M34 branch.
HTMLAnchorElementPingAttribute = 276,
InsertAdjacentHTML = 278,
SVGClassName = 279,
HTMLMediaElementSeekToFragmentStart = 281,
HTMLMediaElementPauseAtFragmentEnd = 282,
......
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