mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Rename ServoDeclarationBlock to RawServoDeclarationBlock.
This commit is contained in:
parent
3ade2b6de3
commit
edeeafe5a7
4 changed files with 32 additions and 32 deletions
|
@ -309,7 +309,7 @@ COMPILATION_TARGETS = {
|
||||||
],
|
],
|
||||||
"servo_nullable_arc_types": [
|
"servo_nullable_arc_types": [
|
||||||
"ServoComputedValues", "RawServoStyleSheet",
|
"ServoComputedValues", "RawServoStyleSheet",
|
||||||
"ServoDeclarationBlock"
|
"RawServoDeclarationBlock"
|
||||||
],
|
],
|
||||||
"servo_owned_types": [
|
"servo_owned_types": [
|
||||||
"RawServoStyleSet",
|
"RawServoStyleSet",
|
||||||
|
|
|
@ -81,7 +81,7 @@ impl PartialEq for GeckoDeclarationBlock {
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl HasFFI for GeckoDeclarationBlock {
|
unsafe impl HasFFI for GeckoDeclarationBlock {
|
||||||
type FFIType = bindings::ServoDeclarationBlock;
|
type FFIType = bindings::RawServoDeclarationBlock;
|
||||||
}
|
}
|
||||||
unsafe impl HasArcFFI for GeckoDeclarationBlock {}
|
unsafe impl HasArcFFI for GeckoDeclarationBlock {}
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,11 @@ pub type RawServoStyleSheetBorrowedOrNull<'a> = Option<&'a RawServoStyleSheet>;
|
||||||
pub type RawServoStyleSheetBorrowed<'a> = &'a RawServoStyleSheet;
|
pub type RawServoStyleSheetBorrowed<'a> = &'a RawServoStyleSheet;
|
||||||
enum RawServoStyleSheetVoid{ }
|
enum RawServoStyleSheetVoid{ }
|
||||||
pub struct RawServoStyleSheet(RawServoStyleSheetVoid);
|
pub struct RawServoStyleSheet(RawServoStyleSheetVoid);
|
||||||
pub type ServoDeclarationBlockStrong = ::gecko_bindings::sugar::ownership::Strong<ServoDeclarationBlock>;
|
pub type RawServoDeclarationBlockStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoDeclarationBlock>;
|
||||||
pub type ServoDeclarationBlockBorrowedOrNull<'a> = Option<&'a ServoDeclarationBlock>;
|
pub type RawServoDeclarationBlockBorrowedOrNull<'a> = Option<&'a RawServoDeclarationBlock>;
|
||||||
pub type ServoDeclarationBlockBorrowed<'a> = &'a ServoDeclarationBlock;
|
pub type RawServoDeclarationBlockBorrowed<'a> = &'a RawServoDeclarationBlock;
|
||||||
enum ServoDeclarationBlockVoid{ }
|
enum RawServoDeclarationBlockVoid{ }
|
||||||
pub struct ServoDeclarationBlock(ServoDeclarationBlockVoid);
|
pub struct RawServoDeclarationBlock(RawServoDeclarationBlockVoid);
|
||||||
pub type RawGeckoNodeBorrowed<'a> = &'a RawGeckoNode;
|
pub type RawGeckoNodeBorrowed<'a> = &'a RawGeckoNode;
|
||||||
pub type RawGeckoNodeBorrowedOrNull<'a> = Option<&'a RawGeckoNode>;
|
pub type RawGeckoNodeBorrowedOrNull<'a> = Option<&'a RawGeckoNode>;
|
||||||
pub type RawGeckoElementBorrowed<'a> = &'a RawGeckoElement;
|
pub type RawGeckoElementBorrowed<'a> = &'a RawGeckoElement;
|
||||||
|
@ -370,7 +370,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Gecko_GetServoDeclarationBlock(element: RawGeckoElementBorrowed)
|
pub fn Gecko_GetServoDeclarationBlock(element: RawGeckoElementBorrowed)
|
||||||
-> ServoDeclarationBlockBorrowedOrNull;
|
-> RawServoDeclarationBlockBorrowedOrNull;
|
||||||
}
|
}
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Gecko_Atomize(aString: *const ::std::os::raw::c_char, aLength: u32)
|
pub fn Gecko_Atomize(aString: *const ::std::os::raw::c_char, aLength: u32)
|
||||||
|
@ -865,11 +865,11 @@ extern "C" {
|
||||||
base: *mut ThreadSafeURIHolder,
|
base: *mut ThreadSafeURIHolder,
|
||||||
referrer: *mut ThreadSafeURIHolder,
|
referrer: *mut ThreadSafeURIHolder,
|
||||||
principal: *mut ThreadSafePrincipalHolder)
|
principal: *mut ThreadSafePrincipalHolder)
|
||||||
-> ServoDeclarationBlockStrong;
|
-> RawServoDeclarationBlockStrong;
|
||||||
}
|
}
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Servo_RestyleWithAddedDeclaration(declarations:
|
pub fn Servo_RestyleWithAddedDeclaration(declarations:
|
||||||
ServoDeclarationBlockBorrowed,
|
RawServoDeclarationBlockBorrowed,
|
||||||
previous_style:
|
previous_style:
|
||||||
ServoComputedValuesBorrowed)
|
ServoComputedValuesBorrowed)
|
||||||
-> ServoComputedValuesStrong;
|
-> ServoComputedValuesStrong;
|
||||||
|
@ -877,37 +877,37 @@ extern "C" {
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Servo_ParseStyleAttribute(bytes: *const u8, length: u32,
|
pub fn Servo_ParseStyleAttribute(bytes: *const u8, length: u32,
|
||||||
cache: *mut nsHTMLCSSStyleSheet)
|
cache: *mut nsHTMLCSSStyleSheet)
|
||||||
-> ServoDeclarationBlockStrong;
|
-> RawServoDeclarationBlockStrong;
|
||||||
}
|
}
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Servo_DeclarationBlock_AddRef(declarations:
|
pub fn Servo_DeclarationBlock_AddRef(declarations:
|
||||||
ServoDeclarationBlockBorrowed);
|
RawServoDeclarationBlockBorrowed);
|
||||||
}
|
}
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Servo_DeclarationBlock_Release(declarations:
|
pub fn Servo_DeclarationBlock_Release(declarations:
|
||||||
ServoDeclarationBlockBorrowed);
|
RawServoDeclarationBlockBorrowed);
|
||||||
}
|
}
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Servo_DeclarationBlock_Equals(a: ServoDeclarationBlockBorrowed,
|
pub fn Servo_DeclarationBlock_Equals(a: RawServoDeclarationBlockBorrowed,
|
||||||
b: ServoDeclarationBlockBorrowed)
|
b: RawServoDeclarationBlockBorrowed)
|
||||||
-> bool;
|
-> bool;
|
||||||
}
|
}
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Servo_DeclarationBlock_GetCache(declarations:
|
pub fn Servo_DeclarationBlock_GetCache(declarations:
|
||||||
ServoDeclarationBlockBorrowed)
|
RawServoDeclarationBlockBorrowed)
|
||||||
-> *mut nsHTMLCSSStyleSheet;
|
-> *mut nsHTMLCSSStyleSheet;
|
||||||
}
|
}
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Servo_DeclarationBlock_SetImmutable(declarations:
|
pub fn Servo_DeclarationBlock_SetImmutable(declarations:
|
||||||
ServoDeclarationBlockBorrowed);
|
RawServoDeclarationBlockBorrowed);
|
||||||
}
|
}
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Servo_DeclarationBlock_ClearCachePointer(declarations:
|
pub fn Servo_DeclarationBlock_ClearCachePointer(declarations:
|
||||||
ServoDeclarationBlockBorrowed);
|
RawServoDeclarationBlockBorrowed);
|
||||||
}
|
}
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Servo_DeclarationBlock_SerializeOneValue(declarations:
|
pub fn Servo_DeclarationBlock_SerializeOneValue(declarations:
|
||||||
ServoDeclarationBlockBorrowed,
|
RawServoDeclarationBlockBorrowed,
|
||||||
buffer: *mut nsString);
|
buffer: *mut nsString);
|
||||||
}
|
}
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
@ -24,10 +24,10 @@ use style::gecko::traversal::RecalcStyleOnly;
|
||||||
use style::gecko::wrapper::{DUMMY_BASE_URL, GeckoDeclarationBlock};
|
use style::gecko::wrapper::{DUMMY_BASE_URL, GeckoDeclarationBlock};
|
||||||
use style::gecko::wrapper::{GeckoElement, GeckoNode};
|
use style::gecko::wrapper::{GeckoElement, GeckoNode};
|
||||||
use style::gecko_bindings::bindings::{RawGeckoElementBorrowed, RawGeckoNodeBorrowed};
|
use style::gecko_bindings::bindings::{RawGeckoElementBorrowed, RawGeckoNodeBorrowed};
|
||||||
|
use style::gecko_bindings::bindings::{RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockStrong};
|
||||||
use style::gecko_bindings::bindings::{RawServoStyleSetBorrowed, RawServoStyleSetOwned};
|
use style::gecko_bindings::bindings::{RawServoStyleSetBorrowed, RawServoStyleSetOwned};
|
||||||
use style::gecko_bindings::bindings::{RawServoStyleSheetBorrowed, ServoComputedValuesBorrowed};
|
use style::gecko_bindings::bindings::{RawServoStyleSheetBorrowed, ServoComputedValuesBorrowed};
|
||||||
use style::gecko_bindings::bindings::{RawServoStyleSheetStrong, ServoComputedValuesStrong};
|
use style::gecko_bindings::bindings::{RawServoStyleSheetStrong, ServoComputedValuesStrong};
|
||||||
use style::gecko_bindings::bindings::{ServoDeclarationBlockBorrowed, ServoDeclarationBlockStrong};
|
|
||||||
use style::gecko_bindings::bindings::{ThreadSafePrincipalHolder, ThreadSafeURIHolder};
|
use style::gecko_bindings::bindings::{ThreadSafePrincipalHolder, ThreadSafeURIHolder};
|
||||||
use style::gecko_bindings::bindings::{nsHTMLCSSStyleSheet, ServoComputedValuesBorrowedOrNull};
|
use style::gecko_bindings::bindings::{nsHTMLCSSStyleSheet, ServoComputedValuesBorrowedOrNull};
|
||||||
use style::gecko_bindings::bindings::Gecko_Utf8SliceToString;
|
use style::gecko_bindings::bindings::Gecko_Utf8SliceToString;
|
||||||
|
@ -127,7 +127,7 @@ pub extern "C" fn Servo_RestyleSubtree(node: RawGeckoNodeBorrowed,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_RestyleWithAddedDeclaration(declarations: ServoDeclarationBlockBorrowed,
|
pub extern "C" fn Servo_RestyleWithAddedDeclaration(declarations: RawServoDeclarationBlockBorrowed,
|
||||||
previous_style: ServoComputedValuesBorrowed)
|
previous_style: ServoComputedValuesBorrowed)
|
||||||
-> ServoComputedValuesStrong
|
-> ServoComputedValuesStrong
|
||||||
{
|
{
|
||||||
|
@ -381,7 +381,7 @@ pub extern "C" fn Servo_ParseProperty(property_bytes: *const u8,
|
||||||
base: *mut ThreadSafeURIHolder,
|
base: *mut ThreadSafeURIHolder,
|
||||||
referrer: *mut ThreadSafeURIHolder,
|
referrer: *mut ThreadSafeURIHolder,
|
||||||
principal: *mut ThreadSafePrincipalHolder)
|
principal: *mut ThreadSafePrincipalHolder)
|
||||||
-> ServoDeclarationBlockStrong {
|
-> RawServoDeclarationBlockStrong {
|
||||||
// All this string wrangling is temporary until the Gecko string bindings land (bug 1294742).
|
// All this string wrangling is temporary until the Gecko string bindings land (bug 1294742).
|
||||||
let name = unsafe { from_utf8_unchecked(slice::from_raw_parts(property_bytes,
|
let name = unsafe { from_utf8_unchecked(slice::from_raw_parts(property_bytes,
|
||||||
property_length as usize)) };
|
property_length as usize)) };
|
||||||
|
@ -404,7 +404,7 @@ pub extern "C" fn Servo_ParseProperty(property_bytes: *const u8,
|
||||||
match PropertyDeclaration::parse(name, &context, &mut Parser::new(value_str),
|
match PropertyDeclaration::parse(name, &context, &mut Parser::new(value_str),
|
||||||
&mut results, false) {
|
&mut results, false) {
|
||||||
PropertyDeclarationParseResult::ValidOrIgnoredDeclaration => {},
|
PropertyDeclarationParseResult::ValidOrIgnoredDeclaration => {},
|
||||||
_ => return ServoDeclarationBlockStrong::null(),
|
_ => return RawServoDeclarationBlockStrong::null(),
|
||||||
}
|
}
|
||||||
|
|
||||||
let results = results.into_iter().map(|r| (r, Importance::Normal)).collect();
|
let results = results.into_iter().map(|r| (r, Importance::Normal)).collect();
|
||||||
|
@ -421,7 +421,7 @@ pub extern "C" fn Servo_ParseProperty(property_bytes: *const u8,
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_ParseStyleAttribute(bytes: *const u8, length: u32,
|
pub extern "C" fn Servo_ParseStyleAttribute(bytes: *const u8, length: u32,
|
||||||
cache: *mut nsHTMLCSSStyleSheet)
|
cache: *mut nsHTMLCSSStyleSheet)
|
||||||
-> ServoDeclarationBlockStrong {
|
-> RawServoDeclarationBlockStrong {
|
||||||
let value = unsafe { from_utf8_unchecked(slice::from_raw_parts(bytes, length as usize)) };
|
let value = unsafe { from_utf8_unchecked(slice::from_raw_parts(bytes, length as usize)) };
|
||||||
Arc::new(GeckoDeclarationBlock {
|
Arc::new(GeckoDeclarationBlock {
|
||||||
declarations: GeckoElement::parse_style_attribute(value).map(|block| {
|
declarations: GeckoElement::parse_style_attribute(value).map(|block| {
|
||||||
|
@ -433,41 +433,41 @@ pub extern "C" fn Servo_ParseStyleAttribute(bytes: *const u8, length: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_AddRef(declarations: ServoDeclarationBlockBorrowed) {
|
pub extern "C" fn Servo_DeclarationBlock_AddRef(declarations: RawServoDeclarationBlockBorrowed) {
|
||||||
unsafe { GeckoDeclarationBlock::addref(declarations) };
|
unsafe { GeckoDeclarationBlock::addref(declarations) };
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_Release(declarations: ServoDeclarationBlockBorrowed) {
|
pub extern "C" fn Servo_DeclarationBlock_Release(declarations: RawServoDeclarationBlockBorrowed) {
|
||||||
unsafe { GeckoDeclarationBlock::release(declarations) };
|
unsafe { GeckoDeclarationBlock::release(declarations) };
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_Equals(a: ServoDeclarationBlockBorrowed,
|
pub extern "C" fn Servo_DeclarationBlock_Equals(a: RawServoDeclarationBlockBorrowed,
|
||||||
b: ServoDeclarationBlockBorrowed)
|
b: RawServoDeclarationBlockBorrowed)
|
||||||
-> bool {
|
-> bool {
|
||||||
GeckoDeclarationBlock::as_arc(&a) == GeckoDeclarationBlock::as_arc(&b)
|
GeckoDeclarationBlock::as_arc(&a) == GeckoDeclarationBlock::as_arc(&b)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_GetCache(declarations: ServoDeclarationBlockBorrowed)
|
pub extern "C" fn Servo_DeclarationBlock_GetCache(declarations: RawServoDeclarationBlockBorrowed)
|
||||||
-> *mut nsHTMLCSSStyleSheet {
|
-> *mut nsHTMLCSSStyleSheet {
|
||||||
GeckoDeclarationBlock::as_arc(&declarations).cache.load(Ordering::Relaxed)
|
GeckoDeclarationBlock::as_arc(&declarations).cache.load(Ordering::Relaxed)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_SetImmutable(declarations: ServoDeclarationBlockBorrowed) {
|
pub extern "C" fn Servo_DeclarationBlock_SetImmutable(declarations: RawServoDeclarationBlockBorrowed) {
|
||||||
GeckoDeclarationBlock::as_arc(&declarations).immutable.store(true, Ordering::Relaxed)
|
GeckoDeclarationBlock::as_arc(&declarations).immutable.store(true, Ordering::Relaxed)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_ClearCachePointer(declarations: ServoDeclarationBlockBorrowed) {
|
pub extern "C" fn Servo_DeclarationBlock_ClearCachePointer(declarations: RawServoDeclarationBlockBorrowed) {
|
||||||
GeckoDeclarationBlock::as_arc(&declarations).cache.store(ptr::null_mut(), Ordering::Relaxed)
|
GeckoDeclarationBlock::as_arc(&declarations).cache.store(ptr::null_mut(), Ordering::Relaxed)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_SerializeOneValue(
|
pub extern "C" fn Servo_DeclarationBlock_SerializeOneValue(
|
||||||
declarations: ServoDeclarationBlockBorrowed,
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
buffer: *mut nsString)
|
buffer: *mut nsString)
|
||||||
{
|
{
|
||||||
let mut string = String::new();
|
let mut string = String::new();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue