Auto merge of #14268 - Manishearth:regen, r=bholley

Regenerate bindings

Don't merge yet

<!-- 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/14268)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-11-21 12:19:39 -06:00 committed by GitHub
commit 95bc7ece47
6 changed files with 1401 additions and 1228 deletions

View file

@ -188,6 +188,7 @@ COMPILATION_TARGETS = {
"StyleTransition", "StyleTransition",
"UniquePtr", "UniquePtr",
], ],
"bitfield_enum_types": ["nsChangeHint", "nsRestyleHint"],
"opaque_types": [ "opaque_types": [
"atomic___base", "atomic___base",
"nsAString_internal_char_traits", "nsAString_internal_char_traits",
@ -524,6 +525,11 @@ def build(objdir, target_name, debug, debugger, kind_name=None,
flags.append("--whitelist-var") flags.append("--whitelist-var")
flags.append(header) flags.append(header)
if "bitfield_enum_types" in current_target:
for ty in current_target["bitfield_enum_types"]:
flags.append("--bitfield-enum")
flags.append(ty)
if "opaque_types" in current_target: if "opaque_types" in current_target:
for ty in current_target["opaque_types"]: for ty in current_target["opaque_types"]:
flags.append("--opaque-type") flags.append("--opaque-type")

View file

@ -4,6 +4,7 @@
use dom::TRestyleDamage; use dom::TRestyleDamage;
use gecko_bindings::bindings; use gecko_bindings::bindings;
use gecko_bindings::structs;
use gecko_bindings::structs::{nsChangeHint, nsStyleContext}; use gecko_bindings::structs::{nsChangeHint, nsStyleContext};
use gecko_bindings::sugar::ownership::FFIArcHelpers; use gecko_bindings::sugar::ownership::FFIArcHelpers;
use properties::ComputedValues; use properties::ComputedValues;
@ -23,8 +24,7 @@ impl TRestyleDamage for GeckoRestyleDamage {
type PreExistingComputedValues = nsStyleContext; type PreExistingComputedValues = nsStyleContext;
fn empty() -> Self { fn empty() -> Self {
use std::mem; GeckoRestyleDamage(nsChangeHint(0))
GeckoRestyleDamage(unsafe { mem::transmute(0u32) })
} }
fn compute(source: &nsStyleContext, fn compute(source: &nsStyleContext,
@ -38,7 +38,7 @@ impl TRestyleDamage for GeckoRestyleDamage {
} }
fn rebuild_and_reflow() -> Self { fn rebuild_and_reflow() -> Self {
GeckoRestyleDamage(nsChangeHint::nsChangeHint_ReconstructFrame) GeckoRestyleDamage(structs::nsChangeHint_nsChangeHint_ReconstructFrame)
} }
} }
@ -46,8 +46,7 @@ impl BitOr for GeckoRestyleDamage {
type Output = Self; type Output = Self;
fn bitor(self, other: Self) -> Self { fn bitor(self, other: Self) -> Self {
use std::mem; GeckoRestyleDamage(self.0 | other.0)
GeckoRestyleDamage(unsafe { mem::transmute(self.0 as u32 | other.0 as u32) })
} }
} }

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -162,8 +162,6 @@ cfg_if! {
pub static nsGkAtoms_anonlocation: *mut nsIAtom; pub static nsGkAtoms_anonlocation: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms3anyE"] #[link_name = "_ZN9nsGkAtoms3anyE"]
pub static nsGkAtoms_any: *mut nsIAtom; pub static nsGkAtoms_any: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms6mozappE"]
pub static nsGkAtoms_mozapp: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms6appletE"] #[link_name = "_ZN9nsGkAtoms6appletE"]
pub static nsGkAtoms_applet: *mut nsIAtom; pub static nsGkAtoms_applet: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms12applyImportsE"] #[link_name = "_ZN9nsGkAtoms12applyImportsE"]
@ -1944,8 +1942,6 @@ cfg_if! {
pub static nsGkAtoms_parameter: *mut nsIAtom; pub static nsGkAtoms_parameter: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms6parentE"] #[link_name = "_ZN9nsGkAtoms6parentE"]
pub static nsGkAtoms_parent: *mut nsIAtom; pub static nsGkAtoms_parent: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms9parentappE"]
pub static nsGkAtoms_parentapp: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms13parentfocusedE"] #[link_name = "_ZN9nsGkAtoms13parentfocusedE"]
pub static nsGkAtoms_parentfocused: *mut nsIAtom; pub static nsGkAtoms_parentfocused: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms9parsetypeE"] #[link_name = "_ZN9nsGkAtoms9parsetypeE"]
@ -5799,8 +5795,6 @@ cfg_if! {
pub static nsGkAtoms_anonlocation: *mut nsIAtom; pub static nsGkAtoms_anonlocation: *mut nsIAtom;
#[link_name = "?any@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?any@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_any: *mut nsIAtom; pub static nsGkAtoms_any: *mut nsIAtom;
#[link_name = "?mozapp@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_mozapp: *mut nsIAtom;
#[link_name = "?applet@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?applet@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_applet: *mut nsIAtom; pub static nsGkAtoms_applet: *mut nsIAtom;
#[link_name = "?applyImports@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?applyImports@nsGkAtoms@@2PEAVnsIAtom@@EA"]
@ -7581,8 +7575,6 @@ cfg_if! {
pub static nsGkAtoms_parameter: *mut nsIAtom; pub static nsGkAtoms_parameter: *mut nsIAtom;
#[link_name = "?parent@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?parent@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_parent: *mut nsIAtom; pub static nsGkAtoms_parent: *mut nsIAtom;
#[link_name = "?parentapp@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_parentapp: *mut nsIAtom;
#[link_name = "?parentfocused@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?parentfocused@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_parentfocused: *mut nsIAtom; pub static nsGkAtoms_parentfocused: *mut nsIAtom;
#[link_name = "?parsetype@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?parsetype@nsGkAtoms@@2PEAVnsIAtom@@EA"]
@ -11436,8 +11428,6 @@ cfg_if! {
pub static nsGkAtoms_anonlocation: *mut nsIAtom; pub static nsGkAtoms_anonlocation: *mut nsIAtom;
#[link_name = "\x01?any@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?any@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_any: *mut nsIAtom; pub static nsGkAtoms_any: *mut nsIAtom;
#[link_name = "\x01?mozapp@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_mozapp: *mut nsIAtom;
#[link_name = "\x01?applet@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?applet@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_applet: *mut nsIAtom; pub static nsGkAtoms_applet: *mut nsIAtom;
#[link_name = "\x01?applyImports@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?applyImports@nsGkAtoms@@2PAVnsIAtom@@A"]
@ -13218,8 +13208,6 @@ cfg_if! {
pub static nsGkAtoms_parameter: *mut nsIAtom; pub static nsGkAtoms_parameter: *mut nsIAtom;
#[link_name = "\x01?parent@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?parent@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_parent: *mut nsIAtom; pub static nsGkAtoms_parent: *mut nsIAtom;
#[link_name = "\x01?parentapp@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_parentapp: *mut nsIAtom;
#[link_name = "\x01?parentfocused@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?parentfocused@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_parentfocused: *mut nsIAtom; pub static nsGkAtoms_parentfocused: *mut nsIAtom;
#[link_name = "\x01?parsetype@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?parsetype@nsGkAtoms@@2PAVnsIAtom@@A"]
@ -17076,8 +17064,6 @@ macro_rules! atom {
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_anonlocation as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_anonlocation as *mut _) } };
("any") => ("any") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_any as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_any as *mut _) } };
("mozapp") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_mozapp as *mut _) } };
("applet") => ("applet") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_applet as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_applet as *mut _) } };
("apply-imports") => ("apply-imports") =>
@ -18858,8 +18844,6 @@ macro_rules! atom {
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_parameter as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_parameter as *mut _) } };
("parent") => ("parent") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_parent as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_parent as *mut _) } };
("parentapp") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_parentapp as *mut _) } };
("parentfocused") => ("parentfocused") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_parentfocused as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_parentfocused as *mut _) } };
("parsetype") => ("parsetype") =>

View file

@ -23,24 +23,24 @@ macro_rules! check_enum_value {
// const-fn and no other way to access the numerical value :-( // const-fn and no other way to access the numerical value :-(
macro_rules! check_enum_value_non_static { macro_rules! check_enum_value_non_static {
($a:expr, $b:expr) => { ($a:expr, $b:expr) => {
assert_eq!($a as usize, $b as usize); assert_eq!($a.0 as usize, $b as usize);
} }
} }
#[test] #[test]
fn assert_restyle_hints_match() { fn assert_restyle_hints_match() {
use style::restyle_hints::*; // For flags use style::restyle_hints::*; // For flags
use style::gecko_bindings::structs::nsRestyleHint; use style::gecko_bindings::structs;
check_enum_value_non_static!(nsRestyleHint::eRestyle_Self, RESTYLE_SELF.bits()); check_enum_value_non_static!(structs::nsRestyleHint_eRestyle_Self, RESTYLE_SELF.bits());
// XXX This for Servo actually means something like an hypothetical // XXX This for Servo actually means something like an hypothetical
// Restyle_AllDescendants (but without running selector matching on the // Restyle_AllDescendants (but without running selector matching on the
// element). ServoRestyleManager interprets it like that, but in practice we // element). ServoRestyleManager interprets it like that, but in practice we
// should align the behavior with Gecko adding a new restyle hint, maybe? // should align the behavior with Gecko adding a new restyle hint, maybe?
// //
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1291786 // See https://bugzilla.mozilla.org/show_bug.cgi?id=1291786
check_enum_value_non_static!(nsRestyleHint::eRestyle_SomeDescendants, RESTYLE_DESCENDANTS.bits()); check_enum_value_non_static!(structs::nsRestyleHint_eRestyle_SomeDescendants, RESTYLE_DESCENDANTS.bits());
check_enum_value_non_static!(nsRestyleHint::eRestyle_LaterSiblings, RESTYLE_LATER_SIBLINGS.bits()); check_enum_value_non_static!(structs::nsRestyleHint_eRestyle_LaterSiblings, RESTYLE_LATER_SIBLINGS.bits());
} }
// Note that we can't call each_pseudo_element, parse_pseudo_element, or // Note that we can't call each_pseudo_element, parse_pseudo_element, or