mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #18864 - emilio:reformat, r=jdm
style: Reformat a few signatures to follow a consistent style. <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18864) <!-- Reviewable:end -->
This commit is contained in:
commit
db29af160c
4 changed files with 253 additions and 200 deletions
|
@ -2926,10 +2926,6 @@ extern "C" {
|
||||||
set: RawServoStyleSetBorrowed)
|
set: RawServoStyleSetBorrowed)
|
||||||
-> ServoStyleContextStrong;
|
-> ServoStyleContextStrong;
|
||||||
}
|
}
|
||||||
extern "C" {
|
|
||||||
pub fn Servo_ResolveStyleAllowStale(element: RawGeckoElementBorrowed)
|
|
||||||
-> ServoStyleContextStrong;
|
|
||||||
}
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Servo_ResolvePseudoStyle(element: RawGeckoElementBorrowed,
|
pub fn Servo_ResolvePseudoStyle(element: RawGeckoElementBorrowed,
|
||||||
pseudo_type: CSSPseudoElementType,
|
pseudo_type: CSSPseudoElementType,
|
||||||
|
|
|
@ -1016,15 +1016,17 @@ pub fn parse_style_attribute<R>(input: &str,
|
||||||
/// `PropertyDeclaration`s when expanding a shorthand, for example.
|
/// `PropertyDeclaration`s when expanding a shorthand, for example.
|
||||||
///
|
///
|
||||||
/// This does not attempt to parse !important at all.
|
/// This does not attempt to parse !important at all.
|
||||||
pub fn parse_one_declaration_into<R>(declarations: &mut SourcePropertyDeclaration,
|
pub fn parse_one_declaration_into<R>(
|
||||||
|
declarations: &mut SourcePropertyDeclaration,
|
||||||
id: PropertyId,
|
id: PropertyId,
|
||||||
input: &str,
|
input: &str,
|
||||||
url_data: &UrlExtraData,
|
url_data: &UrlExtraData,
|
||||||
error_reporter: &R,
|
error_reporter: &R,
|
||||||
parsing_mode: ParsingMode,
|
parsing_mode: ParsingMode,
|
||||||
quirks_mode: QuirksMode)
|
quirks_mode: QuirksMode
|
||||||
-> Result<(), ()>
|
) -> Result<(), ()>
|
||||||
where R: ParseErrorReporter
|
where
|
||||||
|
R: ParseErrorReporter
|
||||||
{
|
{
|
||||||
let context = ParserContext::new(Origin::Author,
|
let context = ParserContext::new(Origin::Author,
|
||||||
url_data,
|
url_data,
|
||||||
|
@ -1102,11 +1104,13 @@ impl<'a, 'b, 'i> DeclarationParser<'i> for PropertyDeclarationParser<'a, 'b> {
|
||||||
|
|
||||||
/// Parse a list of property declarations and return a property declaration
|
/// Parse a list of property declarations and return a property declaration
|
||||||
/// block.
|
/// block.
|
||||||
pub fn parse_property_declaration_list<R>(context: &ParserContext,
|
pub fn parse_property_declaration_list<R>(
|
||||||
|
context: &ParserContext,
|
||||||
error_context: &ParserErrorContext<R>,
|
error_context: &ParserErrorContext<R>,
|
||||||
input: &mut Parser)
|
input: &mut Parser,
|
||||||
-> PropertyDeclarationBlock
|
) -> PropertyDeclarationBlock
|
||||||
where R: ParseErrorReporter
|
where
|
||||||
|
R: ParseErrorReporter
|
||||||
{
|
{
|
||||||
let mut declarations = SourcePropertyDeclaration::new();
|
let mut declarations = SourcePropertyDeclaration::new();
|
||||||
let mut block = PropertyDeclarationBlock::new();
|
let mut block = PropertyDeclarationBlock::new();
|
||||||
|
|
|
@ -869,9 +869,12 @@ impl ShorthandId {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_into<'i, 't>(&self, declarations: &mut SourcePropertyDeclaration,
|
fn parse_into<'i, 't>(
|
||||||
context: &ParserContext, input: &mut Parser<'i, 't>)
|
&self,
|
||||||
-> Result<(), ParseError<'i>> {
|
declarations: &mut SourcePropertyDeclaration,
|
||||||
|
context: &ParserContext,
|
||||||
|
input: &mut Parser<'i, 't>,
|
||||||
|
) -> Result<(), ParseError<'i>> {
|
||||||
match *self {
|
match *self {
|
||||||
% for shorthand in data.shorthands_except_all():
|
% for shorthand in data.shorthands_except_all():
|
||||||
ShorthandId::${shorthand.camel_case} => {
|
ShorthandId::${shorthand.camel_case} => {
|
||||||
|
@ -1628,10 +1631,13 @@ impl PropertyDeclaration {
|
||||||
/// This will not actually parse Importance values, and will always set things
|
/// This will not actually parse Importance values, and will always set things
|
||||||
/// to Importance::Normal. Parsing Importance values is the job of PropertyDeclarationParser,
|
/// to Importance::Normal. Parsing Importance values is the job of PropertyDeclarationParser,
|
||||||
/// we only set them here so that we don't have to reallocate
|
/// we only set them here so that we don't have to reallocate
|
||||||
pub fn parse_into<'i, 't>(declarations: &mut SourcePropertyDeclaration,
|
pub fn parse_into<'i, 't>(
|
||||||
id: PropertyId, name: CowRcStr<'i>,
|
declarations: &mut SourcePropertyDeclaration,
|
||||||
context: &ParserContext, input: &mut Parser<'i, 't>)
|
id: PropertyId,
|
||||||
-> Result<(), ParseError<'i>> {
|
name: CowRcStr<'i>,
|
||||||
|
context: &ParserContext,
|
||||||
|
input: &mut Parser<'i, 't>,
|
||||||
|
) -> Result<(), ParseError<'i>> {
|
||||||
assert!(declarations.is_empty());
|
assert!(declarations.is_empty());
|
||||||
let start = input.state();
|
let start = input.state();
|
||||||
match id {
|
match id {
|
||||||
|
|
|
@ -2147,15 +2147,17 @@ pub extern "C" fn Servo_StyleSet_CompatModeChanged(raw_data: RawServoStyleSetBor
|
||||||
data.stylist.set_quirks_mode(quirks_mode.into());
|
data.stylist.set_quirks_mode(quirks_mode.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_property_into<R>(declarations: &mut SourcePropertyDeclaration,
|
fn parse_property_into<R>(
|
||||||
|
declarations: &mut SourcePropertyDeclaration,
|
||||||
property_id: PropertyId,
|
property_id: PropertyId,
|
||||||
value: *const nsACString,
|
value: *const nsACString,
|
||||||
data: *mut URLExtraData,
|
data: *mut URLExtraData,
|
||||||
parsing_mode: structs::ParsingMode,
|
parsing_mode: structs::ParsingMode,
|
||||||
quirks_mode: QuirksMode,
|
quirks_mode: QuirksMode,
|
||||||
reporter: &R)
|
reporter: &R
|
||||||
-> Result<(), ()>
|
) -> Result<(), ()>
|
||||||
where R: ParseErrorReporter
|
where
|
||||||
|
R: ParseErrorReporter
|
||||||
{
|
{
|
||||||
use style_traits::ParsingMode;
|
use style_traits::ParsingMode;
|
||||||
let value = unsafe { value.as_ref().unwrap().as_str_unchecked() };
|
let value = unsafe { value.as_ref().unwrap().as_str_unchecked() };
|
||||||
|
@ -2173,12 +2175,13 @@ fn parse_property_into<R>(declarations: &mut SourcePropertyDeclaration,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_ParseProperty(property: nsCSSPropertyID, value: *const nsACString,
|
pub extern "C" fn Servo_ParseProperty(
|
||||||
|
property: nsCSSPropertyID, value: *const nsACString,
|
||||||
data: *mut URLExtraData,
|
data: *mut URLExtraData,
|
||||||
parsing_mode: structs::ParsingMode,
|
parsing_mode: structs::ParsingMode,
|
||||||
quirks_mode: nsCompatibility,
|
quirks_mode: nsCompatibility,
|
||||||
loader: *mut Loader)
|
loader: *mut Loader,
|
||||||
-> RawServoDeclarationBlockStrong {
|
) -> RawServoDeclarationBlockStrong {
|
||||||
let id = get_property_id_from_nscsspropertyid!(property,
|
let id = get_property_id_from_nscsspropertyid!(property,
|
||||||
RawServoDeclarationBlockStrong::null());
|
RawServoDeclarationBlockStrong::null());
|
||||||
let mut declarations = SourcePropertyDeclaration::new();
|
let mut declarations = SourcePropertyDeclaration::new();
|
||||||
|
@ -2196,10 +2199,11 @@ pub extern "C" fn Servo_ParseProperty(property: nsCSSPropertyID, value: *const n
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_ParseEasing(easing: *const nsAString,
|
pub extern "C" fn Servo_ParseEasing(
|
||||||
|
easing: *const nsAString,
|
||||||
data: *mut URLExtraData,
|
data: *mut URLExtraData,
|
||||||
output: nsTimingFunctionBorrowedMut)
|
output: nsTimingFunctionBorrowedMut
|
||||||
-> bool {
|
) -> bool {
|
||||||
use style::properties::longhands::transition_timing_function;
|
use style::properties::longhands::transition_timing_function;
|
||||||
|
|
||||||
let url_data = unsafe { RefPtr::from_ptr_ref(&data) };
|
let url_data = unsafe { RefPtr::from_ptr_ref(&data) };
|
||||||
|
@ -2281,11 +2285,12 @@ pub extern "C" fn Servo_MatrixTransform_Operate(matrix_operator: MatrixTransform
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_ParseStyleAttribute(data: *const nsACString,
|
pub extern "C" fn Servo_ParseStyleAttribute(
|
||||||
|
data: *const nsACString,
|
||||||
raw_extra_data: *mut URLExtraData,
|
raw_extra_data: *mut URLExtraData,
|
||||||
quirks_mode: nsCompatibility,
|
quirks_mode: nsCompatibility,
|
||||||
loader: *mut Loader)
|
loader: *mut Loader,
|
||||||
-> RawServoDeclarationBlockStrong {
|
) -> RawServoDeclarationBlockStrong {
|
||||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||||
let value = unsafe { data.as_ref().unwrap().as_str_unchecked() };
|
let value = unsafe { data.as_ref().unwrap().as_str_unchecked() };
|
||||||
let reporter = ErrorReporter::new(ptr::null_mut(), loader, raw_extra_data);
|
let reporter = ErrorReporter::new(ptr::null_mut(), loader, raw_extra_data);
|
||||||
|
@ -2313,9 +2318,10 @@ pub extern "C" fn Servo_DeclarationBlock_Clone(declarations: RawServoDeclaration
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_Equals(a: RawServoDeclarationBlockBorrowed,
|
pub extern "C" fn Servo_DeclarationBlock_Equals(
|
||||||
b: RawServoDeclarationBlockBorrowed)
|
a: RawServoDeclarationBlockBorrowed,
|
||||||
-> bool {
|
b: RawServoDeclarationBlockBorrowed,
|
||||||
|
) -> bool {
|
||||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||||
let guard = global_style_data.shared_lock.read();
|
let guard = global_style_data.shared_lock.read();
|
||||||
*Locked::<PropertyDeclarationBlock>::as_arc(&a).read_with(&guard).declarations() ==
|
*Locked::<PropertyDeclarationBlock>::as_arc(&a).read_with(&guard).declarations() ==
|
||||||
|
@ -2335,8 +2341,8 @@ pub extern "C" fn Servo_DeclarationBlock_SerializeOneValue(
|
||||||
declarations: RawServoDeclarationBlockBorrowed,
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
property_id: nsCSSPropertyID, buffer: *mut nsAString,
|
property_id: nsCSSPropertyID, buffer: *mut nsAString,
|
||||||
computed_values: ServoStyleContextBorrowedOrNull,
|
computed_values: ServoStyleContextBorrowedOrNull,
|
||||||
custom_properties: RawServoDeclarationBlockBorrowedOrNull)
|
custom_properties: RawServoDeclarationBlockBorrowedOrNull,
|
||||||
{
|
) {
|
||||||
let property_id = get_property_id_from_nscsspropertyid!(property_id, ());
|
let property_id = get_property_id_from_nscsspropertyid!(property_id, ());
|
||||||
|
|
||||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||||
|
@ -2358,7 +2364,8 @@ pub extern "C" fn Servo_DeclarationBlock_SerializeOneValue(
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_SerializeFontValueForCanvas(
|
pub extern "C" fn Servo_SerializeFontValueForCanvas(
|
||||||
declarations: RawServoDeclarationBlockBorrowed,
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
buffer: *mut nsAString) {
|
buffer: *mut nsAString,
|
||||||
|
) {
|
||||||
use style::properties::shorthands::font;
|
use style::properties::shorthands::font;
|
||||||
|
|
||||||
read_locked_arc(declarations, |decls: &PropertyDeclarationBlock| {
|
read_locked_arc(declarations, |decls: &PropertyDeclarationBlock| {
|
||||||
|
@ -2387,8 +2394,11 @@ pub extern "C" fn Servo_DeclarationBlock_Count(declarations: RawServoDeclaration
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_GetNthProperty(declarations: RawServoDeclarationBlockBorrowed,
|
pub extern "C" fn Servo_DeclarationBlock_GetNthProperty(
|
||||||
index: u32, result: *mut nsAString) -> bool {
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
|
index: u32,
|
||||||
|
result: *mut nsAString,
|
||||||
|
) -> bool {
|
||||||
read_locked_arc(declarations, |decls: &PropertyDeclarationBlock| {
|
read_locked_arc(declarations, |decls: &PropertyDeclarationBlock| {
|
||||||
if let Some(decl) = decls.declarations().get(index as usize) {
|
if let Some(decl) = decls.declarations().get(index as usize) {
|
||||||
let result = unsafe { result.as_mut().unwrap() };
|
let result = unsafe { result.as_mut().unwrap() };
|
||||||
|
@ -2456,11 +2466,16 @@ pub unsafe extern "C" fn Servo_DeclarationBlock_GetPropertyIsImportant(
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_property(declarations: RawServoDeclarationBlockBorrowed, property_id: PropertyId,
|
fn set_property(
|
||||||
value: *const nsACString, is_important: bool, data: *mut URLExtraData,
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
|
property_id: PropertyId,
|
||||||
|
value: *const nsACString,
|
||||||
|
is_important: bool,
|
||||||
|
data: *mut URLExtraData,
|
||||||
parsing_mode: structs::ParsingMode,
|
parsing_mode: structs::ParsingMode,
|
||||||
quirks_mode: QuirksMode,
|
quirks_mode: QuirksMode,
|
||||||
loader: *mut Loader) -> bool {
|
loader: *mut Loader
|
||||||
|
) -> bool {
|
||||||
let mut source_declarations = SourcePropertyDeclaration::new();
|
let mut source_declarations = SourcePropertyDeclaration::new();
|
||||||
let reporter = ErrorReporter::new(ptr::null_mut(), loader, data);
|
let reporter = ErrorReporter::new(ptr::null_mut(), loader, data);
|
||||||
match parse_property_into(&mut source_declarations, property_id, value, data,
|
match parse_property_into(&mut source_declarations, property_id, value, data,
|
||||||
|
@ -2557,9 +2572,10 @@ pub extern "C" fn Servo_MediaList_DeepClone(list: RawServoMediaListBorrowed) ->
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_MediaList_Matches(list: RawServoMediaListBorrowed,
|
pub extern "C" fn Servo_MediaList_Matches(
|
||||||
raw_data: RawServoStyleSetBorrowed)
|
list: RawServoMediaListBorrowed,
|
||||||
-> bool {
|
raw_data: RawServoStyleSetBorrowed,
|
||||||
|
) -> bool {
|
||||||
let per_doc_data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
let per_doc_data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
||||||
read_locked_arc(list, |list: &MediaList| {
|
read_locked_arc(list, |list: &MediaList| {
|
||||||
list.evaluate(per_doc_data.stylist.device(), per_doc_data.stylist.quirks_mode())
|
list.evaluate(per_doc_data.stylist.device(), per_doc_data.stylist.quirks_mode())
|
||||||
|
@ -2567,8 +2583,10 @@ pub extern "C" fn Servo_MediaList_Matches(list: RawServoMediaListBorrowed,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_HasCSSWideKeyword(declarations: RawServoDeclarationBlockBorrowed,
|
pub extern "C" fn Servo_DeclarationBlock_HasCSSWideKeyword(
|
||||||
property: nsCSSPropertyID) -> bool {
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
|
property: nsCSSPropertyID,
|
||||||
|
) -> bool {
|
||||||
let property_id = get_property_id_from_nscsspropertyid!(property, false);
|
let property_id = get_property_id_from_nscsspropertyid!(property, false);
|
||||||
read_locked_arc(declarations, |decls: &PropertyDeclarationBlock| {
|
read_locked_arc(declarations, |decls: &PropertyDeclarationBlock| {
|
||||||
decls.has_css_wide_keyword(&property_id)
|
decls.has_css_wide_keyword(&property_id)
|
||||||
|
@ -2602,8 +2620,11 @@ pub extern "C" fn Servo_MediaList_GetLength(list: RawServoMediaListBorrowed) ->
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_MediaList_GetMediumAt(list: RawServoMediaListBorrowed, index: u32,
|
pub extern "C" fn Servo_MediaList_GetMediumAt(
|
||||||
result: *mut nsAString) -> bool {
|
list: RawServoMediaListBorrowed,
|
||||||
|
index: u32,
|
||||||
|
result: *mut nsAString,
|
||||||
|
) -> bool {
|
||||||
read_locked_arc(list, |list: &MediaList| {
|
read_locked_arc(list, |list: &MediaList| {
|
||||||
if let Some(media_query) = list.media_queries.get(index as usize) {
|
if let Some(media_query) = list.media_queries.get(index as usize) {
|
||||||
media_query.to_css(unsafe { result.as_mut().unwrap() }).unwrap();
|
media_query.to_css(unsafe { result.as_mut().unwrap() }).unwrap();
|
||||||
|
@ -2615,8 +2636,10 @@ pub extern "C" fn Servo_MediaList_GetMediumAt(list: RawServoMediaListBorrowed, i
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_MediaList_AppendMedium(list: RawServoMediaListBorrowed,
|
pub extern "C" fn Servo_MediaList_AppendMedium(
|
||||||
new_medium: *const nsACString) {
|
list: RawServoMediaListBorrowed,
|
||||||
|
new_medium: *const nsACString,
|
||||||
|
) {
|
||||||
let new_medium = unsafe { new_medium.as_ref().unwrap().as_str_unchecked() };
|
let new_medium = unsafe { new_medium.as_ref().unwrap().as_str_unchecked() };
|
||||||
let url_data = unsafe { dummy_url_data() };
|
let url_data = unsafe { dummy_url_data() };
|
||||||
let context = ParserContext::new_for_cssom(url_data, Some(CssRuleType::Media),
|
let context = ParserContext::new_for_cssom(url_data, Some(CssRuleType::Media),
|
||||||
|
@ -2628,8 +2651,10 @@ pub extern "C" fn Servo_MediaList_AppendMedium(list: RawServoMediaListBorrowed,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_MediaList_DeleteMedium(list: RawServoMediaListBorrowed,
|
pub extern "C" fn Servo_MediaList_DeleteMedium(
|
||||||
old_medium: *const nsACString) -> bool {
|
list: RawServoMediaListBorrowed,
|
||||||
|
old_medium: *const nsACString,
|
||||||
|
) -> bool {
|
||||||
let old_medium = unsafe { old_medium.as_ref().unwrap().as_str_unchecked() };
|
let old_medium = unsafe { old_medium.as_ref().unwrap().as_str_unchecked() };
|
||||||
let url_data = unsafe { dummy_url_data() };
|
let url_data = unsafe { dummy_url_data() };
|
||||||
let context = ParserContext::new_for_cssom(url_data, Some(CssRuleType::Media),
|
let context = ParserContext::new_for_cssom(url_data, Some(CssRuleType::Media),
|
||||||
|
@ -2673,12 +2698,11 @@ pub extern "C" fn Servo_DeclarationBlock_PropertyIsSet(declarations:
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_SetIdentStringValue(declarations:
|
pub extern "C" fn Servo_DeclarationBlock_SetIdentStringValue(
|
||||||
RawServoDeclarationBlockBorrowed,
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
property:
|
property: nsCSSPropertyID,
|
||||||
nsCSSPropertyID,
|
value: *mut nsAtom,
|
||||||
value:
|
) {
|
||||||
*mut nsAtom) {
|
|
||||||
use style::properties::{PropertyDeclaration, LonghandId};
|
use style::properties::{PropertyDeclaration, LonghandId};
|
||||||
use style::properties::longhands::_x_lang::computed_value::T as Lang;
|
use style::properties::longhands::_x_lang::computed_value::T as Lang;
|
||||||
|
|
||||||
|
@ -2693,10 +2717,11 @@ pub extern "C" fn Servo_DeclarationBlock_SetIdentStringValue(declarations:
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
#[allow(unreachable_code)]
|
#[allow(unreachable_code)]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_SetKeywordValue(declarations:
|
pub extern "C" fn Servo_DeclarationBlock_SetKeywordValue(
|
||||||
RawServoDeclarationBlockBorrowed,
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
property: nsCSSPropertyID,
|
property: nsCSSPropertyID,
|
||||||
value: i32) {
|
value: i32
|
||||||
|
) {
|
||||||
use style::properties::{PropertyDeclaration, LonghandId};
|
use style::properties::{PropertyDeclaration, LonghandId};
|
||||||
use style::properties::longhands;
|
use style::properties::longhands;
|
||||||
use style::values::specified::BorderStyle;
|
use style::values::specified::BorderStyle;
|
||||||
|
@ -2737,9 +2762,11 @@ pub extern "C" fn Servo_DeclarationBlock_SetKeywordValue(declarations:
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_SetIntValue(declarations: RawServoDeclarationBlockBorrowed,
|
pub extern "C" fn Servo_DeclarationBlock_SetIntValue(
|
||||||
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
property: nsCSSPropertyID,
|
property: nsCSSPropertyID,
|
||||||
value: i32) {
|
value: i32
|
||||||
|
) {
|
||||||
use style::properties::{PropertyDeclaration, LonghandId};
|
use style::properties::{PropertyDeclaration, LonghandId};
|
||||||
use style::properties::longhands::_moz_script_level::SpecifiedValue as MozScriptLevel;
|
use style::properties::longhands::_moz_script_level::SpecifiedValue as MozScriptLevel;
|
||||||
use style::properties::longhands::_x_span::computed_value::T as Span;
|
use style::properties::longhands::_x_span::computed_value::T as Span;
|
||||||
|
@ -2756,10 +2783,11 @@ pub extern "C" fn Servo_DeclarationBlock_SetIntValue(declarations: RawServoDecla
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_SetPixelValue(declarations:
|
pub extern "C" fn Servo_DeclarationBlock_SetPixelValue(
|
||||||
RawServoDeclarationBlockBorrowed,
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
property: nsCSSPropertyID,
|
property: nsCSSPropertyID,
|
||||||
value: f32) {
|
value: f32
|
||||||
|
) {
|
||||||
use style::properties::{PropertyDeclaration, LonghandId};
|
use style::properties::{PropertyDeclaration, LonghandId};
|
||||||
use style::properties::longhands::border_spacing::SpecifiedValue as BorderSpacing;
|
use style::properties::longhands::border_spacing::SpecifiedValue as BorderSpacing;
|
||||||
use style::properties::longhands::height::SpecifiedValue as Height;
|
use style::properties::longhands::height::SpecifiedValue as Height;
|
||||||
|
@ -2813,11 +2841,12 @@ pub extern "C" fn Servo_DeclarationBlock_SetPixelValue(declarations:
|
||||||
|
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_SetLengthValue(declarations:
|
pub extern "C" fn Servo_DeclarationBlock_SetLengthValue(
|
||||||
RawServoDeclarationBlockBorrowed,
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
property: nsCSSPropertyID,
|
property: nsCSSPropertyID,
|
||||||
value: f32,
|
value: f32,
|
||||||
unit: structs::nsCSSUnit) {
|
unit: structs::nsCSSUnit,
|
||||||
|
) {
|
||||||
use style::properties::{PropertyDeclaration, LonghandId};
|
use style::properties::{PropertyDeclaration, LonghandId};
|
||||||
use style::properties::longhands::_moz_script_min_size::SpecifiedValue as MozScriptMinSize;
|
use style::properties::longhands::_moz_script_min_size::SpecifiedValue as MozScriptMinSize;
|
||||||
use style::properties::longhands::width::SpecifiedValue as Width;
|
use style::properties::longhands::width::SpecifiedValue as Width;
|
||||||
|
@ -2851,10 +2880,11 @@ pub extern "C" fn Servo_DeclarationBlock_SetLengthValue(declarations:
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_SetNumberValue(declarations:
|
pub extern "C" fn Servo_DeclarationBlock_SetNumberValue(
|
||||||
RawServoDeclarationBlockBorrowed,
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
property: nsCSSPropertyID,
|
property: nsCSSPropertyID,
|
||||||
value: f32) {
|
value: f32,
|
||||||
|
) {
|
||||||
use style::properties::{PropertyDeclaration, LonghandId};
|
use style::properties::{PropertyDeclaration, LonghandId};
|
||||||
use style::properties::longhands::_moz_script_level::SpecifiedValue as MozScriptLevel;
|
use style::properties::longhands::_moz_script_level::SpecifiedValue as MozScriptLevel;
|
||||||
|
|
||||||
|
@ -2871,10 +2901,11 @@ pub extern "C" fn Servo_DeclarationBlock_SetNumberValue(declarations:
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_SetPercentValue(declarations:
|
pub extern "C" fn Servo_DeclarationBlock_SetPercentValue(
|
||||||
RawServoDeclarationBlockBorrowed,
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
property: nsCSSPropertyID,
|
property: nsCSSPropertyID,
|
||||||
value: f32) {
|
value: f32,
|
||||||
|
) {
|
||||||
use style::properties::{PropertyDeclaration, LonghandId};
|
use style::properties::{PropertyDeclaration, LonghandId};
|
||||||
use style::properties::longhands::height::SpecifiedValue as Height;
|
use style::properties::longhands::height::SpecifiedValue as Height;
|
||||||
use style::properties::longhands::width::SpecifiedValue as Width;
|
use style::properties::longhands::width::SpecifiedValue as Width;
|
||||||
|
@ -2900,9 +2931,10 @@ pub extern "C" fn Servo_DeclarationBlock_SetPercentValue(declarations:
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_SetAutoValue(declarations:
|
pub extern "C" fn Servo_DeclarationBlock_SetAutoValue(
|
||||||
RawServoDeclarationBlockBorrowed,
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
property: nsCSSPropertyID) {
|
property: nsCSSPropertyID,
|
||||||
|
) {
|
||||||
use style::properties::{PropertyDeclaration, LonghandId};
|
use style::properties::{PropertyDeclaration, LonghandId};
|
||||||
use style::properties::longhands::height::SpecifiedValue as Height;
|
use style::properties::longhands::height::SpecifiedValue as Height;
|
||||||
use style::properties::longhands::width::SpecifiedValue as Width;
|
use style::properties::longhands::width::SpecifiedValue as Width;
|
||||||
|
@ -2925,9 +2957,10 @@ pub extern "C" fn Servo_DeclarationBlock_SetAutoValue(declarations:
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_SetCurrentColor(declarations:
|
pub extern "C" fn Servo_DeclarationBlock_SetCurrentColor(
|
||||||
RawServoDeclarationBlockBorrowed,
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
property: nsCSSPropertyID) {
|
property: nsCSSPropertyID,
|
||||||
|
) {
|
||||||
use style::properties::{PropertyDeclaration, LonghandId};
|
use style::properties::{PropertyDeclaration, LonghandId};
|
||||||
use style::values::specified::Color;
|
use style::values::specified::Color;
|
||||||
|
|
||||||
|
@ -2946,10 +2979,11 @@ pub extern "C" fn Servo_DeclarationBlock_SetCurrentColor(declarations:
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_SetColorValue(declarations:
|
pub extern "C" fn Servo_DeclarationBlock_SetColorValue(
|
||||||
RawServoDeclarationBlockBorrowed,
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
property: nsCSSPropertyID,
|
property: nsCSSPropertyID,
|
||||||
value: structs::nscolor) {
|
value: structs::nscolor,
|
||||||
|
) {
|
||||||
use style::gecko::values::convert_nscolor_to_rgba;
|
use style::gecko::values::convert_nscolor_to_rgba;
|
||||||
use style::properties::{PropertyDeclaration, LonghandId};
|
use style::properties::{PropertyDeclaration, LonghandId};
|
||||||
use style::properties::longhands;
|
use style::properties::longhands;
|
||||||
|
@ -2973,9 +3007,10 @@ pub extern "C" fn Servo_DeclarationBlock_SetColorValue(declarations:
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_SetFontFamily(declarations:
|
pub extern "C" fn Servo_DeclarationBlock_SetFontFamily(
|
||||||
RawServoDeclarationBlockBorrowed,
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
value: *const nsAString) {
|
value: *const nsAString,
|
||||||
|
) {
|
||||||
use cssparser::{Parser, ParserInput};
|
use cssparser::{Parser, ParserInput};
|
||||||
use style::properties::PropertyDeclaration;
|
use style::properties::PropertyDeclaration;
|
||||||
use style::properties::longhands::font_family::SpecifiedValue as FontFamily;
|
use style::properties::longhands::font_family::SpecifiedValue as FontFamily;
|
||||||
|
@ -2995,10 +3030,11 @@ pub extern "C" fn Servo_DeclarationBlock_SetFontFamily(declarations:
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_SetBackgroundImage(declarations:
|
pub extern "C" fn Servo_DeclarationBlock_SetBackgroundImage(
|
||||||
RawServoDeclarationBlockBorrowed,
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
value: *const nsAString,
|
value: *const nsAString,
|
||||||
raw_extra_data: *mut URLExtraData) {
|
raw_extra_data: *mut URLExtraData,
|
||||||
|
) {
|
||||||
use style::properties::PropertyDeclaration;
|
use style::properties::PropertyDeclaration;
|
||||||
use style::properties::longhands::background_image::SpecifiedValue as BackgroundImage;
|
use style::properties::longhands::background_image::SpecifiedValue as BackgroundImage;
|
||||||
use style::values::Either;
|
use style::values::Either;
|
||||||
|
@ -3022,8 +3058,9 @@ pub extern "C" fn Servo_DeclarationBlock_SetBackgroundImage(declarations:
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_SetTextDecorationColorOverride(declarations:
|
pub extern "C" fn Servo_DeclarationBlock_SetTextDecorationColorOverride(
|
||||||
RawServoDeclarationBlockBorrowed) {
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
|
) {
|
||||||
use style::properties::PropertyDeclaration;
|
use style::properties::PropertyDeclaration;
|
||||||
use style::properties::longhands::text_decoration_line;
|
use style::properties::longhands::text_decoration_line;
|
||||||
|
|
||||||
|
@ -3078,16 +3115,19 @@ pub extern "C" fn Servo_CSSSupports(cond: *const nsACString) -> bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_NoteExplicitHints(element: RawGeckoElementBorrowed,
|
pub extern "C" fn Servo_NoteExplicitHints(
|
||||||
|
element: RawGeckoElementBorrowed,
|
||||||
restyle_hint: nsRestyleHint,
|
restyle_hint: nsRestyleHint,
|
||||||
change_hint: nsChangeHint) {
|
change_hint: nsChangeHint,
|
||||||
|
) {
|
||||||
GeckoElement(element).note_explicit_hints(restyle_hint, change_hint);
|
GeckoElement(element).note_explicit_hints(restyle_hint, change_hint);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed,
|
pub extern "C" fn Servo_TakeChangeHint(
|
||||||
was_restyled: *mut bool) -> u32
|
element: RawGeckoElementBorrowed,
|
||||||
{
|
was_restyled: *mut bool
|
||||||
|
) -> u32 {
|
||||||
let was_restyled = unsafe { was_restyled.as_mut().unwrap() };
|
let was_restyled = unsafe { was_restyled.as_mut().unwrap() };
|
||||||
let element = GeckoElement(element);
|
let element = GeckoElement(element);
|
||||||
|
|
||||||
|
@ -3114,10 +3154,10 @@ pub extern "C" fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
|
pub extern "C" fn Servo_ResolveStyle(
|
||||||
_raw_data: RawServoStyleSetBorrowed)
|
element: RawGeckoElementBorrowed,
|
||||||
-> ServoStyleContextStrong
|
_raw_data: RawServoStyleSetBorrowed,
|
||||||
{
|
) -> ServoStyleContextStrong {
|
||||||
let element = GeckoElement(element);
|
let element = GeckoElement(element);
|
||||||
debug!("Servo_ResolveStyle: {:?}", element);
|
debug!("Servo_ResolveStyle: {:?}", element);
|
||||||
let data =
|
let data =
|
||||||
|
@ -3131,26 +3171,14 @@ pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_ResolveStyleAllowStale(element: RawGeckoElementBorrowed)
|
pub extern "C" fn Servo_ResolveStyleLazily(
|
||||||
-> ServoStyleContextStrong
|
element: RawGeckoElementBorrowed,
|
||||||
{
|
|
||||||
let element = GeckoElement(element);
|
|
||||||
debug!("Servo_ResolveStyleAllowStale: {:?}", element);
|
|
||||||
let data =
|
|
||||||
element.borrow_data().expect("Resolving style on unstyled element");
|
|
||||||
assert!(data.has_styles(), "Resolving style on unstyled element");
|
|
||||||
data.styles.primary().clone().into()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[no_mangle]
|
|
||||||
pub extern "C" fn Servo_ResolveStyleLazily(element: RawGeckoElementBorrowed,
|
|
||||||
pseudo_type: CSSPseudoElementType,
|
pseudo_type: CSSPseudoElementType,
|
||||||
rule_inclusion: StyleRuleInclusion,
|
rule_inclusion: StyleRuleInclusion,
|
||||||
snapshots: *const ServoElementSnapshotTable,
|
snapshots: *const ServoElementSnapshotTable,
|
||||||
raw_data: RawServoStyleSetBorrowed,
|
raw_data: RawServoStyleSetBorrowed,
|
||||||
ignore_existing_styles: bool)
|
ignore_existing_styles: bool
|
||||||
-> ServoStyleContextStrong
|
) -> ServoStyleContextStrong {
|
||||||
{
|
|
||||||
debug_assert!(!snapshots.is_null());
|
debug_assert!(!snapshots.is_null());
|
||||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||||
let guard = global_style_data.shared_lock.read();
|
let guard = global_style_data.shared_lock.read();
|
||||||
|
@ -3226,14 +3254,14 @@ pub extern "C" fn Servo_ResolveStyleLazily(element: RawGeckoElementBorrowed,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_ReparentStyle(style_to_reparent: ServoStyleContextBorrowed,
|
pub extern "C" fn Servo_ReparentStyle(
|
||||||
|
style_to_reparent: ServoStyleContextBorrowed,
|
||||||
parent_style: ServoStyleContextBorrowed,
|
parent_style: ServoStyleContextBorrowed,
|
||||||
parent_style_ignoring_first_line: ServoStyleContextBorrowed,
|
parent_style_ignoring_first_line: ServoStyleContextBorrowed,
|
||||||
layout_parent_style: ServoStyleContextBorrowed,
|
layout_parent_style: ServoStyleContextBorrowed,
|
||||||
element: RawGeckoElementBorrowedOrNull,
|
element: RawGeckoElementBorrowedOrNull,
|
||||||
raw_data: RawServoStyleSetBorrowed)
|
raw_data: RawServoStyleSetBorrowed,
|
||||||
-> ServoStyleContextStrong
|
) -> ServoStyleContextStrong {
|
||||||
{
|
|
||||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||||
let guard = global_style_data.shared_lock.read();
|
let guard = global_style_data.shared_lock.read();
|
||||||
let doc_data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
let doc_data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
||||||
|
@ -3365,12 +3393,13 @@ impl<'a> Iterator for PrioritizedPropertyIter<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_GetComputedKeyframeValues(keyframes: RawGeckoKeyframeListBorrowed,
|
pub extern "C" fn Servo_GetComputedKeyframeValues(
|
||||||
|
keyframes: RawGeckoKeyframeListBorrowed,
|
||||||
element: RawGeckoElementBorrowed,
|
element: RawGeckoElementBorrowed,
|
||||||
style: ServoStyleContextBorrowed,
|
style: ServoStyleContextBorrowed,
|
||||||
raw_data: RawServoStyleSetBorrowed,
|
raw_data: RawServoStyleSetBorrowed,
|
||||||
computed_keyframes: RawGeckoComputedKeyframeValuesListBorrowedMut)
|
computed_keyframes: RawGeckoComputedKeyframeValuesListBorrowedMut
|
||||||
{
|
) {
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use style::properties::LonghandIdSet;
|
use style::properties::LonghandIdSet;
|
||||||
|
|
||||||
|
@ -3476,11 +3505,13 @@ pub extern "C" fn Servo_GetComputedKeyframeValues(keyframes: RawGeckoKeyframeLis
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_GetAnimationValues(declarations: RawServoDeclarationBlockBorrowed,
|
pub extern "C" fn Servo_GetAnimationValues(
|
||||||
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
element: RawGeckoElementBorrowed,
|
element: RawGeckoElementBorrowed,
|
||||||
style: ServoStyleContextBorrowed,
|
style: ServoStyleContextBorrowed,
|
||||||
raw_data: RawServoStyleSetBorrowed,
|
raw_data: RawServoStyleSetBorrowed,
|
||||||
animation_values: RawGeckoServoAnimationValueListBorrowedMut) {
|
animation_values: RawGeckoServoAnimationValueListBorrowedMut,
|
||||||
|
) {
|
||||||
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
||||||
let metrics = get_metrics_provider_for_product();
|
let metrics = get_metrics_provider_for_product();
|
||||||
|
|
||||||
|
@ -3519,11 +3550,12 @@ pub extern "C" fn Servo_GetAnimationValues(declarations: RawServoDeclarationBloc
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_AnimationValue_Compute(element: RawGeckoElementBorrowed,
|
pub extern "C" fn Servo_AnimationValue_Compute(
|
||||||
|
element: RawGeckoElementBorrowed,
|
||||||
declarations: RawServoDeclarationBlockBorrowed,
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
style: ServoStyleContextBorrowed,
|
style: ServoStyleContextBorrowed,
|
||||||
raw_data: RawServoStyleSetBorrowed)
|
raw_data: RawServoStyleSetBorrowed,
|
||||||
-> RawServoAnimationValueStrong {
|
) -> RawServoAnimationValueStrong {
|
||||||
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
||||||
let metrics = get_metrics_provider_for_product();
|
let metrics = get_metrics_provider_for_product();
|
||||||
|
|
||||||
|
@ -3634,10 +3666,12 @@ fn fill_in_missing_keyframe_values(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_StyleSet_GetKeyframesForName(raw_data: RawServoStyleSetBorrowed,
|
pub extern "C" fn Servo_StyleSet_GetKeyframesForName(
|
||||||
|
raw_data: RawServoStyleSetBorrowed,
|
||||||
name: *mut nsAtom,
|
name: *mut nsAtom,
|
||||||
inherited_timing_function: nsTimingFunctionBorrowed,
|
inherited_timing_function: nsTimingFunctionBorrowed,
|
||||||
keyframes: RawGeckoKeyframeListBorrowedMut) -> bool {
|
keyframes: RawGeckoKeyframeListBorrowedMut,
|
||||||
|
) -> bool {
|
||||||
debug_assert!(keyframes.len() == 0,
|
debug_assert!(keyframes.len() == 0,
|
||||||
"keyframes should be initially empty");
|
"keyframes should be initially empty");
|
||||||
|
|
||||||
|
@ -3807,8 +3841,10 @@ pub extern "C" fn Servo_StyleSet_GetKeyframesForName(raw_data: RawServoStyleSetB
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_StyleSet_GetFontFaceRules(raw_data: RawServoStyleSetBorrowed,
|
pub extern "C" fn Servo_StyleSet_GetFontFaceRules(
|
||||||
rules: RawGeckoFontFaceRuleListBorrowedMut) {
|
raw_data: RawServoStyleSetBorrowed,
|
||||||
|
rules: RawGeckoFontFaceRuleListBorrowedMut,
|
||||||
|
) {
|
||||||
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
||||||
debug_assert!(rules.len() == 0);
|
debug_assert!(rules.len() == 0);
|
||||||
|
|
||||||
|
@ -3836,8 +3872,10 @@ pub extern "C" fn Servo_StyleSet_GetFontFaceRules(raw_data: RawServoStyleSetBorr
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_StyleSet_GetCounterStyleRule(raw_data: RawServoStyleSetBorrowed,
|
pub extern "C" fn Servo_StyleSet_GetCounterStyleRule(
|
||||||
name: *mut nsAtom) -> *mut nsCSSCounterStyleRule {
|
raw_data: RawServoStyleSetBorrowed,
|
||||||
|
name: *mut nsAtom,
|
||||||
|
) -> *mut nsCSSCounterStyleRule {
|
||||||
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -3856,7 +3894,8 @@ pub extern "C" fn Servo_StyleSet_GetCounterStyleRule(raw_data: RawServoStyleSetB
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_StyleSet_BuildFontFeatureValueSet(
|
pub extern "C" fn Servo_StyleSet_BuildFontFeatureValueSet(
|
||||||
raw_data: RawServoStyleSetBorrowed) -> *mut gfxFontFeatureValueSet {
|
raw_data: RawServoStyleSetBorrowed,
|
||||||
|
) -> *mut gfxFontFeatureValueSet {
|
||||||
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
||||||
|
|
||||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||||
|
@ -3991,9 +4030,11 @@ pub extern "C" fn Servo_StyleSet_HasStateDependency(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_GetCustomPropertyValue(computed_values: ServoStyleContextBorrowed,
|
pub extern "C" fn Servo_GetCustomPropertyValue(
|
||||||
|
computed_values: ServoStyleContextBorrowed,
|
||||||
name: *const nsAString,
|
name: *const nsAString,
|
||||||
value: *mut nsAString) -> bool {
|
value: *mut nsAString,
|
||||||
|
) -> bool {
|
||||||
let custom_properties = match computed_values.custom_properties() {
|
let custom_properties = match computed_values.custom_properties() {
|
||||||
Some(p) => p,
|
Some(p) => p,
|
||||||
None => return false,
|
None => return false,
|
||||||
|
@ -4018,9 +4059,11 @@ pub extern "C" fn Servo_GetCustomPropertiesCount(computed_values: ServoStyleCont
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_GetCustomPropertyNameAt(computed_values: ServoStyleContextBorrowed,
|
pub extern "C" fn Servo_GetCustomPropertyNameAt(
|
||||||
|
computed_values: ServoStyleContextBorrowed,
|
||||||
index: u32,
|
index: u32,
|
||||||
name: *mut nsAString) -> bool {
|
name: *mut nsAString,
|
||||||
|
) -> bool {
|
||||||
let custom_properties = match computed_values.custom_properties() {
|
let custom_properties = match computed_values.custom_properties() {
|
||||||
Some(p) => p,
|
Some(p) => p,
|
||||||
None => return false,
|
None => return false,
|
||||||
|
@ -4045,27 +4088,31 @@ pub unsafe extern "C" fn Servo_ReleaseArcStringData(string: *const RawOffsetArc<
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe extern "C" fn Servo_CloneArcStringData(string: *const RawOffsetArc<RustString>)
|
pub unsafe extern "C" fn Servo_CloneArcStringData(
|
||||||
-> RawOffsetArc<RustString> {
|
string: *const RawOffsetArc<RustString>,
|
||||||
|
) -> RawOffsetArc<RustString> {
|
||||||
let string = string as *const RawOffsetArc<String>;
|
let string = string as *const RawOffsetArc<String>;
|
||||||
let cloned = (*string).clone();
|
let cloned = (*string).clone();
|
||||||
mem::transmute::<_, RawOffsetArc<RustString>>(cloned)
|
mem::transmute::<_, RawOffsetArc<RustString>>(cloned)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe extern "C" fn Servo_GetArcStringData(string: *const RustString,
|
pub unsafe extern "C" fn Servo_GetArcStringData(
|
||||||
|
string: *const RustString,
|
||||||
utf8_chars: *mut *const u8,
|
utf8_chars: *mut *const u8,
|
||||||
utf8_len: *mut u32)
|
utf8_len: *mut u32,
|
||||||
{
|
) {
|
||||||
let string = &*(string as *const String);
|
let string = &*(string as *const String);
|
||||||
*utf8_len = string.len() as u32;
|
*utf8_len = string.len() as u32;
|
||||||
*utf8_chars = string.as_ptr();
|
*utf8_chars = string.as_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_ProcessInvalidations(set: RawServoStyleSetBorrowed,
|
pub extern "C" fn Servo_ProcessInvalidations(
|
||||||
|
set: RawServoStyleSetBorrowed,
|
||||||
element: RawGeckoElementBorrowed,
|
element: RawGeckoElementBorrowed,
|
||||||
snapshots: *const ServoElementSnapshotTable) {
|
snapshots: *const ServoElementSnapshotTable,
|
||||||
|
) {
|
||||||
debug_assert!(!snapshots.is_null());
|
debug_assert!(!snapshots.is_null());
|
||||||
|
|
||||||
let element = GeckoElement(element);
|
let element = GeckoElement(element);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue