Auto merge of #25222 - pshaughn:node_isconnected, r=jdm

adding .isConnected DOM attribute

<!-- Please describe your changes on the following line: -->
is_connected already existed for this concept and just needed to be hooked up to an IDL attribute.

---
<!-- 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 #25126

<!-- Either: -->
- [X] There are tests for these changes OR

<!-- 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 2019-12-11 15:04:45 -05:00 committed by GitHub
commit e10cf7adad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 42 deletions

View file

@ -2296,6 +2296,11 @@ impl NodeMethods for Node {
USVString(String::from(self.owner_doc().base_url().as_str()))
}
// https://dom.spec.whatwg.org/#dom-node-isconnected
fn IsConnected(&self) -> bool {
return self.is_connected();
}
// https://dom.spec.whatwg.org/#dom-node-ownerdocument
fn GetOwnerDocument(&self) -> Option<DomRoot<Document>> {
match self.type_id() {

View file

@ -28,6 +28,9 @@ interface Node : EventTarget {
[Pure]
readonly attribute USVString baseURI;
[Pure]
readonly attribute boolean isConnected;
[Pure]
readonly attribute Document? ownerDocument;