updated components/layout_thread/lib.rs (#31958)

This commit is contained in:
Ekta Siwach 2024-04-01 04:24:04 +05:30 committed by GitHub
parent 673eaa569a
commit 9401102691
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -729,11 +729,11 @@ impl LayoutThread {
) {
// Find all font-face rules and notify the font cache of them.
// 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 =
self.font_cache_thread.add_all_web_fonts_from_stylesheet(
&*stylesheet,
&guard,
stylesheet,
guard,
self.stylist.device(),
&self.font_cache_sender,
self.debug.load_webfonts_synchronously,
@ -843,7 +843,7 @@ impl LayoutThread {
.borrow()
.iter()
.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 {
browsing_context_id: *browsing_context_id,
size: *size,
@ -1108,7 +1108,7 @@ impl LayoutThread {
}
// 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;
debug!("Noting restyle for {:?}: {:?}", el, style_data);
}
@ -1567,17 +1567,17 @@ fn get_ua_stylesheets() -> Result<UserAgentStylesheets, &'static str> {
// (Does it make a difference?)
let mut user_or_user_agent_stylesheets = vec![
parse_ua_stylesheet(
&shared_lock,
shared_lock,
"user-agent.css",
&resources::read_bytes(Resource::UserAgentCSS),
)?,
parse_ua_stylesheet(
&shared_lock,
shared_lock,
"servo.css",
&resources::read_bytes(Resource::ServoCSS),
)?,
parse_ua_stylesheet(
&shared_lock,
shared_lock,
"presentational-hints.css",
&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 {
user_or_user_agent_stylesheets.push(DocumentStyleSheet(ServoArc::new(
Stylesheet::from_bytes(
&contents,
contents,
UrlExtraData(url.get_arc()),
None,
None,
@ -1601,7 +1601,7 @@ fn get_ua_stylesheets() -> Result<UserAgentStylesheets, &'static str> {
}
let quirks_mode_stylesheet = parse_ua_stylesheet(
&shared_lock,
shared_lock,
"quirks-mode.css",
&resources::read_bytes(Resource::QuirksModeCSS),
)?;
@ -1672,7 +1672,7 @@ struct RegisteredPaintersImpl(FnvHashMap<Atom, RegisteredPainterImpl>);
impl RegisteredSpeculativePainters for RegisteredPaintersImpl {
fn get(&self, name: &Atom) -> Option<&dyn RegisteredSpeculativePainter> {
self.0
.get(&name)
.get(name)
.map(|painter| painter as &dyn RegisteredSpeculativePainter)
}
}
@ -1680,7 +1680,7 @@ impl RegisteredSpeculativePainters for RegisteredPaintersImpl {
impl RegisteredPainters for RegisteredPaintersImpl {
fn get(&self, name: &Atom) -> Option<&dyn RegisteredPainter> {
self.0
.get(&name)
.get(name)
.map(|painter| painter as &dyn RegisteredPainter)
}
}