mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Backed out 1 changesets because the gecko part (bug 1420117) has to be backed out for the mochitests r=backout on a CLOSED TREE
Backed out changeset baada68cad47 Backs out https://github.com/servo/servo/pull/19441
This commit is contained in:
parent
eed3adc957
commit
25436276ae
5 changed files with 846 additions and 344 deletions
|
@ -11,7 +11,7 @@ use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser};
|
||||||
use cssparser::{Parser, Token, serialize_identifier, CowRcStr};
|
use cssparser::{Parser, Token, serialize_identifier, CowRcStr};
|
||||||
use error_reporting::{ContextualParseError, ParseErrorReporter};
|
use error_reporting::{ContextualParseError, ParseErrorReporter};
|
||||||
#[cfg(feature = "gecko")] use gecko::rules::CounterStyleDescriptors;
|
#[cfg(feature = "gecko")] use gecko::rules::CounterStyleDescriptors;
|
||||||
#[cfg(feature = "gecko")] use gecko_bindings::structs::{ nsCSSCounterDesc, nsCSSValue };
|
#[cfg(feature = "gecko")] use gecko_bindings::structs::nsCSSCounterDesc;
|
||||||
use parser::{ParserContext, ParserErrorContext, Parse};
|
use parser::{ParserContext, ParserErrorContext, Parse};
|
||||||
use selectors::parser::SelectorParseErrorKind;
|
use selectors::parser::SelectorParseErrorKind;
|
||||||
use shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
|
use shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
|
||||||
|
@ -225,30 +225,6 @@ macro_rules! counter_style_descriptors {
|
||||||
dest.write_str("}")
|
dest.write_str("}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parse a descriptor into an `nsCSSValue`.
|
|
||||||
#[cfg(feature = "gecko")]
|
|
||||||
pub fn parse_counter_style_descriptor<'i, 't>(
|
|
||||||
context: &ParserContext,
|
|
||||||
input: &mut Parser<'i, 't>,
|
|
||||||
descriptor: nsCSSCounterDesc,
|
|
||||||
value: &mut nsCSSValue
|
|
||||||
) -> Result<(), ParseError<'i>> {
|
|
||||||
match descriptor {
|
|
||||||
$(
|
|
||||||
nsCSSCounterDesc::$gecko_ident => {
|
|
||||||
let v: $ty =
|
|
||||||
input.parse_entirely(|i| Parse::parse(context, i))?;
|
|
||||||
value.set_from(v);
|
|
||||||
}
|
|
||||||
)*
|
|
||||||
nsCSSCounterDesc::eCSSCounterDesc_COUNT |
|
|
||||||
nsCSSCounterDesc::eCSSCounterDesc_UNKNOWN => {
|
|
||||||
panic!("invalid counter descriptor");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -564,8 +564,6 @@ cfg_if! {
|
||||||
pub static nsGkAtoms_dateTime: *mut nsStaticAtom;
|
pub static nsGkAtoms_dateTime: *mut nsStaticAtom;
|
||||||
#[link_name = "_ZN9nsGkAtoms11datasourcesE"]
|
#[link_name = "_ZN9nsGkAtoms11datasourcesE"]
|
||||||
pub static nsGkAtoms_datasources: *mut nsStaticAtom;
|
pub static nsGkAtoms_datasources: *mut nsStaticAtom;
|
||||||
#[link_name = "_ZN9nsGkAtoms4dateE"]
|
|
||||||
pub static nsGkAtoms_date: *mut nsStaticAtom;
|
|
||||||
#[link_name = "_ZN9nsGkAtoms8datetimeE"]
|
#[link_name = "_ZN9nsGkAtoms8datetimeE"]
|
||||||
pub static nsGkAtoms_datetime: *mut nsStaticAtom;
|
pub static nsGkAtoms_datetime: *mut nsStaticAtom;
|
||||||
#[link_name = "_ZN9nsGkAtoms11datetimeboxE"]
|
#[link_name = "_ZN9nsGkAtoms11datetimeboxE"]
|
||||||
|
@ -5751,8 +5749,6 @@ cfg_if! {
|
||||||
pub static nsGkAtoms_dateTime: *mut nsStaticAtom;
|
pub static nsGkAtoms_dateTime: *mut nsStaticAtom;
|
||||||
#[link_name = "?datasources@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
#[link_name = "?datasources@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||||
pub static nsGkAtoms_datasources: *mut nsStaticAtom;
|
pub static nsGkAtoms_datasources: *mut nsStaticAtom;
|
||||||
#[link_name = "?date@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
|
||||||
pub static nsGkAtoms_date: *mut nsStaticAtom;
|
|
||||||
#[link_name = "?datetime@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
#[link_name = "?datetime@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||||
pub static nsGkAtoms_datetime: *mut nsStaticAtom;
|
pub static nsGkAtoms_datetime: *mut nsStaticAtom;
|
||||||
#[link_name = "?datetimebox@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
#[link_name = "?datetimebox@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||||
|
@ -10938,8 +10934,6 @@ cfg_if! {
|
||||||
pub static nsGkAtoms_dateTime: *mut nsStaticAtom;
|
pub static nsGkAtoms_dateTime: *mut nsStaticAtom;
|
||||||
#[link_name = "\x01?datasources@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
#[link_name = "\x01?datasources@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||||
pub static nsGkAtoms_datasources: *mut nsStaticAtom;
|
pub static nsGkAtoms_datasources: *mut nsStaticAtom;
|
||||||
#[link_name = "\x01?date@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
|
||||||
pub static nsGkAtoms_date: *mut nsStaticAtom;
|
|
||||||
#[link_name = "\x01?datetime@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
#[link_name = "\x01?datetime@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||||
pub static nsGkAtoms_datetime: *mut nsStaticAtom;
|
pub static nsGkAtoms_datetime: *mut nsStaticAtom;
|
||||||
#[link_name = "\x01?datetimebox@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
#[link_name = "\x01?datetimebox@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||||
|
@ -16128,8 +16122,6 @@ macro_rules! atom {
|
||||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_dateTime as *mut _) } }};
|
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_dateTime as *mut _) } }};
|
||||||
("datasources") =>
|
("datasources") =>
|
||||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_datasources as *mut _) } }};
|
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_datasources as *mut _) } }};
|
||||||
("date") =>
|
|
||||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_date as *mut _) } }};
|
|
||||||
("datetime") =>
|
("datetime") =>
|
||||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_datetime as *mut _) } }};
|
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_datetime as *mut _) } }};
|
||||||
("datetimebox") =>
|
("datetimebox") =>
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
@ -18,7 +18,6 @@ use std::ptr;
|
||||||
use style::applicable_declarations::ApplicableDeclarationBlock;
|
use style::applicable_declarations::ApplicableDeclarationBlock;
|
||||||
use style::context::{CascadeInputs, QuirksMode, SharedStyleContext, StyleContext};
|
use style::context::{CascadeInputs, QuirksMode, SharedStyleContext, StyleContext};
|
||||||
use style::context::ThreadLocalStyleContext;
|
use style::context::ThreadLocalStyleContext;
|
||||||
use style::counter_style;
|
|
||||||
use style::data::{ElementStyles, self};
|
use style::data::{ElementStyles, self};
|
||||||
use style::dom::{ShowSubtreeData, TDocument, TElement, TNode};
|
use style::dom::{ShowSubtreeData, TDocument, TElement, TNode};
|
||||||
use style::driver;
|
use style::driver;
|
||||||
|
@ -105,8 +104,6 @@ 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::gfxFontFeatureValueSet;
|
||||||
use style::gecko_bindings::structs::nsCSSCounterDesc;
|
|
||||||
use style::gecko_bindings::structs::nsCSSValue;
|
|
||||||
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;
|
||||||
|
@ -4738,48 +4735,3 @@ pub unsafe extern "C" fn Servo_SourceSizeList_Evaluate(
|
||||||
pub unsafe extern "C" fn Servo_SourceSizeList_Drop(list: RawServoSourceSizeListOwned) {
|
pub unsafe extern "C" fn Servo_SourceSizeList_Drop(list: RawServoSourceSizeListOwned) {
|
||||||
let _ = list.into_box::<SourceSizeList>();
|
let _ = list.into_box::<SourceSizeList>();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
|
||||||
pub extern "C" fn Servo_ParseCounterStyleName(
|
|
||||||
value: *const nsACString,
|
|
||||||
) -> *mut nsAtom {
|
|
||||||
let value = unsafe { value.as_ref().unwrap().as_str_unchecked() };
|
|
||||||
let mut input = ParserInput::new(&value);
|
|
||||||
match Parser::new(&mut input).parse_entirely(counter_style::parse_counter_style_name) {
|
|
||||||
Ok(name) => name.0.into_addrefed(),
|
|
||||||
Err(_) => ptr::null_mut(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[no_mangle]
|
|
||||||
pub extern "C" fn Servo_ParseCounterStyleDescriptor(
|
|
||||||
descriptor: nsCSSCounterDesc,
|
|
||||||
value: *const nsACString,
|
|
||||||
raw_extra_data: *mut URLExtraData,
|
|
||||||
result: *mut nsCSSValue,
|
|
||||||
) -> bool {
|
|
||||||
let value = unsafe { value.as_ref().unwrap().as_str_unchecked() };
|
|
||||||
let url_data = unsafe {
|
|
||||||
if raw_extra_data.is_null() {
|
|
||||||
dummy_url_data()
|
|
||||||
} else {
|
|
||||||
RefPtr::from_ptr_ref(&raw_extra_data)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
let result = unsafe { result.as_mut().unwrap() };
|
|
||||||
let mut input = ParserInput::new(&value);
|
|
||||||
let mut parser = Parser::new(&mut input);
|
|
||||||
let context = ParserContext::new(
|
|
||||||
Origin::Author,
|
|
||||||
url_data,
|
|
||||||
Some(CssRuleType::CounterStyle),
|
|
||||||
ParsingMode::DEFAULT,
|
|
||||||
QuirksMode::NoQuirks,
|
|
||||||
);
|
|
||||||
counter_style::parse_counter_style_descriptor(
|
|
||||||
&context,
|
|
||||||
&mut parser,
|
|
||||||
descriptor,
|
|
||||||
result,
|
|
||||||
).is_ok()
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue