diff options
author | Matt Brubeck <mbrubeck@limpet.net> | 2014-04-14 11:12:00 -0700 |
---|---|---|
committer | Matt Brubeck <mbrubeck@limpet.net> | 2014-04-14 13:39:11 -0700 |
commit | 28a013cfc57e406eabf54ea8f02c37aa55d5494b (patch) | |
tree | 0a1f20ae77ae9b42fe9e8206eeb855158ce0ba15 /src/components/script/dom/htmlstyleelement.rs | |
parent | 18b5453e09e1f67653888a81578325bab7472717 (diff) | |
download | servo-28a013cfc57e406eabf54ea8f02c37aa55d5494b.tar.gz servo-28a013cfc57e406eabf54ea8f02c37aa55d5494b.zip |
Move child_inserted into VirtualMethods.
Follow-up from #1984.
Diffstat (limited to 'src/components/script/dom/htmlstyleelement.rs')
-rw-r--r-- | src/components/script/dom/htmlstyleelement.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/components/script/dom/htmlstyleelement.rs b/src/components/script/dom/htmlstyleelement.rs index 6596eaec932..ed335dd70eb 100644 --- a/src/components/script/dom/htmlstyleelement.rs +++ b/src/components/script/dom/htmlstyleelement.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::HTMLStyleElementBinding; -use dom::bindings::codegen::InheritTypes::{HTMLStyleElementDerived, NodeCast}; +use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLStyleElementDerived, NodeCast}; use dom::bindings::js::JS; use dom::bindings::error::ErrorResult; use dom::document::Document; @@ -11,6 +11,7 @@ use dom::element::HTMLStyleElementTypeId; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::htmlelement::HTMLElement; use dom::node::{Node, ElementNodeTypeId, window_from_node}; +use dom::virtualmethods::VirtualMethods; use html::cssparse::parse_inline_css; use layout_interface::{AddStylesheetMsg, LayoutChan}; use servo_util::str::DOMString; @@ -91,3 +92,18 @@ impl StyleElementHelpers for JS<HTMLStyleElement> { layout_chan.send(AddStylesheetMsg(sheet)); } } + +impl VirtualMethods for JS<HTMLStyleElement> { + fn super_type(&self) -> Option<~VirtualMethods:> { + let htmlelement: JS<HTMLElement> = HTMLElementCast::from(self); + Some(~htmlelement as ~VirtualMethods:) + } + + fn child_inserted(&mut self, child: &JS<Node>) { + match self.super_type() { + Some(ref mut s) => s.child_inserted(child), + _ => (), + } + self.parse_own_css(); + } +} |