diff --git a/components/style/build_gecko.rs b/components/style/build_gecko.rs index c2983df208a..65c892f92ee 100644 --- a/components/style/build_gecko.rs +++ b/components/style/build_gecko.rs @@ -99,7 +99,7 @@ mod bindings { fn add_include(name: &str) -> String { let mut added_paths = ADDED_PATHS.lock().unwrap(); - let file = search_include(name).unwrap(); + let file = search_include(name).expect("Include not found!"); let result = String::from(file.to_str().unwrap()); add_headers_recursively(file, &mut *added_paths); result @@ -235,6 +235,8 @@ mod bindings { .include(add_include("mozilla/ServoElementSnapshot.h")) .include(add_include("mozilla/dom/Element.h")) .include(add_include("mozilla/ServoBindings.h")) + .include(add_include("nsMediaFeatures.h")) + .include(add_include("nsMediaList.h")) // FIXME(emilio): Incrementally remove these "pub use"s. Probably // mozilla::css and mozilla::dom are easier. .raw_line("pub use self::root::*;") @@ -296,6 +298,14 @@ mod bindings { "nsChangeHint", "nsCSSKeyword", "nsCSSPropertyID", + "nsCSSProps", + + // FIXME(emilio): These three can go away once + // https://github.com/servo/rust-bindgen/pull/397 has landed. + "nsStyleStructID", + "nsStyleAnimType", + "UseCounter", + "nsCSSRect", "nsCSSRect_heap", "nsCSSShadowArray", @@ -316,6 +326,10 @@ mod bindings { "nsMainThreadPtrHandle", "nsMainThreadPtrHolder", "nsMargin", + "nsMediaExpression", + "nsMediaFeature", + "nsMediaFeatures", + "nsMediaList", "nsRect", "nsRestyleHint", "nsresult", @@ -376,6 +390,7 @@ mod bindings { "mozilla::DefaultDelete", ]; let opaque_types = [ + "std::pair__PCCP", "std::namespace::atomic___base", "std::atomic__My_base", "nsAString_internal_char_traits", "nsAString_internal_incompatible_char_type", @@ -401,7 +416,6 @@ mod bindings { // for clang. "nsPIDOMWindow", // <- Takes the vtable from a template parameter, and we can't // generate it conditionally. - "RawGeckoPresContext", // Just passing it through. "JS::Rooted", "mozilla::Maybe", "gfxSize", // <- union { struct { T width; T height; }; T components[2] }; @@ -483,6 +497,7 @@ mod bindings { "RawGeckoAnimationValueList", "RawServoAnimationValue", "RawGeckoPresContext", + "RawGeckoPresContextOwned", "ThreadSafeURIHolder", "ThreadSafePrincipalHolder", "CSSPseudoClassType", @@ -503,6 +518,7 @@ mod bindings { "nsCursorImage", "nsFont", "nsIAtom", + "nsMediaFeature", "nsRestyleHint", "nsStyleBackground", "nsStyleBorder", diff --git a/components/style/gecko/data.rs b/components/style/gecko/data.rs index dd4ae30a429..f4182d365e2 100644 --- a/components/style/gecko/data.rs +++ b/components/style/gecko/data.rs @@ -7,11 +7,10 @@ use animation::Animation; use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut}; use dom::OpaqueNode; -use euclid::size::TypedSize2D; -use gecko_bindings::bindings::RawGeckoPresContextBorrowed; use gecko_bindings::bindings::RawServoStyleSet; +use gecko_bindings::structs::RawGeckoPresContextOwned; use gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI}; -use media_queries::{Device, MediaType}; +use media_queries::Device; use num_cpus; use parking_lot::RwLock; use properties::ComputedValues; @@ -21,7 +20,6 @@ use std::collections::HashMap; use std::env; use std::sync::Arc; use std::sync::mpsc::{Receiver, Sender, channel}; -use style_traits::ViewportPx; use stylesheets::Stylesheet; use stylist::Stylist; @@ -37,6 +35,9 @@ pub struct PerDocumentStyleDataImpl { /// Whether the stylesheets list above has changed since the last restyle. pub stylesheets_changed: bool, + /// Whether the device has changed since the last restyle. + pub device_changed: bool, + // FIXME(bholley): Hook these up to something. /// Unused. Will go away when we actually implement transitions and /// animations properly. @@ -57,9 +58,6 @@ pub struct PerDocumentStyleDataImpl { /// The number of threads of the work queue. pub num_threads: usize, - - /// Default computed values for this document. - pub default_computed_values: Arc } /// The data itself is an `AtomicRefCell`, which guarantees the proper semantics @@ -78,15 +76,8 @@ lazy_static! { impl PerDocumentStyleData { /// Create a dummy `PerDocumentStyleData`. - pub fn new(pres_context: RawGeckoPresContextBorrowed) -> Self { - // FIXME(bholley): Real window size. - let window_size: TypedSize2D = TypedSize2D::new(800.0, 600.0); - let default_computed_values = ComputedValues::default_values(pres_context); - - // FIXME(bz): We're going to need to either update the computed values - // in the Stylist's Device or give the Stylist a new Device when our - // default_computed_values changes. - let device = Device::new(MediaType::Screen, window_size, &default_computed_values); + pub fn new(pres_context: RawGeckoPresContextOwned) -> Self { + let device = Device::new(pres_context); let (new_anims_sender, new_anims_receiver) = channel(); @@ -94,6 +85,7 @@ impl PerDocumentStyleData { stylist: Arc::new(Stylist::new(device)), stylesheets: vec![], stylesheets_changed: true, + device_changed: true, new_animations_sender: new_anims_sender, new_animations_receiver: new_anims_receiver, running_animations: Arc::new(RwLock::new(HashMap::new())), @@ -106,7 +98,6 @@ impl PerDocumentStyleData { rayon::ThreadPool::new(configuration).ok() }, num_threads: *NUM_THREADS, - default_computed_values: default_computed_values, })) } @@ -124,15 +115,30 @@ impl PerDocumentStyleData { impl PerDocumentStyleDataImpl { /// Recreate the style data if the stylesheets have changed. pub fn flush_stylesheets(&mut self) { - // The stylist wants to be flushed if either the stylesheets change or the - // device dimensions change. When we add support for media queries, we'll - // need to detect the latter case and trigger a flush as well. + let mut stylist = if self.device_changed || self.stylesheets_changed { + Some(Arc::get_mut(&mut self.stylist).unwrap()) + } else { + None + }; + + if self.device_changed { + Arc::get_mut(&mut stylist.as_mut().unwrap().device).unwrap().reset(); + self.device_changed = false; + // Force a stylesheet flush if the device has changed. + self.stylesheets_changed = true; + } + if self.stylesheets_changed { - let _ = Arc::get_mut(&mut self.stylist).unwrap() - .update(&self.stylesheets, None, true); + let _ = stylist.unwrap().update(&self.stylesheets, None, true); self.stylesheets_changed = false; } } + + /// Get the default computed values for this document. + pub fn default_computed_values(&self) -> &Arc { + debug_assert!(!self.device_changed, "A device flush was pending"); + self.stylist.device.default_values_arc() + } } unsafe impl HasFFI for PerDocumentStyleData { diff --git a/components/style/gecko/media_queries.rs b/components/style/gecko/media_queries.rs new file mode 100644 index 00000000000..b2c57195b90 --- /dev/null +++ b/components/style/gecko/media_queries.rs @@ -0,0 +1,566 @@ +/* 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/. */ + +//! Gecko's media-query device and expression representation. + +use app_units::Au; +use cssparser::{CssStringWriter, Parser, Token}; +use euclid::Size2D; +use gecko_bindings::bindings; +use gecko_bindings::structs::{nsCSSValue, nsCSSUnit, nsStringBuffer, nsresult}; +use gecko_bindings::structs::{nsMediaExpression_Range, nsMediaFeature}; +use gecko_bindings::structs::{nsMediaFeature_ValueType, nsMediaFeature_RangeType, nsMediaFeature_RequirementFlags}; +use gecko_bindings::structs::RawGeckoPresContextOwned; +use media_queries::MediaType; +use properties::ComputedValues; +use std::ascii::AsciiExt; +use std::fmt::{self, Write}; +use std::sync::Arc; +use string_cache::Atom; +use style_traits::ToCss; +use style_traits::viewport::ViewportConstraints; +use values::{CSSFloat, specified}; +use values::computed::{self, ToComputedValue}; + +/// The `Device` in Gecko wraps a pres context, has a default values computed, +/// and contains all the viewport rule state. +pub struct Device { + /// NB: The pres context lifetime is tied to the styleset, who owns the + /// stylist, and thus the `Device`, so having a raw pres context pointer + /// here is fine. + pres_context: RawGeckoPresContextOwned, + default_values: Arc, + viewport_override: Option, +} + +impl Device { + /// Trivially constructs a new `Device`. + pub fn new(pres_context: RawGeckoPresContextOwned) -> Self { + assert!(!pres_context.is_null()); + Device { + pres_context: pres_context, + default_values: ComputedValues::default_values(unsafe { &*pres_context }), + viewport_override: None, + } + } + + /// Tells the device that a new viewport rule has been found, and stores the + /// relevant viewport constraints. + pub fn account_for_viewport_rule(&mut self, + constraints: &ViewportConstraints) { + self.viewport_override = Some(constraints.clone()); + } + + /// Returns the default computed values as a reference, in order to match + /// Servo. + pub fn default_values(&self) -> &ComputedValues { + &*self.default_values + } + + /// Returns the default computed values as an `Arc`, in order to avoid + /// clones. + pub fn default_values_arc(&self) -> &Arc { + &self.default_values + } + + /// Recreates all the temporary state that the `Device` stores. + /// + /// This includes the viewport override from `@viewport` rules, and also the + /// default computed values. + pub fn reset(&mut self) { + // NB: A following stylesheet flush will populate this if appropriate. + self.viewport_override = None; + self.default_values = ComputedValues::default_values(unsafe { &*self.pres_context }); + } + + /// Returns the current media type of the device. + pub fn media_type(&self) -> MediaType { + unsafe { + // FIXME(emilio): Gecko allows emulating random media with + // mIsEmulatingMedia / mMediaEmulated . Refactor both sides so that + // is supported (probably just making MediaType an Atom). + if (*self.pres_context).mMedium == atom!("screen").as_ptr() { + MediaType::Screen + } else { + debug_assert!((*self.pres_context).mMedium == atom!("print").as_ptr()); + MediaType::Print + } + } + } + + /// Returns the current viewport size in app units. + pub fn au_viewport_size(&self) -> Size2D { + self.viewport_override.as_ref().map(|v| { + Size2D::new(Au::from_f32_px(v.size.width), + Au::from_f32_px(v.size.height)) + }).unwrap_or_else(|| { + // TODO(emilio): Grab from pres context. + Size2D::new(Au::from_f32_px(1024.0), + Au::from_f32_px(768.0)) + }) + } +} + +unsafe impl Sync for Device {} +unsafe impl Send for Device {} + +/// A expression for gecko contains a reference to the media feature, the value +/// the media query contained, and the range to evaluate. +#[derive(Debug, Clone)] +pub struct Expression { + feature: &'static nsMediaFeature, + value: Option, + range: nsMediaExpression_Range +} + +impl ToCss for Expression { + fn to_css(&self, dest: &mut W) -> fmt::Result + where W: fmt::Write, + { + dest.write_str("(")?; + match self.range { + nsMediaExpression_Range::eMin => dest.write_str("min-")?, + nsMediaExpression_Range::eMax => dest.write_str("max-")?, + nsMediaExpression_Range::eEqual => {}, + } + + // NB: CssStringWriter not needed, feature names are under control. + write!(dest, "{}", Atom::from(unsafe { *self.feature.mName }))?; + + if let Some(ref val) = self.value { + dest.write_str(": ")?; + val.to_css(dest)?; + } + + dest.write_str(")") + } +} + +/// A resolution. +#[derive(Debug, Clone)] +pub enum Resolution { + /// Dots per inch. + Dpi(CSSFloat), + /// Dots per pixel. + Dppx(CSSFloat), + /// Dots per centimeter. + Dpcm(CSSFloat), +} + +impl Resolution { + fn to_dpi(&self) -> CSSFloat { + match *self { + Resolution::Dpi(f) => f, + Resolution::Dppx(f) => f * 96.0, + Resolution::Dpcm(f) => f * 2.54, + } + } + + fn parse(input: &mut Parser) -> Result { + let (value, unit) = match try!(input.next()) { + Token::Dimension(value, unit) => { + (value.value, unit) + }, + _ => return Err(()), + }; + + Ok(match_ignore_ascii_case! { unit, + "dpi" => Resolution::Dpi(value), + "dppx" => Resolution::Dppx(value), + "dpcm" => Resolution::Dpcm(value), + _ => return Err(()) + }) + } +} + +impl ToCss for Resolution { + fn to_css(&self, dest: &mut W) -> fmt::Result + where W: fmt::Write, + { + match *self { + Resolution::Dpi(v) => write!(dest, "{}dpi", v), + Resolution::Dppx(v) => write!(dest, "{}dppx", v), + Resolution::Dpcm(v) => write!(dest, "{}dpcm", v), + } + } +} + +unsafe fn string_from_ns_string_buffer(buffer: *const nsStringBuffer) -> String { + use std::slice; + debug_assert!(!buffer.is_null()); + let data = buffer.offset(1) as *const u16; + let mut length = 0; + let mut iter = data; + while *iter != 0 { + length += 1; + iter = iter.offset(1); + } + String::from_utf16_lossy(slice::from_raw_parts(data, length)) +} + +/// A value found or expected in a media expression. +#[derive(Debug, Clone)] +pub enum MediaExpressionValue { + /// A length. + Length(specified::Length), + /// A (non-negative) integer. + Integer(u32), + /// A floating point value. + Float(CSSFloat), + /// A boolean value, specified as an integer (i.e., either 0 or 1). + BoolInteger(bool), + /// Two integers separated by '/', with optional whitespace on either side + /// of the '/'. + IntRatio(u32, u32), + /// A resolution. + Resolution(Resolution), + /// An enumerated value, defined by the variant keyword table in the + /// feature's `mData` member. + Enumerated(u32), + /// An identifier. + /// + /// TODO(emilio): Maybe atomize? + Ident(String), +} + +impl MediaExpressionValue { + fn from_css_value(for_expr: &Expression, css_value: &nsCSSValue) -> Option { + // NB: If there's a null value, that means that we don't support the + // feature. + if css_value.mUnit == nsCSSUnit::eCSSUnit_Null { + return None; + } + + match for_expr.feature.mValueType { + nsMediaFeature_ValueType::eLength => { + debug_assert!(css_value.mUnit == nsCSSUnit::eCSSUnit_Pixel); + let pixels = css_value.float_unchecked(); + Some(MediaExpressionValue::Length( + specified::Length::Absolute(Au::from_f32_px(pixels)))) + } + nsMediaFeature_ValueType::eInteger => { + let i = css_value.integer_unchecked(); + debug_assert!(i >= 0); + Some(MediaExpressionValue::Integer(i as u32)) + } + nsMediaFeature_ValueType::eFloat => { + debug_assert!(css_value.mUnit == nsCSSUnit::eCSSUnit_Number); + Some(MediaExpressionValue::Float(css_value.float_unchecked())) + } + nsMediaFeature_ValueType::eBoolInteger => { + debug_assert!(css_value.mUnit == nsCSSUnit::eCSSUnit_Integer); + let i = css_value.integer_unchecked(); + debug_assert!(i == 0 || i == 1); + Some(MediaExpressionValue::BoolInteger(i == 1)) + } + nsMediaFeature_ValueType::eResolution => { + debug_assert!(css_value.mUnit == nsCSSUnit::eCSSUnit_Inch); + Some(MediaExpressionValue::Resolution(Resolution::Dpi(css_value.float_unchecked()))) + } + nsMediaFeature_ValueType::eEnumerated => { + debug_assert!(css_value.mUnit == nsCSSUnit::eCSSUnit_Enumerated); + let value = css_value.integer_unchecked(); + debug_assert!(value >= 0); + Some(MediaExpressionValue::Enumerated(value as u32)) + } + nsMediaFeature_ValueType::eIdent => { + debug_assert!(css_value.mUnit == nsCSSUnit::eCSSUnit_Ident); + let string = unsafe { + string_from_ns_string_buffer(*css_value.mValue.mString.as_ref()) + }; + Some(MediaExpressionValue::Ident(string)) + } + nsMediaFeature_ValueType::eIntRatio => { + let array = unsafe { css_value.array_unchecked() }; + debug_assert_eq!(array.len(), 2); + let first = array[0].integer_unchecked(); + let second = array[1].integer_unchecked(); + + debug_assert!(first >= 0 && second >= 0); + Some(MediaExpressionValue::IntRatio(first as u32, second as u32)) + } + } + } +} + +impl ToCss for MediaExpressionValue { + fn to_css(&self, dest: &mut W) -> fmt::Result + where W: fmt::Write, + { + match *self { + MediaExpressionValue::Length(ref l) => l.to_css(dest), + MediaExpressionValue::Integer(v) => write!(dest, "{}", v), + MediaExpressionValue::Float(v) => write!(dest, "{}", v), + MediaExpressionValue::BoolInteger(v) => { + dest.write_str(if v { "1" } else { "0" }) + }, + MediaExpressionValue::IntRatio(a, b) => { + write!(dest, "{}/{}", a, b) + }, + MediaExpressionValue::Resolution(ref r) => r.to_css(dest), + MediaExpressionValue::Ident(ref ident) => { + CssStringWriter::new(dest).write_str(ident) + } + MediaExpressionValue::Enumerated(..) => { + // TODO(emilio): Use the CSS keyword table. + unimplemented!() + } + } + } +} + +fn starts_with_ignore_ascii_case(string: &str, prefix: &str) -> bool { + string.len() > prefix.len() && + string[0..prefix.len()].eq_ignore_ascii_case(prefix) +} + +fn find_feature(mut f: F) -> Option<&'static nsMediaFeature> + where F: FnMut(&'static nsMediaFeature) -> bool, +{ + // FIXME(emilio): With build-time bindgen, we would be able to use + // structs::nsMediaFeatures_features. That would unfortunately break MSVC + // builds, or require one bindings file per platform. + // + // I'm not into any of those, so meanwhile let's use a FFI function. + unsafe { + let mut features = bindings::Gecko_GetMediaFeatures(); + while !(*features).mName.is_null() { + if f(&*features) { + return Some(&*features); + } + features = features.offset(1); + } + } + + None +} + +impl Expression { + /// Trivially construct a new expression. + fn new(feature: &'static nsMediaFeature, + value: Option, + range: nsMediaExpression_Range) -> Self { + Expression { + feature: feature, + value: value, + range: range, + } + } + + /// Parse a media expression of the form: + /// + /// ``` + /// (media-feature: media-value) + /// ``` + pub fn parse(input: &mut Parser) -> Result { + try!(input.expect_parenthesis_block()); + input.parse_nested_block(|input| { + let ident = try!(input.expect_ident()); + + let mut flags = 0; + let mut feature_name = &*ident; + + // TODO(emilio): this is under a pref in Gecko. + if starts_with_ignore_ascii_case(feature_name, "-webkit-") { + feature_name = &feature_name[8..]; + flags |= nsMediaFeature_RequirementFlags::eHasWebkitPrefix as u8; + } + + let range = if starts_with_ignore_ascii_case(feature_name, "min-") { + feature_name = &feature_name[4..]; + nsMediaExpression_Range::eMin + } else if starts_with_ignore_ascii_case(feature_name, "max-") { + feature_name = &feature_name[4..]; + nsMediaExpression_Range::eMax + } else { + nsMediaExpression_Range::eEqual + }; + + let atom = Atom::from(feature_name); + let feature = + match find_feature(|f| atom.as_ptr() == unsafe { *f.mName }) { + Some(f) => f, + None => return Err(()), + }; + + if (feature.mReqFlags & !flags) != 0 { + return Err(()); + } + + if range != nsMediaExpression_Range::eEqual && + feature.mRangeType != nsMediaFeature_RangeType::eMinMaxAllowed { + return Err(()); + } + + // If there's no colon, this is a media query of the form + // '()', that is, there's no value specified. + // + // FIXME(emilio): We need to check for range operators too here when + // we support them, see: + // + // https://drafts.csswg.org/mediaqueries/#mq-ranges + if input.try(|i| i.expect_colon()).is_err() { + return Ok(Expression::new(feature, None, range)); + } + + let value = match feature.mValueType { + nsMediaFeature_ValueType::eLength => { + MediaExpressionValue::Length( + specified::Length::parse_non_negative(input)?) + }, + nsMediaFeature_ValueType::eInteger => { + let i = input.expect_integer()?; + if i < 0 { + return Err(()) + } + MediaExpressionValue::Integer(i as u32) + } + nsMediaFeature_ValueType::eBoolInteger => { + let i = input.expect_integer()?; + if i < 0 || i > 1 { + return Err(()) + } + MediaExpressionValue::BoolInteger(i == 1) + } + nsMediaFeature_ValueType::eFloat => { + MediaExpressionValue::Float(input.expect_number()?) + } + nsMediaFeature_ValueType::eIntRatio => { + let a = input.expect_integer()?; + if a <= 0 { + return Err(()) + } + + input.expect_delim('/')?; + + let b = input.expect_integer()?; + if b <= 0 { + return Err(()) + } + MediaExpressionValue::IntRatio(a as u32, b as u32) + } + nsMediaFeature_ValueType::eResolution => { + MediaExpressionValue::Resolution(Resolution::parse(input)?) + } + nsMediaFeature_ValueType::eEnumerated => { + // TODO(emilio): Use Gecko's CSS keyword table to parse + // this. + return Err(()) + } + nsMediaFeature_ValueType::eIdent => { + MediaExpressionValue::Ident(input.expect_ident()?.into_owned()) + } + }; + + Ok(Expression::new(feature, Some(value), range)) + }) + } + + /// Returns whether this media query evaluates to true for the given device. + pub fn matches(&self, device: &Device) -> bool { + let mut css_value = nsCSSValue::null(); + let result = unsafe { + (self.feature.mGetter.unwrap())(device.pres_context, + self.feature, + &mut css_value) + }; + + if result != nsresult::NS_OK { + // FIXME(emilio): This doesn't seem possible from reading gecko + // code, probably we should just clean up that function and return + // void. + error!("Media feature getter errored: {:?}, {:?}", + result, Atom::from(unsafe { *self.feature.mName })); + return false; + } + + let value = match MediaExpressionValue::from_css_value(self, &css_value) { + Some(v) => v, + None => return false, + }; + + self.evaluate_against(device, &value) + } + + fn evaluate_against(&self, + device: &Device, + actual_value: &MediaExpressionValue) + -> bool { + use self::MediaExpressionValue::*; + use std::cmp::Ordering; + + debug_assert!(self.range == nsMediaExpression_Range::eEqual || + self.feature.mRangeType == nsMediaFeature_RangeType::eMinMaxAllowed, + "Whoops, wrong range"); + + let default_values = device.default_values(); + + // http://dev.w3.org/csswg/mediaqueries3/#units + // em units are relative to the initial font-size. + let context = computed::Context { + is_root_element: false, + viewport_size: device.au_viewport_size(), + inherited_style: default_values, + // This cloning business is kind of dumb.... It's because Context + // insists on having an actual ComputedValues inside itself. + style: default_values.clone(), + font_metrics_provider: None + }; + + let required_value = match self.value { + Some(ref v) => v, + None => { + // If there's no value, always match unless it's a zero length + // or a zero integer or boolean. + return match *actual_value { + BoolInteger(v) => v, + Integer(v) => v != 0, + Length(ref l) => l.to_computed_value(&context) != Au(0), + _ => true, + } + } + }; + + // FIXME(emilio): Handle the possible floating point errors? + let cmp = match (required_value, actual_value) { + (&Length(ref one), &Length(ref other)) => { + one.to_computed_value(&context) + .cmp(&other.to_computed_value(&context)) + } + (&Integer(one), &Integer(ref other)) => one.cmp(other), + (&BoolInteger(one), &BoolInteger(ref other)) => one.cmp(other), + (&Float(one), &Float(ref other)) => one.partial_cmp(other).unwrap(), + (&IntRatio(one_num, one_den), &IntRatio(other_num, other_den)) => { + (one_num * other_den).partial_cmp(&(other_num * one_den)).unwrap() + } + (&Resolution(ref one), &Resolution(ref other)) => { + let actual_dpi = unsafe { + if (*device.pres_context).mOverrideDPPX > 0.0 { + self::Resolution::Dppx((*device.pres_context).mOverrideDPPX) + .to_dpi() + } else { + other.to_dpi() + } + }; + + one.to_dpi().partial_cmp(&actual_dpi).unwrap() + } + (&Ident(ref one), &Ident(ref other)) => { + debug_assert!(self.feature.mRangeType != nsMediaFeature_RangeType::eMinMaxAllowed); + return one == other; + } + (&Enumerated(..), &Enumerated(..)) => { + // TODO(emilio) + unimplemented!(); + } + _ => unreachable!(), + }; + + cmp == Ordering::Equal || match self.range { + nsMediaExpression_Range::eMin => cmp == Ordering::Less, + nsMediaExpression_Range::eEqual => false, + nsMediaExpression_Range::eMax => cmp == Ordering::Greater, + } + } +} diff --git a/components/style/gecko/mod.rs b/components/style/gecko/mod.rs index 6166a64bea3..ca87d081ef7 100644 --- a/components/style/gecko/mod.rs +++ b/components/style/gecko/mod.rs @@ -6,12 +6,7 @@ pub mod conversions; pub mod data; - -// TODO(emilio): Implement Gecko media query parsing and evaluation using -// nsMediaFeatures. -#[path = "../servo/media_queries.rs"] pub mod media_queries; - pub mod restyle_damage; pub mod selector_parser; pub mod snapshot; diff --git a/components/style/gecko_bindings/bindings.rs b/components/style/gecko_bindings/bindings.rs index 9d355444e27..16bfaf40fff 100644 --- a/components/style/gecko_bindings/bindings.rs +++ b/components/style/gecko_bindings/bindings.rs @@ -9,6 +9,7 @@ use gecko_bindings::structs::RawGeckoNode; use gecko_bindings::structs::RawGeckoAnimationValueList; use gecko_bindings::structs::RawServoAnimationValue; use gecko_bindings::structs::RawGeckoPresContext; +use gecko_bindings::structs::RawGeckoPresContextOwned; use gecko_bindings::structs::ThreadSafeURIHolder; use gecko_bindings::structs::ThreadSafePrincipalHolder; use gecko_bindings::structs::CSSPseudoClassType; @@ -29,6 +30,7 @@ use gecko_bindings::structs::nsChangeHint; use gecko_bindings::structs::nsCursorImage; use gecko_bindings::structs::nsFont; use gecko_bindings::structs::nsIAtom; +use gecko_bindings::structs::nsMediaFeature; use gecko_bindings::structs::nsRestyleHint; use gecko_bindings::structs::nsStyleBackground; unsafe impl Send for nsStyleBackground {} @@ -748,6 +750,9 @@ extern "C" { pub fn Gecko_CSSValue_GetArrayItem(css_value: nsCSSValueBorrowedMut, index: i32) -> nsCSSValueBorrowedMut; } +extern "C" { + pub fn Gecko_CSSValue_Drop(css_value: nsCSSValueBorrowedMut); +} extern "C" { pub fn Gecko_AddRefCSSValueSharedListArbitraryThread(aPtr: *mut nsCSSValueSharedList); @@ -759,6 +764,9 @@ extern "C" { extern "C" { pub fn Gecko_PropertyId_IsPrefEnabled(id: nsCSSPropertyID) -> bool; } +extern "C" { + pub fn Gecko_GetMediaFeatures() -> *const nsMediaFeature; +} extern "C" { pub fn Gecko_Construct_Default_nsStyleFont(ptr: *mut nsStyleFont, pres_context: @@ -1114,14 +1122,11 @@ extern "C" { -> ServoCssRulesStrong; } extern "C" { - pub fn Servo_StyleSet_Init(pres_context: RawGeckoPresContextBorrowed) + pub fn Servo_StyleSet_Init(pres_context: RawGeckoPresContextOwned) -> RawServoStyleSetOwned; } extern "C" { - pub fn Servo_StyleSet_RecomputeDefaultStyles(set: - RawServoStyleSetBorrowed, - pres_context: - RawGeckoPresContextBorrowed); + pub fn Servo_StyleSet_RebuildData(set: RawServoStyleSetBorrowed); } extern "C" { pub fn Servo_StyleSet_AppendStyleSheet(set: RawServoStyleSetBorrowed, diff --git a/components/style/gecko_bindings/structs_debug.rs b/components/style/gecko_bindings/structs_debug.rs index 9972511f5e4..05e522645bd 100644 --- a/components/style/gecko_bindings/structs_debug.rs +++ b/components/style/gecko_bindings/structs_debug.rs @@ -994,6 +994,7 @@ pub mod root { pub const NS_STYLE_DISPLAY_MODE_BROWSER: ::std::os::raw::c_uint = 0; pub const NS_STYLE_DISPLAY_MODE_MINIMAL_UI: ::std::os::raw::c_uint = 1; pub const NS_STYLE_DISPLAY_MODE_STANDALONE: ::std::os::raw::c_uint = 2; + pub const NS_STYLE_DISPLAY_MODE_FULLSCREEN: ::std::os::raw::c_uint = 3; pub const NS_STYLE_INHERIT_MASK: ::std::os::raw::c_uint = 16777215; pub const NS_STYLE_HAS_TEXT_DECORATION_LINES: ::std::os::raw::c_uint = 16777216; @@ -2667,6 +2668,14 @@ pub mod root { assert_eq!(::std::mem::align_of::() , 8usize); } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct DocumentRule { + pub _address: u8, + } + impl Clone for DocumentRule { + fn clone(&self) -> Self { *self } + } } /** * Superclass for data common to CSSStyleSheet and ServoStyleSheet. @@ -2847,6 +2856,14 @@ pub mod root { Count = 10, Unknown = 255, } + #[repr(i32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum CSSEnabledState { + eForAllContent = 0, + eInUASheets = 1, + eInChrome = 2, + eIgnoreEnabledState = 255, + } pub mod a11y { #[allow(unused_imports)] use self::super::super::super::root; @@ -3744,15 +3761,16 @@ pub mod root { } pub type pair_first_type<_T1> = _T1; pub type pair_second_type<_T2> = _T2; - pub mod namespace { - #[allow(unused_imports)] - use self::super::super::super::root; - } + pub type pair__PCCP = [u8; 0usize]; #[repr(C)] #[derive(Debug)] pub struct atomic<_Tp> { pub _M_i: _Tp, } + pub mod namespace { + #[allow(unused_imports)] + use self::super::super::super::root; + } pub mod chrono { #[allow(unused_imports)] use self::super::super::super::root; @@ -5493,6 +5511,82 @@ pub mod root { impl Clone for EventStates { fn clone(&self) -> Self { *self } } + #[repr(i16)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum UseCounter { + eUseCounter_UNKNOWN = -1, + eUseCounter_SVGSVGElement_getElementById = 0, + eUseCounter_SVGSVGElement_currentScale_getter = 1, + eUseCounter_SVGSVGElement_currentScale_setter = 2, + eUseCounter_property_Fill = 3, + eUseCounter_property_FillOpacity = 4, + eUseCounter_PushManager_subscribe = 5, + eUseCounter_PushSubscription_unsubscribe = 6, + eUseCounter_Window_sidebar_getter = 7, + eUseCounter_Window_sidebar_setter = 8, + eUseCounter_External_addSearchEngine = 9, + eUseCounter_OfflineResourceList_swapCache = 10, + eUseCounter_OfflineResourceList_update = 11, + eUseCounter_OfflineResourceList_status_getter = 12, + eUseCounter_OfflineResourceList_status_setter = 13, + eUseCounter_OfflineResourceList_onchecking_getter = 14, + eUseCounter_OfflineResourceList_onchecking_setter = 15, + eUseCounter_OfflineResourceList_onerror_getter = 16, + eUseCounter_OfflineResourceList_onerror_setter = 17, + eUseCounter_OfflineResourceList_onnoupdate_getter = 18, + eUseCounter_OfflineResourceList_onnoupdate_setter = 19, + eUseCounter_OfflineResourceList_ondownloading_getter = 20, + eUseCounter_OfflineResourceList_ondownloading_setter = 21, + eUseCounter_OfflineResourceList_onprogress_getter = 22, + eUseCounter_OfflineResourceList_onprogress_setter = 23, + eUseCounter_OfflineResourceList_onupdateready_getter = 24, + eUseCounter_OfflineResourceList_onupdateready_setter = 25, + eUseCounter_OfflineResourceList_oncached_getter = 26, + eUseCounter_OfflineResourceList_oncached_setter = 27, + eUseCounter_OfflineResourceList_onobsolete_getter = 28, + eUseCounter_OfflineResourceList_onobsolete_setter = 29, + eUseCounter_GetAttributeNode = 30, + eUseCounter_SetAttributeNode = 31, + eUseCounter_GetAttributeNodeNS = 32, + eUseCounter_SetAttributeNodeNS = 33, + eUseCounter_RemoveAttributeNode = 34, + eUseCounter_CreateAttribute = 35, + eUseCounter_CreateAttributeNS = 36, + eUseCounter_NodeValue = 37, + eUseCounter_TextContent = 38, + eUseCounter_EnablePrivilege = 39, + eUseCounter_DOMExceptionCode = 40, + eUseCounter_NoExposedProps = 41, + eUseCounter_MutationEvent = 42, + eUseCounter_Components = 43, + eUseCounter_PrefixedVisibilityAPI = 44, + eUseCounter_NodeIteratorDetach = 45, + eUseCounter_LenientThis = 46, + eUseCounter_GetPreventDefault = 47, + eUseCounter_GetSetUserData = 48, + eUseCounter_MozGetAsFile = 49, + eUseCounter_UseOfCaptureEvents = 50, + eUseCounter_UseOfReleaseEvents = 51, + eUseCounter_UseOfDOM3LoadMethod = 52, + eUseCounter_ChromeUseOfDOM3LoadMethod = 53, + eUseCounter_ShowModalDialog = 54, + eUseCounter_Window_Content = 55, + eUseCounter_SyncXMLHttpRequest = 56, + eUseCounter_DataContainerEvent = 57, + eUseCounter_Window_Controllers = 58, + eUseCounter_ImportXULIntoContent = 59, + eUseCounter_PannerNodeDoppler = 60, + eUseCounter_NavigatorGetUserMedia = 61, + eUseCounter_WebrtcDeprecatedPrefix = 62, + eUseCounter_RTCPeerConnectionGetStreams = 63, + eUseCounter_AppCache = 64, + eUseCounter_PrefixedImageSmoothingEnabled = 65, + eUseCounter_PrefixedFullscreenAPI = 66, + eUseCounter_LenientSetter = 67, + eUseCounter_FileLastModifiedDate = 68, + eUseCounter_ImageBitmapRenderingContext_TransferImageBitmap = 69, + eUseCounter_Count = 70, + } #[repr(C)] #[derive(Debug)] pub struct nsIDocument { @@ -6686,6 +6780,26 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy)] + pub struct nsIDOMMediaList { + pub _base: root::nsISupports, + } + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct nsIDOMMediaList_COMTypeInfo { + pub _address: u8, + pub _phantom_0: ::std::marker::PhantomData, + pub _phantom_1: ::std::marker::PhantomData, + } + #[test] + fn bindgen_test_layout_nsIDOMMediaList() { + assert_eq!(::std::mem::size_of::() , 8usize); + assert_eq!(::std::mem::align_of::() , 8usize); + } + impl Clone for nsIDOMMediaList { + fn clone(&self) -> Self { *self } + } + #[repr(C)] + #[derive(Debug, Copy)] pub struct nsIDOMEventTarget { pub _base: root::nsISupports, } @@ -8399,13 +8513,42 @@ pub mod root { *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int>; #[repr(C)] - #[derive(Debug, Copy)] + #[derive(Debug)] pub struct nsMediaList { - pub _address: u8, + pub _base: root::nsIDOMMediaList, + pub _base_1: root::nsWrapperCache, + pub mRefCnt: root::nsCycleCollectingAutoRefCnt, + pub _mOwningThread: root::nsAutoOwningThread, + pub mArray: root::nsTArray>, + pub mStyleSheet: *mut root::mozilla::StyleSheet, } - impl Clone for nsMediaList { + pub type nsMediaList_ErrorResult = [u64; 4usize]; + pub type nsMediaList_HasThreadSafeRefCnt = root::mozilla::FalseType; + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsMediaList_cycleCollection { + pub _base: root::nsXPCOMCycleCollectionParticipant, + } + #[test] + fn bindgen_test_layout_nsMediaList_cycleCollection() { + assert_eq!(::std::mem::size_of::() , + 16usize); + assert_eq!(::std::mem::align_of::() , + 8usize); + } + impl Clone for nsMediaList_cycleCollection { fn clone(&self) -> Self { *self } } + extern "C" { + #[link_name = "_ZN11nsMediaList21_cycleCollectorGlobalE"] + pub static mut nsMediaList__cycleCollectorGlobal: + root::nsMediaList_cycleCollection; + } + #[test] + fn bindgen_test_layout_nsMediaList() { + assert_eq!(::std::mem::size_of::() , 64usize); + assert_eq!(::std::mem::align_of::() , 8usize); + } #[repr(C)] #[derive(Debug)] pub struct nsAttrValue { @@ -9174,63 +9317,63 @@ pub mod root { impl Clone for nsDOMMutationObserver { fn clone(&self) -> Self { *self } } - pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_HAS_LISTENERMANAGER; - pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_HAS_PROPERTIES; - pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_IS_ANONYMOUS_ROOT; - pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; - pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_IS_NATIVE_ANONYMOUS_ROOT; - pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_FORCE_XBL_BINDINGS; - pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_MAY_BE_IN_BINDING_MNGR; - pub const NODE_IS_EDITABLE: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_IS_EDITABLE; - pub const NODE_MAY_HAVE_CLASS: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_MAY_HAVE_CLASS; - pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_IS_IN_SHADOW_TREE; - pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_HAS_EMPTY_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_HAS_SLOW_SELECTOR; - pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_HAS_EDGE_CHILD_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; - pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_ALL_SELECTOR_FLAGS; - pub const NODE_NEEDS_FRAME: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_NEEDS_FRAME; - pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_DESCENDANTS_NEED_FRAMES; - pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_HAS_ACCESSKEY; - pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_HAS_DIRECTION_RTL; - pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_HAS_DIRECTION_LTR; - pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_ALL_DIRECTION_FLAGS; - pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_CHROME_ONLY_ACCESS; - pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; - pub const NODE_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_SHARED_RESTYLE_BIT_1; - pub const NODE_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_SHARED_RESTYLE_BIT_2; - pub const NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_SHARED_RESTYLE_BIT_1; - pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_155 = - _bindgen_ty_155::NODE_TYPE_SPECIFIC_BITS_OFFSET; + pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_HAS_LISTENERMANAGER; + pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_HAS_PROPERTIES; + pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_IS_ANONYMOUS_ROOT; + pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; + pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_IS_NATIVE_ANONYMOUS_ROOT; + pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_FORCE_XBL_BINDINGS; + pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_MAY_BE_IN_BINDING_MNGR; + pub const NODE_IS_EDITABLE: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_IS_EDITABLE; + pub const NODE_MAY_HAVE_CLASS: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_MAY_HAVE_CLASS; + pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_IS_IN_SHADOW_TREE; + pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_HAS_EMPTY_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_HAS_SLOW_SELECTOR; + pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_HAS_EDGE_CHILD_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; + pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_ALL_SELECTOR_FLAGS; + pub const NODE_NEEDS_FRAME: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_NEEDS_FRAME; + pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_DESCENDANTS_NEED_FRAMES; + pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_HAS_ACCESSKEY; + pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_HAS_DIRECTION_RTL; + pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_HAS_DIRECTION_LTR; + pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_ALL_DIRECTION_FLAGS; + pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_CHROME_ONLY_ACCESS; + pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; + pub const NODE_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_SHARED_RESTYLE_BIT_1; + pub const NODE_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_SHARED_RESTYLE_BIT_2; + pub const NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_SHARED_RESTYLE_BIT_1; + pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_137 = + _bindgen_ty_137::NODE_TYPE_SPECIFIC_BITS_OFFSET; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_155 { + pub enum _bindgen_ty_137 { NODE_HAS_LISTENERMANAGER = 4, NODE_HAS_PROPERTIES = 8, NODE_IS_ANONYMOUS_ROOT = 16, @@ -11632,6 +11775,1041 @@ pub mod root { eCSSPropertyExtra_variable = 476, eCSSProperty_DOM = 477, } + pub const nsStyleStructID_nsStyleStructID_DUMMY1: root::nsStyleStructID = + nsStyleStructID::nsStyleStructID_None; + pub const nsStyleStructID_eStyleStruct_Font: root::nsStyleStructID = + nsStyleStructID::nsStyleStructID_Inherited_Start; + pub const nsStyleStructID_nsStyleStructID_DUMMY2: root::nsStyleStructID = + nsStyleStructID::eStyleStruct_Variables; + pub const nsStyleStructID_eStyleStruct_Background: root::nsStyleStructID = + nsStyleStructID::nsStyleStructID_Reset_Start; + pub const nsStyleStructID_nsStyleStructID_Inherited_Count: + root::nsStyleStructID = + nsStyleStructID::nsStyleStructID_Reset_Start; + pub const nsStyleStructID_nsStyleStructID_Reset_Count: + root::nsStyleStructID = + nsStyleStructID::eStyleStruct_Table; + #[repr(i32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsStyleStructID { + nsStyleStructID_None = -1, + nsStyleStructID_Inherited_Start = 0, + eStyleStruct_Color = 1, + eStyleStruct_List = 2, + eStyleStruct_Text = 3, + eStyleStruct_Visibility = 4, + eStyleStruct_UserInterface = 5, + eStyleStruct_TableBorder = 6, + eStyleStruct_SVG = 7, + eStyleStruct_Variables = 8, + nsStyleStructID_Reset_Start = 9, + eStyleStruct_Position = 10, + eStyleStruct_TextReset = 11, + eStyleStruct_Display = 12, + eStyleStruct_Content = 13, + eStyleStruct_UIReset = 14, + eStyleStruct_Table = 15, + eStyleStruct_Margin = 16, + eStyleStruct_Padding = 17, + eStyleStruct_Border = 18, + eStyleStruct_Outline = 19, + eStyleStruct_XUL = 20, + eStyleStruct_SVGReset = 21, + eStyleStruct_Column = 22, + eStyleStruct_Effects = 23, + nsStyleStructID_Length = 24, + } + #[repr(u32)] + /** + * Types of animatable values. + */ + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsStyleAnimType { + eStyleAnimType_Custom = 0, + eStyleAnimType_Coord = 1, + eStyleAnimType_Sides_Top = 2, + eStyleAnimType_Sides_Right = 3, + eStyleAnimType_Sides_Bottom = 4, + eStyleAnimType_Sides_Left = 5, + eStyleAnimType_Corner_TopLeft = 6, + eStyleAnimType_Corner_TopRight = 7, + eStyleAnimType_Corner_BottomRight = 8, + eStyleAnimType_Corner_BottomLeft = 9, + eStyleAnimType_nscoord = 10, + eStyleAnimType_float = 11, + eStyleAnimType_Color = 12, + eStyleAnimType_ComplexColor = 13, + eStyleAnimType_PaintServer = 14, + eStyleAnimType_Shadow = 15, + eStyleAnimType_Discrete = 16, + eStyleAnimType_None = 17, + } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsCSSProps { + pub _address: u8, + } + pub type nsCSSProps_EnabledState = root::mozilla::CSSEnabledState; + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsCSSProps_KTableEntry { + pub mKeyword: root::nsCSSKeyword, + pub mValue: i16, + } + #[test] + fn bindgen_test_layout_nsCSSProps_KTableEntry() { + assert_eq!(::std::mem::size_of::() , 4usize); + assert_eq!(::std::mem::align_of::() , 2usize); + } + impl Clone for nsCSSProps_KTableEntry { + fn clone(&self) -> Self { *self } + } + extern "C" { + #[link_name = "_ZN10nsCSSProps9kSIDTableE"] + pub static mut nsCSSProps_kSIDTable: + [root::nsStyleStructID; 316usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kKeywordTableTableE"] + pub static mut nsCSSProps_kKeywordTableTable: + [*const root::nsCSSProps_KTableEntry; 316usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps14kAnimTypeTableE"] + pub static mut nsCSSProps_kAnimTypeTable: + [root::nsStyleAnimType; 316usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps23kStyleStructOffsetTableE"] + pub static mut nsCSSProps_kStyleStructOffsetTable: [isize; 316usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps11kFlagsTableE"] + pub static mut nsCSSProps_kFlagsTable: [u32; 364usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kParserVariantTableE"] + pub static mut nsCSSProps_kParserVariantTable: [u32; 316usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kSubpropertyTableE"] + pub static mut nsCSSProps_kSubpropertyTable: + [*const root::nsCSSPropertyID; 48usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps26gShorthandsContainingTableE"] + pub static mut nsCSSProps_gShorthandsContainingTable: + [*mut root::nsCSSPropertyID; 316usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25gShorthandsContainingPoolE"] + pub static mut nsCSSProps_gShorthandsContainingPool: + *mut root::nsCSSPropertyID; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps22gPropertyCountInStructE"] + pub static mut nsCSSProps_gPropertyCountInStruct: [usize; 24usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps22gPropertyIndexInStructE"] + pub static mut nsCSSProps_gPropertyIndexInStruct: [usize; 316usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kLogicalGroupTableE"] + pub static mut nsCSSProps_kLogicalGroupTable: + [*const root::nsCSSPropertyID; 9usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16gPropertyEnabledE"] + pub static mut nsCSSProps_gPropertyEnabled: [bool; 472usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps13kIDLNameTableE"] + pub static mut nsCSSProps_kIDLNameTable: + [*const ::std::os::raw::c_char; 364usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kIDLNameSortPositionTableE"] + pub static mut nsCSSProps_kIDLNameSortPositionTable: [i32; 364usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19gPropertyUseCounterE"] + pub static mut nsCSSProps_gPropertyUseCounter: + [root::UseCounter; 316usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kAnimationDirectionKTableE"] + pub static mut nsCSSProps_kAnimationDirectionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps24kAnimationFillModeKTableE"] + pub static mut nsCSSProps_kAnimationFillModeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps30kAnimationIterationCountKTableE"] + pub static mut nsCSSProps_kAnimationIterationCountKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kAnimationPlayStateKTableE"] + pub static mut nsCSSProps_kAnimationPlayStateKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps30kAnimationTimingFunctionKTableE"] + pub static mut nsCSSProps_kAnimationTimingFunctionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kAppearanceKTableE"] + pub static mut nsCSSProps_kAppearanceKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps14kAzimuthKTableE"] + pub static mut nsCSSProps_kAzimuthKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kBackfaceVisibilityKTableE"] + pub static mut nsCSSProps_kBackfaceVisibilityKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kTransformStyleKTableE"] + pub static mut nsCSSProps_kTransformStyleKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kImageLayerAttachmentKTableE"] + pub static mut nsCSSProps_kImageLayerAttachmentKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps23kBackgroundOriginKTableE"] + pub static mut nsCSSProps_kBackgroundOriginKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kMaskOriginKTableE"] + pub static mut nsCSSProps_kMaskOriginKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kImageLayerPositionKTableE"] + pub static mut nsCSSProps_kImageLayerPositionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps23kImageLayerRepeatKTableE"] + pub static mut nsCSSProps_kImageLayerRepeatKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kImageLayerRepeatPartKTableE"] + pub static mut nsCSSProps_kImageLayerRepeatPartKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kImageLayerSizeKTableE"] + pub static mut nsCSSProps_kImageLayerSizeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps26kImageLayerCompositeKTableE"] + pub static mut nsCSSProps_kImageLayerCompositeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kImageLayerModeKTableE"] + pub static mut nsCSSProps_kImageLayerModeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kBackgroundClipKTableE"] + pub static mut nsCSSProps_kBackgroundClipKTable: + *mut root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kMaskClipKTableE"] + pub static mut nsCSSProps_kMaskClipKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kBlendModeKTableE"] + pub static mut nsCSSProps_kBlendModeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kBorderCollapseKTableE"] + pub static mut nsCSSProps_kBorderCollapseKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps24kBorderImageRepeatKTableE"] + pub static mut nsCSSProps_kBorderImageRepeatKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps23kBorderImageSliceKTableE"] + pub static mut nsCSSProps_kBorderImageSliceKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kBorderStyleKTableE"] + pub static mut nsCSSProps_kBorderStyleKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kBorderWidthKTableE"] + pub static mut nsCSSProps_kBorderWidthKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kBoxAlignKTableE"] + pub static mut nsCSSProps_kBoxAlignKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kBoxDecorationBreakKTableE"] + pub static mut nsCSSProps_kBoxDecorationBreakKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kBoxDirectionKTableE"] + pub static mut nsCSSProps_kBoxDirectionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kBoxOrientKTableE"] + pub static mut nsCSSProps_kBoxOrientKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps14kBoxPackKTableE"] + pub static mut nsCSSProps_kBoxPackKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps26kClipPathGeometryBoxKTableE"] + pub static mut nsCSSProps_kClipPathGeometryBoxKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kCounterRangeKTableE"] + pub static mut nsCSSProps_kCounterRangeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kCounterSpeakAsKTableE"] + pub static mut nsCSSProps_kCounterSpeakAsKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kCounterSymbolsSystemKTableE"] + pub static mut nsCSSProps_kCounterSymbolsSystemKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kCounterSystemKTableE"] + pub static mut nsCSSProps_kCounterSystemKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps23kDominantBaselineKTableE"] + pub static mut nsCSSProps_kDominantBaselineKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kShapeRadiusKTableE"] + pub static mut nsCSSProps_kShapeRadiusKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kFillRuleKTableE"] + pub static mut nsCSSProps_kFillRuleKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kFilterFunctionKTableE"] + pub static mut nsCSSProps_kFilterFunctionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kImageRenderingKTableE"] + pub static mut nsCSSProps_kImageRenderingKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kShapeOutsideShapeBoxKTableE"] + pub static mut nsCSSProps_kShapeOutsideShapeBoxKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kShapeRenderingKTableE"] + pub static mut nsCSSProps_kShapeRenderingKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kStrokeLinecapKTableE"] + pub static mut nsCSSProps_kStrokeLinecapKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kStrokeLinejoinKTableE"] + pub static mut nsCSSProps_kStrokeLinejoinKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kStrokeContextValueKTableE"] + pub static mut nsCSSProps_kStrokeContextValueKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kVectorEffectKTableE"] + pub static mut nsCSSProps_kVectorEffectKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kTextAnchorKTableE"] + pub static mut nsCSSProps_kTextAnchorKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kTextRenderingKTableE"] + pub static mut nsCSSProps_kTextRenderingKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kColorAdjustKTableE"] + pub static mut nsCSSProps_kColorAdjustKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kColorInterpolationKTableE"] + pub static mut nsCSSProps_kColorInterpolationKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kColumnFillKTableE"] + pub static mut nsCSSProps_kColumnFillKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kBoxPropSourceKTableE"] + pub static mut nsCSSProps_kBoxPropSourceKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kBoxShadowTypeKTableE"] + pub static mut nsCSSProps_kBoxShadowTypeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kBoxSizingKTableE"] + pub static mut nsCSSProps_kBoxSizingKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kCaptionSideKTableE"] + pub static mut nsCSSProps_kCaptionSideKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps12kClearKTableE"] + pub static mut nsCSSProps_kClearKTable: + *mut root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps12kColorKTableE"] + pub static mut nsCSSProps_kColorKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps14kContentKTableE"] + pub static mut nsCSSProps_kContentKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps33kControlCharacterVisibilityKTableE"] + pub static mut nsCSSProps_kControlCharacterVisibilityKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps13kCursorKTableE"] + pub static mut nsCSSProps_kCursorKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kDirectionKTableE"] + pub static mut nsCSSProps_kDirectionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps14kDisplayKTableE"] + pub static mut nsCSSProps_kDisplayKTable: + *mut root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kElevationKTableE"] + pub static mut nsCSSProps_kElevationKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kEmptyCellsKTableE"] + pub static mut nsCSSProps_kEmptyCellsKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kAlignAllKeywordsE"] + pub static mut nsCSSProps_kAlignAllKeywords: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps22kAlignOverflowPositionE"] + pub static mut nsCSSProps_kAlignOverflowPosition: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kAlignSelfPositionE"] + pub static mut nsCSSProps_kAlignSelfPosition: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps12kAlignLegacyE"] + pub static mut nsCSSProps_kAlignLegacy: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kAlignLegacyPositionE"] + pub static mut nsCSSProps_kAlignLegacyPosition: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps31kAlignAutoNormalStretchBaselineE"] + pub static mut nsCSSProps_kAlignAutoNormalStretchBaseline: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kAlignNormalStretchBaselineE"] + pub static mut nsCSSProps_kAlignNormalStretchBaseline: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kAlignNormalBaselineE"] + pub static mut nsCSSProps_kAlignNormalBaseline: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kAlignContentDistributionE"] + pub static mut nsCSSProps_kAlignContentDistribution: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kAlignContentPositionE"] + pub static mut nsCSSProps_kAlignContentPosition: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps31kAutoCompletionAlignJustifySelfE"] + pub static mut nsCSSProps_kAutoCompletionAlignJustifySelf: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kAutoCompletionAlignItemsE"] + pub static mut nsCSSProps_kAutoCompletionAlignItems: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps34kAutoCompletionAlignJustifyContentE"] + pub static mut nsCSSProps_kAutoCompletionAlignJustifyContent: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kFlexDirectionKTableE"] + pub static mut nsCSSProps_kFlexDirectionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kFlexWrapKTableE"] + pub static mut nsCSSProps_kFlexWrapKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps12kFloatKTableE"] + pub static mut nsCSSProps_kFloatKTable: + *mut root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kFloatEdgeKTableE"] + pub static mut nsCSSProps_kFloatEdgeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kFontDisplayKTableE"] + pub static mut nsCSSProps_kFontDisplayKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps11kFontKTableE"] + pub static mut nsCSSProps_kFontKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kFontKerningKTableE"] + pub static mut nsCSSProps_kFontKerningKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kFontSizeKTableE"] + pub static mut nsCSSProps_kFontSizeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kFontSmoothingKTableE"] + pub static mut nsCSSProps_kFontSmoothingKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kFontStretchKTableE"] + pub static mut nsCSSProps_kFontStretchKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kFontStyleKTableE"] + pub static mut nsCSSProps_kFontStyleKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kFontSynthesisKTableE"] + pub static mut nsCSSProps_kFontSynthesisKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kFontVariantKTableE"] + pub static mut nsCSSProps_kFontVariantKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps28kFontVariantAlternatesKTableE"] + pub static mut nsCSSProps_kFontVariantAlternatesKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps33kFontVariantAlternatesFuncsKTableE"] + pub static mut nsCSSProps_kFontVariantAlternatesFuncsKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps22kFontVariantCapsKTableE"] + pub static mut nsCSSProps_kFontVariantCapsKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kFontVariantEastAsianKTableE"] + pub static mut nsCSSProps_kFontVariantEastAsianKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kFontVariantLigaturesKTableE"] + pub static mut nsCSSProps_kFontVariantLigaturesKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kFontVariantNumericKTableE"] + pub static mut nsCSSProps_kFontVariantNumericKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps26kFontVariantPositionKTableE"] + pub static mut nsCSSProps_kFontVariantPositionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kFontWeightKTableE"] + pub static mut nsCSSProps_kFontWeightKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kGridAutoFlowKTableE"] + pub static mut nsCSSProps_kGridAutoFlowKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps23kGridTrackBreadthKTableE"] + pub static mut nsCSSProps_kGridTrackBreadthKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps14kHyphensKTableE"] + pub static mut nsCSSProps_kHyphensKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps23kImageOrientationKTableE"] + pub static mut nsCSSProps_kImageOrientationKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kImageOrientationFlipKTableE"] + pub static mut nsCSSProps_kImageOrientationFlipKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kIsolationKTableE"] + pub static mut nsCSSProps_kIsolationKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps14kIMEModeKTableE"] + pub static mut nsCSSProps_kIMEModeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kLineHeightKTableE"] + pub static mut nsCSSProps_kLineHeightKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps24kListStylePositionKTableE"] + pub static mut nsCSSProps_kListStylePositionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kListStyleKTableE"] + pub static mut nsCSSProps_kListStyleKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kMaskTypeKTableE"] + pub static mut nsCSSProps_kMaskTypeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kMathVariantKTableE"] + pub static mut nsCSSProps_kMathVariantKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kMathDisplayKTableE"] + pub static mut nsCSSProps_kMathDisplayKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps14kContainKTableE"] + pub static mut nsCSSProps_kContainKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kContextOpacityKTableE"] + pub static mut nsCSSProps_kContextOpacityKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kContextPatternKTableE"] + pub static mut nsCSSProps_kContextPatternKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kObjectFitKTableE"] + pub static mut nsCSSProps_kObjectFitKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps13kOrientKTableE"] + pub static mut nsCSSProps_kOrientKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kOutlineStyleKTableE"] + pub static mut nsCSSProps_kOutlineStyleKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kOverflowKTableE"] + pub static mut nsCSSProps_kOverflowKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kOverflowSubKTableE"] + pub static mut nsCSSProps_kOverflowSubKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps22kOverflowClipBoxKTableE"] + pub static mut nsCSSProps_kOverflowClipBoxKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kOverflowWrapKTableE"] + pub static mut nsCSSProps_kOverflowWrapKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kPageBreakKTableE"] + pub static mut nsCSSProps_kPageBreakKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps22kPageBreakInsideKTableE"] + pub static mut nsCSSProps_kPageBreakInsideKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kPageMarksKTableE"] + pub static mut nsCSSProps_kPageMarksKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kPageSizeKTableE"] + pub static mut nsCSSProps_kPageSizeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps12kPitchKTableE"] + pub static mut nsCSSProps_kPitchKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kPointerEventsKTableE"] + pub static mut nsCSSProps_kPointerEventsKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kPositionKTableE"] + pub static mut nsCSSProps_kPositionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps26kRadialGradientShapeKTableE"] + pub static mut nsCSSProps_kRadialGradientShapeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kRadialGradientSizeKTableE"] + pub static mut nsCSSProps_kRadialGradientSizeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps31kRadialGradientLegacySizeKTableE"] + pub static mut nsCSSProps_kRadialGradientLegacySizeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps13kResizeKTableE"] + pub static mut nsCSSProps_kResizeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kRubyAlignKTableE"] + pub static mut nsCSSProps_kRubyAlignKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kRubyPositionKTableE"] + pub static mut nsCSSProps_kRubyPositionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kScrollBehaviorKTableE"] + pub static mut nsCSSProps_kScrollBehaviorKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kScrollSnapTypeKTableE"] + pub static mut nsCSSProps_kScrollSnapTypeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps12kSpeakKTableE"] + pub static mut nsCSSProps_kSpeakKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kSpeakHeaderKTableE"] + pub static mut nsCSSProps_kSpeakHeaderKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kSpeakNumeralKTableE"] + pub static mut nsCSSProps_kSpeakNumeralKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps23kSpeakPunctuationKTableE"] + pub static mut nsCSSProps_kSpeakPunctuationKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kSpeechRateKTableE"] + pub static mut nsCSSProps_kSpeechRateKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kStackSizingKTableE"] + pub static mut nsCSSProps_kStackSizingKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kTableLayoutKTableE"] + pub static mut nsCSSProps_kTableLayoutKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kTextAlignKTableE"] + pub static mut nsCSSProps_kTextAlignKTable: + *mut root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kTextAlignLastKTableE"] + pub static mut nsCSSProps_kTextAlignLastKTable: + *mut root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kTextCombineUprightKTableE"] + pub static mut nsCSSProps_kTextCombineUprightKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kTextDecorationLineKTableE"] + pub static mut nsCSSProps_kTextDecorationLineKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps26kTextDecorationStyleKTableE"] + pub static mut nsCSSProps_kTextDecorationStyleKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kTextEmphasisPositionKTableE"] + pub static mut nsCSSProps_kTextEmphasisPositionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps28kTextEmphasisStyleFillKTableE"] + pub static mut nsCSSProps_kTextEmphasisStyleFillKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps29kTextEmphasisStyleShapeKTableE"] + pub static mut nsCSSProps_kTextEmphasisStyleShapeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps22kTextOrientationKTableE"] + pub static mut nsCSSProps_kTextOrientationKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kTextOverflowKTableE"] + pub static mut nsCSSProps_kTextOverflowKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kTextTransformKTableE"] + pub static mut nsCSSProps_kTextTransformKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kTouchActionKTableE"] + pub static mut nsCSSProps_kTouchActionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kTopLayerKTableE"] + pub static mut nsCSSProps_kTopLayerKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kTransformBoxKTableE"] + pub static mut nsCSSProps_kTransformBoxKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps31kTransitionTimingFunctionKTableE"] + pub static mut nsCSSProps_kTransitionTimingFunctionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kUnicodeBidiKTableE"] + pub static mut nsCSSProps_kUnicodeBidiKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kUserFocusKTableE"] + pub static mut nsCSSProps_kUserFocusKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kUserInputKTableE"] + pub static mut nsCSSProps_kUserInputKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kUserModifyKTableE"] + pub static mut nsCSSProps_kUserModifyKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kUserSelectKTableE"] + pub static mut nsCSSProps_kUserSelectKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kVerticalAlignKTableE"] + pub static mut nsCSSProps_kVerticalAlignKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kVisibilityKTableE"] + pub static mut nsCSSProps_kVisibilityKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps13kVolumeKTableE"] + pub static mut nsCSSProps_kVolumeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kWhitespaceKTableE"] + pub static mut nsCSSProps_kWhitespaceKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps12kWidthKTableE"] + pub static mut nsCSSProps_kWidthKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kWindowDraggingKTableE"] + pub static mut nsCSSProps_kWindowDraggingKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kWindowShadowKTableE"] + pub static mut nsCSSProps_kWindowShadowKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kWordBreakKTableE"] + pub static mut nsCSSProps_kWordBreakKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kWritingModeKTableE"] + pub static mut nsCSSProps_kWritingModeKTable: + *const root::nsCSSProps_KTableEntry; + } + #[test] + fn bindgen_test_layout_nsCSSProps() { + assert_eq!(::std::mem::size_of::() , 1usize); + assert_eq!(::std::mem::align_of::() , 1usize); + } + impl Clone for nsCSSProps { + fn clone(&self) -> Self { *self } + } /** * Class to safely handle main-thread-only pointers off the main thread. * @@ -12140,7 +13318,7 @@ pub mod root { pub type RawGeckoNode = root::nsINode; pub type RawGeckoElement = root::mozilla::dom::Element; pub type RawGeckoDocument = root::nsIDocument; - pub type RawGeckoPresContext = [u64; 162usize]; + pub type RawGeckoPresContext = root::nsPresContext; pub type RawGeckoAnimationValueList = root::nsTArray; pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode; @@ -12149,7 +13327,9 @@ pub mod root { pub type RawGeckoElementBorrowedOrNull = *const root::RawGeckoElement; pub type RawGeckoDocumentBorrowed = *const root::RawGeckoDocument; pub type RawGeckoDocumentBorrowedOrNull = *const root::RawGeckoDocument; - pub type RawGeckoPresContextBorrowed = *const [u64; 162usize]; + pub type RawGeckoPresContextOwned = *mut root::RawGeckoPresContext; + pub type RawGeckoPresContextBorrowed = *const root::RawGeckoPresContext; + pub type RawGeckoPresContextBorrowedMut = *mut root::RawGeckoPresContext; pub type RawGeckoAnimationValueListBorrowedMut = *mut root::RawGeckoAnimationValueList; #[repr(u32)] @@ -13597,9 +14777,125 @@ pub mod root { pub struct nsTArray { pub mBuffer: *mut T, } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsMediaFeature { + pub mName: *mut *mut root::nsIAtom, + pub mRangeType: root::nsMediaFeature_RangeType, + pub mValueType: root::nsMediaFeature_ValueType, + pub mReqFlags: u8, + pub mData: root::nsMediaFeature__bindgen_ty_1, + pub mGetter: root::nsMediaFeatureValueGetter, + } + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsMediaFeature_RangeType { + eMinMaxAllowed = 0, + eMinMaxNotAllowed = 1, + } + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsMediaFeature_ValueType { + eLength = 0, + eInteger = 1, + eFloat = 2, + eBoolInteger = 3, + eIntRatio = 4, + eResolution = 5, + eEnumerated = 6, + eIdent = 7, + } + #[repr(u8)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsMediaFeature_RequirementFlags { + eNoRequirements = 0, + eHasWebkitPrefix = 1, + eWebkitDevicePixelRatioPrefEnabled = 2, + } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsMediaFeature__bindgen_ty_1 { + pub mInitializer_: root::__BindgenUnionField<*const ::std::os::raw::c_void>, + pub mKeywordTable: root::__BindgenUnionField<*const root::nsCSSProps_KTableEntry>, + pub mMetric: root::__BindgenUnionField<*const *const root::nsIAtom>, + pub bindgen_union_field: u64, + } + #[test] + fn bindgen_test_layout_nsMediaFeature__bindgen_ty_1() { + assert_eq!(::std::mem::size_of::() , + 8usize); + assert_eq!(::std::mem::align_of::() , + 8usize); + } + impl Clone for nsMediaFeature__bindgen_ty_1 { + fn clone(&self) -> Self { *self } + } + #[test] + fn bindgen_test_layout_nsMediaFeature() { + assert_eq!(::std::mem::size_of::() , 40usize); + assert_eq!(::std::mem::align_of::() , 8usize); + } + impl Clone for nsMediaFeature { + fn clone(&self) -> Self { *self } + } pub type ThreadSafePrincipalHolder = root::nsMainThreadPtrHolder; pub type ThreadSafeURIHolder = root::nsMainThreadPtrHolder; + pub type nsMediaFeatureValueGetter = + ::std::option::Option root::nsresult>; + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsMediaFeatures { + pub _address: u8, + } + extern "C" { + #[link_name = "_ZN15nsMediaFeatures8featuresE"] + pub static mut nsMediaFeatures_features: *const root::nsMediaFeature; + } + #[test] + fn bindgen_test_layout_nsMediaFeatures() { + assert_eq!(::std::mem::size_of::() , 1usize); + assert_eq!(::std::mem::align_of::() , 1usize); + } + impl Clone for nsMediaFeatures { + fn clone(&self) -> Self { *self } + } + #[repr(C)] + #[derive(Debug)] + pub struct nsMediaExpression { + pub mFeature: *const root::nsMediaFeature, + pub mRange: root::nsMediaExpression_Range, + pub mValue: root::nsCSSValue, + } + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsMediaExpression_Range { eMin = 0, eMax = 1, eEqual = 2, } + #[test] + fn bindgen_test_layout_nsMediaExpression() { + assert_eq!(::std::mem::size_of::() , 32usize); + assert_eq!(::std::mem::align_of::() , 8usize); + } + #[repr(C)] + #[derive(Debug)] + pub struct nsMediaQuery { + pub mNegated: bool, + pub mHasOnly: bool, + pub mTypeOmitted: bool, + pub mHadUnknownExpression: bool, + pub mMediaType: root::nsCOMPtr, + pub mExpressions: root::nsTArray, + } + #[test] + fn bindgen_test_layout_nsMediaQuery() { + assert_eq!(::std::mem::size_of::() , 24usize); + assert_eq!(::std::mem::align_of::() , 8usize); + } #[test] fn __bindgen_test_layout_template_11() { assert_eq!(::std::mem::size_of::>() @@ -13686,105 +14982,119 @@ pub mod root { } #[test] fn __bindgen_test_layout_template_23() { + assert_eq!(::std::mem::size_of::>() + , 8usize); + assert_eq!(::std::mem::align_of::>() + , 8usize); + } + #[test] + fn __bindgen_test_layout_template_24() { assert_eq!(::std::mem::size_of::>() , 16usize); assert_eq!(::std::mem::align_of::>() , 8usize); } #[test] - fn __bindgen_test_layout_template_24() { + fn __bindgen_test_layout_template_25() { assert_eq!(::std::mem::size_of::>() , 8usize); assert_eq!(::std::mem::align_of::>() , 8usize); } #[test] - fn __bindgen_test_layout_template_25() { + fn __bindgen_test_layout_template_26() { assert_eq!(::std::mem::size_of::>() , 8usize); assert_eq!(::std::mem::align_of::>() , 8usize); } #[test] - fn __bindgen_test_layout_template_26() { + fn __bindgen_test_layout_template_27() { assert_eq!(::std::mem::size_of::>>() , 8usize); assert_eq!(::std::mem::align_of::>>() , 8usize); } #[test] - fn __bindgen_test_layout_template_27() { + fn __bindgen_test_layout_template_28() { assert_eq!(::std::mem::size_of::>() , 24usize); assert_eq!(::std::mem::align_of::>() , 8usize); } #[test] - fn __bindgen_test_layout_template_28() { + fn __bindgen_test_layout_template_29() { assert_eq!(::std::mem::size_of::>() , 24usize); assert_eq!(::std::mem::align_of::>() , 8usize); } #[test] - fn __bindgen_test_layout_template_29() { + fn __bindgen_test_layout_template_30() { assert_eq!(::std::mem::size_of::>() , 16usize); assert_eq!(::std::mem::align_of::>() , 8usize); } #[test] - fn __bindgen_test_layout_template_30() { + fn __bindgen_test_layout_template_31() { assert_eq!(::std::mem::size_of::>() , 8usize); assert_eq!(::std::mem::align_of::>() , 8usize); } #[test] - fn __bindgen_test_layout_template_31() { + fn __bindgen_test_layout_template_32() { assert_eq!(::std::mem::size_of::>() , 8usize); assert_eq!(::std::mem::align_of::>() , 8usize); } #[test] - fn __bindgen_test_layout_template_32() { + fn __bindgen_test_layout_template_33() { assert_eq!(::std::mem::size_of::>() , 1usize); assert_eq!(::std::mem::align_of::>() , 1usize); } #[test] - fn __bindgen_test_layout_template_33() { + fn __bindgen_test_layout_template_34() { assert_eq!(::std::mem::size_of::>() , 1usize); assert_eq!(::std::mem::align_of::>() , 1usize); } #[test] - fn __bindgen_test_layout_template_34() { + fn __bindgen_test_layout_template_35() { assert_eq!(::std::mem::size_of::>() , 1usize); assert_eq!(::std::mem::align_of::>() , 1usize); } #[test] - fn __bindgen_test_layout_template_35() { + fn __bindgen_test_layout_template_36() { assert_eq!(::std::mem::size_of::>() , 1usize); assert_eq!(::std::mem::align_of::>() , 1usize); } #[test] - fn __bindgen_test_layout_template_36() { + fn __bindgen_test_layout_template_37() { assert_eq!(::std::mem::size_of::>() , 1usize); assert_eq!(::std::mem::align_of::>() , 1usize); } #[test] - fn __bindgen_test_layout_template_37() { + fn __bindgen_test_layout_template_38() { assert_eq!(::std::mem::size_of::>() , 32usize); assert_eq!(::std::mem::align_of::>() , 8usize); } + #[test] + fn __bindgen_test_layout_template_39() { + assert_eq!(::std::mem::size_of::>() + , 8usize); + assert_eq!(::std::mem::align_of::>() + , 8usize); + } } diff --git a/components/style/gecko_bindings/structs_release.rs b/components/style/gecko_bindings/structs_release.rs index e7b8fdc5ff2..89bef397c47 100644 --- a/components/style/gecko_bindings/structs_release.rs +++ b/components/style/gecko_bindings/structs_release.rs @@ -994,6 +994,7 @@ pub mod root { pub const NS_STYLE_DISPLAY_MODE_BROWSER: ::std::os::raw::c_uint = 0; pub const NS_STYLE_DISPLAY_MODE_MINIMAL_UI: ::std::os::raw::c_uint = 1; pub const NS_STYLE_DISPLAY_MODE_STANDALONE: ::std::os::raw::c_uint = 2; + pub const NS_STYLE_DISPLAY_MODE_FULLSCREEN: ::std::os::raw::c_uint = 3; pub const NS_STYLE_INHERIT_MASK: ::std::os::raw::c_uint = 16777215; pub const NS_STYLE_HAS_TEXT_DECORATION_LINES: ::std::os::raw::c_uint = 16777216; @@ -2655,6 +2656,14 @@ pub mod root { assert_eq!(::std::mem::align_of::() , 8usize); } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct DocumentRule { + pub _address: u8, + } + impl Clone for DocumentRule { + fn clone(&self) -> Self { *self } + } } /** * Superclass for data common to CSSStyleSheet and ServoStyleSheet. @@ -2834,6 +2843,14 @@ pub mod root { Count = 10, Unknown = 255, } + #[repr(i32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum CSSEnabledState { + eForAllContent = 0, + eInUASheets = 1, + eInChrome = 2, + eIgnoreEnabledState = 255, + } pub mod a11y { #[allow(unused_imports)] use self::super::super::super::root; @@ -3730,15 +3747,16 @@ pub mod root { } pub type pair_first_type<_T1> = _T1; pub type pair_second_type<_T2> = _T2; - pub mod namespace { - #[allow(unused_imports)] - use self::super::super::super::root; - } + pub type pair__PCCP = [u8; 0usize]; #[repr(C)] #[derive(Debug)] pub struct atomic<_Tp> { pub _M_i: _Tp, } + pub mod namespace { + #[allow(unused_imports)] + use self::super::super::super::root; + } } pub mod __gnu_cxx { #[allow(unused_imports)] @@ -5463,6 +5481,82 @@ pub mod root { impl Clone for EventStates { fn clone(&self) -> Self { *self } } + #[repr(i16)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum UseCounter { + eUseCounter_UNKNOWN = -1, + eUseCounter_SVGSVGElement_getElementById = 0, + eUseCounter_SVGSVGElement_currentScale_getter = 1, + eUseCounter_SVGSVGElement_currentScale_setter = 2, + eUseCounter_property_Fill = 3, + eUseCounter_property_FillOpacity = 4, + eUseCounter_PushManager_subscribe = 5, + eUseCounter_PushSubscription_unsubscribe = 6, + eUseCounter_Window_sidebar_getter = 7, + eUseCounter_Window_sidebar_setter = 8, + eUseCounter_External_addSearchEngine = 9, + eUseCounter_OfflineResourceList_swapCache = 10, + eUseCounter_OfflineResourceList_update = 11, + eUseCounter_OfflineResourceList_status_getter = 12, + eUseCounter_OfflineResourceList_status_setter = 13, + eUseCounter_OfflineResourceList_onchecking_getter = 14, + eUseCounter_OfflineResourceList_onchecking_setter = 15, + eUseCounter_OfflineResourceList_onerror_getter = 16, + eUseCounter_OfflineResourceList_onerror_setter = 17, + eUseCounter_OfflineResourceList_onnoupdate_getter = 18, + eUseCounter_OfflineResourceList_onnoupdate_setter = 19, + eUseCounter_OfflineResourceList_ondownloading_getter = 20, + eUseCounter_OfflineResourceList_ondownloading_setter = 21, + eUseCounter_OfflineResourceList_onprogress_getter = 22, + eUseCounter_OfflineResourceList_onprogress_setter = 23, + eUseCounter_OfflineResourceList_onupdateready_getter = 24, + eUseCounter_OfflineResourceList_onupdateready_setter = 25, + eUseCounter_OfflineResourceList_oncached_getter = 26, + eUseCounter_OfflineResourceList_oncached_setter = 27, + eUseCounter_OfflineResourceList_onobsolete_getter = 28, + eUseCounter_OfflineResourceList_onobsolete_setter = 29, + eUseCounter_GetAttributeNode = 30, + eUseCounter_SetAttributeNode = 31, + eUseCounter_GetAttributeNodeNS = 32, + eUseCounter_SetAttributeNodeNS = 33, + eUseCounter_RemoveAttributeNode = 34, + eUseCounter_CreateAttribute = 35, + eUseCounter_CreateAttributeNS = 36, + eUseCounter_NodeValue = 37, + eUseCounter_TextContent = 38, + eUseCounter_EnablePrivilege = 39, + eUseCounter_DOMExceptionCode = 40, + eUseCounter_NoExposedProps = 41, + eUseCounter_MutationEvent = 42, + eUseCounter_Components = 43, + eUseCounter_PrefixedVisibilityAPI = 44, + eUseCounter_NodeIteratorDetach = 45, + eUseCounter_LenientThis = 46, + eUseCounter_GetPreventDefault = 47, + eUseCounter_GetSetUserData = 48, + eUseCounter_MozGetAsFile = 49, + eUseCounter_UseOfCaptureEvents = 50, + eUseCounter_UseOfReleaseEvents = 51, + eUseCounter_UseOfDOM3LoadMethod = 52, + eUseCounter_ChromeUseOfDOM3LoadMethod = 53, + eUseCounter_ShowModalDialog = 54, + eUseCounter_Window_Content = 55, + eUseCounter_SyncXMLHttpRequest = 56, + eUseCounter_DataContainerEvent = 57, + eUseCounter_Window_Controllers = 58, + eUseCounter_ImportXULIntoContent = 59, + eUseCounter_PannerNodeDoppler = 60, + eUseCounter_NavigatorGetUserMedia = 61, + eUseCounter_WebrtcDeprecatedPrefix = 62, + eUseCounter_RTCPeerConnectionGetStreams = 63, + eUseCounter_AppCache = 64, + eUseCounter_PrefixedImageSmoothingEnabled = 65, + eUseCounter_PrefixedFullscreenAPI = 66, + eUseCounter_LenientSetter = 67, + eUseCounter_FileLastModifiedDate = 68, + eUseCounter_ImageBitmapRenderingContext_TransferImageBitmap = 69, + eUseCounter_Count = 70, + } #[repr(C)] #[derive(Debug)] pub struct nsIDocument { @@ -6651,6 +6745,26 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy)] + pub struct nsIDOMMediaList { + pub _base: root::nsISupports, + } + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct nsIDOMMediaList_COMTypeInfo { + pub _address: u8, + pub _phantom_0: ::std::marker::PhantomData, + pub _phantom_1: ::std::marker::PhantomData, + } + #[test] + fn bindgen_test_layout_nsIDOMMediaList() { + assert_eq!(::std::mem::size_of::() , 8usize); + assert_eq!(::std::mem::align_of::() , 8usize); + } + impl Clone for nsIDOMMediaList { + fn clone(&self) -> Self { *self } + } + #[repr(C)] + #[derive(Debug, Copy)] pub struct nsIDOMEventTarget { pub _base: root::nsISupports, } @@ -8341,13 +8455,41 @@ pub mod root { *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int>; #[repr(C)] - #[derive(Debug, Copy)] + #[derive(Debug)] pub struct nsMediaList { - pub _address: u8, + pub _base: root::nsIDOMMediaList, + pub _base_1: root::nsWrapperCache, + pub mRefCnt: root::nsCycleCollectingAutoRefCnt, + pub mArray: root::nsTArray>, + pub mStyleSheet: *mut root::mozilla::StyleSheet, } - impl Clone for nsMediaList { + pub type nsMediaList_ErrorResult = [u64; 2usize]; + pub type nsMediaList_HasThreadSafeRefCnt = root::mozilla::FalseType; + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsMediaList_cycleCollection { + pub _base: root::nsXPCOMCycleCollectionParticipant, + } + #[test] + fn bindgen_test_layout_nsMediaList_cycleCollection() { + assert_eq!(::std::mem::size_of::() , + 16usize); + assert_eq!(::std::mem::align_of::() , + 8usize); + } + impl Clone for nsMediaList_cycleCollection { fn clone(&self) -> Self { *self } } + extern "C" { + #[link_name = "_ZN11nsMediaList21_cycleCollectorGlobalE"] + pub static mut nsMediaList__cycleCollectorGlobal: + root::nsMediaList_cycleCollection; + } + #[test] + fn bindgen_test_layout_nsMediaList() { + assert_eq!(::std::mem::size_of::() , 56usize); + assert_eq!(::std::mem::align_of::() , 8usize); + } #[repr(C)] #[derive(Debug)] pub struct nsAttrValue { @@ -9111,63 +9253,63 @@ pub mod root { impl Clone for nsDOMMutationObserver { fn clone(&self) -> Self { *self } } - pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_HAS_LISTENERMANAGER; - pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_HAS_PROPERTIES; - pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_IS_ANONYMOUS_ROOT; - pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; - pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_IS_NATIVE_ANONYMOUS_ROOT; - pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_FORCE_XBL_BINDINGS; - pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_MAY_BE_IN_BINDING_MNGR; - pub const NODE_IS_EDITABLE: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_IS_EDITABLE; - pub const NODE_MAY_HAVE_CLASS: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_MAY_HAVE_CLASS; - pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_IS_IN_SHADOW_TREE; - pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_HAS_EMPTY_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_HAS_SLOW_SELECTOR; - pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_HAS_EDGE_CHILD_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; - pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_ALL_SELECTOR_FLAGS; - pub const NODE_NEEDS_FRAME: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_NEEDS_FRAME; - pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_DESCENDANTS_NEED_FRAMES; - pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_HAS_ACCESSKEY; - pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_HAS_DIRECTION_RTL; - pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_HAS_DIRECTION_LTR; - pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_ALL_DIRECTION_FLAGS; - pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_CHROME_ONLY_ACCESS; - pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; - pub const NODE_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_SHARED_RESTYLE_BIT_1; - pub const NODE_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_SHARED_RESTYLE_BIT_2; - pub const NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_SHARED_RESTYLE_BIT_1; - pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_136 = - _bindgen_ty_136::NODE_TYPE_SPECIFIC_BITS_OFFSET; + pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_LISTENERMANAGER; + pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_PROPERTIES; + pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_IS_ANONYMOUS_ROOT; + pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; + pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_IS_NATIVE_ANONYMOUS_ROOT; + pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_FORCE_XBL_BINDINGS; + pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_MAY_BE_IN_BINDING_MNGR; + pub const NODE_IS_EDITABLE: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_IS_EDITABLE; + pub const NODE_MAY_HAVE_CLASS: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_MAY_HAVE_CLASS; + pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_IS_IN_SHADOW_TREE; + pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_EMPTY_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_SLOW_SELECTOR; + pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_EDGE_CHILD_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; + pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_ALL_SELECTOR_FLAGS; + pub const NODE_NEEDS_FRAME: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_NEEDS_FRAME; + pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_DESCENDANTS_NEED_FRAMES; + pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_ACCESSKEY; + pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_DIRECTION_RTL; + pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_DIRECTION_LTR; + pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_ALL_DIRECTION_FLAGS; + pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_CHROME_ONLY_ACCESS; + pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; + pub const NODE_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_SHARED_RESTYLE_BIT_1; + pub const NODE_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_SHARED_RESTYLE_BIT_2; + pub const NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_SHARED_RESTYLE_BIT_1; + pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_TYPE_SPECIFIC_BITS_OFFSET; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_136 { + pub enum _bindgen_ty_118 { NODE_HAS_LISTENERMANAGER = 4, NODE_HAS_PROPERTIES = 8, NODE_IS_ANONYMOUS_ROOT = 16, @@ -11568,6 +11710,1041 @@ pub mod root { eCSSPropertyExtra_variable = 476, eCSSProperty_DOM = 477, } + pub const nsStyleStructID_nsStyleStructID_DUMMY1: root::nsStyleStructID = + nsStyleStructID::nsStyleStructID_None; + pub const nsStyleStructID_eStyleStruct_Font: root::nsStyleStructID = + nsStyleStructID::nsStyleStructID_Inherited_Start; + pub const nsStyleStructID_nsStyleStructID_DUMMY2: root::nsStyleStructID = + nsStyleStructID::eStyleStruct_Variables; + pub const nsStyleStructID_eStyleStruct_Background: root::nsStyleStructID = + nsStyleStructID::nsStyleStructID_Reset_Start; + pub const nsStyleStructID_nsStyleStructID_Inherited_Count: + root::nsStyleStructID = + nsStyleStructID::nsStyleStructID_Reset_Start; + pub const nsStyleStructID_nsStyleStructID_Reset_Count: + root::nsStyleStructID = + nsStyleStructID::eStyleStruct_Table; + #[repr(i32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsStyleStructID { + nsStyleStructID_None = -1, + nsStyleStructID_Inherited_Start = 0, + eStyleStruct_Color = 1, + eStyleStruct_List = 2, + eStyleStruct_Text = 3, + eStyleStruct_Visibility = 4, + eStyleStruct_UserInterface = 5, + eStyleStruct_TableBorder = 6, + eStyleStruct_SVG = 7, + eStyleStruct_Variables = 8, + nsStyleStructID_Reset_Start = 9, + eStyleStruct_Position = 10, + eStyleStruct_TextReset = 11, + eStyleStruct_Display = 12, + eStyleStruct_Content = 13, + eStyleStruct_UIReset = 14, + eStyleStruct_Table = 15, + eStyleStruct_Margin = 16, + eStyleStruct_Padding = 17, + eStyleStruct_Border = 18, + eStyleStruct_Outline = 19, + eStyleStruct_XUL = 20, + eStyleStruct_SVGReset = 21, + eStyleStruct_Column = 22, + eStyleStruct_Effects = 23, + nsStyleStructID_Length = 24, + } + #[repr(u32)] + /** + * Types of animatable values. + */ + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsStyleAnimType { + eStyleAnimType_Custom = 0, + eStyleAnimType_Coord = 1, + eStyleAnimType_Sides_Top = 2, + eStyleAnimType_Sides_Right = 3, + eStyleAnimType_Sides_Bottom = 4, + eStyleAnimType_Sides_Left = 5, + eStyleAnimType_Corner_TopLeft = 6, + eStyleAnimType_Corner_TopRight = 7, + eStyleAnimType_Corner_BottomRight = 8, + eStyleAnimType_Corner_BottomLeft = 9, + eStyleAnimType_nscoord = 10, + eStyleAnimType_float = 11, + eStyleAnimType_Color = 12, + eStyleAnimType_ComplexColor = 13, + eStyleAnimType_PaintServer = 14, + eStyleAnimType_Shadow = 15, + eStyleAnimType_Discrete = 16, + eStyleAnimType_None = 17, + } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsCSSProps { + pub _address: u8, + } + pub type nsCSSProps_EnabledState = root::mozilla::CSSEnabledState; + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsCSSProps_KTableEntry { + pub mKeyword: root::nsCSSKeyword, + pub mValue: i16, + } + #[test] + fn bindgen_test_layout_nsCSSProps_KTableEntry() { + assert_eq!(::std::mem::size_of::() , 4usize); + assert_eq!(::std::mem::align_of::() , 2usize); + } + impl Clone for nsCSSProps_KTableEntry { + fn clone(&self) -> Self { *self } + } + extern "C" { + #[link_name = "_ZN10nsCSSProps9kSIDTableE"] + pub static mut nsCSSProps_kSIDTable: + [root::nsStyleStructID; 316usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kKeywordTableTableE"] + pub static mut nsCSSProps_kKeywordTableTable: + [*const root::nsCSSProps_KTableEntry; 316usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps14kAnimTypeTableE"] + pub static mut nsCSSProps_kAnimTypeTable: + [root::nsStyleAnimType; 316usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps23kStyleStructOffsetTableE"] + pub static mut nsCSSProps_kStyleStructOffsetTable: [isize; 316usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps11kFlagsTableE"] + pub static mut nsCSSProps_kFlagsTable: [u32; 364usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kParserVariantTableE"] + pub static mut nsCSSProps_kParserVariantTable: [u32; 316usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kSubpropertyTableE"] + pub static mut nsCSSProps_kSubpropertyTable: + [*const root::nsCSSPropertyID; 48usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps26gShorthandsContainingTableE"] + pub static mut nsCSSProps_gShorthandsContainingTable: + [*mut root::nsCSSPropertyID; 316usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25gShorthandsContainingPoolE"] + pub static mut nsCSSProps_gShorthandsContainingPool: + *mut root::nsCSSPropertyID; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps22gPropertyCountInStructE"] + pub static mut nsCSSProps_gPropertyCountInStruct: [usize; 24usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps22gPropertyIndexInStructE"] + pub static mut nsCSSProps_gPropertyIndexInStruct: [usize; 316usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kLogicalGroupTableE"] + pub static mut nsCSSProps_kLogicalGroupTable: + [*const root::nsCSSPropertyID; 9usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16gPropertyEnabledE"] + pub static mut nsCSSProps_gPropertyEnabled: [bool; 472usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps13kIDLNameTableE"] + pub static mut nsCSSProps_kIDLNameTable: + [*const ::std::os::raw::c_char; 364usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kIDLNameSortPositionTableE"] + pub static mut nsCSSProps_kIDLNameSortPositionTable: [i32; 364usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19gPropertyUseCounterE"] + pub static mut nsCSSProps_gPropertyUseCounter: + [root::UseCounter; 316usize]; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kAnimationDirectionKTableE"] + pub static mut nsCSSProps_kAnimationDirectionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps24kAnimationFillModeKTableE"] + pub static mut nsCSSProps_kAnimationFillModeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps30kAnimationIterationCountKTableE"] + pub static mut nsCSSProps_kAnimationIterationCountKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kAnimationPlayStateKTableE"] + pub static mut nsCSSProps_kAnimationPlayStateKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps30kAnimationTimingFunctionKTableE"] + pub static mut nsCSSProps_kAnimationTimingFunctionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kAppearanceKTableE"] + pub static mut nsCSSProps_kAppearanceKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps14kAzimuthKTableE"] + pub static mut nsCSSProps_kAzimuthKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kBackfaceVisibilityKTableE"] + pub static mut nsCSSProps_kBackfaceVisibilityKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kTransformStyleKTableE"] + pub static mut nsCSSProps_kTransformStyleKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kImageLayerAttachmentKTableE"] + pub static mut nsCSSProps_kImageLayerAttachmentKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps23kBackgroundOriginKTableE"] + pub static mut nsCSSProps_kBackgroundOriginKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kMaskOriginKTableE"] + pub static mut nsCSSProps_kMaskOriginKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kImageLayerPositionKTableE"] + pub static mut nsCSSProps_kImageLayerPositionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps23kImageLayerRepeatKTableE"] + pub static mut nsCSSProps_kImageLayerRepeatKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kImageLayerRepeatPartKTableE"] + pub static mut nsCSSProps_kImageLayerRepeatPartKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kImageLayerSizeKTableE"] + pub static mut nsCSSProps_kImageLayerSizeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps26kImageLayerCompositeKTableE"] + pub static mut nsCSSProps_kImageLayerCompositeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kImageLayerModeKTableE"] + pub static mut nsCSSProps_kImageLayerModeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kBackgroundClipKTableE"] + pub static mut nsCSSProps_kBackgroundClipKTable: + *mut root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kMaskClipKTableE"] + pub static mut nsCSSProps_kMaskClipKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kBlendModeKTableE"] + pub static mut nsCSSProps_kBlendModeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kBorderCollapseKTableE"] + pub static mut nsCSSProps_kBorderCollapseKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps24kBorderImageRepeatKTableE"] + pub static mut nsCSSProps_kBorderImageRepeatKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps23kBorderImageSliceKTableE"] + pub static mut nsCSSProps_kBorderImageSliceKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kBorderStyleKTableE"] + pub static mut nsCSSProps_kBorderStyleKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kBorderWidthKTableE"] + pub static mut nsCSSProps_kBorderWidthKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kBoxAlignKTableE"] + pub static mut nsCSSProps_kBoxAlignKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kBoxDecorationBreakKTableE"] + pub static mut nsCSSProps_kBoxDecorationBreakKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kBoxDirectionKTableE"] + pub static mut nsCSSProps_kBoxDirectionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kBoxOrientKTableE"] + pub static mut nsCSSProps_kBoxOrientKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps14kBoxPackKTableE"] + pub static mut nsCSSProps_kBoxPackKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps26kClipPathGeometryBoxKTableE"] + pub static mut nsCSSProps_kClipPathGeometryBoxKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kCounterRangeKTableE"] + pub static mut nsCSSProps_kCounterRangeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kCounterSpeakAsKTableE"] + pub static mut nsCSSProps_kCounterSpeakAsKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kCounterSymbolsSystemKTableE"] + pub static mut nsCSSProps_kCounterSymbolsSystemKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kCounterSystemKTableE"] + pub static mut nsCSSProps_kCounterSystemKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps23kDominantBaselineKTableE"] + pub static mut nsCSSProps_kDominantBaselineKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kShapeRadiusKTableE"] + pub static mut nsCSSProps_kShapeRadiusKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kFillRuleKTableE"] + pub static mut nsCSSProps_kFillRuleKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kFilterFunctionKTableE"] + pub static mut nsCSSProps_kFilterFunctionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kImageRenderingKTableE"] + pub static mut nsCSSProps_kImageRenderingKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kShapeOutsideShapeBoxKTableE"] + pub static mut nsCSSProps_kShapeOutsideShapeBoxKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kShapeRenderingKTableE"] + pub static mut nsCSSProps_kShapeRenderingKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kStrokeLinecapKTableE"] + pub static mut nsCSSProps_kStrokeLinecapKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kStrokeLinejoinKTableE"] + pub static mut nsCSSProps_kStrokeLinejoinKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kStrokeContextValueKTableE"] + pub static mut nsCSSProps_kStrokeContextValueKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kVectorEffectKTableE"] + pub static mut nsCSSProps_kVectorEffectKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kTextAnchorKTableE"] + pub static mut nsCSSProps_kTextAnchorKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kTextRenderingKTableE"] + pub static mut nsCSSProps_kTextRenderingKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kColorAdjustKTableE"] + pub static mut nsCSSProps_kColorAdjustKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kColorInterpolationKTableE"] + pub static mut nsCSSProps_kColorInterpolationKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kColumnFillKTableE"] + pub static mut nsCSSProps_kColumnFillKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kBoxPropSourceKTableE"] + pub static mut nsCSSProps_kBoxPropSourceKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kBoxShadowTypeKTableE"] + pub static mut nsCSSProps_kBoxShadowTypeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kBoxSizingKTableE"] + pub static mut nsCSSProps_kBoxSizingKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kCaptionSideKTableE"] + pub static mut nsCSSProps_kCaptionSideKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps12kClearKTableE"] + pub static mut nsCSSProps_kClearKTable: + *mut root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps12kColorKTableE"] + pub static mut nsCSSProps_kColorKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps14kContentKTableE"] + pub static mut nsCSSProps_kContentKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps33kControlCharacterVisibilityKTableE"] + pub static mut nsCSSProps_kControlCharacterVisibilityKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps13kCursorKTableE"] + pub static mut nsCSSProps_kCursorKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kDirectionKTableE"] + pub static mut nsCSSProps_kDirectionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps14kDisplayKTableE"] + pub static mut nsCSSProps_kDisplayKTable: + *mut root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kElevationKTableE"] + pub static mut nsCSSProps_kElevationKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kEmptyCellsKTableE"] + pub static mut nsCSSProps_kEmptyCellsKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kAlignAllKeywordsE"] + pub static mut nsCSSProps_kAlignAllKeywords: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps22kAlignOverflowPositionE"] + pub static mut nsCSSProps_kAlignOverflowPosition: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kAlignSelfPositionE"] + pub static mut nsCSSProps_kAlignSelfPosition: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps12kAlignLegacyE"] + pub static mut nsCSSProps_kAlignLegacy: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kAlignLegacyPositionE"] + pub static mut nsCSSProps_kAlignLegacyPosition: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps31kAlignAutoNormalStretchBaselineE"] + pub static mut nsCSSProps_kAlignAutoNormalStretchBaseline: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kAlignNormalStretchBaselineE"] + pub static mut nsCSSProps_kAlignNormalStretchBaseline: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kAlignNormalBaselineE"] + pub static mut nsCSSProps_kAlignNormalBaseline: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kAlignContentDistributionE"] + pub static mut nsCSSProps_kAlignContentDistribution: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kAlignContentPositionE"] + pub static mut nsCSSProps_kAlignContentPosition: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps31kAutoCompletionAlignJustifySelfE"] + pub static mut nsCSSProps_kAutoCompletionAlignJustifySelf: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kAutoCompletionAlignItemsE"] + pub static mut nsCSSProps_kAutoCompletionAlignItems: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps34kAutoCompletionAlignJustifyContentE"] + pub static mut nsCSSProps_kAutoCompletionAlignJustifyContent: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kFlexDirectionKTableE"] + pub static mut nsCSSProps_kFlexDirectionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kFlexWrapKTableE"] + pub static mut nsCSSProps_kFlexWrapKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps12kFloatKTableE"] + pub static mut nsCSSProps_kFloatKTable: + *mut root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kFloatEdgeKTableE"] + pub static mut nsCSSProps_kFloatEdgeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kFontDisplayKTableE"] + pub static mut nsCSSProps_kFontDisplayKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps11kFontKTableE"] + pub static mut nsCSSProps_kFontKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kFontKerningKTableE"] + pub static mut nsCSSProps_kFontKerningKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kFontSizeKTableE"] + pub static mut nsCSSProps_kFontSizeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kFontSmoothingKTableE"] + pub static mut nsCSSProps_kFontSmoothingKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kFontStretchKTableE"] + pub static mut nsCSSProps_kFontStretchKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kFontStyleKTableE"] + pub static mut nsCSSProps_kFontStyleKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kFontSynthesisKTableE"] + pub static mut nsCSSProps_kFontSynthesisKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kFontVariantKTableE"] + pub static mut nsCSSProps_kFontVariantKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps28kFontVariantAlternatesKTableE"] + pub static mut nsCSSProps_kFontVariantAlternatesKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps33kFontVariantAlternatesFuncsKTableE"] + pub static mut nsCSSProps_kFontVariantAlternatesFuncsKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps22kFontVariantCapsKTableE"] + pub static mut nsCSSProps_kFontVariantCapsKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kFontVariantEastAsianKTableE"] + pub static mut nsCSSProps_kFontVariantEastAsianKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kFontVariantLigaturesKTableE"] + pub static mut nsCSSProps_kFontVariantLigaturesKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kFontVariantNumericKTableE"] + pub static mut nsCSSProps_kFontVariantNumericKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps26kFontVariantPositionKTableE"] + pub static mut nsCSSProps_kFontVariantPositionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kFontWeightKTableE"] + pub static mut nsCSSProps_kFontWeightKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kGridAutoFlowKTableE"] + pub static mut nsCSSProps_kGridAutoFlowKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps23kGridTrackBreadthKTableE"] + pub static mut nsCSSProps_kGridTrackBreadthKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps14kHyphensKTableE"] + pub static mut nsCSSProps_kHyphensKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps23kImageOrientationKTableE"] + pub static mut nsCSSProps_kImageOrientationKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kImageOrientationFlipKTableE"] + pub static mut nsCSSProps_kImageOrientationFlipKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kIsolationKTableE"] + pub static mut nsCSSProps_kIsolationKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps14kIMEModeKTableE"] + pub static mut nsCSSProps_kIMEModeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kLineHeightKTableE"] + pub static mut nsCSSProps_kLineHeightKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps24kListStylePositionKTableE"] + pub static mut nsCSSProps_kListStylePositionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kListStyleKTableE"] + pub static mut nsCSSProps_kListStyleKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kMaskTypeKTableE"] + pub static mut nsCSSProps_kMaskTypeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kMathVariantKTableE"] + pub static mut nsCSSProps_kMathVariantKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kMathDisplayKTableE"] + pub static mut nsCSSProps_kMathDisplayKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps14kContainKTableE"] + pub static mut nsCSSProps_kContainKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kContextOpacityKTableE"] + pub static mut nsCSSProps_kContextOpacityKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kContextPatternKTableE"] + pub static mut nsCSSProps_kContextPatternKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kObjectFitKTableE"] + pub static mut nsCSSProps_kObjectFitKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps13kOrientKTableE"] + pub static mut nsCSSProps_kOrientKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kOutlineStyleKTableE"] + pub static mut nsCSSProps_kOutlineStyleKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kOverflowKTableE"] + pub static mut nsCSSProps_kOverflowKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kOverflowSubKTableE"] + pub static mut nsCSSProps_kOverflowSubKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps22kOverflowClipBoxKTableE"] + pub static mut nsCSSProps_kOverflowClipBoxKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kOverflowWrapKTableE"] + pub static mut nsCSSProps_kOverflowWrapKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kPageBreakKTableE"] + pub static mut nsCSSProps_kPageBreakKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps22kPageBreakInsideKTableE"] + pub static mut nsCSSProps_kPageBreakInsideKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kPageMarksKTableE"] + pub static mut nsCSSProps_kPageMarksKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kPageSizeKTableE"] + pub static mut nsCSSProps_kPageSizeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps12kPitchKTableE"] + pub static mut nsCSSProps_kPitchKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kPointerEventsKTableE"] + pub static mut nsCSSProps_kPointerEventsKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kPositionKTableE"] + pub static mut nsCSSProps_kPositionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps26kRadialGradientShapeKTableE"] + pub static mut nsCSSProps_kRadialGradientShapeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kRadialGradientSizeKTableE"] + pub static mut nsCSSProps_kRadialGradientSizeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps31kRadialGradientLegacySizeKTableE"] + pub static mut nsCSSProps_kRadialGradientLegacySizeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps13kResizeKTableE"] + pub static mut nsCSSProps_kResizeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kRubyAlignKTableE"] + pub static mut nsCSSProps_kRubyAlignKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kRubyPositionKTableE"] + pub static mut nsCSSProps_kRubyPositionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kScrollBehaviorKTableE"] + pub static mut nsCSSProps_kScrollBehaviorKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kScrollSnapTypeKTableE"] + pub static mut nsCSSProps_kScrollSnapTypeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps12kSpeakKTableE"] + pub static mut nsCSSProps_kSpeakKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kSpeakHeaderKTableE"] + pub static mut nsCSSProps_kSpeakHeaderKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kSpeakNumeralKTableE"] + pub static mut nsCSSProps_kSpeakNumeralKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps23kSpeakPunctuationKTableE"] + pub static mut nsCSSProps_kSpeakPunctuationKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kSpeechRateKTableE"] + pub static mut nsCSSProps_kSpeechRateKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kStackSizingKTableE"] + pub static mut nsCSSProps_kStackSizingKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kTableLayoutKTableE"] + pub static mut nsCSSProps_kTableLayoutKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kTextAlignKTableE"] + pub static mut nsCSSProps_kTextAlignKTable: + *mut root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kTextAlignLastKTableE"] + pub static mut nsCSSProps_kTextAlignLastKTable: + *mut root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kTextCombineUprightKTableE"] + pub static mut nsCSSProps_kTextCombineUprightKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps25kTextDecorationLineKTableE"] + pub static mut nsCSSProps_kTextDecorationLineKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps26kTextDecorationStyleKTableE"] + pub static mut nsCSSProps_kTextDecorationStyleKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps27kTextEmphasisPositionKTableE"] + pub static mut nsCSSProps_kTextEmphasisPositionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps28kTextEmphasisStyleFillKTableE"] + pub static mut nsCSSProps_kTextEmphasisStyleFillKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps29kTextEmphasisStyleShapeKTableE"] + pub static mut nsCSSProps_kTextEmphasisStyleShapeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps22kTextOrientationKTableE"] + pub static mut nsCSSProps_kTextOrientationKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kTextOverflowKTableE"] + pub static mut nsCSSProps_kTextOverflowKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kTextTransformKTableE"] + pub static mut nsCSSProps_kTextTransformKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kTouchActionKTableE"] + pub static mut nsCSSProps_kTouchActionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps15kTopLayerKTableE"] + pub static mut nsCSSProps_kTopLayerKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kTransformBoxKTableE"] + pub static mut nsCSSProps_kTransformBoxKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps31kTransitionTimingFunctionKTableE"] + pub static mut nsCSSProps_kTransitionTimingFunctionKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kUnicodeBidiKTableE"] + pub static mut nsCSSProps_kUnicodeBidiKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kUserFocusKTableE"] + pub static mut nsCSSProps_kUserFocusKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kUserInputKTableE"] + pub static mut nsCSSProps_kUserInputKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kUserModifyKTableE"] + pub static mut nsCSSProps_kUserModifyKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kUserSelectKTableE"] + pub static mut nsCSSProps_kUserSelectKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps20kVerticalAlignKTableE"] + pub static mut nsCSSProps_kVerticalAlignKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kVisibilityKTableE"] + pub static mut nsCSSProps_kVisibilityKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps13kVolumeKTableE"] + pub static mut nsCSSProps_kVolumeKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps17kWhitespaceKTableE"] + pub static mut nsCSSProps_kWhitespaceKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps12kWidthKTableE"] + pub static mut nsCSSProps_kWidthKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps21kWindowDraggingKTableE"] + pub static mut nsCSSProps_kWindowDraggingKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps19kWindowShadowKTableE"] + pub static mut nsCSSProps_kWindowShadowKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps16kWordBreakKTableE"] + pub static mut nsCSSProps_kWordBreakKTable: + *const root::nsCSSProps_KTableEntry; + } + extern "C" { + #[link_name = "_ZN10nsCSSProps18kWritingModeKTableE"] + pub static mut nsCSSProps_kWritingModeKTable: + *const root::nsCSSProps_KTableEntry; + } + #[test] + fn bindgen_test_layout_nsCSSProps() { + assert_eq!(::std::mem::size_of::() , 1usize); + assert_eq!(::std::mem::align_of::() , 1usize); + } + impl Clone for nsCSSProps { + fn clone(&self) -> Self { *self } + } /** * Class to safely handle main-thread-only pointers off the main thread. * @@ -12067,7 +13244,7 @@ pub mod root { pub type RawGeckoNode = root::nsINode; pub type RawGeckoElement = root::mozilla::dom::Element; pub type RawGeckoDocument = root::nsIDocument; - pub type RawGeckoPresContext = [u64; 158usize]; + pub type RawGeckoPresContext = root::nsPresContext; pub type RawGeckoAnimationValueList = root::nsTArray; pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode; @@ -12076,7 +13253,9 @@ pub mod root { pub type RawGeckoElementBorrowedOrNull = *const root::RawGeckoElement; pub type RawGeckoDocumentBorrowed = *const root::RawGeckoDocument; pub type RawGeckoDocumentBorrowedOrNull = *const root::RawGeckoDocument; - pub type RawGeckoPresContextBorrowed = *const [u64; 158usize]; + pub type RawGeckoPresContextOwned = *mut root::RawGeckoPresContext; + pub type RawGeckoPresContextBorrowed = *const root::RawGeckoPresContext; + pub type RawGeckoPresContextBorrowedMut = *mut root::RawGeckoPresContext; pub type RawGeckoAnimationValueListBorrowedMut = *mut root::RawGeckoAnimationValueList; #[repr(u32)] @@ -13524,9 +14703,125 @@ pub mod root { pub struct nsTArray { pub mBuffer: *mut T, } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsMediaFeature { + pub mName: *mut *mut root::nsIAtom, + pub mRangeType: root::nsMediaFeature_RangeType, + pub mValueType: root::nsMediaFeature_ValueType, + pub mReqFlags: u8, + pub mData: root::nsMediaFeature__bindgen_ty_1, + pub mGetter: root::nsMediaFeatureValueGetter, + } + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsMediaFeature_RangeType { + eMinMaxAllowed = 0, + eMinMaxNotAllowed = 1, + } + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsMediaFeature_ValueType { + eLength = 0, + eInteger = 1, + eFloat = 2, + eBoolInteger = 3, + eIntRatio = 4, + eResolution = 5, + eEnumerated = 6, + eIdent = 7, + } + #[repr(u8)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsMediaFeature_RequirementFlags { + eNoRequirements = 0, + eHasWebkitPrefix = 1, + eWebkitDevicePixelRatioPrefEnabled = 2, + } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsMediaFeature__bindgen_ty_1 { + pub mInitializer_: root::__BindgenUnionField<*const ::std::os::raw::c_void>, + pub mKeywordTable: root::__BindgenUnionField<*const root::nsCSSProps_KTableEntry>, + pub mMetric: root::__BindgenUnionField<*const *const root::nsIAtom>, + pub bindgen_union_field: u64, + } + #[test] + fn bindgen_test_layout_nsMediaFeature__bindgen_ty_1() { + assert_eq!(::std::mem::size_of::() , + 8usize); + assert_eq!(::std::mem::align_of::() , + 8usize); + } + impl Clone for nsMediaFeature__bindgen_ty_1 { + fn clone(&self) -> Self { *self } + } + #[test] + fn bindgen_test_layout_nsMediaFeature() { + assert_eq!(::std::mem::size_of::() , 40usize); + assert_eq!(::std::mem::align_of::() , 8usize); + } + impl Clone for nsMediaFeature { + fn clone(&self) -> Self { *self } + } pub type ThreadSafePrincipalHolder = root::nsMainThreadPtrHolder; pub type ThreadSafeURIHolder = root::nsMainThreadPtrHolder; + pub type nsMediaFeatureValueGetter = + ::std::option::Option root::nsresult>; + #[repr(C)] + #[derive(Debug, Copy)] + pub struct nsMediaFeatures { + pub _address: u8, + } + extern "C" { + #[link_name = "_ZN15nsMediaFeatures8featuresE"] + pub static mut nsMediaFeatures_features: *const root::nsMediaFeature; + } + #[test] + fn bindgen_test_layout_nsMediaFeatures() { + assert_eq!(::std::mem::size_of::() , 1usize); + assert_eq!(::std::mem::align_of::() , 1usize); + } + impl Clone for nsMediaFeatures { + fn clone(&self) -> Self { *self } + } + #[repr(C)] + #[derive(Debug)] + pub struct nsMediaExpression { + pub mFeature: *const root::nsMediaFeature, + pub mRange: root::nsMediaExpression_Range, + pub mValue: root::nsCSSValue, + } + #[repr(u32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum nsMediaExpression_Range { eMin = 0, eMax = 1, eEqual = 2, } + #[test] + fn bindgen_test_layout_nsMediaExpression() { + assert_eq!(::std::mem::size_of::() , 32usize); + assert_eq!(::std::mem::align_of::() , 8usize); + } + #[repr(C)] + #[derive(Debug)] + pub struct nsMediaQuery { + pub mNegated: bool, + pub mHasOnly: bool, + pub mTypeOmitted: bool, + pub mHadUnknownExpression: bool, + pub mMediaType: root::nsCOMPtr, + pub mExpressions: root::nsTArray, + } + #[test] + fn bindgen_test_layout_nsMediaQuery() { + assert_eq!(::std::mem::size_of::() , 24usize); + assert_eq!(::std::mem::align_of::() , 8usize); + } #[test] fn __bindgen_test_layout_template_11() { assert_eq!(::std::mem::size_of::>() @@ -13613,105 +14908,119 @@ pub mod root { } #[test] fn __bindgen_test_layout_template_23() { + assert_eq!(::std::mem::size_of::>() + , 8usize); + assert_eq!(::std::mem::align_of::>() + , 8usize); + } + #[test] + fn __bindgen_test_layout_template_24() { assert_eq!(::std::mem::size_of::>() , 8usize); assert_eq!(::std::mem::align_of::>() , 8usize); } #[test] - fn __bindgen_test_layout_template_24() { + fn __bindgen_test_layout_template_25() { assert_eq!(::std::mem::size_of::>() , 8usize); assert_eq!(::std::mem::align_of::>() , 8usize); } #[test] - fn __bindgen_test_layout_template_25() { + fn __bindgen_test_layout_template_26() { assert_eq!(::std::mem::size_of::>() , 8usize); assert_eq!(::std::mem::align_of::>() , 8usize); } #[test] - fn __bindgen_test_layout_template_26() { + fn __bindgen_test_layout_template_27() { assert_eq!(::std::mem::size_of::>>() , 8usize); assert_eq!(::std::mem::align_of::>>() , 8usize); } #[test] - fn __bindgen_test_layout_template_27() { + fn __bindgen_test_layout_template_28() { assert_eq!(::std::mem::size_of::>() , 24usize); assert_eq!(::std::mem::align_of::>() , 8usize); } #[test] - fn __bindgen_test_layout_template_28() { + fn __bindgen_test_layout_template_29() { assert_eq!(::std::mem::size_of::>() , 24usize); assert_eq!(::std::mem::align_of::>() , 8usize); } #[test] - fn __bindgen_test_layout_template_29() { + fn __bindgen_test_layout_template_30() { assert_eq!(::std::mem::size_of::>() , 16usize); assert_eq!(::std::mem::align_of::>() , 8usize); } #[test] - fn __bindgen_test_layout_template_30() { + fn __bindgen_test_layout_template_31() { assert_eq!(::std::mem::size_of::>() , 8usize); assert_eq!(::std::mem::align_of::>() , 8usize); } #[test] - fn __bindgen_test_layout_template_31() { + fn __bindgen_test_layout_template_32() { assert_eq!(::std::mem::size_of::>() , 8usize); assert_eq!(::std::mem::align_of::>() , 8usize); } #[test] - fn __bindgen_test_layout_template_32() { + fn __bindgen_test_layout_template_33() { assert_eq!(::std::mem::size_of::>() , 1usize); assert_eq!(::std::mem::align_of::>() , 1usize); } #[test] - fn __bindgen_test_layout_template_33() { + fn __bindgen_test_layout_template_34() { assert_eq!(::std::mem::size_of::>() , 1usize); assert_eq!(::std::mem::align_of::>() , 1usize); } #[test] - fn __bindgen_test_layout_template_34() { + fn __bindgen_test_layout_template_35() { assert_eq!(::std::mem::size_of::>() , 1usize); assert_eq!(::std::mem::align_of::>() , 1usize); } #[test] - fn __bindgen_test_layout_template_35() { + fn __bindgen_test_layout_template_36() { assert_eq!(::std::mem::size_of::>() , 1usize); assert_eq!(::std::mem::align_of::>() , 1usize); } #[test] - fn __bindgen_test_layout_template_36() { + fn __bindgen_test_layout_template_37() { assert_eq!(::std::mem::size_of::>() , 1usize); assert_eq!(::std::mem::align_of::>() , 1usize); } #[test] - fn __bindgen_test_layout_template_37() { + fn __bindgen_test_layout_template_38() { assert_eq!(::std::mem::size_of::>() , 32usize); assert_eq!(::std::mem::align_of::>() , 8usize); } + #[test] + fn __bindgen_test_layout_template_39() { + assert_eq!(::std::mem::size_of::>() + , 8usize); + assert_eq!(::std::mem::align_of::>() + , 8usize); + } } diff --git a/components/style/gecko_bindings/sugar/mod.rs b/components/style/gecko_bindings/sugar/mod.rs index 623125c396e..c531a2efa01 100644 --- a/components/style/gecko_bindings/sugar/mod.rs +++ b/components/style/gecko_bindings/sugar/mod.rs @@ -6,6 +6,7 @@ mod ns_com_ptr; mod ns_css_shadow_array; +mod ns_css_value; mod ns_style_auto_array; pub mod ns_style_coord; mod ns_t_array; diff --git a/components/style/gecko_bindings/sugar/ns_css_value.rs b/components/style/gecko_bindings/sugar/ns_css_value.rs new file mode 100644 index 00000000000..3f1110ecd34 --- /dev/null +++ b/components/style/gecko_bindings/sugar/ns_css_value.rs @@ -0,0 +1,78 @@ +/* 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/. */ + +//! Little helpers for `nsCSSValue`. + +use gecko_bindings::bindings::Gecko_CSSValue_Drop; +use gecko_bindings::structs::{nsCSSValue, nsCSSUnit, nsCSSValue_Array}; +use std::mem; +use std::ops::Index; +use std::slice; + +impl nsCSSValue { + /// Create a CSSValue with null unit, useful to be used as a return value. + #[inline] + pub fn null() -> Self { + unsafe { mem::zeroed() } + } + + /// Returns this nsCSSValue value as an integer, unchecked in release + /// builds. + pub fn integer_unchecked(&self) -> i32 { + debug_assert!(self.mUnit == nsCSSUnit::eCSSUnit_Integer || + self.mUnit == nsCSSUnit::eCSSUnit_Enumerated || + self.mUnit == nsCSSUnit::eCSSUnit_EnumColor); + unsafe { *self.mValue.mInt.as_ref() } + } + + /// Returns this nsCSSValue value as a floating point value, unchecked in + /// release builds. + pub fn float_unchecked(&self) -> f32 { + debug_assert!(nsCSSUnit::eCSSUnit_Number as u32 <= self.mUnit as u32); + unsafe { *self.mValue.mFloat.as_ref() } + } + + /// Returns this nsCSSValue as a nsCSSValue::Array, unchecked in release + /// builds. + pub unsafe fn array_unchecked(&self) -> &nsCSSValue_Array { + debug_assert!(nsCSSUnit::eCSSUnit_Array as u32 <= self.mUnit as u32 && + self.mUnit as u32 <= nsCSSUnit::eCSSUnit_Calc_Divided as u32); + let array = *self.mValue.mArray.as_ref(); + debug_assert!(!array.is_null()); + &*array + } +} + +impl Drop for nsCSSValue { + fn drop(&mut self) { + unsafe { Gecko_CSSValue_Drop(self) }; + } +} + +impl nsCSSValue_Array { + /// Return the length of this `nsCSSShadowArray` + #[inline] + pub fn len(&self) -> usize { + self.mCount + } + + #[inline] + fn buffer(&self) -> *const nsCSSValue { + self.mArray.as_ptr() + } + + /// Get the array as a slice of nsCSSValues. + #[inline] + pub fn as_slice(&self) -> &[nsCSSValue] { + unsafe { slice::from_raw_parts(self.buffer(), self.len()) } + } +} + +impl Index for nsCSSValue_Array { + type Output = nsCSSValue; + #[inline] + fn index(&self, i: usize) -> &nsCSSValue { + &self.as_slice()[i] + } +} diff --git a/components/style/media_queries.rs b/components/style/media_queries.rs index daac8bed876..19a7fd41b39 100644 --- a/components/style/media_queries.rs +++ b/components/style/media_queries.rs @@ -19,7 +19,7 @@ pub use servo::media_queries::{Device, Expression}; pub use gecko::media_queries::{Device, Expression}; /// A type that encapsulates a media query list. -#[derive(Debug, PartialEq)] +#[derive(Debug)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct MediaList { /// The list of media queries. @@ -66,7 +66,7 @@ impl ToCss for Qualifier { /// A [media query][mq]. /// /// [mq]: https://drafts.csswg.org/mediaqueries/ -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct MediaQuery { /// The qualifier for this query. diff --git a/components/style/servo/media_queries.rs b/components/style/servo/media_queries.rs index 9f8b5ddf46c..516bc02fcd1 100644 --- a/components/style/servo/media_queries.rs +++ b/components/style/servo/media_queries.rs @@ -10,8 +10,6 @@ use euclid::{Size2D, TypedSize2D}; use media_queries::MediaType; use properties::ComputedValues; use std::fmt; -#[cfg(feature = "gecko")] -use std::sync::Arc; use style_traits::{ToCss, ViewportPx}; use style_traits::viewport::ViewportConstraints; use values::computed::{self, ToComputedValue}; @@ -21,24 +19,16 @@ use values::specified; /// is displayed in. /// /// This is the struct against which media queries are evaluated. -#[derive(Debug)] -#[cfg_attr(feature = "servo", derive(HeapSizeOf))] +#[derive(Debug, HeapSizeOf)] pub struct Device { /// The current media type used by de device. media_type: MediaType, /// The current viewport size, in viewport pixels. viewport_size: TypedSize2D, - /// A set of default computed values for this document. - /// - /// This allows handling zoom correctly, among other things. Gecko-only for - /// now, see #14773. - #[cfg(feature = "gecko")] - default_values: Arc, } impl Device { /// Trivially construct a new `Device`. - #[cfg(feature = "servo")] pub fn new(media_type: MediaType, viewport_size: TypedSize2D) -> Device { @@ -48,30 +38,11 @@ impl Device { } } - /// Trivially construct a new `Device`. - #[cfg(feature = "gecko")] - pub fn new(media_type: - MediaType, viewport_size: TypedSize2D, - default_values: &Arc) -> Device { - Device { - media_type: media_type, - viewport_size: viewport_size, - default_values: default_values.clone(), - } - } - /// Return the default computed values for this device. - #[cfg(feature = "servo")] pub fn default_values(&self) -> &ComputedValues { ComputedValues::initial_values() } - /// Return the default computed values for this device. - #[cfg(feature = "gecko")] - pub fn default_values(&self) -> &ComputedValues { - &*self.default_values - } - /// Returns the viewport size of the current device in app units, needed, /// among other things, to resolve viewport units. #[inline] diff --git a/components/style/stylist.rs b/components/style/stylist.rs index 45e6b0f9529..27ffea363d1 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -49,6 +49,20 @@ pub use ::fnv::FnvHashMap; #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct Stylist { /// Device that the stylist is currently evaluating against. + /// + /// This field deserves a bigger comment due to the different use that Gecko + /// and Servo give to it (that we should eventually unify). + /// + /// With Gecko, the device is never changed. Gecko manually tracks whether + /// the device data should be reconstructed, and "resets" the state of the + /// device. + /// + /// On Servo, on the other hand, the device is a really cheap representation + /// that is recreated each time some constraint changes and calling + /// `set_device`. + /// + /// In both cases, the device is actually _owned_ by the Stylist, and it's + /// only an `Arc` so we can implement `add_stylesheet` more idiomatically. pub device: Arc, /// Viewport constraints based on the current device. @@ -146,6 +160,18 @@ impl Stylist { return false; } + let cascaded_rule = ViewportRule { + declarations: viewport::Cascade::from_stylesheets(doc_stylesheets, &self.device).finish(), + }; + + self.viewport_constraints = + ViewportConstraints::maybe_new(&self.device, &cascaded_rule); + + if let Some(ref constraints) = self.viewport_constraints { + Arc::get_mut(&mut self.device).unwrap() + .account_for_viewport_rule(constraints); + } + self.element_map = PerPseudoElementSelectorMap::new(); self.pseudos_map = Default::default(); self.animations = Default::default(); @@ -394,6 +420,13 @@ impl Stylist { /// /// Probably worth to make the stylist own a single `Device`, and have a /// `update_device` function? + /// + /// feature = "servo" because gecko only has one device, and manually tracks + /// when the device is dirty. + /// + /// FIXME(emilio): The semantics of the device for Servo and Gecko are + /// different enough we may want to unify them. + #[cfg(feature = "servo")] pub fn set_device(&mut self, mut device: Device, stylesheets: &[Arc]) { let cascaded_rule = ViewportRule { declarations: viewport::Cascade::from_stylesheets(stylesheets, &device).finish(), diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 70ec377cce7..56fabe67b87 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -47,6 +47,7 @@ use style::gecko_bindings::structs::{SheetParsingMode, nsIAtom, nsCSSPropertyID} use style::gecko_bindings::structs::{ThreadSafePrincipalHolder, ThreadSafeURIHolder}; use style::gecko_bindings::structs::{nsRestyleHint, nsChangeHint}; use style::gecko_bindings::structs::Loader; +use style::gecko_bindings::structs::RawGeckoPresContextOwned; use style::gecko_bindings::structs::ServoStyleSheet; use style::gecko_bindings::structs::nsresult; use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasArcFFI, HasBoxFFI}; @@ -111,7 +112,7 @@ fn create_shared_context(per_doc_data: &PerDocumentStyleDataImpl) -> SharedStyle timer: Timer::new(), // FIXME Find the real QuirksMode information for this document quirks_mode: QuirksMode::NoQuirks, - default_computed_values: per_doc_data.default_computed_values.clone(), + default_computed_values: per_doc_data.default_computed_values().clone(), } } @@ -251,7 +252,7 @@ pub extern "C" fn Servo_RestyleWithAddedDeclaration(raw_data: RawServoStyleSetBo /* is_root_element = */ false, declarations, previous_style, - &data.default_computed_values, + data.default_computed_values(), None, Box::new(StdoutErrorReporter), None, @@ -597,7 +598,7 @@ pub extern "C" fn Servo_ComputedValues_GetForAnonymousBox(parent_style_or_null: let maybe_parent = ComputedValues::arc_from_borrowed(&parent_style_or_null); data.stylist.precomputed_values_for_pseudo(&pseudo, maybe_parent, - &data.default_computed_values, false) + data.default_computed_values(), false) .values .into_strong() } @@ -618,7 +619,7 @@ pub extern "C" fn Servo_ResolvePseudoStyle(element: RawGeckoElementBorrowed, return if is_probe { Strong::null() } else { - doc_data.borrow().default_computed_values.clone().into_strong() + doc_data.borrow().default_computed_values().clone().into_strong() }; } @@ -640,7 +641,7 @@ fn get_pseudo_style(element: GeckoElement, pseudo_tag: *mut nsIAtom, PseudoElementCascadeType::Lazy => { let d = doc_data.borrow_mut(); let base = &styles.primary.values; - d.stylist.lazily_compute_pseudo_element_style(&element, &pseudo, base, &d.default_computed_values) + d.stylist.lazily_compute_pseudo_element_style(&element, &pseudo, base, &d.default_computed_values()) .map(|s| s.values.clone()) }, } @@ -654,37 +655,37 @@ pub extern "C" fn Servo_ComputedValues_Inherit( let data = PerDocumentStyleData::from_ffi(raw_data).borrow(); let maybe_arc = ComputedValues::arc_from_borrowed(&parent_style); let style = if let Some(reference) = maybe_arc.as_ref() { - ComputedValues::inherit_from(reference, &data.default_computed_values) + ComputedValues::inherit_from(reference, &data.default_computed_values()) } else { - data.default_computed_values.clone() + data.default_computed_values().clone() }; style.into_strong() } #[no_mangle] -pub extern "C" fn Servo_ComputedValues_AddRef(ptr: ServoComputedValuesBorrowed) -> () { +pub extern "C" fn Servo_ComputedValues_AddRef(ptr: ServoComputedValuesBorrowed) { unsafe { ComputedValues::addref(ptr) }; } #[no_mangle] -pub extern "C" fn Servo_ComputedValues_Release(ptr: ServoComputedValuesBorrowed) -> () { +pub extern "C" fn Servo_ComputedValues_Release(ptr: ServoComputedValuesBorrowed) { unsafe { ComputedValues::release(ptr) }; } +/// See the comment in `Device` to see why it's ok to pass an owned reference to +/// the pres context (hint: the context outlives the StyleSet, that holds the +/// device alive). #[no_mangle] -pub extern "C" fn Servo_StyleSet_Init(pres_context: RawGeckoPresContextBorrowed) +pub extern "C" fn Servo_StyleSet_Init(pres_context: RawGeckoPresContextOwned) -> RawServoStyleSetOwned { let data = Box::new(PerDocumentStyleData::new(pres_context)); data.into_ffi() } #[no_mangle] -pub extern "C" fn Servo_StyleSet_RecomputeDefaultStyles( - raw_data: RawServoStyleSetBorrowed, - pres_context: RawGeckoPresContextBorrowed) { +pub extern "C" fn Servo_StyleSet_RebuildData(raw_data: RawServoStyleSetBorrowed) { let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); - data.default_computed_values = ComputedValues::default_values(pres_context); - // FIXME(bz): We need to update our Stylist's Device's computed values, but how? + data.device_changed = true; } #[no_mangle] @@ -1034,7 +1035,7 @@ pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed, if !data.has_current_styles() { error!("Resolving style on unstyled element with lazy computation forbidden."); let per_doc_data = PerDocumentStyleData::from_ffi(raw_data).borrow(); - return per_doc_data.default_computed_values.clone().into_strong(); + return per_doc_data.default_computed_values().clone().into_strong(); } data.styles().primary.values.clone().into_strong()