Auto merge of #18800 - hiikezoe:fix-mismatched-arguments-for-servo-selector-list, r=emilio

Fix mismatched arguments for servo selector list

<!-- Please describe your changes on the following line: -->
https://bugzilla.mozilla.org/show_bug.cgi?id=1406811

This needs to be fixed to update binding files.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- 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/18800)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-10-10 01:20:38 -05:00 committed by GitHub
commit 2cd9dcebee
5 changed files with 677 additions and 520 deletions

View file

@ -1122,6 +1122,8 @@ cfg_if! {
pub static nsGkAtoms_integrity: *mut nsAtom;
#[link_name = "_ZN9nsGkAtoms12intersectionE"]
pub static nsGkAtoms_intersection: *mut nsAtom;
#[link_name = "_ZN9nsGkAtoms24intersectionobserverlistE"]
pub static nsGkAtoms_intersectionobserverlist: *mut nsAtom;
#[link_name = "_ZN9nsGkAtoms2isE"]
pub static nsGkAtoms_is: *mut nsAtom;
#[link_name = "_ZN9nsGkAtoms11iscontainerE"]
@ -6291,6 +6293,8 @@ cfg_if! {
pub static nsGkAtoms_integrity: *mut nsAtom;
#[link_name = "?intersection@nsGkAtoms@@2PEAVnsAtom@@EA"]
pub static nsGkAtoms_intersection: *mut nsAtom;
#[link_name = "?intersectionobserverlist@nsGkAtoms@@2PEAVnsAtom@@EA"]
pub static nsGkAtoms_intersectionobserverlist: *mut nsAtom;
#[link_name = "?is@nsGkAtoms@@2PEAVnsAtom@@EA"]
pub static nsGkAtoms_is: *mut nsAtom;
#[link_name = "?iscontainer@nsGkAtoms@@2PEAVnsAtom@@EA"]
@ -11460,6 +11464,8 @@ cfg_if! {
pub static nsGkAtoms_integrity: *mut nsAtom;
#[link_name = "\x01?intersection@nsGkAtoms@@2PAVnsAtom@@A"]
pub static nsGkAtoms_intersection: *mut nsAtom;
#[link_name = "\x01?intersectionobserverlist@nsGkAtoms@@2PAVnsAtom@@A"]
pub static nsGkAtoms_intersectionobserverlist: *mut nsAtom;
#[link_name = "\x01?is@nsGkAtoms@@2PAVnsAtom@@A"]
pub static nsGkAtoms_is: *mut nsAtom;
#[link_name = "\x01?iscontainer@nsGkAtoms@@2PAVnsAtom@@A"]
@ -16632,6 +16638,8 @@ macro_rules! atom {
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_integrity as *mut _) } };
("intersection") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_intersection as *mut _) } };
("intersectionobserverlist") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_intersectionobserverlist as *mut _) } };
("is") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_is as *mut _) } };
("iscontainer") =>

View file

@ -45,6 +45,7 @@ use gecko_bindings::structs::RawGeckoStyleChildrenIterator;
use gecko_bindings::structs::RawGeckoServoStyleRuleList;
use gecko_bindings::structs::RawGeckoURLExtraData;
use gecko_bindings::structs::RawGeckoXBLBinding;
use gecko_bindings::structs::RawServoSelectorList;
use gecko_bindings::structs::RefPtr;
use gecko_bindings::structs::RustString;
use gecko_bindings::structs::CSSPseudoClassType;
@ -250,6 +251,12 @@ pub type RawServoStyleSetBorrowedMut<'a> = &'a mut RawServoStyleSet;
pub type RawServoStyleSetBorrowedMutOrNull<'a> = Option<&'a mut RawServoStyleSet>;
enum RawServoStyleSetVoid { }
pub struct RawServoStyleSet(RawServoStyleSetVoid);
pub type RawServoSelectorListOwned = ::gecko_bindings::sugar::ownership::Owned<RawServoSelectorList>;
pub type RawServoSelectorListOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<RawServoSelectorList>;
pub type RawServoSelectorListBorrowed<'a> = &'a RawServoSelectorList;
pub type RawServoSelectorListBorrowedOrNull<'a> = Option<&'a RawServoSelectorList>;
pub type RawServoSelectorListBorrowedMut<'a> = &'a mut RawServoSelectorList;
pub type RawServoSelectorListBorrowedMutOrNull<'a> = Option<&'a mut RawServoSelectorList>;
pub type ServoElementSnapshotOwned = ::gecko_bindings::sugar::ownership::Owned<ServoElementSnapshot>;
pub type ServoElementSnapshotOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<ServoElementSnapshot>;
pub type ServoElementSnapshotBorrowed<'a> = &'a ServoElementSnapshot;
@ -514,6 +521,9 @@ extern "C" {
extern "C" {
pub fn Servo_StyleSet_Drop(ptr: RawServoStyleSetOwned);
}
extern "C" {
pub fn Servo_SelectorList_Drop(ptr: RawServoSelectorListOwned);
}
extern "C" {
pub fn Gecko_IsInDocument(node: RawGeckoNodeBorrowed) -> bool;
}
@ -628,9 +638,9 @@ extern "C" {
name: *mut nsAtom) -> bool;
}
extern "C" {
pub fn Gecko_AttrEquals(element: RawGeckoElementBorrowed,
ns: *mut nsAtom, name: *mut nsAtom,
str: *mut nsAtom, ignoreCase: bool) -> bool;
pub fn Gecko_AttrEquals(element: RawGeckoElementBorrowed, ns: *mut nsAtom,
name: *mut nsAtom, str: *mut nsAtom,
ignoreCase: bool) -> bool;
}
extern "C" {
pub fn Gecko_AttrDashEquals(element: RawGeckoElementBorrowed,
@ -665,8 +675,7 @@ extern "C" {
}
extern "C" {
pub fn Gecko_SnapshotAtomAttrValue(element: *const ServoElementSnapshot,
attribute: *mut nsAtom)
-> *mut nsAtom;
attribute: *mut nsAtom) -> *mut nsAtom;
}
extern "C" {
pub fn Gecko_SnapshotLangValue(element: *const ServoElementSnapshot)
@ -674,8 +683,7 @@ extern "C" {
}
extern "C" {
pub fn Gecko_SnapshotHasAttr(element: *const ServoElementSnapshot,
ns: *mut nsAtom, name: *mut nsAtom)
-> bool;
ns: *mut nsAtom, name: *mut nsAtom) -> bool;
}
extern "C" {
pub fn Gecko_SnapshotAttrEquals(element: *const ServoElementSnapshot,
@ -698,10 +706,9 @@ extern "C" {
extern "C" {
pub fn Gecko_SnapshotAttrHasSubstring(element:
*const ServoElementSnapshot,
ns: *mut nsAtom,
name: *mut nsAtom,
str: *mut nsAtom,
ignore_case: bool) -> bool;
ns: *mut nsAtom, name: *mut nsAtom,
str: *mut nsAtom, ignore_case: bool)
-> bool;
}
extern "C" {
pub fn Gecko_SnapshotAttrHasPrefix(element: *const ServoElementSnapshot,
@ -1015,8 +1022,7 @@ extern "C" {
aImageValue: *mut ImageValue);
}
extern "C" {
pub fn Gecko_SetImageElement(image: *mut nsStyleImage,
atom: *mut nsAtom);
pub fn Gecko_SetImageElement(image: *mut nsStyleImage, atom: *mut nsAtom);
}
extern "C" {
pub fn Gecko_CopyImageValueFrom(image: *mut nsStyleImage,
@ -1580,9 +1586,6 @@ extern "C" {
extern "C" {
pub fn Gecko_ShouldCreateStyleThreadPool() -> bool;
}
extern "C" {
pub fn Gecko_GetSystemPageSize() -> usize;
}
extern "C" {
pub fn Gecko_Construct_Default_nsStyleFont(ptr: *mut nsStyleFont,
pres_context:
@ -1902,6 +1905,10 @@ extern "C" {
extern "C" {
pub fn Gecko_SetJemallocThreadLocalArena(enabled: bool);
}
extern "C" {
pub fn Gecko_AddBufferToCrashReport(addr: *const ::std::os::raw::c_void,
len: usize);
}
extern "C" {
pub fn Servo_Element_ClearData(node: RawGeckoElementBorrowed);
}
@ -2090,6 +2097,15 @@ extern "C" {
RawServoDeclarationBlockBorrowed)
-> ServoStyleContextStrong;
}
extern "C" {
pub fn Servo_SelectorList_Parse(selector_list: *const nsACString)
-> *mut RawServoSelectorList;
}
extern "C" {
pub fn Servo_SelectorList_Matches(arg1: RawGeckoElementBorrowed,
arg2: RawServoSelectorListBorrowed)
-> bool;
}
extern "C" {
pub fn Servo_StyleSet_AddSizeOfExcludingThis(malloc_size_of: MallocSizeOf,
malloc_enclosing_size_of:

File diff suppressed because it is too large Load diff

View file

@ -7,7 +7,10 @@
use cssparser::{BasicParseError, Parser, ToCss, Token, CowRcStr};
use element_state::ElementState;
use gecko_bindings::structs::CSSPseudoClassType;
use gecko_bindings::structs::RawServoSelectorList;
use gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI};
use selector_parser::{SelectorParser, PseudoElementCascadeType};
use selectors::SelectorList;
use selectors::parser::{Selector, SelectorMethods, SelectorParseError};
use selectors::visitor::SelectorVisitor;
use std::fmt;
@ -438,3 +441,9 @@ fn utf16_to_ascii_lowercase(unit: u16) -> u16 {
_ => unit
}
}
unsafe impl HasFFI for SelectorList<SelectorImpl> {
type FFIType = RawServoSelectorList;
}
unsafe impl HasSimpleFFI for SelectorList<SelectorImpl> {}
unsafe impl HasBoxFFI for SelectorList<SelectorImpl> {}