Auto merge of #25310 - pshaughn:attr_node, r=Manishearth

Attr is a Node, with consequences for many Node methods

<!-- Please describe your changes on the following line: -->
Attr is now a Node, as current WHATWG specs require. I think I did some unidiomatic things to make compareDocumentPosition work and it could use a look by someone more familiar with how to write concise Rust code. I also think the new cases in compareDocumentPosition lack tests; it is possible to compare the position of two attributes, or of an attribute and an element, and I don't think any tests are exercising that functionality.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #25124

<!-- Either: -->
- [ ] There are tests for these changes (existing cases of Node methods are well-tested, and there is a WPT test specifically for whether Attr is Node, but I'm not sure about new Node method cases)

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
bors-servo 2020-01-07 18:13:40 -05:00 committed by GitHub
commit e185423fc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 229 additions and 306 deletions

View file

@ -8,7 +8,7 @@
*/
[Exposed=Window]
interface Attr {
interface Attr : Node {
[Constant]
readonly attribute DOMString? namespaceURI;
[Constant]
@ -17,14 +17,8 @@ interface Attr {
readonly attribute DOMString localName;
[Constant]
readonly attribute DOMString name;
[Constant]
readonly attribute DOMString nodeName; // historical alias of .name
[CEReactions, Pure]
attribute DOMString value;
[CEReactions, Pure]
attribute DOMString textContent; // historical alias of .value
[CEReactions, Pure]
attribute DOMString nodeValue; // historical alias of .value
[Pure]
readonly attribute Element? ownerElement;