mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
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:
commit
2cd9dcebee
5 changed files with 677 additions and 520 deletions
|
@ -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") =>
|
||||
|
|
|
@ -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
|
@ -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> {}
|
||||
|
|
|
@ -43,6 +43,7 @@ use style::gecko_bindings::bindings::{RawServoMediaListBorrowed, RawServoMediaLi
|
|||
use style::gecko_bindings::bindings::{RawServoMediaRule, RawServoMediaRuleBorrowed};
|
||||
use style::gecko_bindings::bindings::{RawServoNamespaceRule, RawServoNamespaceRuleBorrowed};
|
||||
use style::gecko_bindings::bindings::{RawServoPageRule, RawServoPageRuleBorrowed};
|
||||
use style::gecko_bindings::bindings::{RawServoSelectorListBorrowed, RawServoSelectorListOwned};
|
||||
use style::gecko_bindings::bindings::{RawServoStyleSetBorrowed, RawServoStyleSetOwned};
|
||||
use style::gecko_bindings::bindings::{RawServoStyleSheetContentsBorrowed, ServoComputedDataBorrowed};
|
||||
use style::gecko_bindings::bindings::{RawServoStyleSheetContentsStrong, ServoStyleContextBorrowed};
|
||||
|
@ -91,6 +92,7 @@ use style::gecko_bindings::structs::OriginFlags_User;
|
|||
use style::gecko_bindings::structs::OriginFlags_UserAgent;
|
||||
use style::gecko_bindings::structs::RawGeckoGfxMatrix4x4;
|
||||
use style::gecko_bindings::structs::RawGeckoPresContextOwned;
|
||||
use style::gecko_bindings::structs::RawServoSelectorList;
|
||||
use style::gecko_bindings::structs::SeenPtrs;
|
||||
use style::gecko_bindings::structs::ServoElementSnapshotTable;
|
||||
use style::gecko_bindings::structs::ServoStyleSetSizes;
|
||||
|
@ -1521,8 +1523,10 @@ pub extern "C" fn Servo_StyleRule_SelectorMatchesElement(rule: RawServoStyleRule
|
|||
#[no_mangle]
|
||||
pub unsafe extern "C" fn Servo_SelectorList_Matches(
|
||||
element: RawGeckoElementBorrowed,
|
||||
selectors: &::selectors::SelectorList<SelectorImpl>,
|
||||
selectors: RawServoSelectorListBorrowed,
|
||||
) -> bool {
|
||||
use std::borrow::Borrow;
|
||||
|
||||
let element = GeckoElement(element);
|
||||
let mut context = MatchingContext::new(
|
||||
MatchingMode::Normal,
|
||||
|
@ -1532,7 +1536,8 @@ pub unsafe extern "C" fn Servo_SelectorList_Matches(
|
|||
);
|
||||
context.scope_element = Some(element.opaque());
|
||||
|
||||
selectors::matching::matches_selector_list(selectors, &element, &mut context)
|
||||
let selectors = ::selectors::SelectorList::from_ffi(selectors).borrow();
|
||||
selectors::matching::matches_selector_list(&selectors, &element, &mut context)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
@ -4113,7 +4118,7 @@ pub extern "C" fn Servo_HasPendingRestyleAncestor(element: RawGeckoElementBorrow
|
|||
#[no_mangle]
|
||||
pub unsafe extern "C" fn Servo_SelectorList_Parse(
|
||||
selector_list: *const nsACString,
|
||||
) -> *mut ::selectors::SelectorList<SelectorImpl> {
|
||||
) -> *mut RawServoSelectorList {
|
||||
use style::selector_parser::SelectorParser;
|
||||
|
||||
debug_assert!(!selector_list.is_null());
|
||||
|
@ -4124,10 +4129,10 @@ pub unsafe extern "C" fn Servo_SelectorList_Parse(
|
|||
Err(..) => return ptr::null_mut(),
|
||||
};
|
||||
|
||||
Box::into_raw(Box::new(selector_list))
|
||||
Box::into_raw(Box::new(selector_list)) as *mut RawServoSelectorList
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn Servo_SelectorList_Drop(list: *mut ::selectors::SelectorList<SelectorImpl>) {
|
||||
let _ = Box::from_raw(list);
|
||||
pub unsafe extern "C" fn Servo_SelectorList_Drop(list: RawServoSelectorListOwned) {
|
||||
let _ = list.into_box::<::selectors::SelectorList<SelectorImpl>>();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue