mirror of
https://github.com/servo/servo.git
synced 2025-06-08 00:23:30 +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::element_state::*;
|
||||||
use style::font_metrics::ServoMetricsProvider;
|
use style::font_metrics::ServoMetricsProvider;
|
||||||
use style::properties::{ComputedValues, PropertyDeclarationBlock};
|
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::selector_parser::{PseudoElement, SelectorImpl, extended_filtering};
|
||||||
use style::shared_lock::{SharedRwLock as StyleSharedRwLock, Locked as StyleLocked};
|
use style::shared_lock::{SharedRwLock as StyleSharedRwLock, Locked as StyleLocked};
|
||||||
use style::str::is_whitespace;
|
use style::str::is_whitespace;
|
||||||
|
@ -168,7 +168,7 @@ impl<'lr> TShadowRoot for ShadowRoot<'lr> {
|
||||||
match self.0 { }
|
match self.0 { }
|
||||||
}
|
}
|
||||||
|
|
||||||
fn style_data<'a>(&self) -> &'a CascadeData
|
fn style_data<'a>(&self) -> Option<&'a CascadeData>
|
||||||
where
|
where
|
||||||
Self: 'a,
|
Self: 'a,
|
||||||
{
|
{
|
||||||
|
@ -531,7 +531,7 @@ impl<'le> TElement for ServoLayoutElement<'le> {
|
||||||
fn match_element_lang(
|
fn match_element_lang(
|
||||||
&self,
|
&self,
|
||||||
override_lang: Option<Option<SelectorAttrValue>>,
|
override_lang: Option<Option<SelectorAttrValue>>,
|
||||||
value: &PseudoClassStringArg,
|
value: &Lang,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
// Servo supports :lang() from CSS Selectors 4, which can take a comma-
|
// Servo supports :lang() from CSS Selectors 4, which can take a comma-
|
||||||
// separated list of language tags in the pseudo-class, and which
|
// separated list of language tags in the pseudo-class, and which
|
||||||
|
|
|
@ -44,6 +44,7 @@ impl CSS {
|
||||||
ParsingMode::DEFAULT,
|
ParsingMode::DEFAULT,
|
||||||
QuirksMode::NoQuirks,
|
QuirksMode::NoQuirks,
|
||||||
None,
|
None,
|
||||||
|
None,
|
||||||
);
|
);
|
||||||
decl.eval(&context)
|
decl.eval(&context)
|
||||||
}
|
}
|
||||||
|
@ -61,6 +62,7 @@ impl CSS {
|
||||||
ParsingMode::DEFAULT,
|
ParsingMode::DEFAULT,
|
||||||
QuirksMode::NoQuirks,
|
QuirksMode::NoQuirks,
|
||||||
None,
|
None,
|
||||||
|
None,
|
||||||
);
|
);
|
||||||
cond.eval(&context)
|
cond.eval(&context)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -81,6 +81,7 @@ impl CSSMediaRule {
|
||||||
ParsingMode::DEFAULT,
|
ParsingMode::DEFAULT,
|
||||||
quirks_mode,
|
quirks_mode,
|
||||||
window.css_error_reporter(),
|
window.css_error_reporter(),
|
||||||
|
None,
|
||||||
);
|
);
|
||||||
|
|
||||||
let new_medialist = StyleMediaList::parse(&context, &mut input);
|
let new_medialist = StyleMediaList::parse(&context, &mut input);
|
||||||
|
|
|
@ -69,6 +69,7 @@ impl CSSSupportsRule {
|
||||||
ParsingMode::DEFAULT,
|
ParsingMode::DEFAULT,
|
||||||
quirks_mode,
|
quirks_mode,
|
||||||
None,
|
None,
|
||||||
|
None,
|
||||||
);
|
);
|
||||||
let enabled = cond.eval(&context);
|
let enabled = cond.eval(&context);
|
||||||
let mut guard = self.cssconditionrule.shared_lock().write();
|
let mut guard = self.cssconditionrule.shared_lock().write();
|
||||||
|
|
|
@ -538,12 +538,17 @@ impl HTMLImageElement {
|
||||||
/// https://html.spec.whatwg.org/multipage/#matches-the-environment
|
/// https://html.spec.whatwg.org/multipage/#matches-the-environment
|
||||||
fn matches_environment(&self, media_query: String) -> bool {
|
fn matches_environment(&self, media_query: String) -> bool {
|
||||||
let document = document_from_node(self);
|
let document = document_from_node(self);
|
||||||
let device = document.device();
|
let device = match document.device() {
|
||||||
if !device.is_some() {
|
Some(device) => device,
|
||||||
return false;
|
None => return false,
|
||||||
}
|
};
|
||||||
let quirks_mode = document.quirks_mode();
|
let quirks_mode = document.quirks_mode();
|
||||||
let document_url = &document.url();
|
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(
|
let context = ParserContext::new(
|
||||||
Origin::Author,
|
Origin::Author,
|
||||||
document_url,
|
document_url,
|
||||||
|
@ -551,11 +556,12 @@ impl HTMLImageElement {
|
||||||
ParsingMode::all(),
|
ParsingMode::all(),
|
||||||
quirks_mode,
|
quirks_mode,
|
||||||
None,
|
None,
|
||||||
|
None,
|
||||||
);
|
);
|
||||||
let mut parserInput = ParserInput::new(&media_query);
|
let mut parserInput = ParserInput::new(&media_query);
|
||||||
let mut parser = Parser::new(&mut parserInput);
|
let mut parser = Parser::new(&mut parserInput);
|
||||||
let media_list = MediaList::parse(&context, &mut parser);
|
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>
|
/// <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,
|
Origin::Author,
|
||||||
&url,
|
&url,
|
||||||
Some(CssRuleType::Style),
|
Some(CssRuleType::Style),
|
||||||
|
// FIXME(emilio): why ::empty() instead of ::DEFAULT? Also, what do
|
||||||
|
// browsers do regarding quirks-mode in a media list?
|
||||||
ParsingMode::empty(),
|
ParsingMode::empty(),
|
||||||
QuirksMode::NoQuirks,
|
QuirksMode::NoQuirks,
|
||||||
None,
|
None,
|
||||||
|
None,
|
||||||
);
|
);
|
||||||
SourceSizeList::parse(&context, &mut parser)
|
SourceSizeList::parse(&context, &mut parser)
|
||||||
}
|
}
|
||||||
|
|
|
@ -287,6 +287,7 @@ impl HTMLLinkElement {
|
||||||
ParsingMode::DEFAULT,
|
ParsingMode::DEFAULT,
|
||||||
document.quirks_mode(),
|
document.quirks_mode(),
|
||||||
window.css_error_reporter(),
|
window.css_error_reporter(),
|
||||||
|
None,
|
||||||
);
|
);
|
||||||
let media = MediaList::parse(&context, &mut css_parser);
|
let media = MediaList::parse(&context, &mut css_parser);
|
||||||
|
|
||||||
|
|
|
@ -91,6 +91,7 @@ impl HTMLStyleElement {
|
||||||
ParsingMode::DEFAULT,
|
ParsingMode::DEFAULT,
|
||||||
doc.quirks_mode(),
|
doc.quirks_mode(),
|
||||||
css_error_reporter,
|
css_error_reporter,
|
||||||
|
None,
|
||||||
);
|
);
|
||||||
let shared_lock = node.owner_doc().style_shared_lock().clone();
|
let shared_lock = node.owner_doc().style_shared_lock().clone();
|
||||||
let mut input = ParserInput::new(&mq_str);
|
let mut input = ParserInput::new(&mq_str);
|
||||||
|
|
|
@ -83,6 +83,7 @@ impl MediaListMethods for MediaList {
|
||||||
ParsingMode::DEFAULT,
|
ParsingMode::DEFAULT,
|
||||||
quirks_mode,
|
quirks_mode,
|
||||||
window.css_error_reporter(),
|
window.css_error_reporter(),
|
||||||
|
None,
|
||||||
);
|
);
|
||||||
*media_queries = StyleMediaList::parse(&context, &mut parser);
|
*media_queries = StyleMediaList::parse(&context, &mut parser);
|
||||||
}
|
}
|
||||||
|
@ -123,6 +124,7 @@ impl MediaListMethods for MediaList {
|
||||||
ParsingMode::DEFAULT,
|
ParsingMode::DEFAULT,
|
||||||
quirks_mode,
|
quirks_mode,
|
||||||
win.css_error_reporter(),
|
win.css_error_reporter(),
|
||||||
|
None,
|
||||||
);
|
);
|
||||||
let m = MediaQuery::parse(&context, &mut parser);
|
let m = MediaQuery::parse(&context, &mut parser);
|
||||||
// Step 2
|
// Step 2
|
||||||
|
@ -156,6 +158,7 @@ impl MediaListMethods for MediaList {
|
||||||
ParsingMode::DEFAULT,
|
ParsingMode::DEFAULT,
|
||||||
quirks_mode,
|
quirks_mode,
|
||||||
win.css_error_reporter(),
|
win.css_error_reporter(),
|
||||||
|
None,
|
||||||
);
|
);
|
||||||
let m = MediaQuery::parse(&context, &mut parser);
|
let m = MediaQuery::parse(&context, &mut parser);
|
||||||
// Step 2
|
// Step 2
|
||||||
|
|
|
@ -1089,6 +1089,7 @@ impl WindowMethods for Window {
|
||||||
ParsingMode::DEFAULT,
|
ParsingMode::DEFAULT,
|
||||||
quirks_mode,
|
quirks_mode,
|
||||||
self.css_error_reporter(),
|
self.css_error_reporter(),
|
||||||
|
None,
|
||||||
);
|
);
|
||||||
let media_query_list =
|
let media_query_list =
|
||||||
media_queries::MediaList::parse(&context, &mut parser);
|
media_queries::MediaList::parse(&context, &mut parser);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue