mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
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:
commit
95bc7ece47
6 changed files with 1401 additions and 1228 deletions
|
@ -188,6 +188,7 @@ COMPILATION_TARGETS = {
|
|||
"StyleTransition",
|
||||
"UniquePtr",
|
||||
],
|
||||
"bitfield_enum_types": ["nsChangeHint", "nsRestyleHint"],
|
||||
"opaque_types": [
|
||||
"atomic___base",
|
||||
"nsAString_internal_char_traits",
|
||||
|
@ -524,6 +525,11 @@ def build(objdir, target_name, debug, debugger, kind_name=None,
|
|||
flags.append("--whitelist-var")
|
||||
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:
|
||||
for ty in current_target["opaque_types"]:
|
||||
flags.append("--opaque-type")
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
use dom::TRestyleDamage;
|
||||
use gecko_bindings::bindings;
|
||||
use gecko_bindings::structs;
|
||||
use gecko_bindings::structs::{nsChangeHint, nsStyleContext};
|
||||
use gecko_bindings::sugar::ownership::FFIArcHelpers;
|
||||
use properties::ComputedValues;
|
||||
|
@ -23,8 +24,7 @@ impl TRestyleDamage for GeckoRestyleDamage {
|
|||
type PreExistingComputedValues = nsStyleContext;
|
||||
|
||||
fn empty() -> Self {
|
||||
use std::mem;
|
||||
GeckoRestyleDamage(unsafe { mem::transmute(0u32) })
|
||||
GeckoRestyleDamage(nsChangeHint(0))
|
||||
}
|
||||
|
||||
fn compute(source: &nsStyleContext,
|
||||
|
@ -38,7 +38,7 @@ impl TRestyleDamage for GeckoRestyleDamage {
|
|||
}
|
||||
|
||||
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;
|
||||
|
||||
fn bitor(self, other: Self) -> Self {
|
||||
use std::mem;
|
||||
GeckoRestyleDamage(unsafe { mem::transmute(self.0 as u32 | other.0 as u32) })
|
||||
GeckoRestyleDamage(self.0 | other.0)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -162,8 +162,6 @@ cfg_if! {
|
|||
pub static nsGkAtoms_anonlocation: *mut nsIAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms3anyE"]
|
||||
pub static nsGkAtoms_any: *mut nsIAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms6mozappE"]
|
||||
pub static nsGkAtoms_mozapp: *mut nsIAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms6appletE"]
|
||||
pub static nsGkAtoms_applet: *mut nsIAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms12applyImportsE"]
|
||||
|
@ -1944,8 +1942,6 @@ cfg_if! {
|
|||
pub static nsGkAtoms_parameter: *mut nsIAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms6parentE"]
|
||||
pub static nsGkAtoms_parent: *mut nsIAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms9parentappE"]
|
||||
pub static nsGkAtoms_parentapp: *mut nsIAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms13parentfocusedE"]
|
||||
pub static nsGkAtoms_parentfocused: *mut nsIAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms9parsetypeE"]
|
||||
|
@ -5799,8 +5795,6 @@ cfg_if! {
|
|||
pub static nsGkAtoms_anonlocation: *mut nsIAtom;
|
||||
#[link_name = "?any@nsGkAtoms@@2PEAVnsIAtom@@EA"]
|
||||
pub static nsGkAtoms_any: *mut nsIAtom;
|
||||
#[link_name = "?mozapp@nsGkAtoms@@2PEAVnsIAtom@@EA"]
|
||||
pub static nsGkAtoms_mozapp: *mut nsIAtom;
|
||||
#[link_name = "?applet@nsGkAtoms@@2PEAVnsIAtom@@EA"]
|
||||
pub static nsGkAtoms_applet: *mut nsIAtom;
|
||||
#[link_name = "?applyImports@nsGkAtoms@@2PEAVnsIAtom@@EA"]
|
||||
|
@ -7581,8 +7575,6 @@ cfg_if! {
|
|||
pub static nsGkAtoms_parameter: *mut nsIAtom;
|
||||
#[link_name = "?parent@nsGkAtoms@@2PEAVnsIAtom@@EA"]
|
||||
pub static nsGkAtoms_parent: *mut nsIAtom;
|
||||
#[link_name = "?parentapp@nsGkAtoms@@2PEAVnsIAtom@@EA"]
|
||||
pub static nsGkAtoms_parentapp: *mut nsIAtom;
|
||||
#[link_name = "?parentfocused@nsGkAtoms@@2PEAVnsIAtom@@EA"]
|
||||
pub static nsGkAtoms_parentfocused: *mut nsIAtom;
|
||||
#[link_name = "?parsetype@nsGkAtoms@@2PEAVnsIAtom@@EA"]
|
||||
|
@ -11436,8 +11428,6 @@ cfg_if! {
|
|||
pub static nsGkAtoms_anonlocation: *mut nsIAtom;
|
||||
#[link_name = "\x01?any@nsGkAtoms@@2PAVnsIAtom@@A"]
|
||||
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"]
|
||||
pub static nsGkAtoms_applet: *mut nsIAtom;
|
||||
#[link_name = "\x01?applyImports@nsGkAtoms@@2PAVnsIAtom@@A"]
|
||||
|
@ -13218,8 +13208,6 @@ cfg_if! {
|
|||
pub static nsGkAtoms_parameter: *mut nsIAtom;
|
||||
#[link_name = "\x01?parent@nsGkAtoms@@2PAVnsIAtom@@A"]
|
||||
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"]
|
||||
pub static nsGkAtoms_parentfocused: *mut nsIAtom;
|
||||
#[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 _) } };
|
||||
("any") =>
|
||||
{ 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") =>
|
||||
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_applet as *mut _) } };
|
||||
("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 _) } };
|
||||
("parent") =>
|
||||
{ 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") =>
|
||||
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_parentfocused as *mut _) } };
|
||||
("parsetype") =>
|
||||
|
|
|
@ -23,24 +23,24 @@ macro_rules! check_enum_value {
|
|||
// const-fn and no other way to access the numerical value :-(
|
||||
macro_rules! check_enum_value_non_static {
|
||||
($a:expr, $b:expr) => {
|
||||
assert_eq!($a as usize, $b as usize);
|
||||
assert_eq!($a.0 as usize, $b as usize);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn assert_restyle_hints_match() {
|
||||
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
|
||||
// Restyle_AllDescendants (but without running selector matching on the
|
||||
// element). ServoRestyleManager interprets it like that, but in practice we
|
||||
// should align the behavior with Gecko adding a new restyle hint, maybe?
|
||||
//
|
||||
// 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!(nsRestyleHint::eRestyle_LaterSiblings, RESTYLE_LATER_SIBLINGS.bits());
|
||||
check_enum_value_non_static!(structs::nsRestyleHint_eRestyle_SomeDescendants, RESTYLE_DESCENDANTS.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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue