diff options
author | Ms2ger <ms2ger@gmail.com> | 2014-10-23 11:48:01 +0200 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2014-10-23 18:20:11 +0200 |
commit | d643ade7e844f33a26dbcc2a3fcb8fc126aba7d7 (patch) | |
tree | 859b34a8047e01b857e27d6fe5358ae7d3741062 /components/script/dom/document.rs | |
parent | 32bcc192b005f1e98371f6633e1b0ed0b105b5d8 (diff) | |
download | servo-d643ade7e844f33a26dbcc2a3fcb8fc126aba7d7.tar.gz servo-d643ade7e844f33a26dbcc2a3fcb8fc126aba7d7.zip |
Introduce LayoutDocumentHelpers::is_html_document_for_layout for LayoutElementHelpers::html_element_in_html_document_for_layout.
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r-- | components/script/dom/document.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 7bc0345b279..94263523bf1 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -311,6 +311,18 @@ pub enum DocumentSource { NotFromParser, } +pub trait LayoutDocumentHelpers { + unsafe fn is_html_document_for_layout(&self) -> bool; +} + +impl LayoutDocumentHelpers for JS<Document> { + #[allow(unrooted_must_root)] + #[inline] + unsafe fn is_html_document_for_layout(&self) -> bool { + (*self.unsafe_get()).is_html_document + } +} + impl Document { fn new_inherited(window: JSRef<Window>, url: Option<Url>, |