зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 01348a3860f7 for build bustage
CLOSED TREE
This commit is contained in:
Родитель
2a5e786286
Коммит
60fa5e095c
|
@ -66,7 +66,6 @@ use gecko_bindings::structs::StyleBasicShape;
|
||||||
use gecko_bindings::structs::StyleBasicShapeType;
|
use gecko_bindings::structs::StyleBasicShapeType;
|
||||||
use gecko_bindings::structs::StyleShapeSource;
|
use gecko_bindings::structs::StyleShapeSource;
|
||||||
use gecko_bindings::structs::StyleTransition;
|
use gecko_bindings::structs::StyleTransition;
|
||||||
use gecko_bindings::structs::gfxFontFeatureValueSet;
|
|
||||||
use gecko_bindings::structs::nsBorderColors;
|
use gecko_bindings::structs::nsBorderColors;
|
||||||
use gecko_bindings::structs::nsCSSCounterStyleRule;
|
use gecko_bindings::structs::nsCSSCounterStyleRule;
|
||||||
use gecko_bindings::structs::nsCSSFontFaceRule;
|
use gecko_bindings::structs::nsCSSFontFaceRule;
|
||||||
|
@ -240,7 +239,6 @@ unsafe impl Send for nsStyleTransformMatrix::MatrixTransformOperator {}
|
||||||
unsafe impl Sync for nsStyleTransformMatrix::MatrixTransformOperator {}
|
unsafe impl Sync for nsStyleTransformMatrix::MatrixTransformOperator {}
|
||||||
use gecko_bindings::structs::RawGeckoGfxMatrix4x4;
|
use gecko_bindings::structs::RawGeckoGfxMatrix4x4;
|
||||||
pub type nsTArrayBorrowed_uintptr_t<'a> = &'a mut ::gecko_bindings::structs::nsTArray<usize>;
|
pub type nsTArrayBorrowed_uintptr_t<'a> = &'a mut ::gecko_bindings::structs::nsTArray<usize>;
|
||||||
pub type nsTArrayBorrowed_uint32_t<'a> = &'a mut ::gecko_bindings::structs::nsTArray<u32>;
|
|
||||||
pub type RawServoStyleSetOwned = ::gecko_bindings::sugar::ownership::Owned<RawServoStyleSet>;
|
pub type RawServoStyleSetOwned = ::gecko_bindings::sugar::ownership::Owned<RawServoStyleSet>;
|
||||||
pub type RawServoStyleSetOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<RawServoStyleSet>;
|
pub type RawServoStyleSetOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<RawServoStyleSet>;
|
||||||
pub type RawServoStyleSetBorrowed<'a> = &'a RawServoStyleSet;
|
pub type RawServoStyleSetBorrowed<'a> = &'a RawServoStyleSet;
|
||||||
|
@ -912,22 +910,6 @@ extern "C" {
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Gecko_nsFont_Destroy(dst: *mut nsFont);
|
pub fn Gecko_nsFont_Destroy(dst: *mut nsFont);
|
||||||
}
|
}
|
||||||
extern "C" {
|
|
||||||
pub fn Gecko_AppendFeatureValueHashEntry(value_set:
|
|
||||||
*mut gfxFontFeatureValueSet,
|
|
||||||
family: *mut nsIAtom,
|
|
||||||
alternate: u32,
|
|
||||||
name: *mut nsIAtom)
|
|
||||||
-> nsTArrayBorrowed_uint32_t;
|
|
||||||
}
|
|
||||||
extern "C" {
|
|
||||||
pub fn Gecko_nsFont_SetFontFeatureValuesLookup(font: *mut nsFont,
|
|
||||||
pres_context:
|
|
||||||
*const RawGeckoPresContext);
|
|
||||||
}
|
|
||||||
extern "C" {
|
|
||||||
pub fn Gecko_nsFont_ResetFontFeatureValuesLookup(font: *mut nsFont);
|
|
||||||
}
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Gecko_ClearAlternateValues(font: *mut nsFont, length: usize);
|
pub fn Gecko_ClearAlternateValues(font: *mut nsFont, length: usize);
|
||||||
}
|
}
|
||||||
|
@ -2052,13 +2034,6 @@ extern "C" {
|
||||||
name: *mut nsIAtom)
|
name: *mut nsIAtom)
|
||||||
-> *mut nsCSSCounterStyleRule;
|
-> *mut nsCSSCounterStyleRule;
|
||||||
}
|
}
|
||||||
extern "C" {
|
|
||||||
pub fn Servo_StyleSet_BuildFontFeatureValueSet(set:
|
|
||||||
RawServoStyleSetBorrowed,
|
|
||||||
list:
|
|
||||||
*mut gfxFontFeatureValueSet)
|
|
||||||
-> bool;
|
|
||||||
}
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Servo_StyleSet_ResolveForDeclarations(set:
|
pub fn Servo_StyleSet_ResolveForDeclarations(set:
|
||||||
RawServoStyleSetBorrowed,
|
RawServoStyleSetBorrowed,
|
||||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -2513,12 +2513,8 @@ fn static_assert() {
|
||||||
|
|
||||||
<% impl_simple_type_with_conversion("font_language_override", "mFont.languageOverride") %>
|
<% impl_simple_type_with_conversion("font_language_override", "mFont.languageOverride") %>
|
||||||
|
|
||||||
pub fn set_font_variant_alternates(&mut self,
|
pub fn set_font_variant_alternates(&mut self, v: longhands::font_variant_alternates::computed_value::T) {
|
||||||
v: longhands::font_variant_alternates::computed_value::T,
|
|
||||||
device: &Device) {
|
|
||||||
use gecko_bindings::bindings::{Gecko_ClearAlternateValues, Gecko_AppendAlternateValues};
|
use gecko_bindings::bindings::{Gecko_ClearAlternateValues, Gecko_AppendAlternateValues};
|
||||||
use gecko_bindings::bindings::Gecko_nsFont_ResetFontFeatureValuesLookup;
|
|
||||||
use gecko_bindings::bindings::Gecko_nsFont_SetFontFeatureValuesLookup;
|
|
||||||
% for value in "normal swash stylistic ornaments annotation styleset character_variant historical".split():
|
% for value in "normal swash stylistic ornaments annotation styleset character_variant historical".split():
|
||||||
use gecko_bindings::structs::NS_FONT_VARIANT_ALTERNATES_${value.upper()};
|
use gecko_bindings::structs::NS_FONT_VARIANT_ALTERNATES_${value.upper()};
|
||||||
% endfor
|
% endfor
|
||||||
|
@ -2530,8 +2526,6 @@ fn static_assert() {
|
||||||
|
|
||||||
if v.0.is_empty() {
|
if v.0.is_empty() {
|
||||||
self.gecko.mFont.variantAlternates = NS_FONT_VARIANT_ALTERNATES_NORMAL as u16;
|
self.gecko.mFont.variantAlternates = NS_FONT_VARIANT_ALTERNATES_NORMAL as u16;
|
||||||
unsafe { Gecko_nsFont_ResetFontFeatureValuesLookup(&mut self.gecko.mFont); }
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for val in v.0.iter() {
|
for val in v.0.iter() {
|
||||||
|
@ -2563,10 +2557,6 @@ fn static_assert() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe {
|
|
||||||
Gecko_nsFont_SetFontFeatureValuesLookup(&mut self.gecko.mFont, device.pres_context());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
|
|
@ -2722,13 +2722,12 @@ impl<'a> StyleBuilder<'a> {
|
||||||
&mut self,
|
&mut self,
|
||||||
value: longhands::${property.ident}::computed_value::T
|
value: longhands::${property.ident}::computed_value::T
|
||||||
) {
|
) {
|
||||||
<% props_need_device = ["content", "list_style_type", "font_variant_alternates"] %>
|
|
||||||
self.${property.style_struct.ident}.mutate()
|
self.${property.style_struct.ident}.mutate()
|
||||||
.set_${property.ident}(
|
.set_${property.ident}(
|
||||||
value,
|
value,
|
||||||
% if property.logical:
|
% if property.logical:
|
||||||
self.writing_mode,
|
self.writing_mode,
|
||||||
% elif product == "gecko" and property.ident in props_need_device:
|
% elif product == "gecko" and property.ident in ["content", "list_style_type"]:
|
||||||
self.device,
|
self.device,
|
||||||
% endif
|
% endif
|
||||||
);
|
);
|
||||||
|
|
|
@ -11,10 +11,6 @@ use computed_values::font_family::FamilyName;
|
||||||
use cssparser::{AtRuleParser, AtRuleType, BasicParseError, DeclarationListParser, DeclarationParser, Parser};
|
use cssparser::{AtRuleParser, AtRuleType, BasicParseError, DeclarationListParser, DeclarationParser, Parser};
|
||||||
use cssparser::{CowRcStr, RuleListParser, SourceLocation, QualifiedRuleParser, Token, serialize_identifier};
|
use cssparser::{CowRcStr, RuleListParser, SourceLocation, QualifiedRuleParser, Token, serialize_identifier};
|
||||||
use error_reporting::{ContextualParseError, ParseErrorReporter};
|
use error_reporting::{ContextualParseError, ParseErrorReporter};
|
||||||
#[cfg(feature = "gecko")]
|
|
||||||
use gecko_bindings::bindings::Gecko_AppendFeatureValueHashEntry;
|
|
||||||
#[cfg(feature = "gecko")]
|
|
||||||
use gecko_bindings::structs::{self, gfxFontFeatureValueSet, nsTArray};
|
|
||||||
use parser::{ParserContext, ParserErrorContext, Parse};
|
use parser::{ParserContext, ParserErrorContext, Parse};
|
||||||
use selectors::parser::SelectorParseError;
|
use selectors::parser::SelectorParseError;
|
||||||
use shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
|
use shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
|
||||||
|
@ -45,13 +41,6 @@ impl<T: ToCss> ToCss for FFVDeclaration<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A trait for @font-feature-values rule to gecko values conversion.
|
|
||||||
#[cfg(feature = "gecko")]
|
|
||||||
pub trait ToGeckoFontFeatureValues {
|
|
||||||
/// Sets the equivalent of declaration to gecko `nsTArray<u32>` array.
|
|
||||||
fn to_gecko_font_feature_values(&self, array: &mut nsTArray<u32>);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A @font-feature-values block declaration value that keeps one value.
|
/// A @font-feature-values block declaration value that keeps one value.
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
pub struct SingleValue(pub u32);
|
pub struct SingleValue(pub u32);
|
||||||
|
@ -72,14 +61,6 @@ impl ToCss for SingleValue {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "gecko")]
|
|
||||||
impl ToGeckoFontFeatureValues for SingleValue {
|
|
||||||
fn to_gecko_font_feature_values(&self, array: &mut nsTArray<u32>) {
|
|
||||||
unsafe { array.set_len_pod(1); }
|
|
||||||
array[0] = self.0 as u32;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A @font-feature-values block declaration value that keeps one or two values.
|
/// A @font-feature-values block declaration value that keeps one or two values.
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
pub struct PairValues(pub u32, pub Option<u32>);
|
pub struct PairValues(pub u32, pub Option<u32>);
|
||||||
|
@ -113,19 +94,6 @@ impl ToCss for PairValues {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "gecko")]
|
|
||||||
impl ToGeckoFontFeatureValues for PairValues {
|
|
||||||
fn to_gecko_font_feature_values(&self, array: &mut nsTArray<u32>) {
|
|
||||||
let len = if self.1.is_some() { 2 } else { 1 };
|
|
||||||
|
|
||||||
unsafe { array.set_len_pod(len); }
|
|
||||||
array[0] = self.0 as u32;
|
|
||||||
if let Some(second) = self.1 {
|
|
||||||
array[1] = second as u32;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A @font-feature-values block declaration value that keeps a list of values.
|
/// A @font-feature-values block declaration value that keeps a list of values.
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
pub struct VectorValues(pub Vec<u32>);
|
pub struct VectorValues(pub Vec<u32>);
|
||||||
|
@ -168,16 +136,6 @@ impl ToCss for VectorValues {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "gecko")]
|
|
||||||
impl ToGeckoFontFeatureValues for VectorValues {
|
|
||||||
fn to_gecko_font_feature_values(&self, array: &mut nsTArray<u32>) {
|
|
||||||
unsafe { array.set_len_pod(self.0.len() as u32); }
|
|
||||||
for (dest, value) in array.iter_mut().zip(self.0.iter()) {
|
|
||||||
*dest = *value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Parses a list of `FamilyName`s.
|
/// Parses a list of `FamilyName`s.
|
||||||
pub fn parse_family_name_list<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
pub fn parse_family_name_list<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||||
-> Result<Vec<FamilyName>, ParseError<'i>> {
|
-> Result<Vec<FamilyName>, ParseError<'i>> {
|
||||||
|
@ -208,7 +166,7 @@ impl<'a, 'b, 'i, T> DeclarationParser<'i> for FFVDeclarationsParser<'a, 'b, T>
|
||||||
-> Result<(), ParseError<'i>> {
|
-> Result<(), ParseError<'i>> {
|
||||||
let value = input.parse_entirely(|i| T::parse(self.context, i))?;
|
let value = input.parse_entirely(|i| T::parse(self.context, i))?;
|
||||||
let new = FFVDeclaration {
|
let new = FFVDeclaration {
|
||||||
name: Atom::from(&*name).to_ascii_lowercase(),
|
name: Atom::from(&*name),
|
||||||
value: value,
|
value: value,
|
||||||
};
|
};
|
||||||
update_or_push(&mut self.declarations, new);
|
update_or_push(&mut self.declarations, new);
|
||||||
|
@ -219,7 +177,7 @@ impl<'a, 'b, 'i, T> DeclarationParser<'i> for FFVDeclarationsParser<'a, 'b, T>
|
||||||
macro_rules! font_feature_values_blocks {
|
macro_rules! font_feature_values_blocks {
|
||||||
(
|
(
|
||||||
blocks = [
|
blocks = [
|
||||||
$( #[$doc: meta] $name: tt $ident: ident / $ident_camel: ident / $gecko_enum: ident: $ty: ty, )*
|
$( #[$doc: meta] $name: tt $ident: ident / $ident_camel: ident: $ty: ty, )*
|
||||||
]
|
]
|
||||||
) => {
|
) => {
|
||||||
/// The [`@font-feature-values`][font-feature-values] at-rule.
|
/// The [`@font-feature-values`][font-feature-values] at-rule.
|
||||||
|
@ -304,38 +262,6 @@ macro_rules! font_feature_values_blocks {
|
||||||
)*
|
)*
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns length of all at-rules.
|
|
||||||
pub fn len(&self) -> usize {
|
|
||||||
let mut len = 0;
|
|
||||||
$(
|
|
||||||
len += self.$ident.len();
|
|
||||||
)*
|
|
||||||
len
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Convert to Gecko gfxFontFeatureValueSet.
|
|
||||||
#[cfg(feature = "gecko")]
|
|
||||||
pub fn set_at_rules(&self, dest: *mut gfxFontFeatureValueSet) {
|
|
||||||
for ref family in self.family_names.iter() {
|
|
||||||
let family = family.name.to_ascii_lowercase();
|
|
||||||
$(
|
|
||||||
if self.$ident.len() > 0 {
|
|
||||||
for val in self.$ident.iter() {
|
|
||||||
let mut array = unsafe {
|
|
||||||
Gecko_AppendFeatureValueHashEntry(
|
|
||||||
dest,
|
|
||||||
family.as_ptr(),
|
|
||||||
structs::$gecko_enum,
|
|
||||||
val.name.as_ptr()
|
|
||||||
)
|
|
||||||
};
|
|
||||||
val.value.to_gecko_font_feature_values(&mut array);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)*
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ToCssWithGuard for FontFeatureValuesRule {
|
impl ToCssWithGuard for FontFeatureValuesRule {
|
||||||
|
@ -440,32 +366,31 @@ font_feature_values_blocks! {
|
||||||
#[doc = "A @swash blocksck. \
|
#[doc = "A @swash blocksck. \
|
||||||
Specifies a feature name that will work with the swash() \
|
Specifies a feature name that will work with the swash() \
|
||||||
functional notation of font-variant-alternates."]
|
functional notation of font-variant-alternates."]
|
||||||
"swash" swash / Swash / NS_FONT_VARIANT_ALTERNATES_SWASH: SingleValue,
|
"swash" swash / Swash: SingleValue,
|
||||||
|
|
||||||
#[doc = "A @stylistic block. \
|
#[doc = "A @stylistic block. \
|
||||||
Specifies a feature name that will work with the annotation() \
|
Specifies a feature name that will work with the annotation() \
|
||||||
functional notation of font-variant-alternates."]
|
functional notation of font-variant-alternates."]
|
||||||
"stylistic" stylistic / Stylistic / NS_FONT_VARIANT_ALTERNATES_STYLISTIC: SingleValue,
|
"stylistic" stylistic / Stylistic: SingleValue,
|
||||||
|
|
||||||
#[doc = "A @ornaments block. \
|
#[doc = "A @ornaments block. \
|
||||||
Specifies a feature name that will work with the ornaments() ] \
|
Specifies a feature name that will work with the ornaments() ] \
|
||||||
functional notation of font-variant-alternates."]
|
functional notation of font-variant-alternates."]
|
||||||
"ornaments" ornaments / Ornaments / NS_FONT_VARIANT_ALTERNATES_ORNAMENTS: SingleValue,
|
"ornaments" ornaments / Ornaments: SingleValue,
|
||||||
|
|
||||||
#[doc = "A @annotation block. \
|
#[doc = "A @annotation block. \
|
||||||
Specifies a feature name that will work with the stylistic() \
|
Specifies a feature name that will work with the stylistic() \
|
||||||
functional notation of font-variant-alternates."]
|
functional notation of font-variant-alternates."]
|
||||||
"annotation" annotation / Annotation / NS_FONT_VARIANT_ALTERNATES_ANNOTATION: SingleValue,
|
"annotation" annotation / Annotation: SingleValue,
|
||||||
|
|
||||||
#[doc = "A @character-variant block. \
|
#[doc = "A @character-variant block. \
|
||||||
Specifies a feature name that will work with the styleset() \
|
Specifies a feature name that will work with the styleset() \
|
||||||
functional notation of font-variant-alternates. The value can be a pair."]
|
functional notation of font-variant-alternates. The value can be a pair."]
|
||||||
"character-variant" character_variant / CharacterVariant / NS_FONT_VARIANT_ALTERNATES_CHARACTER_VARIANT:
|
"character-variant" character_variant / CharacterVariant: PairValues,
|
||||||
PairValues,
|
|
||||||
|
|
||||||
#[doc = "A @styleset block. \
|
#[doc = "A @styleset block. \
|
||||||
Specifies a feature name that will work with the character-variant() \
|
Specifies a feature name that will work with the character-variant() \
|
||||||
functional notation of font-variant-alternates. The value can be a list."]
|
functional notation of font-variant-alternates. The value can be a list."]
|
||||||
"styleset" styleset / Styleset / NS_FONT_VARIANT_ALTERNATES_STYLESET: VectorValues,
|
"styleset" styleset / Styleset: VectorValues,
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ use std::ops;
|
||||||
use style_traits::viewport::ViewportConstraints;
|
use style_traits::viewport::ViewportConstraints;
|
||||||
use stylesheet_set::{OriginValidity, SheetRebuildKind, StylesheetSet, StylesheetIterator, StylesheetFlusher};
|
use stylesheet_set::{OriginValidity, SheetRebuildKind, StylesheetSet, StylesheetIterator, StylesheetFlusher};
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
use stylesheets::{CounterStyleRule, FontFaceRule, FontFeatureValuesRule};
|
use stylesheets::{CounterStyleRule, FontFaceRule};
|
||||||
use stylesheets::{CssRule, StyleRule};
|
use stylesheets::{CssRule, StyleRule};
|
||||||
use stylesheets::{StylesheetInDocument, Origin, OriginSet, PerOrigin, PerOriginIter};
|
use stylesheets::{StylesheetInDocument, Origin, OriginSet, PerOrigin, PerOriginIter};
|
||||||
use stylesheets::UserAgentStylesheets;
|
use stylesheets::UserAgentStylesheets;
|
||||||
|
@ -338,19 +338,13 @@ impl DocumentCascadeData {
|
||||||
CssRule::FontFace(ref rule) => {
|
CssRule::FontFace(ref rule) => {
|
||||||
_extra_data
|
_extra_data
|
||||||
.borrow_mut_for_origin(&origin)
|
.borrow_mut_for_origin(&origin)
|
||||||
.add_font_face(rule);
|
.add_font_face(&rule);
|
||||||
}
|
|
||||||
#[cfg(feature = "gecko")]
|
|
||||||
CssRule::FontFeatureValues(ref rule) => {
|
|
||||||
_extra_data
|
|
||||||
.borrow_mut_for_origin(&origin)
|
|
||||||
.add_font_feature_values(rule);
|
|
||||||
}
|
}
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
CssRule::CounterStyle(ref rule) => {
|
CssRule::CounterStyle(ref rule) => {
|
||||||
_extra_data
|
_extra_data
|
||||||
.borrow_mut_for_origin(&origin)
|
.borrow_mut_for_origin(&origin)
|
||||||
.add_counter_style(guard, rule);
|
.add_counter_style(guard, &rule);
|
||||||
}
|
}
|
||||||
// We don't care about any other rule.
|
// We don't care about any other rule.
|
||||||
_ => {}
|
_ => {}
|
||||||
|
@ -1522,10 +1516,6 @@ pub struct ExtraStyleData {
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
pub font_faces: Vec<Arc<Locked<FontFaceRule>>>,
|
pub font_faces: Vec<Arc<Locked<FontFaceRule>>>,
|
||||||
|
|
||||||
/// A list of effective font-feature-values rules.
|
|
||||||
#[cfg(feature = "gecko")]
|
|
||||||
pub font_feature_values: Vec<Arc<Locked<FontFeatureValuesRule>>>,
|
|
||||||
|
|
||||||
/// A map of effective counter-style rules.
|
/// A map of effective counter-style rules.
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
pub counter_styles: PrecomputedHashMap<Atom, Arc<Locked<CounterStyleRule>>>,
|
pub counter_styles: PrecomputedHashMap<Atom, Arc<Locked<CounterStyleRule>>>,
|
||||||
|
@ -1538,11 +1528,6 @@ impl ExtraStyleData {
|
||||||
self.font_faces.push(rule.clone());
|
self.font_faces.push(rule.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add the given @font-feature-values rule.
|
|
||||||
fn add_font_feature_values(&mut self, rule: &Arc<Locked<FontFeatureValuesRule>>) {
|
|
||||||
self.font_feature_values.push(rule.clone());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Add the given @counter-style rule.
|
/// Add the given @counter-style rule.
|
||||||
fn add_counter_style(
|
fn add_counter_style(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -1559,7 +1544,6 @@ impl ExtraStyleData {
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
{
|
{
|
||||||
self.font_faces.clear();
|
self.font_faces.clear();
|
||||||
self.font_feature_values.clear();
|
|
||||||
self.counter_styles.clear();
|
self.counter_styles.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,6 @@ use style::gecko_bindings::structs::ServoElementSnapshotTable;
|
||||||
use style::gecko_bindings::structs::ServoTraversalFlags;
|
use style::gecko_bindings::structs::ServoTraversalFlags;
|
||||||
use style::gecko_bindings::structs::StyleRuleInclusion;
|
use style::gecko_bindings::structs::StyleRuleInclusion;
|
||||||
use style::gecko_bindings::structs::URLExtraData;
|
use style::gecko_bindings::structs::URLExtraData;
|
||||||
use style::gecko_bindings::structs::gfxFontFeatureValueSet;
|
|
||||||
use style::gecko_bindings::structs::nsCSSValueSharedList;
|
use style::gecko_bindings::structs::nsCSSValueSharedList;
|
||||||
use style::gecko_bindings::structs::nsCompatibility;
|
use style::gecko_bindings::structs::nsCompatibility;
|
||||||
use style::gecko_bindings::structs::nsIDocument;
|
use style::gecko_bindings::structs::nsIDocument;
|
||||||
|
@ -3520,30 +3519,6 @@ pub extern "C" fn Servo_StyleSet_GetCounterStyleRule(raw_data: RawServoStyleSetB
|
||||||
}).unwrap_or(ptr::null_mut())
|
}).unwrap_or(ptr::null_mut())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
|
||||||
pub extern "C" fn Servo_StyleSet_BuildFontFeatureValueSet(
|
|
||||||
raw_data: RawServoStyleSetBorrowed,
|
|
||||||
set: *mut gfxFontFeatureValueSet
|
|
||||||
) -> bool {
|
|
||||||
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
|
||||||
|
|
||||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
|
||||||
let guard = global_style_data.shared_lock.read();
|
|
||||||
|
|
||||||
let font_feature_values_iter = data.extra_style_data
|
|
||||||
.iter_origins_rev()
|
|
||||||
.flat_map(|(d, _)| d.font_feature_values.iter());
|
|
||||||
|
|
||||||
let mut any_rule = false;
|
|
||||||
for src in font_feature_values_iter {
|
|
||||||
any_rule = true;
|
|
||||||
let rule = src.read_with(&guard);
|
|
||||||
rule.set_at_rules(set);
|
|
||||||
}
|
|
||||||
|
|
||||||
any_rule
|
|
||||||
}
|
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_StyleSet_ResolveForDeclarations(
|
pub extern "C" fn Servo_StyleSet_ResolveForDeclarations(
|
||||||
raw_data: RawServoStyleSetBorrowed,
|
raw_data: RawServoStyleSetBorrowed,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче