mirror of
https://github.com/servo/servo.git
synced 2025-09-30 16:49:16 +01:00
script: Move HTML DOM interfaces to script/dom/html/
(#39046)
See #38901. Testing: Refactor Fixes: Partially #38901 Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This commit is contained in:
parent
ec1b9b2480
commit
c92cd9e624
142 changed files with 546 additions and 533 deletions
36
components/script/dom/html/htmldocument.rs
Normal file
36
components/script/dom/html/htmldocument.rs
Normal file
|
@ -0,0 +1,36 @@
|
|||
/* 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 https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom_struct::dom_struct;
|
||||
use script_bindings::codegen::GenericBindings::DocumentBinding::DocumentMethods;
|
||||
use script_bindings::codegen::GenericBindings::HTMLDocumentBinding::HTMLDocumentMethods;
|
||||
use script_bindings::root::DomRoot;
|
||||
use script_bindings::script_runtime::CanGc;
|
||||
use script_bindings::str::DOMString;
|
||||
|
||||
use crate::dom::bindings::codegen::Bindings::DocumentBinding::NamedPropertyValue;
|
||||
use crate::dom::types::{Document, Location};
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#htmldocument>
|
||||
#[dom_struct]
|
||||
pub(crate) struct HTMLDocument {
|
||||
document: Document,
|
||||
}
|
||||
|
||||
impl HTMLDocumentMethods<crate::DomTypeHolder> for HTMLDocument {
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-document-location>
|
||||
fn GetLocation(&self) -> Option<DomRoot<Location>> {
|
||||
self.document.GetLocation()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-tree-accessors:supported-property-names>
|
||||
fn SupportedPropertyNames(&self) -> Vec<DOMString> {
|
||||
self.document.SupportedPropertyNames()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-tree-accessors:dom-document-nameditem-filter>
|
||||
fn NamedGetter(&self, name: DOMString, can_gc: CanGc) -> Option<NamedPropertyValue> {
|
||||
self.document.NamedGetter(name, can_gc)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue