mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Fix other parts of the Servo build.
This commit is contained in:
parent
6d43bf78bc
commit
5d8545d2b4
9 changed files with 27 additions and 8 deletions
|
@ -70,7 +70,7 @@ use style::dom::{TDocument, TElement, TNode, TShadowRoot};
|
|||
use style::element_state::*;
|
||||
use style::font_metrics::ServoMetricsProvider;
|
||||
use style::properties::{ComputedValues, PropertyDeclarationBlock};
|
||||
use style::selector_parser::{AttrValue as SelectorAttrValue, NonTSPseudoClass, PseudoClassStringArg};
|
||||
use style::selector_parser::{AttrValue as SelectorAttrValue, NonTSPseudoClass, Lang};
|
||||
use style::selector_parser::{PseudoElement, SelectorImpl, extended_filtering};
|
||||
use style::shared_lock::{SharedRwLock as StyleSharedRwLock, Locked as StyleLocked};
|
||||
use style::str::is_whitespace;
|
||||
|
@ -168,7 +168,7 @@ impl<'lr> TShadowRoot for ShadowRoot<'lr> {
|
|||
match self.0 { }
|
||||
}
|
||||
|
||||
fn style_data<'a>(&self) -> &'a CascadeData
|
||||
fn style_data<'a>(&self) -> Option<&'a CascadeData>
|
||||
where
|
||||
Self: 'a,
|
||||
{
|
||||
|
@ -531,7 +531,7 @@ impl<'le> TElement for ServoLayoutElement<'le> {
|
|||
fn match_element_lang(
|
||||
&self,
|
||||
override_lang: Option<Option<SelectorAttrValue>>,
|
||||
value: &PseudoClassStringArg,
|
||||
value: &Lang,
|
||||
) -> bool {
|
||||
// Servo supports :lang() from CSS Selectors 4, which can take a comma-
|
||||
// separated list of language tags in the pseudo-class, and which
|
||||
|
|
|
@ -44,6 +44,7 @@ impl CSS {
|
|||
ParsingMode::DEFAULT,
|
||||
QuirksMode::NoQuirks,
|
||||
None,
|
||||
None,
|
||||
);
|
||||
decl.eval(&context)
|
||||
}
|
||||
|
@ -61,6 +62,7 @@ impl CSS {
|
|||
ParsingMode::DEFAULT,
|
||||
QuirksMode::NoQuirks,
|
||||
None,
|
||||
None,
|
||||
);
|
||||
cond.eval(&context)
|
||||
} else {
|
||||
|
|
|
@ -81,6 +81,7 @@ impl CSSMediaRule {
|
|||
ParsingMode::DEFAULT,
|
||||
quirks_mode,
|
||||
window.css_error_reporter(),
|
||||
None,
|
||||
);
|
||||
|
||||
let new_medialist = StyleMediaList::parse(&context, &mut input);
|
||||
|
|
|
@ -69,6 +69,7 @@ impl CSSSupportsRule {
|
|||
ParsingMode::DEFAULT,
|
||||
quirks_mode,
|
||||
None,
|
||||
None,
|
||||
);
|
||||
let enabled = cond.eval(&context);
|
||||
let mut guard = self.cssconditionrule.shared_lock().write();
|
||||
|
|
|
@ -538,12 +538,17 @@ impl HTMLImageElement {
|
|||
/// https://html.spec.whatwg.org/multipage/#matches-the-environment
|
||||
fn matches_environment(&self, media_query: String) -> bool {
|
||||
let document = document_from_node(self);
|
||||
let device = document.device();
|
||||
if !device.is_some() {
|
||||
return false;
|
||||
}
|
||||
let device = match document.device() {
|
||||
Some(device) => device,
|
||||
None => return false,
|
||||
};
|
||||
let quirks_mode = document.quirks_mode();
|
||||
let document_url = &document.url();
|
||||
// FIXME(emilio): This should do the same that we do for other media
|
||||
// lists regarding the rule type and such, though it doesn't really
|
||||
// matter right now...
|
||||
//
|
||||
// Also, ParsingMode::all() is wrong, and should be DEFAULT.
|
||||
let context = ParserContext::new(
|
||||
Origin::Author,
|
||||
document_url,
|
||||
|
@ -551,11 +556,12 @@ impl HTMLImageElement {
|
|||
ParsingMode::all(),
|
||||
quirks_mode,
|
||||
None,
|
||||
None,
|
||||
);
|
||||
let mut parserInput = ParserInput::new(&media_query);
|
||||
let mut parser = Parser::new(&mut parserInput);
|
||||
let media_list = MediaList::parse(&context, &mut parser);
|
||||
media_list.evaluate(&device.unwrap(), quirks_mode)
|
||||
media_list.evaluate(&device, quirks_mode)
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#normalise-the-source-densities>
|
||||
|
@ -1039,9 +1045,12 @@ pub fn parse_a_sizes_attribute(value: DOMString) -> SourceSizeList {
|
|||
Origin::Author,
|
||||
&url,
|
||||
Some(CssRuleType::Style),
|
||||
// FIXME(emilio): why ::empty() instead of ::DEFAULT? Also, what do
|
||||
// browsers do regarding quirks-mode in a media list?
|
||||
ParsingMode::empty(),
|
||||
QuirksMode::NoQuirks,
|
||||
None,
|
||||
None,
|
||||
);
|
||||
SourceSizeList::parse(&context, &mut parser)
|
||||
}
|
||||
|
|
|
@ -287,6 +287,7 @@ impl HTMLLinkElement {
|
|||
ParsingMode::DEFAULT,
|
||||
document.quirks_mode(),
|
||||
window.css_error_reporter(),
|
||||
None,
|
||||
);
|
||||
let media = MediaList::parse(&context, &mut css_parser);
|
||||
|
||||
|
|
|
@ -91,6 +91,7 @@ impl HTMLStyleElement {
|
|||
ParsingMode::DEFAULT,
|
||||
doc.quirks_mode(),
|
||||
css_error_reporter,
|
||||
None,
|
||||
);
|
||||
let shared_lock = node.owner_doc().style_shared_lock().clone();
|
||||
let mut input = ParserInput::new(&mq_str);
|
||||
|
|
|
@ -83,6 +83,7 @@ impl MediaListMethods for MediaList {
|
|||
ParsingMode::DEFAULT,
|
||||
quirks_mode,
|
||||
window.css_error_reporter(),
|
||||
None,
|
||||
);
|
||||
*media_queries = StyleMediaList::parse(&context, &mut parser);
|
||||
}
|
||||
|
@ -123,6 +124,7 @@ impl MediaListMethods for MediaList {
|
|||
ParsingMode::DEFAULT,
|
||||
quirks_mode,
|
||||
win.css_error_reporter(),
|
||||
None,
|
||||
);
|
||||
let m = MediaQuery::parse(&context, &mut parser);
|
||||
// Step 2
|
||||
|
@ -156,6 +158,7 @@ impl MediaListMethods for MediaList {
|
|||
ParsingMode::DEFAULT,
|
||||
quirks_mode,
|
||||
win.css_error_reporter(),
|
||||
None,
|
||||
);
|
||||
let m = MediaQuery::parse(&context, &mut parser);
|
||||
// Step 2
|
||||
|
|
|
@ -1089,6 +1089,7 @@ impl WindowMethods for Window {
|
|||
ParsingMode::DEFAULT,
|
||||
quirks_mode,
|
||||
self.css_error_reporter(),
|
||||
None,
|
||||
);
|
||||
let media_query_list =
|
||||
media_queries::MediaList::parse(&context, &mut parser);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue