mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
updated components/layout_thread/lib.rs (#31958)
This commit is contained in:
parent
673eaa569a
commit
9401102691
1 changed files with 12 additions and 12 deletions
|
@ -729,11 +729,11 @@ impl LayoutThread {
|
||||||
) {
|
) {
|
||||||
// Find all font-face rules and notify the font cache of them.
|
// Find all font-face rules and notify the font cache of them.
|
||||||
// GWTODO: Need to handle unloading web fonts.
|
// GWTODO: Need to handle unloading web fonts.
|
||||||
if stylesheet.is_effective_for_device(self.stylist.device(), &guard) {
|
if stylesheet.is_effective_for_device(self.stylist.device(), guard) {
|
||||||
let newly_loading_font_count =
|
let newly_loading_font_count =
|
||||||
self.font_cache_thread.add_all_web_fonts_from_stylesheet(
|
self.font_cache_thread.add_all_web_fonts_from_stylesheet(
|
||||||
&*stylesheet,
|
stylesheet,
|
||||||
&guard,
|
guard,
|
||||||
self.stylist.device(),
|
self.stylist.device(),
|
||||||
&self.font_cache_sender,
|
&self.font_cache_sender,
|
||||||
self.debug.load_webfonts_synchronously,
|
self.debug.load_webfonts_synchronously,
|
||||||
|
@ -843,7 +843,7 @@ impl LayoutThread {
|
||||||
.borrow()
|
.borrow()
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|(browsing_context_id, size)| {
|
.filter_map(|(browsing_context_id, size)| {
|
||||||
match old_iframe_sizes.get(&browsing_context_id) {
|
match old_iframe_sizes.get(browsing_context_id) {
|
||||||
Some(old_size) if old_size != size => Some(IFrameSizeMsg {
|
Some(old_size) if old_size != size => Some(IFrameSizeMsg {
|
||||||
browsing_context_id: *browsing_context_id,
|
browsing_context_id: *browsing_context_id,
|
||||||
size: *size,
|
size: *size,
|
||||||
|
@ -1108,7 +1108,7 @@ impl LayoutThread {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stash the data on the element for processing by the style system.
|
// Stash the data on the element for processing by the style system.
|
||||||
style_data.hint.insert(restyle.hint.into());
|
style_data.hint.insert(restyle.hint);
|
||||||
style_data.damage = restyle.damage;
|
style_data.damage = restyle.damage;
|
||||||
debug!("Noting restyle for {:?}: {:?}", el, style_data);
|
debug!("Noting restyle for {:?}: {:?}", el, style_data);
|
||||||
}
|
}
|
||||||
|
@ -1567,17 +1567,17 @@ fn get_ua_stylesheets() -> Result<UserAgentStylesheets, &'static str> {
|
||||||
// (Does it make a difference?)
|
// (Does it make a difference?)
|
||||||
let mut user_or_user_agent_stylesheets = vec![
|
let mut user_or_user_agent_stylesheets = vec![
|
||||||
parse_ua_stylesheet(
|
parse_ua_stylesheet(
|
||||||
&shared_lock,
|
shared_lock,
|
||||||
"user-agent.css",
|
"user-agent.css",
|
||||||
&resources::read_bytes(Resource::UserAgentCSS),
|
&resources::read_bytes(Resource::UserAgentCSS),
|
||||||
)?,
|
)?,
|
||||||
parse_ua_stylesheet(
|
parse_ua_stylesheet(
|
||||||
&shared_lock,
|
shared_lock,
|
||||||
"servo.css",
|
"servo.css",
|
||||||
&resources::read_bytes(Resource::ServoCSS),
|
&resources::read_bytes(Resource::ServoCSS),
|
||||||
)?,
|
)?,
|
||||||
parse_ua_stylesheet(
|
parse_ua_stylesheet(
|
||||||
&shared_lock,
|
shared_lock,
|
||||||
"presentational-hints.css",
|
"presentational-hints.css",
|
||||||
&resources::read_bytes(Resource::PresentationalHintsCSS),
|
&resources::read_bytes(Resource::PresentationalHintsCSS),
|
||||||
)?,
|
)?,
|
||||||
|
@ -1586,7 +1586,7 @@ fn get_ua_stylesheets() -> Result<UserAgentStylesheets, &'static str> {
|
||||||
for &(ref contents, ref url) in &opts::get().user_stylesheets {
|
for &(ref contents, ref url) in &opts::get().user_stylesheets {
|
||||||
user_or_user_agent_stylesheets.push(DocumentStyleSheet(ServoArc::new(
|
user_or_user_agent_stylesheets.push(DocumentStyleSheet(ServoArc::new(
|
||||||
Stylesheet::from_bytes(
|
Stylesheet::from_bytes(
|
||||||
&contents,
|
contents,
|
||||||
UrlExtraData(url.get_arc()),
|
UrlExtraData(url.get_arc()),
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
|
@ -1601,7 +1601,7 @@ fn get_ua_stylesheets() -> Result<UserAgentStylesheets, &'static str> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let quirks_mode_stylesheet = parse_ua_stylesheet(
|
let quirks_mode_stylesheet = parse_ua_stylesheet(
|
||||||
&shared_lock,
|
shared_lock,
|
||||||
"quirks-mode.css",
|
"quirks-mode.css",
|
||||||
&resources::read_bytes(Resource::QuirksModeCSS),
|
&resources::read_bytes(Resource::QuirksModeCSS),
|
||||||
)?;
|
)?;
|
||||||
|
@ -1672,7 +1672,7 @@ struct RegisteredPaintersImpl(FnvHashMap<Atom, RegisteredPainterImpl>);
|
||||||
impl RegisteredSpeculativePainters for RegisteredPaintersImpl {
|
impl RegisteredSpeculativePainters for RegisteredPaintersImpl {
|
||||||
fn get(&self, name: &Atom) -> Option<&dyn RegisteredSpeculativePainter> {
|
fn get(&self, name: &Atom) -> Option<&dyn RegisteredSpeculativePainter> {
|
||||||
self.0
|
self.0
|
||||||
.get(&name)
|
.get(name)
|
||||||
.map(|painter| painter as &dyn RegisteredSpeculativePainter)
|
.map(|painter| painter as &dyn RegisteredSpeculativePainter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1680,7 +1680,7 @@ impl RegisteredSpeculativePainters for RegisteredPaintersImpl {
|
||||||
impl RegisteredPainters for RegisteredPaintersImpl {
|
impl RegisteredPainters for RegisteredPaintersImpl {
|
||||||
fn get(&self, name: &Atom) -> Option<&dyn RegisteredPainter> {
|
fn get(&self, name: &Atom) -> Option<&dyn RegisteredPainter> {
|
||||||
self.0
|
self.0
|
||||||
.get(&name)
|
.get(name)
|
||||||
.map(|painter| painter as &dyn RegisteredPainter)
|
.map(|painter| painter as &dyn RegisteredPainter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue