aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/virtualmethods.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-09-19 17:47:27 -0400
committerGitHub <noreply@github.com>2018-09-19 17:47:27 -0400
commitdf2adebefdfa3da49f173e480fa1e56450f9bda2 (patch)
tree1f05b49bac02318455a59d5b143c186fd872bdb9 /components/script/dom/virtualmethods.rs
parent2ca7a134736bb4759ff209c1bc0b6dc3cc1984c9 (diff)
parentc37a345dc9f4dda6ea29c42f96f6c7201c42cbac (diff)
downloadservo-df2adebefdfa3da49f173e480fa1e56450f9bda2.tar.gz
servo-df2adebefdfa3da49f173e480fa1e56450f9bda2.zip
Auto merge of #21737 - chansuke:format_script, r=jdm
Format script component --- <!-- 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 - [ ] These changes fix part of #21373. - [x] These changes do not require tests because they format code only. <!-- 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. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21737) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/virtualmethods.rs')
-rw-r--r--components/script/dom/virtualmethods.rs104
1 files changed, 51 insertions, 53 deletions
diff --git a/components/script/dom/virtualmethods.rs b/components/script/dom/virtualmethods.rs
index 03193415cb4..30c80c86fae 100644
--- a/components/script/dom/virtualmethods.rs
+++ b/components/script/dom/virtualmethods.rs
@@ -75,7 +75,7 @@ pub trait VirtualMethods {
fn attribute_affects_presentational_hints(&self, attr: &Attr) -> bool {
match self.super_type() {
Some(s) => s.attribute_affects_presentational_hints(attr),
- None => false
+ None => false,
}
}
@@ -128,8 +128,12 @@ pub trait VirtualMethods {
}
/// <https://dom.spec.whatwg.org/#concept-node-clone-ext>
- fn cloning_steps(&self, copy: &Node, maybe_doc: Option<&Document>,
- clone_children: CloneChildrenFlag) {
+ fn cloning_steps(
+ &self,
+ copy: &Node,
+ maybe_doc: Option<&Document>,
+ clone_children: CloneChildrenFlag,
+ ) {
if let Some(ref s) = self.super_type() {
s.cloning_steps(copy, maybe_doc, clone_children);
}
@@ -152,122 +156,116 @@ pub fn vtable_for(node: &Node) -> &VirtualMethods {
match node.type_id() {
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLAnchorElement)) => {
node.downcast::<HTMLAnchorElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLAreaElement)) => {
node.downcast::<HTMLAreaElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLBaseElement)) => {
node.downcast::<HTMLBaseElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLBodyElement)) => {
node.downcast::<HTMLBodyElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLButtonElement)) => {
node.downcast::<HTMLButtonElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLCanvasElement)) => {
node.downcast::<HTMLCanvasElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLDetailsElement)) => {
node.downcast::<HTMLDetailsElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLFieldSetElement)) => {
node.downcast::<HTMLFieldSetElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLFontElement)) => {
node.downcast::<HTMLFontElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLFormElement)) => {
node.downcast::<HTMLFormElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLHeadElement)) => {
node.downcast::<HTMLHeadElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLHRElement)) => {
node.downcast::<HTMLHRElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLImageElement)) => {
node.downcast::<HTMLImageElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLIFrameElement)) => {
node.downcast::<HTMLIFrameElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLInputElement)) => {
node.downcast::<HTMLInputElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLLabelElement)) => {
node.downcast::<HTMLLabelElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLLIElement)) => {
node.downcast::<HTMLLIElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLLinkElement)) => {
node.downcast::<HTMLLinkElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLMediaElement(_))) => {
node.downcast::<HTMLMediaElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLMetaElement)) => {
node.downcast::<HTMLMetaElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLObjectElement)) => {
node.downcast::<HTMLObjectElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLOptGroupElement)) => {
node.downcast::<HTMLOptGroupElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLOptionElement)) => {
node.downcast::<HTMLOptionElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLOutputElement)) => {
node.downcast::<HTMLOutputElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLScriptElement)) => {
node.downcast::<HTMLScriptElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLSelectElement)) => {
node.downcast::<HTMLSelectElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLSourceElement)) => {
node.downcast::<HTMLSourceElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLStyleElement)) => {
node.downcast::<HTMLStyleElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTableElement)) => {
node.downcast::<HTMLTableElement>().unwrap() as &VirtualMethods
- }
- NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTableCellElement(_))) => {
- node.downcast::<HTMLTableCellElement>().unwrap() as &VirtualMethods
- }
+ },
+ NodeTypeId::Element(ElementTypeId::HTMLElement(
+ HTMLElementTypeId::HTMLTableCellElement(_),
+ )) => node.downcast::<HTMLTableCellElement>().unwrap() as &VirtualMethods,
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTableRowElement)) => {
node.downcast::<HTMLTableRowElement>().unwrap() as &VirtualMethods
- }
- NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTableSectionElement)) => {
- node.downcast::<HTMLTableSectionElement>().unwrap() as &VirtualMethods
- }
+ },
+ NodeTypeId::Element(ElementTypeId::HTMLElement(
+ HTMLElementTypeId::HTMLTableSectionElement,
+ )) => node.downcast::<HTMLTableSectionElement>().unwrap() as &VirtualMethods,
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTemplateElement)) => {
node.downcast::<HTMLTemplateElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTextAreaElement)) => {
node.downcast::<HTMLTextAreaElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTitleElement)) => {
node.downcast::<HTMLTitleElement>().unwrap() as &VirtualMethods
- }
+ },
NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGraphicsElement(
- SVGGraphicsElementTypeId::SVGSVGElement
- ))) => {
- node.downcast::<SVGSVGElement>().unwrap() as &VirtualMethods
- }
+ SVGGraphicsElementTypeId::SVGSVGElement,
+ ))) => node.downcast::<SVGSVGElement>().unwrap() as &VirtualMethods,
NodeTypeId::Element(ElementTypeId::Element) => {
node.downcast::<Element>().unwrap() as &VirtualMethods
- }
- NodeTypeId::Element(_) => {
- node.downcast::<HTMLElement>().unwrap() as &VirtualMethods
- }
- _ => {
- node as &VirtualMethods
- }
+ },
+ NodeTypeId::Element(_) => node.downcast::<HTMLElement>().unwrap() as &VirtualMethods,
+ _ => node as &VirtualMethods,
}
}