Auto merge of #16328 - bradwerth:computedStyles, r=heycam

Stylo: Add FFI interfaces for exposing style sources.

https://bugzilla.mozilla.org/show_bug.cgi?id=1346256
https://reviewboard.mozilla.org/r/119044/

<!-- 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/16328)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-04-10 04:04:54 -05:00 committed by GitHub
commit a0a60ba61d
6 changed files with 59 additions and 6 deletions

View file

@ -615,9 +615,11 @@ mod bindings {
"RawServoAnimationValue",
"RawServoAnimationValueMap",
"RawServoDeclarationBlock",
"RawServoStyleRule",
"RawGeckoPresContext",
"RawGeckoPresContextOwned",
"RawGeckoStyleAnimationList",
"RawGeckoServoStyleRuleList",
"RawGeckoURLExtraData",
"RefPtr",
"CSSPseudoClassType",
@ -733,6 +735,7 @@ mod bindings {
"RawGeckoKeyframeList",
"RawGeckoComputedKeyframeValuesList",
"RawGeckoFontFaceRuleList",
"RawGeckoServoStyleRuleList",
];
for &ty in structs_types.iter() {
builder = builder.hide_type(ty)

View file

@ -9,9 +9,10 @@
#![allow(non_snake_case, missing_docs)]
use gecko_bindings::bindings::{RawServoMediaList, RawServoMediaRule, RawServoNamespaceRule, RawServoPageRule};
use gecko_bindings::bindings::{RawServoStyleSheet, RawServoStyleRule, RawServoImportRule};
use gecko_bindings::bindings::{RawServoStyleSheet, RawServoImportRule};
use gecko_bindings::bindings::{ServoComputedValues, ServoCssRules};
use gecko_bindings::structs::{RawServoAnimationValue, RawServoAnimationValueMap, RawServoDeclarationBlock};
use gecko_bindings::structs::{RawServoAnimationValue, RawServoAnimationValueMap};
use gecko_bindings::structs::{RawServoDeclarationBlock, RawServoStyleRule};
use gecko_bindings::sugar::ownership::{HasArcFFI, HasFFI};
use media_queries::MediaList;
use parking_lot::RwLock;

View file

@ -16,9 +16,11 @@ use gecko_bindings::structs::RawGeckoAnimationValueList;
use gecko_bindings::structs::RawServoAnimationValue;
use gecko_bindings::structs::RawServoAnimationValueMap;
use gecko_bindings::structs::RawServoDeclarationBlock;
use gecko_bindings::structs::RawServoStyleRule;
use gecko_bindings::structs::RawGeckoPresContext;
use gecko_bindings::structs::RawGeckoPresContextOwned;
use gecko_bindings::structs::RawGeckoStyleAnimationList;
use gecko_bindings::structs::RawGeckoServoStyleRuleList;
use gecko_bindings::structs::RawGeckoURLExtraData;
use gecko_bindings::structs::RefPtr;
use gecko_bindings::structs::CSSPseudoClassType;
@ -208,8 +210,6 @@ pub type RawServoDeclarationBlockBorrowedOrNull<'a> = Option<&'a RawServoDeclara
pub type RawServoStyleRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoStyleRule>;
pub type RawServoStyleRuleBorrowed<'a> = &'a RawServoStyleRule;
pub type RawServoStyleRuleBorrowedOrNull<'a> = Option<&'a RawServoStyleRule>;
enum RawServoStyleRuleVoid { }
pub struct RawServoStyleRule(RawServoStyleRuleVoid);
pub type RawServoImportRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoImportRule>;
pub type RawServoImportRuleBorrowed<'a> = &'a RawServoImportRule;
pub type RawServoImportRuleBorrowedOrNull<'a> = Option<&'a RawServoImportRule>;
@ -307,6 +307,10 @@ pub type RawGeckoFontFaceRuleListBorrowed<'a> = &'a RawGeckoFontFaceRuleList;
pub type RawGeckoFontFaceRuleListBorrowedOrNull<'a> = Option<&'a RawGeckoFontFaceRuleList>;
pub type RawGeckoFontFaceRuleListBorrowedMut<'a> = &'a mut RawGeckoFontFaceRuleList;
pub type RawGeckoFontFaceRuleListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoFontFaceRuleList>;
pub type RawGeckoServoStyleRuleListBorrowed<'a> = &'a RawGeckoServoStyleRuleList;
pub type RawGeckoServoStyleRuleListBorrowedOrNull<'a> = Option<&'a RawGeckoServoStyleRuleList>;
pub type RawGeckoServoStyleRuleListBorrowedMut<'a> = &'a mut RawGeckoServoStyleRuleList;
pub type RawGeckoServoStyleRuleListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoServoStyleRuleList>;
extern "C" {
pub fn Gecko_EnsureTArrayCapacity(aArray: *mut ::std::os::raw::c_void,
@ -1918,6 +1922,11 @@ extern "C" {
pub fn Servo_Element_GetSnapshot(element: RawGeckoElementBorrowed)
-> *mut ServoElementSnapshot;
}
extern "C" {
pub fn Servo_Element_GetStyleRuleList(element: RawGeckoElementBorrowed,
rules:
RawGeckoServoStyleRuleListBorrowedMut);
}
extern "C" {
pub fn Servo_NoteExplicitHints(element: RawGeckoElementBorrowed,
restyle_hint: nsRestyleHint,

View file

@ -26659,6 +26659,9 @@ pub mod root {
pub struct RawServoDeclarationBlock([u8; 0]);
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct RawServoStyleRule([u8; 0]);
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct RawServoAnimationValue([u8; 0]);
#[repr(C)]
#[derive(Debug, Copy, Clone)]
@ -26680,6 +26683,8 @@ pub mod root {
pub type RawGeckoAnimationPropertySegment =
root::mozilla::AnimationPropertySegment;
pub type RawGeckoComputedTiming = root::mozilla::ComputedTiming;
pub type RawGeckoServoStyleRuleList =
root::nsTArray<*const root::RawServoStyleRule>;
pub type RawServoAnimationValueMapBorrowed =
*const root::RawServoAnimationValueMap;
pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode;
@ -26706,6 +26711,8 @@ pub mod root {
*const root::RawGeckoAnimationPropertySegment;
pub type RawGeckoComputedTimingBorrowed =
*const root::RawGeckoComputedTiming;
pub type RawGeckoServoStyleRuleListBorrowedMut =
*mut root::RawGeckoServoStyleRuleList;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nsSVGAngle([u8; 0]);

View file

@ -26000,6 +26000,9 @@ pub mod root {
pub struct RawServoDeclarationBlock([u8; 0]);
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct RawServoStyleRule([u8; 0]);
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct RawServoAnimationValue([u8; 0]);
#[repr(C)]
#[derive(Debug, Copy, Clone)]
@ -26021,6 +26024,8 @@ pub mod root {
pub type RawGeckoAnimationPropertySegment =
root::mozilla::AnimationPropertySegment;
pub type RawGeckoComputedTiming = root::mozilla::ComputedTiming;
pub type RawGeckoServoStyleRuleList =
root::nsTArray<*const root::RawServoStyleRule>;
pub type RawServoAnimationValueMapBorrowed =
*const root::RawServoAnimationValueMap;
pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode;
@ -26047,6 +26052,8 @@ pub mod root {
*const root::RawGeckoAnimationPropertySegment;
pub type RawGeckoComputedTimingBorrowed =
*const root::RawGeckoComputedTiming;
pub type RawGeckoServoStyleRuleListBorrowedMut =
*mut root::RawGeckoServoStyleRuleList;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nsSVGAngle([u8; 0]);