diff options
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/element.rs | 21 | ||||
-rw-r--r-- | components/script/dom/webidls/ActivatableElement.webidl | 15 | ||||
-rw-r--r-- | components/script/dom/webidls/Element.webidl | 1 |
3 files changed, 37 insertions, 0 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index f85f608545f..838da981524 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -2087,6 +2087,27 @@ impl ElementMethods for Element { // Step 4. self.insert_adjacent(position, fragment.upcast()).map(|_| ()) } + + // check-tidy: no specs after this line + fn EnterFormalActivationState(&self) -> ErrorResult { + match self.as_maybe_activatable() { + Some(a) => { + a.enter_formal_activation_state(); + return Ok(()); + }, + None => return Err(Error::NotSupported) + } + } + + fn ExitFormalActivationState(&self) -> ErrorResult { + match self.as_maybe_activatable() { + Some(a) => { + a.exit_formal_activation_state(); + return Ok(()); + }, + None => return Err(Error::NotSupported) + } + } } pub fn fragment_affecting_attributes() -> [Atom; 3] { diff --git a/components/script/dom/webidls/ActivatableElement.webidl b/components/script/dom/webidls/ActivatableElement.webidl new file mode 100644 index 00000000000..2b69baff303 --- /dev/null +++ b/components/script/dom/webidls/ActivatableElement.webidl @@ -0,0 +1,15 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// Interface for testing element activation +// This interface is entirely internal to Servo, and should not be accessible to +// web pages. +[Exposed=(Window,Worker), NoInterfaceObject] +interface ActivatableElement { + [Throws, Pref="dom.testing.element.activation.enabled"] + void enterFormalActivationState(); + + [Throws, Pref="dom.testing.element.activation.enabled"] + void exitFormalActivationState(); +}; diff --git a/components/script/dom/webidls/Element.webidl b/components/script/dom/webidls/Element.webidl index b0ba81d1816..295d76cd1f4 100644 --- a/components/script/dom/webidls/Element.webidl +++ b/components/script/dom/webidls/Element.webidl @@ -122,3 +122,4 @@ partial interface Element { Element implements ChildNode; Element implements NonDocumentTypeChildNode; Element implements ParentNode; +Element implements ActivatableElement; |