зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #20061 - style: Make XBL / Shadow DOM use something more light-weight than a Stylist (from emilio:author-styles); r=xidorn
Introduce AuthorStyles, which is just a struct aggregating stylesheets + CascadeData, with a quirks_mode parameter because XBL sucks so bad. Bug: 1436059 Reviewed-by: xidorn MozReview-Commit-ID: 7q99tSNXo0K Source-Repo: https://github.com/servo/servo Source-Revision: 504b901cc82db5c5e02e157cec9753f7c297ac2c --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 79252144a91938156e03e4bf1be76988a14beeed
This commit is contained in:
Родитель
9ccfb5a21c
Коммит
946bc4825a
|
@ -0,0 +1,91 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
//! A set of author stylesheets and their computed representation, such as the
|
||||
//! ones used for ShadowRoot and XBL.
|
||||
|
||||
use context::QuirksMode;
|
||||
use dom::TElement;
|
||||
#[cfg(feature = "gecko")]
|
||||
use gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI};
|
||||
use invalidation::media_queries::ToMediaListKey;
|
||||
use media_queries::Device;
|
||||
use shared_lock::SharedRwLockReadGuard;
|
||||
use stylesheet_set::AuthorStylesheetSet;
|
||||
use stylesheets::StylesheetInDocument;
|
||||
use stylist::CascadeData;
|
||||
|
||||
|
||||
/// A set of author stylesheets and their computed representation, such as the
|
||||
/// ones used for ShadowRoot and XBL.
|
||||
pub struct AuthorStyles<S>
|
||||
where
|
||||
S: StylesheetInDocument + PartialEq + 'static,
|
||||
{
|
||||
/// The sheet collection, which holds the sheet pointers, the invalidations,
|
||||
/// and all that stuff.
|
||||
pub stylesheets: AuthorStylesheetSet<S>,
|
||||
/// The actual cascade data computed from the stylesheets.
|
||||
pub data: CascadeData,
|
||||
/// The quirks mode of the last stylesheet flush, used because XBL sucks and
|
||||
/// we should really fix it, see bug 1406875.
|
||||
pub quirks_mode: QuirksMode,
|
||||
}
|
||||
|
||||
impl<S> AuthorStyles<S>
|
||||
where
|
||||
S: StylesheetInDocument + PartialEq + 'static,
|
||||
{
|
||||
/// Create an empty AuthorStyles.
|
||||
#[inline]
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
stylesheets: AuthorStylesheetSet::new(),
|
||||
data: CascadeData::new(),
|
||||
quirks_mode: QuirksMode::NoQuirks,
|
||||
}
|
||||
}
|
||||
|
||||
/// Flush the pending sheet changes, updating `data` as appropriate.
|
||||
///
|
||||
/// TODO(emilio): Need a host element and a snapshot map to do invalidation
|
||||
/// properly.
|
||||
#[inline]
|
||||
pub fn flush<E>(
|
||||
&mut self,
|
||||
device: &Device,
|
||||
quirks_mode: QuirksMode,
|
||||
guard: &SharedRwLockReadGuard,
|
||||
)
|
||||
where
|
||||
E: TElement,
|
||||
S: ToMediaListKey,
|
||||
{
|
||||
let flusher = self.stylesheets.flush::<E>(
|
||||
/* host = */ None,
|
||||
/* snapshot_map = */ None,
|
||||
);
|
||||
|
||||
if flusher.sheets.dirty() {
|
||||
self.quirks_mode = quirks_mode;
|
||||
}
|
||||
|
||||
// Ignore OOM.
|
||||
let _ = self.data.rebuild(
|
||||
device,
|
||||
quirks_mode,
|
||||
flusher.sheets,
|
||||
guard,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
unsafe impl HasFFI for AuthorStyles<::gecko::data::GeckoStyleSheet> {
|
||||
type FFIType = ::gecko_bindings::bindings::RawServoAuthorStyles;
|
||||
}
|
||||
#[cfg(feature = "gecko")]
|
||||
unsafe impl HasSimpleFFI for AuthorStyles<::gecko::data::GeckoStyleSheet> {}
|
||||
#[cfg(feature = "gecko")]
|
||||
unsafe impl HasBoxFFI for AuthorStyles<::gecko::data::GeckoStyleSheet> {}
|
|
@ -754,7 +754,7 @@ pub trait TElement
|
|||
fn each_xbl_cascade_data<'a, F>(&self, _: F) -> bool
|
||||
where
|
||||
Self: 'a,
|
||||
F: FnMut(AtomicRef<'a, CascadeData>, QuirksMode),
|
||||
F: FnMut(&'a CascadeData, QuirksMode),
|
||||
{
|
||||
false
|
||||
}
|
||||
|
@ -766,7 +766,7 @@ pub trait TElement
|
|||
fn each_applicable_non_document_style_rule_data<'a, F>(&self, mut f: F) -> bool
|
||||
where
|
||||
Self: 'a,
|
||||
F: FnMut(AtomicRef<'a, CascadeData>, QuirksMode),
|
||||
F: FnMut(&'a CascadeData, QuirksMode),
|
||||
{
|
||||
let cut_off_inheritance = self.each_xbl_cascade_data(&mut f);
|
||||
|
||||
|
|
|
@ -884,6 +884,8 @@ cfg_if! {
|
|||
pub static nsGkAtoms_figcaption: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms6figureE"]
|
||||
pub static nsGkAtoms_figure: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms7findbarE"]
|
||||
pub static nsGkAtoms_findbar: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms5fixedE"]
|
||||
pub static nsGkAtoms_fixed: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms5flagsE"]
|
||||
|
@ -964,12 +966,20 @@ cfg_if! {
|
|||
pub static nsGkAtoms_glyphchar: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms7glyphidE"]
|
||||
pub static nsGkAtoms_glyphid: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms16graphicsDocumentE"]
|
||||
pub static nsGkAtoms_graphicsDocument: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms14graphicsObjectE"]
|
||||
pub static nsGkAtoms_graphicsObject: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms14graphicsSymbolE"]
|
||||
pub static nsGkAtoms_graphicsSymbol: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms4gridE"]
|
||||
pub static nsGkAtoms_grid: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms6grippyE"]
|
||||
pub static nsGkAtoms_grippy: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms5groupE"]
|
||||
pub static nsGkAtoms_group: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms8groupboxE"]
|
||||
pub static nsGkAtoms_groupbox: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms17groupingSeparatorE"]
|
||||
pub static nsGkAtoms_groupingSeparator: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms12groupingSizeE"]
|
||||
|
@ -1328,6 +1338,8 @@ cfg_if! {
|
|||
pub static nsGkAtoms_menubutton: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms10menuButtonE"]
|
||||
pub static nsGkAtoms_menuButton: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms11menucaptionE"]
|
||||
pub static nsGkAtoms_menucaption: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms9menugroupE"]
|
||||
pub static nsGkAtoms_menugroup: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms8menuitemE"]
|
||||
|
@ -1482,6 +1494,8 @@ cfg_if! {
|
|||
pub static nsGkAtoms_noscript: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms7noshadeE"]
|
||||
pub static nsGkAtoms_noshade: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms12notificationE"]
|
||||
pub static nsGkAtoms_notification: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms10novalidateE"]
|
||||
pub static nsGkAtoms_novalidate: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms4_notE"]
|
||||
|
@ -4418,6 +4432,26 @@ cfg_if! {
|
|||
pub static nsGkAtoms_windows_theme_zune: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms21windows_theme_genericE"]
|
||||
pub static nsGkAtoms_windows_theme_generic: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms4aeroE"]
|
||||
pub static nsGkAtoms_aero: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms9aero_liteE"]
|
||||
pub static nsGkAtoms_aero_lite: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms9luna_blueE"]
|
||||
pub static nsGkAtoms_luna_blue: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms10luna_oliveE"]
|
||||
pub static nsGkAtoms_luna_olive: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms11luna_silverE"]
|
||||
pub static nsGkAtoms_luna_silver: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms6royaleE"]
|
||||
pub static nsGkAtoms_royale: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms4zuneE"]
|
||||
pub static nsGkAtoms_zune: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms12windows_win7E"]
|
||||
pub static nsGkAtoms_windows_win7: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms12windows_win8E"]
|
||||
pub static nsGkAtoms_windows_win8: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms13windows_win10E"]
|
||||
pub static nsGkAtoms_windows_win10: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms29_moz_scrollbar_start_backwardE"]
|
||||
pub static nsGkAtoms__moz_scrollbar_start_backward: *mut nsStaticAtom;
|
||||
#[link_name = "_ZN9nsGkAtoms28_moz_scrollbar_start_forwardE"]
|
||||
|
@ -6055,6 +6089,8 @@ cfg_if! {
|
|||
pub static nsGkAtoms_figcaption: *mut nsStaticAtom;
|
||||
#[link_name = "?figure@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_figure: *mut nsStaticAtom;
|
||||
#[link_name = "?findbar@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_findbar: *mut nsStaticAtom;
|
||||
#[link_name = "?fixed@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_fixed: *mut nsStaticAtom;
|
||||
#[link_name = "?flags@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
|
@ -6135,12 +6171,20 @@ cfg_if! {
|
|||
pub static nsGkAtoms_glyphchar: *mut nsStaticAtom;
|
||||
#[link_name = "?glyphid@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_glyphid: *mut nsStaticAtom;
|
||||
#[link_name = "?graphicsDocument@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_graphicsDocument: *mut nsStaticAtom;
|
||||
#[link_name = "?graphicsObject@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_graphicsObject: *mut nsStaticAtom;
|
||||
#[link_name = "?graphicsSymbol@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_graphicsSymbol: *mut nsStaticAtom;
|
||||
#[link_name = "?grid@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_grid: *mut nsStaticAtom;
|
||||
#[link_name = "?grippy@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_grippy: *mut nsStaticAtom;
|
||||
#[link_name = "?group@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_group: *mut nsStaticAtom;
|
||||
#[link_name = "?groupbox@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_groupbox: *mut nsStaticAtom;
|
||||
#[link_name = "?groupingSeparator@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_groupingSeparator: *mut nsStaticAtom;
|
||||
#[link_name = "?groupingSize@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
|
@ -6499,6 +6543,8 @@ cfg_if! {
|
|||
pub static nsGkAtoms_menubutton: *mut nsStaticAtom;
|
||||
#[link_name = "?menuButton@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_menuButton: *mut nsStaticAtom;
|
||||
#[link_name = "?menucaption@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_menucaption: *mut nsStaticAtom;
|
||||
#[link_name = "?menugroup@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_menugroup: *mut nsStaticAtom;
|
||||
#[link_name = "?menuitem@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
|
@ -6653,6 +6699,8 @@ cfg_if! {
|
|||
pub static nsGkAtoms_noscript: *mut nsStaticAtom;
|
||||
#[link_name = "?noshade@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_noshade: *mut nsStaticAtom;
|
||||
#[link_name = "?notification@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_notification: *mut nsStaticAtom;
|
||||
#[link_name = "?novalidate@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_novalidate: *mut nsStaticAtom;
|
||||
#[link_name = "?_not@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
|
@ -9589,6 +9637,26 @@ cfg_if! {
|
|||
pub static nsGkAtoms_windows_theme_zune: *mut nsStaticAtom;
|
||||
#[link_name = "?windows_theme_generic@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_windows_theme_generic: *mut nsStaticAtom;
|
||||
#[link_name = "?aero@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_aero: *mut nsStaticAtom;
|
||||
#[link_name = "?aero_lite@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_aero_lite: *mut nsStaticAtom;
|
||||
#[link_name = "?luna_blue@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_luna_blue: *mut nsStaticAtom;
|
||||
#[link_name = "?luna_olive@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_luna_olive: *mut nsStaticAtom;
|
||||
#[link_name = "?luna_silver@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_luna_silver: *mut nsStaticAtom;
|
||||
#[link_name = "?royale@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_royale: *mut nsStaticAtom;
|
||||
#[link_name = "?zune@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_zune: *mut nsStaticAtom;
|
||||
#[link_name = "?windows_win7@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_windows_win7: *mut nsStaticAtom;
|
||||
#[link_name = "?windows_win8@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_windows_win8: *mut nsStaticAtom;
|
||||
#[link_name = "?windows_win10@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms_windows_win10: *mut nsStaticAtom;
|
||||
#[link_name = "?_moz_scrollbar_start_backward@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
pub static nsGkAtoms__moz_scrollbar_start_backward: *mut nsStaticAtom;
|
||||
#[link_name = "?_moz_scrollbar_start_forward@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
|
||||
|
@ -11226,6 +11294,8 @@ cfg_if! {
|
|||
pub static nsGkAtoms_figcaption: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?figure@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_figure: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?findbar@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_findbar: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?fixed@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_fixed: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?flags@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
|
@ -11306,12 +11376,20 @@ cfg_if! {
|
|||
pub static nsGkAtoms_glyphchar: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?glyphid@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_glyphid: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?graphicsDocument@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_graphicsDocument: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?graphicsObject@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_graphicsObject: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?graphicsSymbol@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_graphicsSymbol: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?grid@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_grid: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?grippy@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_grippy: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?group@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_group: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?groupbox@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_groupbox: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?groupingSeparator@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_groupingSeparator: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?groupingSize@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
|
@ -11670,6 +11748,8 @@ cfg_if! {
|
|||
pub static nsGkAtoms_menubutton: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?menuButton@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_menuButton: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?menucaption@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_menucaption: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?menugroup@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_menugroup: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?menuitem@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
|
@ -11824,6 +11904,8 @@ cfg_if! {
|
|||
pub static nsGkAtoms_noscript: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?noshade@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_noshade: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?notification@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_notification: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?novalidate@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_novalidate: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?_not@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
|
@ -14760,6 +14842,26 @@ cfg_if! {
|
|||
pub static nsGkAtoms_windows_theme_zune: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?windows_theme_generic@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_windows_theme_generic: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?aero@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_aero: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?aero_lite@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_aero_lite: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?luna_blue@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_luna_blue: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?luna_olive@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_luna_olive: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?luna_silver@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_luna_silver: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?royale@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_royale: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?zune@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_zune: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?windows_win7@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_windows_win7: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?windows_win8@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_windows_win8: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?windows_win10@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms_windows_win10: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?_moz_scrollbar_start_backward@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
pub static nsGkAtoms__moz_scrollbar_start_backward: *mut nsStaticAtom;
|
||||
#[link_name = "\x01?_moz_scrollbar_start_forward@nsGkAtoms@@2PAVnsStaticAtom@@A"]
|
||||
|
@ -16400,6 +16502,8 @@ macro_rules! atom {
|
|||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_figcaption as *mut _) } }};
|
||||
("figure") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_figure as *mut _) } }};
|
||||
("findbar") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_findbar as *mut _) } }};
|
||||
("fixed") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_fixed as *mut _) } }};
|
||||
("flags") =>
|
||||
|
@ -16480,12 +16584,20 @@ macro_rules! atom {
|
|||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_glyphchar as *mut _) } }};
|
||||
("glyphid") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_glyphid as *mut _) } }};
|
||||
("graphics-document") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_graphicsDocument as *mut _) } }};
|
||||
("graphics-object") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_graphicsObject as *mut _) } }};
|
||||
("graphics-symbol") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_graphicsSymbol as *mut _) } }};
|
||||
("grid") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_grid as *mut _) } }};
|
||||
("grippy") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_grippy as *mut _) } }};
|
||||
("group") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_group as *mut _) } }};
|
||||
("groupbox") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_groupbox as *mut _) } }};
|
||||
("grouping-separator") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_groupingSeparator as *mut _) } }};
|
||||
("grouping-size") =>
|
||||
|
@ -16844,6 +16956,8 @@ macro_rules! atom {
|
|||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_menubutton as *mut _) } }};
|
||||
("menu-button") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_menuButton as *mut _) } }};
|
||||
("menucaption") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_menucaption as *mut _) } }};
|
||||
("menugroup") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_menugroup as *mut _) } }};
|
||||
("menuitem") =>
|
||||
|
@ -16998,6 +17112,8 @@ macro_rules! atom {
|
|||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_noscript as *mut _) } }};
|
||||
("noshade") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_noshade as *mut _) } }};
|
||||
("notification") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_notification as *mut _) } }};
|
||||
("novalidate") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_novalidate as *mut _) } }};
|
||||
("not") =>
|
||||
|
@ -19934,6 +20050,26 @@ macro_rules! atom {
|
|||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_windows_theme_zune as *mut _) } }};
|
||||
("windows-theme-generic") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_windows_theme_generic as *mut _) } }};
|
||||
("aero") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_aero as *mut _) } }};
|
||||
("aero-lite") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_aero_lite as *mut _) } }};
|
||||
("luna-blue") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_luna_blue as *mut _) } }};
|
||||
("luna-olive") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_luna_olive as *mut _) } }};
|
||||
("luna-silver") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_luna_silver as *mut _) } }};
|
||||
("royale") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_royale as *mut _) } }};
|
||||
("zune") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_zune as *mut _) } }};
|
||||
("windows-win7") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_windows_win7 as *mut _) } }};
|
||||
("windows-win8") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_windows_win8 as *mut _) } }};
|
||||
("windows-win10") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_windows_win10 as *mut _) } }};
|
||||
("-moz-scrollbar-start-backward") =>
|
||||
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms__moz_scrollbar_start_backward as *mut _) } }};
|
||||
("-moz-scrollbar-start-forward") =>
|
||||
|
|
|
@ -18,7 +18,6 @@ use gecko_bindings::structs::mozilla::dom::CallerType;
|
|||
use gecko_bindings::structs::mozilla::AnonymousCounterStyle;
|
||||
use gecko_bindings::structs::mozilla::AtomArray;
|
||||
use gecko_bindings::structs::mozilla::MallocSizeOf;
|
||||
use gecko_bindings::structs::mozilla::ServoStyleSet;
|
||||
use gecko_bindings::structs::mozilla::OriginFlags;
|
||||
use gecko_bindings::structs::mozilla::UniquePtr;
|
||||
use gecko_bindings::structs::ServoRawOffsetArc;
|
||||
|
@ -255,38 +254,60 @@ use gecko_bindings::structs::FontFamilyName;
|
|||
use gecko_bindings::structs::mozilla::SharedFontList;
|
||||
pub type nsTArrayBorrowed_uintptr_t<'a> = &'a mut ::gecko_bindings::structs::nsTArray<usize>;
|
||||
pub type RawServoStyleSetOwned = ::gecko_bindings::sugar::ownership::Owned<RawServoStyleSet>;
|
||||
pub type RawServoStyleSetOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<RawServoStyleSet>;
|
||||
pub type RawServoStyleSetOwnedOrNull =
|
||||
::gecko_bindings::sugar::ownership::OwnedOrNull<RawServoStyleSet>;
|
||||
pub type RawServoStyleSetBorrowed<'a> = &'a RawServoStyleSet;
|
||||
pub type RawServoStyleSetBorrowedOrNull<'a> = Option<&'a RawServoStyleSet>;
|
||||
pub type RawServoStyleSetBorrowedMut<'a> = &'a mut RawServoStyleSet;
|
||||
pub type RawServoStyleSetBorrowedMutOrNull<'a> = Option<&'a mut RawServoStyleSet>;
|
||||
enum RawServoStyleSetVoid { }
|
||||
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 RawServoAuthorStylesOwned =
|
||||
::gecko_bindings::sugar::ownership::Owned<RawServoAuthorStyles>;
|
||||
pub type RawServoAuthorStylesOwnedOrNull =
|
||||
::gecko_bindings::sugar::ownership::OwnedOrNull<RawServoAuthorStyles>;
|
||||
pub type RawServoAuthorStylesBorrowed<'a> = &'a RawServoAuthorStyles;
|
||||
pub type RawServoAuthorStylesBorrowedOrNull<'a> = Option<&'a RawServoAuthorStyles>;
|
||||
pub type RawServoAuthorStylesBorrowedMut<'a> = &'a mut RawServoAuthorStyles;
|
||||
pub type RawServoAuthorStylesBorrowedMutOrNull<'a> = Option<&'a mut RawServoAuthorStyles>;
|
||||
enum RawServoAuthorStylesVoid {
|
||||
}
|
||||
pub struct RawServoAuthorStyles(RawServoAuthorStylesVoid);
|
||||
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 RawServoSourceSizeListOwned = ::gecko_bindings::sugar::ownership::Owned<RawServoSourceSizeList>;
|
||||
pub type RawServoSourceSizeListOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<RawServoSourceSizeList>;
|
||||
pub type RawServoSourceSizeListOwned =
|
||||
::gecko_bindings::sugar::ownership::Owned<RawServoSourceSizeList>;
|
||||
pub type RawServoSourceSizeListOwnedOrNull =
|
||||
::gecko_bindings::sugar::ownership::OwnedOrNull<RawServoSourceSizeList>;
|
||||
pub type RawServoSourceSizeListBorrowed<'a> = &'a RawServoSourceSizeList;
|
||||
pub type RawServoSourceSizeListBorrowedOrNull<'a> = Option<&'a RawServoSourceSizeList>;
|
||||
pub type RawServoSourceSizeListBorrowedMut<'a> = &'a mut RawServoSourceSizeList;
|
||||
pub type RawServoSourceSizeListBorrowedMutOrNull<'a> = Option<&'a mut RawServoSourceSizeList>;
|
||||
pub type ServoElementSnapshotOwned = ::gecko_bindings::sugar::ownership::Owned<ServoElementSnapshot>;
|
||||
pub type ServoElementSnapshotOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<ServoElementSnapshot>;
|
||||
pub type ServoElementSnapshotOwned =
|
||||
::gecko_bindings::sugar::ownership::Owned<ServoElementSnapshot>;
|
||||
pub type ServoElementSnapshotOwnedOrNull =
|
||||
::gecko_bindings::sugar::ownership::OwnedOrNull<ServoElementSnapshot>;
|
||||
pub type ServoElementSnapshotBorrowed<'a> = &'a ServoElementSnapshot;
|
||||
pub type ServoElementSnapshotBorrowedOrNull<'a> = Option<&'a ServoElementSnapshot>;
|
||||
pub type ServoElementSnapshotBorrowedMut<'a> = &'a mut ServoElementSnapshot;
|
||||
pub type ServoElementSnapshotBorrowedMutOrNull<'a> = Option<&'a mut ServoElementSnapshot>;
|
||||
pub type RawServoAnimationValueMapOwned = ::gecko_bindings::sugar::ownership::Owned<RawServoAnimationValueMap>;
|
||||
pub type RawServoAnimationValueMapOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<RawServoAnimationValueMap>;
|
||||
pub type RawServoAnimationValueMapOwned =
|
||||
::gecko_bindings::sugar::ownership::Owned<RawServoAnimationValueMap>;
|
||||
pub type RawServoAnimationValueMapOwnedOrNull =
|
||||
::gecko_bindings::sugar::ownership::OwnedOrNull<RawServoAnimationValueMap>;
|
||||
pub type RawServoAnimationValueMapBorrowed<'a> = &'a RawServoAnimationValueMap;
|
||||
pub type RawServoAnimationValueMapBorrowedOrNull<'a> = Option<&'a RawServoAnimationValueMap>;
|
||||
pub type RawServoAnimationValueMapBorrowedMut<'a> = &'a mut RawServoAnimationValueMap;
|
||||
pub type RawServoAnimationValueMapBorrowedMutOrNull<'a> = Option<&'a mut RawServoAnimationValueMap>;
|
||||
enum RawServoAnimationValueMapVoid { }
|
||||
enum RawServoAnimationValueMapVoid {
|
||||
}
|
||||
pub struct RawServoAnimationValueMap(RawServoAnimationValueMapVoid);
|
||||
pub type RawGeckoNodeBorrowed<'a> = &'a RawGeckoNode;
|
||||
pub type RawGeckoNodeBorrowedOrNull<'a> = Option<&'a RawGeckoNode>;
|
||||
|
@ -295,7 +316,8 @@ pub type RawGeckoElementBorrowedOrNull<'a> = Option<&'a RawGeckoElement>;
|
|||
pub type RawGeckoDocumentBorrowed<'a> = &'a RawGeckoDocument;
|
||||
pub type RawGeckoDocumentBorrowedOrNull<'a> = Option<&'a RawGeckoDocument>;
|
||||
pub type RawServoDeclarationBlockStrongBorrowed<'a> = &'a RawServoDeclarationBlockStrong;
|
||||
pub type RawServoDeclarationBlockStrongBorrowedOrNull<'a> = Option<&'a RawServoDeclarationBlockStrong>;
|
||||
pub type RawServoDeclarationBlockStrongBorrowedOrNull<'a> =
|
||||
Option<&'a RawServoDeclarationBlockStrong>;
|
||||
pub type RawGeckoPresContextBorrowed<'a> = &'a RawGeckoPresContext;
|
||||
pub type RawGeckoPresContextBorrowedOrNull<'a> = Option<&'a RawGeckoPresContext>;
|
||||
pub type RawGeckoXBLBindingBorrowed<'a> = &'a RawGeckoXBLBinding;
|
||||
|
@ -313,9 +335,11 @@ pub type nsTimingFunctionBorrowedOrNull<'a> = Option<&'a nsTimingFunction>;
|
|||
pub type nsTimingFunctionBorrowedMut<'a> = &'a mut nsTimingFunction;
|
||||
pub type nsTimingFunctionBorrowedMutOrNull<'a> = Option<&'a mut nsTimingFunction>;
|
||||
pub type RawGeckoAnimationPropertySegmentBorrowed<'a> = &'a RawGeckoAnimationPropertySegment;
|
||||
pub type RawGeckoAnimationPropertySegmentBorrowedOrNull<'a> = Option<&'a RawGeckoAnimationPropertySegment>;
|
||||
pub type RawGeckoAnimationPropertySegmentBorrowedOrNull<'a> =
|
||||
Option<&'a RawGeckoAnimationPropertySegment>;
|
||||
pub type RawGeckoAnimationPropertySegmentBorrowedMut<'a> = &'a mut RawGeckoAnimationPropertySegment;
|
||||
pub type RawGeckoAnimationPropertySegmentBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoAnimationPropertySegment>;
|
||||
pub type RawGeckoAnimationPropertySegmentBorrowedMutOrNull<'a> =
|
||||
Option<&'a mut RawGeckoAnimationPropertySegment>;
|
||||
pub type RawGeckoComputedTimingBorrowed<'a> = &'a RawGeckoComputedTiming;
|
||||
pub type RawGeckoComputedTimingBorrowedOrNull<'a> = Option<&'a RawGeckoComputedTiming>;
|
||||
pub type RawGeckoComputedTimingBorrowedMut<'a> = &'a mut RawGeckoComputedTiming;
|
||||
|
@ -329,13 +353,18 @@ pub type RawGeckoKeyframeListBorrowedOrNull<'a> = Option<&'a RawGeckoKeyframeLis
|
|||
pub type RawGeckoKeyframeListBorrowedMut<'a> = &'a mut RawGeckoKeyframeList;
|
||||
pub type RawGeckoKeyframeListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoKeyframeList>;
|
||||
pub type RawGeckoPropertyValuePairListBorrowed<'a> = &'a RawGeckoPropertyValuePairList;
|
||||
pub type RawGeckoPropertyValuePairListBorrowedOrNull<'a> = Option<&'a RawGeckoPropertyValuePairList>;
|
||||
pub type RawGeckoPropertyValuePairListBorrowedOrNull<'a> =
|
||||
Option<&'a RawGeckoPropertyValuePairList>;
|
||||
pub type RawGeckoPropertyValuePairListBorrowedMut<'a> = &'a mut RawGeckoPropertyValuePairList;
|
||||
pub type RawGeckoPropertyValuePairListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoPropertyValuePairList>;
|
||||
pub type RawGeckoPropertyValuePairListBorrowedMutOrNull<'a> =
|
||||
Option<&'a mut RawGeckoPropertyValuePairList>;
|
||||
pub type RawGeckoComputedKeyframeValuesListBorrowed<'a> = &'a RawGeckoComputedKeyframeValuesList;
|
||||
pub type RawGeckoComputedKeyframeValuesListBorrowedOrNull<'a> = Option<&'a RawGeckoComputedKeyframeValuesList>;
|
||||
pub type RawGeckoComputedKeyframeValuesListBorrowedMut<'a> = &'a mut RawGeckoComputedKeyframeValuesList;
|
||||
pub type RawGeckoComputedKeyframeValuesListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoComputedKeyframeValuesList>;
|
||||
pub type RawGeckoComputedKeyframeValuesListBorrowedOrNull<'a> =
|
||||
Option<&'a RawGeckoComputedKeyframeValuesList>;
|
||||
pub type RawGeckoComputedKeyframeValuesListBorrowedMut<'a> =
|
||||
&'a mut RawGeckoComputedKeyframeValuesList;
|
||||
pub type RawGeckoComputedKeyframeValuesListBorrowedMutOrNull<'a> =
|
||||
Option<&'a mut RawGeckoComputedKeyframeValuesList>;
|
||||
pub type RawGeckoFontFaceRuleListBorrowed<'a> = &'a RawGeckoFontFaceRuleList;
|
||||
pub type RawGeckoFontFaceRuleListBorrowedOrNull<'a> = Option<&'a RawGeckoFontFaceRuleList>;
|
||||
pub type RawGeckoFontFaceRuleListBorrowedMut<'a> = &'a mut RawGeckoFontFaceRuleList;
|
||||
|
@ -343,28 +372,37 @@ pub type RawGeckoFontFaceRuleListBorrowedMutOrNull<'a> = Option<&'a mut RawGecko
|
|||
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>;
|
||||
pub type RawGeckoServoStyleRuleListBorrowedMutOrNull<'a> =
|
||||
Option<&'a mut RawGeckoServoStyleRuleList>;
|
||||
pub type RawGeckoServoAnimationValueListBorrowed<'a> = &'a RawGeckoServoAnimationValueList;
|
||||
pub type RawGeckoServoAnimationValueListBorrowedOrNull<'a> = Option<&'a RawGeckoServoAnimationValueList>;
|
||||
pub type RawGeckoServoAnimationValueListBorrowedOrNull<'a> =
|
||||
Option<&'a RawGeckoServoAnimationValueList>;
|
||||
pub type RawGeckoServoAnimationValueListBorrowedMut<'a> = &'a mut RawGeckoServoAnimationValueList;
|
||||
pub type RawGeckoServoAnimationValueListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoServoAnimationValueList>;
|
||||
pub type RawGeckoServoAnimationValueListBorrowedMutOrNull<'a> =
|
||||
Option<&'a mut RawGeckoServoAnimationValueList>;
|
||||
pub type RawGeckoStyleAnimationListBorrowed<'a> = &'a RawGeckoStyleAnimationList;
|
||||
pub type RawGeckoStyleAnimationListBorrowedOrNull<'a> = Option<&'a RawGeckoStyleAnimationList>;
|
||||
pub type RawGeckoStyleAnimationListBorrowedMut<'a> = &'a mut RawGeckoStyleAnimationList;
|
||||
pub type RawGeckoStyleAnimationListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoStyleAnimationList>;
|
||||
pub type RawGeckoStyleAnimationListBorrowedMutOrNull<'a> =
|
||||
Option<&'a mut RawGeckoStyleAnimationList>;
|
||||
pub type RawGeckoStyleChildrenIteratorBorrowed<'a> = &'a RawGeckoStyleChildrenIterator;
|
||||
pub type RawGeckoStyleChildrenIteratorBorrowedOrNull<'a> = Option<&'a RawGeckoStyleChildrenIterator>;
|
||||
pub type RawGeckoStyleChildrenIteratorBorrowedOrNull<'a> =
|
||||
Option<&'a RawGeckoStyleChildrenIterator>;
|
||||
pub type RawGeckoStyleChildrenIteratorBorrowedMut<'a> = &'a mut RawGeckoStyleChildrenIterator;
|
||||
pub type RawGeckoStyleChildrenIteratorBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoStyleChildrenIterator>;
|
||||
pub type RawGeckoStyleChildrenIteratorBorrowedMutOrNull<'a> =
|
||||
Option<&'a mut RawGeckoStyleChildrenIterator>;
|
||||
pub type ServoCssRulesStrong = ::gecko_bindings::sugar::ownership::Strong<ServoCssRules>;
|
||||
pub type ServoCssRulesBorrowed<'a> = &'a ServoCssRules;
|
||||
pub type ServoCssRulesBorrowedOrNull<'a> = Option<&'a ServoCssRules>;
|
||||
enum ServoCssRulesVoid { }
|
||||
enum ServoCssRulesVoid {
|
||||
}
|
||||
pub struct ServoCssRules(ServoCssRulesVoid);
|
||||
pub type RawServoStyleSheetContentsStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoStyleSheetContents>;
|
||||
pub type RawServoStyleSheetContentsStrong =
|
||||
::gecko_bindings::sugar::ownership::Strong<RawServoStyleSheetContents>;
|
||||
pub type RawServoStyleSheetContentsBorrowed<'a> = &'a RawServoStyleSheetContents;
|
||||
pub type RawServoStyleSheetContentsBorrowedOrNull<'a> = Option<&'a RawServoStyleSheetContents>;
|
||||
pub type RawServoDeclarationBlockStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoDeclarationBlock>;
|
||||
pub type RawServoDeclarationBlockStrong =
|
||||
::gecko_bindings::sugar::ownership::Strong<RawServoDeclarationBlock>;
|
||||
pub type RawServoDeclarationBlockBorrowed<'a> = &'a RawServoDeclarationBlock;
|
||||
pub type RawServoDeclarationBlockBorrowedOrNull<'a> = Option<&'a RawServoDeclarationBlock>;
|
||||
pub type RawServoStyleRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoStyleRule>;
|
||||
|
@ -373,20 +411,25 @@ pub type RawServoStyleRuleBorrowedOrNull<'a> = Option<&'a RawServoStyleRule>;
|
|||
pub type RawServoImportRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoImportRule>;
|
||||
pub type RawServoImportRuleBorrowed<'a> = &'a RawServoImportRule;
|
||||
pub type RawServoImportRuleBorrowedOrNull<'a> = Option<&'a RawServoImportRule>;
|
||||
enum RawServoImportRuleVoid { }
|
||||
enum RawServoImportRuleVoid {
|
||||
}
|
||||
pub struct RawServoImportRule(RawServoImportRuleVoid);
|
||||
pub type RawServoAnimationValueStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoAnimationValue>;
|
||||
pub type RawServoAnimationValueStrong =
|
||||
::gecko_bindings::sugar::ownership::Strong<RawServoAnimationValue>;
|
||||
pub type RawServoAnimationValueBorrowed<'a> = &'a RawServoAnimationValue;
|
||||
pub type RawServoAnimationValueBorrowedOrNull<'a> = Option<&'a RawServoAnimationValue>;
|
||||
pub type RawServoKeyframeStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoKeyframe>;
|
||||
pub type RawServoKeyframeBorrowed<'a> = &'a RawServoKeyframe;
|
||||
pub type RawServoKeyframeBorrowedOrNull<'a> = Option<&'a RawServoKeyframe>;
|
||||
enum RawServoKeyframeVoid { }
|
||||
enum RawServoKeyframeVoid {
|
||||
}
|
||||
pub struct RawServoKeyframe(RawServoKeyframeVoid);
|
||||
pub type RawServoKeyframesRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoKeyframesRule>;
|
||||
pub type RawServoKeyframesRuleStrong =
|
||||
::gecko_bindings::sugar::ownership::Strong<RawServoKeyframesRule>;
|
||||
pub type RawServoKeyframesRuleBorrowed<'a> = &'a RawServoKeyframesRule;
|
||||
pub type RawServoKeyframesRuleBorrowedOrNull<'a> = Option<&'a RawServoKeyframesRule>;
|
||||
enum RawServoKeyframesRuleVoid { }
|
||||
enum RawServoKeyframesRuleVoid {
|
||||
}
|
||||
pub struct RawServoKeyframesRule(RawServoKeyframesRuleVoid);
|
||||
pub type RawServoMediaListStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoMediaList>;
|
||||
pub type RawServoMediaListBorrowed<'a> = &'a RawServoMediaList;
|
||||
|
@ -394,37 +437,49 @@ pub type RawServoMediaListBorrowedOrNull<'a> = Option<&'a RawServoMediaList>;
|
|||
pub type RawServoMediaRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoMediaRule>;
|
||||
pub type RawServoMediaRuleBorrowed<'a> = &'a RawServoMediaRule;
|
||||
pub type RawServoMediaRuleBorrowedOrNull<'a> = Option<&'a RawServoMediaRule>;
|
||||
enum RawServoMediaRuleVoid { }
|
||||
enum RawServoMediaRuleVoid {
|
||||
}
|
||||
pub struct RawServoMediaRule(RawServoMediaRuleVoid);
|
||||
pub type RawServoNamespaceRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoNamespaceRule>;
|
||||
pub type RawServoNamespaceRuleStrong =
|
||||
::gecko_bindings::sugar::ownership::Strong<RawServoNamespaceRule>;
|
||||
pub type RawServoNamespaceRuleBorrowed<'a> = &'a RawServoNamespaceRule;
|
||||
pub type RawServoNamespaceRuleBorrowedOrNull<'a> = Option<&'a RawServoNamespaceRule>;
|
||||
enum RawServoNamespaceRuleVoid { }
|
||||
enum RawServoNamespaceRuleVoid {
|
||||
}
|
||||
pub struct RawServoNamespaceRule(RawServoNamespaceRuleVoid);
|
||||
pub type RawServoPageRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoPageRule>;
|
||||
pub type RawServoPageRuleBorrowed<'a> = &'a RawServoPageRule;
|
||||
pub type RawServoPageRuleBorrowedOrNull<'a> = Option<&'a RawServoPageRule>;
|
||||
enum RawServoPageRuleVoid { }
|
||||
enum RawServoPageRuleVoid {
|
||||
}
|
||||
pub struct RawServoPageRule(RawServoPageRuleVoid);
|
||||
pub type RawServoSupportsRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoSupportsRule>;
|
||||
pub type RawServoSupportsRuleStrong =
|
||||
::gecko_bindings::sugar::ownership::Strong<RawServoSupportsRule>;
|
||||
pub type RawServoSupportsRuleBorrowed<'a> = &'a RawServoSupportsRule;
|
||||
pub type RawServoSupportsRuleBorrowedOrNull<'a> = Option<&'a RawServoSupportsRule>;
|
||||
enum RawServoSupportsRuleVoid { }
|
||||
enum RawServoSupportsRuleVoid {
|
||||
}
|
||||
pub struct RawServoSupportsRule(RawServoSupportsRuleVoid);
|
||||
pub type RawServoDocumentRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoDocumentRule>;
|
||||
pub type RawServoDocumentRuleStrong =
|
||||
::gecko_bindings::sugar::ownership::Strong<RawServoDocumentRule>;
|
||||
pub type RawServoDocumentRuleBorrowed<'a> = &'a RawServoDocumentRule;
|
||||
pub type RawServoDocumentRuleBorrowedOrNull<'a> = Option<&'a RawServoDocumentRule>;
|
||||
enum RawServoDocumentRuleVoid { }
|
||||
enum RawServoDocumentRuleVoid {
|
||||
}
|
||||
pub struct RawServoDocumentRule(RawServoDocumentRuleVoid);
|
||||
pub type RawServoFontFeatureValuesRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoFontFeatureValuesRule>;
|
||||
pub type RawServoFontFeatureValuesRuleStrong =
|
||||
::gecko_bindings::sugar::ownership::Strong<RawServoFontFeatureValuesRule>;
|
||||
pub type RawServoFontFeatureValuesRuleBorrowed<'a> = &'a RawServoFontFeatureValuesRule;
|
||||
pub type RawServoFontFeatureValuesRuleBorrowedOrNull<'a> = Option<&'a RawServoFontFeatureValuesRule>;
|
||||
enum RawServoFontFeatureValuesRuleVoid { }
|
||||
pub type RawServoFontFeatureValuesRuleBorrowedOrNull<'a> =
|
||||
Option<&'a RawServoFontFeatureValuesRule>;
|
||||
enum RawServoFontFeatureValuesRuleVoid {
|
||||
}
|
||||
pub struct RawServoFontFeatureValuesRule(RawServoFontFeatureValuesRuleVoid);
|
||||
pub type RawServoRuleNodeStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoRuleNode>;
|
||||
pub type RawServoRuleNodeBorrowed<'a> = &'a RawServoRuleNode;
|
||||
pub type RawServoRuleNodeBorrowedOrNull<'a> = Option<&'a RawServoRuleNode>;
|
||||
enum RawServoRuleNodeVoid { }
|
||||
enum RawServoRuleNodeVoid {
|
||||
}
|
||||
pub struct RawServoRuleNode(RawServoRuleNodeVoid);
|
||||
|
||||
extern "C" {
|
||||
|
@ -540,12 +595,25 @@ extern "C" {
|
|||
extern "C" {
|
||||
pub fn Servo_StyleSet_Drop(ptr: RawServoStyleSetOwned);
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_AuthorStyles_Drop(ptr: RawServoAuthorStylesOwned);
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_SelectorList_Drop(ptr: RawServoSelectorListOwned);
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_SourceSizeList_Drop(ptr: RawServoSourceSizeListOwned);
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Gecko_RecordTraversalStatistics(
|
||||
total: u32,
|
||||
parallel: u32,
|
||||
total_t: u32,
|
||||
parallel_t: u32,
|
||||
total_s: u32,
|
||||
parallel_s: u32,
|
||||
);
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Gecko_IsSignificantChild(
|
||||
node: RawGeckoNodeBorrowed,
|
||||
|
@ -1538,9 +1606,9 @@ extern "C" {
|
|||
) -> RawGeckoXBLBindingBorrowedOrNull;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Gecko_XBLBinding_GetRawServoStyleSet(
|
||||
pub fn Gecko_XBLBinding_GetRawServoStyles(
|
||||
aXBLBinding: RawGeckoXBLBindingBorrowed,
|
||||
) -> RawServoStyleSetBorrowedOrNull;
|
||||
) -> RawServoAuthorStylesBorrowedOrNull;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Gecko_XBLBinding_InheritsStyle(aXBLBinding: RawGeckoXBLBindingBorrowed) -> bool;
|
||||
|
@ -2026,7 +2094,8 @@ extern "C" {
|
|||
extern "C" {
|
||||
pub fn Servo_InvalidateStyleForDocStateChanges(
|
||||
root: RawGeckoElementBorrowed,
|
||||
sets: *const nsTArray<RawServoStyleSetBorrowed>,
|
||||
doc_styles: RawServoStyleSetBorrowed,
|
||||
non_document_styles: *const nsTArray<RawServoAuthorStylesBorrowed>,
|
||||
aStatesChanged: u64,
|
||||
);
|
||||
}
|
||||
|
@ -2093,7 +2162,7 @@ extern "C" {
|
|||
extern "C" {
|
||||
pub fn Servo_StyleSet_MediumFeaturesChanged(
|
||||
document_set: RawServoStyleSetBorrowed,
|
||||
non_document_sets: *const nsTArray<*mut ServoStyleSet>,
|
||||
non_document_sets: *mut nsTArray<RawServoAuthorStylesBorrowedMut>,
|
||||
may_affect_default_style: bool,
|
||||
) -> MediumFeaturesChangedResult;
|
||||
}
|
||||
|
@ -2230,6 +2299,24 @@ extern "C" {
|
|||
sizes: *mut ServoStyleSetSizes,
|
||||
);
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_AuthorStyles_Create() -> *mut RawServoAuthorStyles;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_AuthorStyles_AppendStyleSheet(
|
||||
self_: RawServoAuthorStylesBorrowedMut,
|
||||
gecko_sheet: *const ServoStyleSheet,
|
||||
);
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_AuthorStyles_ForceDirty(self_: RawServoAuthorStylesBorrowedMut);
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_AuthorStyles_Flush(
|
||||
self_: RawServoAuthorStylesBorrowedMut,
|
||||
document_styles: RawServoStyleSetBorrowed,
|
||||
);
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_StyleContext_AddRef(ctx: ServoStyleContextBorrowed);
|
||||
}
|
||||
|
|
|
@ -1728,7 +1728,7 @@ impl ToCss for PseudoElement {
|
|||
dest.write_char('(')?;
|
||||
let mut iter = args.iter();
|
||||
if let Some(first) = iter.next() {
|
||||
serialize_atom_identifier(first, dest)?;
|
||||
serialize_atom_identifier(&first, dest)?;
|
||||
for item in iter {
|
||||
dest.write_str(", ")?;
|
||||
serialize_atom_identifier(item, dest)?;
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -17,13 +17,14 @@
|
|||
use CaseSensitivityExt;
|
||||
use app_units::Au;
|
||||
use applicable_declarations::ApplicableDeclarationBlock;
|
||||
use atomic_refcell::{AtomicRefCell, AtomicRef, AtomicRefMut};
|
||||
use atomic_refcell::{AtomicRefCell, AtomicRefMut};
|
||||
use author_styles::AuthorStyles;
|
||||
use context::{QuirksMode, SharedStyleContext, PostAnimationTasks, UpdateAnimationsTasks};
|
||||
use data::ElementData;
|
||||
use dom::{LayoutIterator, NodeInfo, OpaqueNode, TElement, TDocument, TNode};
|
||||
use element_state::{ElementState, DocumentState};
|
||||
use font_metrics::{FontMetrics, FontMetricsProvider, FontMetricsQueryResult};
|
||||
use gecko::data::PerDocumentStyleData;
|
||||
use gecko::data::GeckoStyleSheet;
|
||||
use gecko::global_style_data::GLOBAL_STYLE_DATA;
|
||||
use gecko::selector_parser::{SelectorImpl, NonTSPseudoClass, PseudoElement};
|
||||
use gecko::snapshot_helpers;
|
||||
|
@ -431,20 +432,19 @@ impl<'lb> GeckoXBLBinding<'lb> {
|
|||
|
||||
fn each_xbl_cascade_data<F>(&self, f: &mut F)
|
||||
where
|
||||
F: FnMut(AtomicRef<'lb, CascadeData>, QuirksMode),
|
||||
F: FnMut(&'lb CascadeData, QuirksMode),
|
||||
{
|
||||
if let Some(base) = self.base_binding() {
|
||||
base.each_xbl_cascade_data(f);
|
||||
}
|
||||
|
||||
let raw_data = unsafe {
|
||||
bindings::Gecko_XBLBinding_GetRawServoStyleSet(self.0)
|
||||
let data = unsafe {
|
||||
bindings::Gecko_XBLBinding_GetRawServoStyles(self.0)
|
||||
};
|
||||
|
||||
if let Some(raw_data) = raw_data {
|
||||
let data = PerDocumentStyleData::from_ffi(&*raw_data).borrow();
|
||||
let quirks_mode = data.stylist.quirks_mode();
|
||||
f(AtomicRef::map(data, |d| d.stylist.author_cascade_data()), quirks_mode);
|
||||
if let Some(data) = data {
|
||||
let data: &'lb _ = AuthorStyles::<GeckoStyleSheet>::from_ffi(data);
|
||||
f(&data.data, data.quirks_mode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1378,7 +1378,7 @@ impl<'le> TElement for GeckoElement<'le> {
|
|||
fn each_xbl_cascade_data<'a, F>(&self, mut f: F) -> bool
|
||||
where
|
||||
'le: 'a,
|
||||
F: FnMut(AtomicRef<'a, CascadeData>, QuirksMode),
|
||||
F: FnMut(&'a CascadeData, QuirksMode),
|
||||
{
|
||||
// Walk the binding scope chain, starting with the binding attached to
|
||||
// our content, up till we run out of scopes or we get cut off.
|
||||
|
|
|
@ -36,6 +36,7 @@ impl<T> nsTArray<T> {
|
|||
debug_assert!(!self.mBuffer.is_null());
|
||||
unsafe { mem::transmute(self.mBuffer) }
|
||||
}
|
||||
|
||||
// unsafe, since header may be in shared static or something
|
||||
unsafe fn header_mut<'a>(&'a mut self) -> &'a mut nsTArrayHeader {
|
||||
debug_assert!(!self.mBuffer.is_null());
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
//! changes.
|
||||
|
||||
use Atom;
|
||||
use atomic_refcell::AtomicRef;
|
||||
use context::{QuirksMode, SharedStyleContext};
|
||||
use data::ElementData;
|
||||
use dom::TElement;
|
||||
|
@ -57,7 +56,7 @@ where
|
|||
/// changes.
|
||||
pub struct StateAndAttrInvalidationProcessor<'a, 'b: 'a, E: TElement> {
|
||||
shared_context: &'a SharedStyleContext<'b>,
|
||||
shadow_rule_datas: &'a [(AtomicRef<'b, CascadeData>, QuirksMode)],
|
||||
shadow_rule_datas: &'a [(&'b CascadeData, QuirksMode)],
|
||||
cut_off_inheritance: bool,
|
||||
element: E,
|
||||
data: &'a mut ElementData,
|
||||
|
@ -68,7 +67,7 @@ impl<'a, 'b: 'a, E: TElement> StateAndAttrInvalidationProcessor<'a, 'b, E> {
|
|||
/// Creates a new StateAndAttrInvalidationProcessor.
|
||||
pub fn new(
|
||||
shared_context: &'a SharedStyleContext<'b>,
|
||||
shadow_rule_datas: &'a [(AtomicRef<'b, CascadeData>, QuirksMode)],
|
||||
shadow_rule_datas: &'a [(&'b CascadeData, QuirksMode)],
|
||||
cut_off_inheritance: bool,
|
||||
element: E,
|
||||
data: &'a mut ElementData,
|
||||
|
|
|
@ -87,6 +87,7 @@ mod macros;
|
|||
pub mod applicable_declarations;
|
||||
#[allow(missing_docs)] // TODO.
|
||||
#[cfg(feature = "servo")] pub mod attr;
|
||||
pub mod author_styles;
|
||||
pub mod bezier;
|
||||
pub mod bloom;
|
||||
pub mod context;
|
||||
|
|
|
@ -583,6 +583,20 @@ impl<S> AuthorStylesheetSet<S>
|
|||
where
|
||||
S: StylesheetInDocument + PartialEq + 'static,
|
||||
{
|
||||
/// Create a new empty AuthorStylesheetSet.
|
||||
#[inline]
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
collection: Default::default(),
|
||||
invalidations: StylesheetInvalidationSet::new(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether anything has changed since the last time this was flushed.
|
||||
pub fn dirty(&self) -> bool {
|
||||
self.collection.dirty
|
||||
}
|
||||
|
||||
fn collection_for(
|
||||
&mut self,
|
||||
_sheet: &S,
|
||||
|
@ -593,6 +607,17 @@ where
|
|||
|
||||
sheet_set_methods!("AuthorStylesheetSet");
|
||||
|
||||
/// Iterate over the list of stylesheets.
|
||||
pub fn iter(&self) -> StylesheetCollectionIterator<S> {
|
||||
self.collection.iter()
|
||||
}
|
||||
|
||||
/// Mark the sheet set dirty, as appropriate.
|
||||
pub fn force_dirty(&mut self) {
|
||||
self.invalidations.invalidate_fully();
|
||||
self.collection.set_data_validity_at_least(DataValidity::FullyInvalid);
|
||||
}
|
||||
|
||||
/// Flush the stylesheets for this author set.
|
||||
///
|
||||
/// `host` is the root of the affected subtree, like the shadow host, for
|
||||
|
|
|
@ -1983,7 +1983,8 @@ pub struct CascadeData {
|
|||
}
|
||||
|
||||
impl CascadeData {
|
||||
fn new() -> Self {
|
||||
/// Creates an empty `CascadeData`.
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
normal_rules: ElementAndPseudoRules::default(),
|
||||
slotted_rules: None,
|
||||
|
@ -2005,7 +2006,7 @@ impl CascadeData {
|
|||
|
||||
/// Rebuild the cascade data from a given SheetCollection, incrementally if
|
||||
/// possible.
|
||||
fn rebuild<'a, S>(
|
||||
pub fn rebuild<'a, S>(
|
||||
&mut self,
|
||||
device: &Device,
|
||||
quirks_mode: QuirksMode,
|
||||
|
@ -2281,7 +2282,7 @@ impl CascadeData {
|
|||
|
||||
/// Returns whether all the media-feature affected values matched before and
|
||||
/// match now in the given stylesheet.
|
||||
fn media_feature_affected_matches<S>(
|
||||
pub fn media_feature_affected_matches<S>(
|
||||
&self,
|
||||
stylesheet: &S,
|
||||
guard: &SharedRwLockReadGuard,
|
||||
|
|
|
@ -17,6 +17,7 @@ use std::iter;
|
|||
use std::mem;
|
||||
use std::ptr;
|
||||
use style::applicable_declarations::ApplicableDeclarationBlock;
|
||||
use style::author_styles::AuthorStyles;
|
||||
use style::context::{CascadeInputs, QuirksMode, SharedStyleContext, StyleContext};
|
||||
use style::context::ThreadLocalStyleContext;
|
||||
use style::counter_style;
|
||||
|
@ -35,6 +36,8 @@ use style::gecko::wrapper::{GeckoElement, GeckoNode};
|
|||
use style::gecko_bindings::bindings;
|
||||
use style::gecko_bindings::bindings::{RawGeckoElementBorrowed, RawGeckoElementBorrowedOrNull, RawGeckoNodeBorrowed};
|
||||
use style::gecko_bindings::bindings::{RawGeckoKeyframeListBorrowed, RawGeckoKeyframeListBorrowedMut};
|
||||
use style::gecko_bindings::bindings::{RawServoAuthorStyles, RawServoAuthorStylesBorrowed};
|
||||
use style::gecko_bindings::bindings::{RawServoAuthorStylesBorrowedMut, RawServoAuthorStylesOwned};
|
||||
use style::gecko_bindings::bindings::{RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockStrong};
|
||||
use style::gecko_bindings::bindings::{RawServoDocumentRule, RawServoDocumentRuleBorrowed};
|
||||
use style::gecko_bindings::bindings::{RawServoFontFeatureValuesRule, RawServoFontFeatureValuesRuleBorrowed};
|
||||
|
@ -1120,10 +1123,71 @@ pub extern "C" fn Servo_StyleSet_AppendStyleSheet(
|
|||
data.stylist.append_stylesheet(sheet, &guard);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_AuthorStyles_Create() -> *mut RawServoAuthorStyles {
|
||||
Box::into_raw(Box::new(AuthorStyles::<GeckoStyleSheet>::new())) as *mut _
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_AuthorStyles_Drop(
|
||||
styles: RawServoAuthorStylesOwned,
|
||||
) {
|
||||
let _ = styles.into_box::<AuthorStyles<_>>();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn Servo_AuthorStyles_AppendStyleSheet(
|
||||
styles: RawServoAuthorStylesBorrowedMut,
|
||||
sheet: *const ServoStyleSheet,
|
||||
) {
|
||||
let styles = AuthorStyles::<GeckoStyleSheet>::from_ffi_mut(styles);
|
||||
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
let guard = global_style_data.shared_lock.read();
|
||||
let sheet = GeckoStyleSheet::new(sheet);
|
||||
styles.stylesheets.append_stylesheet(None, sheet, &guard);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn Servo_AuthorStyles_ForceDirty(
|
||||
styles: RawServoAuthorStylesBorrowedMut,
|
||||
) {
|
||||
let styles = AuthorStyles::<GeckoStyleSheet>::from_ffi_mut(styles);
|
||||
styles.stylesheets.force_dirty();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn Servo_AuthorStyles_Flush(
|
||||
styles: RawServoAuthorStylesBorrowedMut,
|
||||
document_set: RawServoStyleSetBorrowed,
|
||||
) {
|
||||
let styles = AuthorStyles::<GeckoStyleSheet>::from_ffi_mut(styles);
|
||||
// Try to avoid the atomic borrow below if possible.
|
||||
if !styles.stylesheets.dirty() {
|
||||
return;
|
||||
}
|
||||
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
let guard = global_style_data.shared_lock.read();
|
||||
|
||||
let document_data =
|
||||
PerDocumentStyleData::from_ffi(document_set).borrow();
|
||||
|
||||
let stylist = &document_data.stylist;
|
||||
|
||||
// TODO(emilio): This is going to need an element or something to do proper
|
||||
// invalidation in Shadow roots.
|
||||
styles.flush::<GeckoElement>(
|
||||
stylist.device(),
|
||||
stylist.quirks_mode(),
|
||||
&guard,
|
||||
);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn Servo_StyleSet_MediumFeaturesChanged(
|
||||
document_set: RawServoStyleSetBorrowed,
|
||||
non_document_sets: *const nsTArray<*mut structs::ServoStyleSet>,
|
||||
non_document_styles: *mut nsTArray<RawServoAuthorStylesBorrowedMut>,
|
||||
may_affect_default_style: bool,
|
||||
) -> structs::MediumFeaturesChangedResult {
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
|
@ -1156,27 +1220,20 @@ pub unsafe extern "C" fn Servo_StyleSet_MediumFeaturesChanged(
|
|||
}
|
||||
|
||||
let mut affects_non_document_rules = false;
|
||||
for non_document_style_set in &**non_document_sets {
|
||||
let non_document_data = &*(**non_document_style_set).mRawSet.mPtr;
|
||||
let non_document_data =
|
||||
mem::transmute::<&structs::RawServoStyleSet, &bindings::RawServoStyleSet>(non_document_data);
|
||||
let mut non_document_data =
|
||||
PerDocumentStyleData::from_ffi(non_document_data).borrow_mut();
|
||||
|
||||
let origins_changed =
|
||||
non_document_data.stylist.media_features_change_changed_style(
|
||||
&guards,
|
||||
for author_styles in &mut **non_document_styles {
|
||||
let author_styles =
|
||||
AuthorStyles::<GeckoStyleSheet>::from_ffi_mut(&mut *author_styles);
|
||||
let affected_style = author_styles.stylesheets.iter().any(|sheet| {
|
||||
!author_styles.data.media_feature_affected_matches(
|
||||
sheet,
|
||||
&guards.author,
|
||||
document_data.stylist.device(),
|
||||
);
|
||||
if !origins_changed.is_empty() {
|
||||
document_data.stylist.quirks_mode(),
|
||||
)
|
||||
});
|
||||
if affected_style {
|
||||
affects_non_document_rules = true;
|
||||
// XBL stylesets are rebuilt entirely, so we need to mark them
|
||||
// dirty from here instead of going through the stylist
|
||||
// force_origin_dirty stuff, which would be useless.
|
||||
//
|
||||
// FIXME(emilio, bug 1436059): This is super-hacky, make XBL /
|
||||
// Shadow DOM not use a style set at all.
|
||||
(**non_document_style_set).mStylistState = structs::StylistState_StyleSheetsDirty;
|
||||
author_styles.stylesheets.force_dirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4930,19 +4987,25 @@ pub extern "C" fn Servo_ParseCounterStyleName(
|
|||
#[no_mangle]
|
||||
pub unsafe extern "C" fn Servo_InvalidateStyleForDocStateChanges(
|
||||
root: RawGeckoElementBorrowed,
|
||||
raw_style_sets: *const nsTArray<RawServoStyleSetBorrowed>,
|
||||
document_style: RawServoStyleSetBorrowed,
|
||||
non_document_styles: *const nsTArray<RawServoAuthorStylesBorrowed>,
|
||||
states_changed: u64,
|
||||
) {
|
||||
use style::invalidation::element::document_state::DocumentStateInvalidationProcessor;
|
||||
use style::invalidation::element::invalidator::TreeStyleInvalidator;
|
||||
|
||||
let mut borrows = SmallVec::<[_; 20]>::with_capacity((*raw_style_sets).len());
|
||||
for style_set in &**raw_style_sets {
|
||||
borrows.push(PerDocumentStyleData::from_ffi(*style_set).borrow());
|
||||
}
|
||||
let document_data = PerDocumentStyleData::from_ffi(document_style).borrow();
|
||||
|
||||
let iter =
|
||||
document_data.stylist.iter_origins().map(|(data, _origin)| data)
|
||||
.chain((*non_document_styles).iter().map(|author_styles| {
|
||||
let styles: &_ = AuthorStyles::<GeckoStyleSheet>::from_ffi(author_styles);
|
||||
&styles.data
|
||||
}));
|
||||
|
||||
let root = GeckoElement(root);
|
||||
let mut processor = DocumentStateInvalidationProcessor::new(
|
||||
borrows.iter().flat_map(|b| b.stylist.iter_origins().map(|(data, _origin)| data)),
|
||||
iter,
|
||||
DocumentState::from_bits_truncate(states_changed),
|
||||
root.as_node().owner_doc().quirks_mode(),
|
||||
);
|
||||
|
|
Загрузка…
Ссылка в новой задаче