mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Introduce TDocument::is_html_element and TDocument::quirks_mode.
This allows some code to read a bit nicer, and stop passing down quirks mode to querySelector / querySelectorAll.
This commit is contained in:
parent
bfa7cd7d9e
commit
dd5cd29a61
5 changed files with 38 additions and 26 deletions
|
@ -22,7 +22,7 @@ use properties::{AnimationRules, ComputedValues, PropertyDeclarationBlock};
|
|||
use rule_tree::CascadeLevel;
|
||||
use selector_parser::{AttrValue, PseudoClassStringArg, PseudoElement, SelectorImpl};
|
||||
use selectors::Element as SelectorsElement;
|
||||
use selectors::matching::{ElementSelectorFlags, VisitedHandlingMode};
|
||||
use selectors::matching::{ElementSelectorFlags, QuirksMode, VisitedHandlingMode};
|
||||
use selectors::sink::Push;
|
||||
use servo_arc::{Arc, ArcBorrow};
|
||||
use shared_lock::Locked;
|
||||
|
@ -140,6 +140,12 @@ pub trait TDocument : Sized + Copy + Clone {
|
|||
|
||||
/// Get this document as a `TNode`.
|
||||
fn as_node(&self) -> Self::ConcreteNode;
|
||||
|
||||
/// Returns whether this document is an HTML document.
|
||||
fn is_html_document(&self) -> bool;
|
||||
|
||||
/// Returns the quirks mode of this document.
|
||||
fn quirks_mode(&self) -> QuirksMode;
|
||||
}
|
||||
|
||||
/// The `TNode` trait. This is the main generic trait over which the style
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue