aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-12-11 15:04:45 -0500
committerGitHub <noreply@github.com>2019-12-11 15:04:45 -0500
commite10cf7adad91a4740a5ba859f4fc33ee59423908 (patch)
treee1c35745b3b919811248dc49826260830af4d067 /components/script
parentfc97a53a9413b1b72c8eb25f9a38a26bdd5beefe (diff)
parent0231a0a7124475cbdfac3551312b726d14a5d897 (diff)
downloadservo-e10cf7adad91a4740a5ba859f4fc33ee59423908.tar.gz
servo-e10cf7adad91a4740a5ba859f4fc33ee59423908.zip
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. -->
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/node.rs5
-rw-r--r--components/script/dom/webidls/Node.webidl3
2 files changed, 8 insertions, 0 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index 4885d87c64b..8ee51283146 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -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() {
diff --git a/components/script/dom/webidls/Node.webidl b/components/script/dom/webidls/Node.webidl
index 6879518b017..c8a71dbebb7 100644
--- a/components/script/dom/webidls/Node.webidl
+++ b/components/script/dom/webidls/Node.webidl
@@ -29,6 +29,9 @@ interface Node : EventTarget {
readonly attribute USVString baseURI;
[Pure]
+ readonly attribute boolean isConnected;
+
+ [Pure]
readonly attribute Document? ownerDocument;
[Pure]