servo: Merge #13904 - Move RawGecko{Node,Element,Document} to bindings (from upsuper:bug1311598); r=heycam

This is the Servo side change of [bug 1311598](https://bugzilla.mozilla.org/show_bug.cgi?id=1311598). This has been approved by @heycam on Bugzilla.

(Please don't merge it before the Gecko side code gets merged into mozilla-central)

Source-Repo: https://github.com/servo/servo
Source-Revision: 8bd79789803157bf9ef7a57738fe99a7c04ac71f
This commit is contained in:
Xidorn Quan 2016-10-24 16:13:27 -05:00
Родитель 9a353e3cb2
Коммит 78035c0733
5 изменённых файлов: 40 добавлений и 43 удалений

Просмотреть файл

@ -171,9 +171,6 @@ COMPILATION_TARGETS = {
"nsTArrayHeader",
"pair",
"Position",
"RawGeckoDocument",
"RawGeckoElement",
"RawGeckoNode",
"Runnable",
"ServoAttrSnapshot",
"ServoElementSnapshot",
@ -248,14 +245,17 @@ COMPILATION_TARGETS = {
"files": [
"{}/dist/include/mozilla/ServoBindings.h",
],
# Types to just use from the `structs` target.
"structs_types": [
"FontFamilyList",
"FontFamilyType",
"whitelist": [
"RawGeckoDocument",
"RawGeckoElement",
"RawGeckoNode",
],
# Types to just use from the `structs` target.
"structs_types": [
"Element",
"FontFamilyList",
"FontFamilyType",
"ServoElementSnapshot",
"SheetParsingMode",
"StyleBasicShape",
@ -265,6 +265,8 @@ COMPILATION_TARGETS = {
"nsChangeHint",
"nsFont",
"nsIAtom",
"nsIDocument",
"nsINode",
"nsIPrincipal",
"nsIURI",
"nsMainThreadPtrHolder",

Просмотреть файл

@ -22,12 +22,12 @@ use gecko_bindings::bindings::{Gecko_GetLastChild, Gecko_GetNextStyleChild};
use gecko_bindings::bindings::{Gecko_GetServoDeclarationBlock, Gecko_IsHTMLElementInHTMLDocument};
use gecko_bindings::bindings::{Gecko_IsLink, Gecko_IsRootElement};
use gecko_bindings::bindings::{Gecko_IsUnvisitedLink, Gecko_IsVisitedLink, Gecko_Namespace};
use gecko_bindings::bindings::{RawGeckoDocument, RawGeckoElement, RawGeckoNode};
use gecko_bindings::bindings::Gecko_ClassOrClassList;
use gecko_bindings::bindings::Gecko_GetStyleContext;
use gecko_bindings::bindings::Gecko_SetNodeFlags;
use gecko_bindings::structs;
use gecko_bindings::structs::{NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO, NODE_IS_DIRTY_FOR_SERVO};
use gecko_bindings::structs::{RawGeckoDocument, RawGeckoElement, RawGeckoNode};
use gecko_bindings::structs::{nsChangeHint, nsIAtom, nsIContent, nsStyleContext};
use gecko_bindings::sugar::ownership::FFIArcHelpers;
use libc::uintptr_t;

Просмотреть файл

@ -39,11 +39,9 @@ pub type StyleChildrenIteratorBorrowedMutOrNull<'a> = Option<&'a mut StyleChildr
pub type StyleChildrenIteratorOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<StyleChildrenIterator>;
enum StyleChildrenIteratorVoid{ }
pub struct StyleChildrenIterator(StyleChildrenIteratorVoid);
use gecko_bindings::structs::Element;
use gecko_bindings::structs::FontFamilyList;
use gecko_bindings::structs::FontFamilyType;
use gecko_bindings::structs::RawGeckoDocument;
use gecko_bindings::structs::RawGeckoElement;
use gecko_bindings::structs::RawGeckoNode;
use gecko_bindings::structs::ServoElementSnapshot;
use gecko_bindings::structs::SheetParsingMode;
use gecko_bindings::structs::StyleBasicShape;
@ -53,6 +51,8 @@ use gecko_bindings::structs::nsCSSShadowArray;
use gecko_bindings::structs::nsChangeHint;
use gecko_bindings::structs::nsFont;
use gecko_bindings::structs::nsIAtom;
use gecko_bindings::structs::nsIDocument;
use gecko_bindings::structs::nsINode;
use gecko_bindings::structs::nsIPrincipal;
use gecko_bindings::structs::nsIURI;
use gecko_bindings::structs::nsMainThreadPtrHolder;
@ -170,6 +170,32 @@ use gecko_bindings::structs::nsStyleXUL;
unsafe impl Send for nsStyleXUL {}
unsafe impl Sync for nsStyleXUL {}
pub type RawGeckoNode = nsINode;
pub type RawGeckoElement = Element;
pub type RawGeckoDocument = nsIDocument;
extern "C" {
pub fn Servo_StyleSheet_AddRef(ptr: RawServoStyleSheetBorrowed);
}
extern "C" {
pub fn Servo_StyleSheet_Release(ptr: RawServoStyleSheetBorrowed);
}
extern "C" {
pub fn Servo_ComputedValues_AddRef(ptr: ServoComputedValuesBorrowed);
}
extern "C" {
pub fn Servo_ComputedValues_Release(ptr: ServoComputedValuesBorrowed);
}
extern "C" {
pub fn Servo_DeclarationBlock_AddRef(ptr:
RawServoDeclarationBlockBorrowed);
}
extern "C" {
pub fn Servo_DeclarationBlock_Release(ptr:
RawServoDeclarationBlockBorrowed);
}
extern "C" {
pub fn Servo_StyleSet_Drop(ptr: RawServoStyleSetOwned);
}
extern "C" {
pub fn Gecko_EnsureTArrayCapacity(aArray: *mut ::std::os::raw::c_void,
aCapacity: usize, aElementSize: usize);
@ -821,12 +847,6 @@ extern "C" {
*mut ThreadSafePrincipalHolder)
-> RawServoStyleSheetStrong;
}
extern "C" {
pub fn Servo_StyleSheet_AddRef(sheet: RawServoStyleSheetBorrowed);
}
extern "C" {
pub fn Servo_StyleSheet_Release(sheet: RawServoStyleSheetBorrowed);
}
extern "C" {
pub fn Servo_StyleSheet_HasRules(sheet: RawServoStyleSheetBorrowed)
-> bool;
@ -834,9 +854,6 @@ extern "C" {
extern "C" {
pub fn Servo_StyleSet_Init() -> RawServoStyleSetOwned;
}
extern "C" {
pub fn Servo_StyleSet_Drop(set: RawServoStyleSetOwned);
}
extern "C" {
pub fn Servo_StyleSet_AppendStyleSheet(set: RawServoStyleSetBorrowed,
sheet: RawServoStyleSheetBorrowed);
@ -879,14 +896,6 @@ extern "C" {
pub fn Servo_ParseStyleAttribute(bytes: *const u8, length: u32)
-> RawServoDeclarationBlockStrong;
}
extern "C" {
pub fn Servo_DeclarationBlock_AddRef(declarations:
RawServoDeclarationBlockBorrowed);
}
extern "C" {
pub fn Servo_DeclarationBlock_Release(declarations:
RawServoDeclarationBlockBorrowed);
}
extern "C" {
pub fn Servo_DeclarationBlock_Equals(a: RawServoDeclarationBlockBorrowed,
b: RawServoDeclarationBlockBorrowed)
@ -929,14 +938,6 @@ extern "C" {
ServoComputedValuesBorrowedOrNull)
-> ServoComputedValuesStrong;
}
extern "C" {
pub fn Servo_ComputedValues_AddRef(computed_values:
ServoComputedValuesBorrowed);
}
extern "C" {
pub fn Servo_ComputedValues_Release(computed_values:
ServoComputedValuesBorrowed);
}
extern "C" {
pub fn Servo_Initialize();
}

Просмотреть файл

@ -10035,9 +10035,6 @@ fn bindgen_test_layout_nsStyleVisibility() {
assert_eq!(::std::mem::size_of::<nsStyleVisibility>() , 7usize);
assert_eq!(::std::mem::align_of::<nsStyleVisibility>() , 1usize);
}
pub type RawGeckoNode = nsINode;
pub type RawGeckoElement = Element;
pub type RawGeckoDocument = nsIDocument;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Position {

Просмотреть файл

@ -9981,9 +9981,6 @@ fn bindgen_test_layout_nsStyleVisibility() {
assert_eq!(::std::mem::size_of::<nsStyleVisibility>() , 7usize);
assert_eq!(::std::mem::align_of::<nsStyleVisibility>() , 1usize);
}
pub type RawGeckoNode = nsINode;
pub type RawGeckoElement = Element;
pub type RawGeckoDocument = nsIDocument;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Position {