mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Remove/don’t call no-op compute_font_hash method for stylo.
This removes a potentially-costly Arc::mut call.
This commit is contained in:
parent
4ad844f7bd
commit
e0c63efe01
3 changed files with 9 additions and 11 deletions
|
@ -1247,9 +1247,6 @@ fn static_assert() {
|
||||||
unsafe { transmute(self.gecko.mFont.weight) }
|
unsafe { transmute(self.gecko.mFont.weight) }
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is used for PartialEq, which we don't implement for gecko style structs.
|
|
||||||
pub fn compute_font_hash(&mut self) {}
|
|
||||||
|
|
||||||
pub fn set_font_synthesis(&mut self, v: longhands::font_synthesis::computed_value::T) {
|
pub fn set_font_synthesis(&mut self, v: longhands::font_synthesis::computed_value::T) {
|
||||||
use gecko_bindings::structs::{NS_FONT_SYNTHESIS_WEIGHT, NS_FONT_SYNTHESIS_STYLE};
|
use gecko_bindings::structs::{NS_FONT_SYNTHESIS_WEIGHT, NS_FONT_SYNTHESIS_STYLE};
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,7 @@
|
||||||
<% from data import Method %>
|
<% from data import Method %>
|
||||||
|
|
||||||
<% data.new_style_struct("Font",
|
<% data.new_style_struct("Font",
|
||||||
inherited=True,
|
inherited=True) %>
|
||||||
additional_methods=[Method("compute_font_hash", is_mut=True)]) %>
|
|
||||||
<%helpers:longhand name="font-family" animatable="False" need_index="True"
|
<%helpers:longhand name="font-family" animatable="False" need_index="True"
|
||||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-family">
|
spec="https://drafts.csswg.org/css-fonts/#propdef-font-family">
|
||||||
use self::computed_value::{FontFamily, FamilyName};
|
use self::computed_value::{FontFamily, FamilyName};
|
||||||
|
|
|
@ -2044,12 +2044,14 @@ pub fn apply_declarations<'a, F, I>(viewport_size: Size2D<Au>,
|
||||||
style.set_root_font_size(s);
|
style.set_root_font_size(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
% if product == "servo":
|
||||||
if seen.contains(LonghandId::FontStyle) ||
|
if seen.contains(LonghandId::FontStyle) ||
|
||||||
seen.contains(LonghandId::FontWeight) ||
|
seen.contains(LonghandId::FontWeight) ||
|
||||||
seen.contains(LonghandId::FontStretch) ||
|
seen.contains(LonghandId::FontStretch) ||
|
||||||
seen.contains(LonghandId::FontFamily) {
|
seen.contains(LonghandId::FontFamily) {
|
||||||
style.mutate_font().compute_font_hash();
|
style.mutate_font().compute_font_hash();
|
||||||
}
|
}
|
||||||
|
% endif
|
||||||
|
|
||||||
style
|
style
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue