mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Regen bindings
This commit is contained in:
parent
c3c4805c82
commit
9c69b3d0a5
4 changed files with 1285 additions and 254 deletions
|
@ -388,10 +388,15 @@ mod bindings {
|
||||||
"StyleTransition",
|
"StyleTransition",
|
||||||
"mozilla::UniquePtr",
|
"mozilla::UniquePtr",
|
||||||
"mozilla::DefaultDelete",
|
"mozilla::DefaultDelete",
|
||||||
|
|
||||||
|
// bindgen can't find these
|
||||||
|
"mozilla::binding_danger::TErrorResult",
|
||||||
|
"mozilla::binding_danger::AssertAndSuppressCleanupPolicy",
|
||||||
];
|
];
|
||||||
let opaque_types = [
|
let opaque_types = [
|
||||||
"std::pair__PCCP",
|
"std::pair__PCCP",
|
||||||
"std::namespace::atomic___base", "std::atomic__My_base",
|
"std::namespace::atomic___base", "std::atomic__My_base",
|
||||||
|
"std::atomic___base",
|
||||||
"nsAString_internal_char_traits",
|
"nsAString_internal_char_traits",
|
||||||
"nsAString_internal_incompatible_char_type",
|
"nsAString_internal_incompatible_char_type",
|
||||||
"nsACString_internal_char_traits",
|
"nsACString_internal_char_traits",
|
||||||
|
|
|
@ -8,7 +8,7 @@ use app_units::Au;
|
||||||
use cssparser::{CssStringWriter, Parser, Token};
|
use cssparser::{CssStringWriter, Parser, Token};
|
||||||
use euclid::Size2D;
|
use euclid::Size2D;
|
||||||
use gecko_bindings::bindings;
|
use gecko_bindings::bindings;
|
||||||
use gecko_bindings::structs::{nsCSSValue, nsCSSUnit, nsStringBuffer, nsresult};
|
use gecko_bindings::structs::{nsCSSValue, nsCSSUnit, nsStringBuffer};
|
||||||
use gecko_bindings::structs::{nsMediaExpression_Range, nsMediaFeature};
|
use gecko_bindings::structs::{nsMediaExpression_Range, nsMediaFeature};
|
||||||
use gecko_bindings::structs::{nsMediaFeature_ValueType, nsMediaFeature_RangeType, nsMediaFeature_RequirementFlags};
|
use gecko_bindings::structs::{nsMediaFeature_ValueType, nsMediaFeature_RangeType, nsMediaFeature_RequirementFlags};
|
||||||
use gecko_bindings::structs::RawGeckoPresContextOwned;
|
use gecko_bindings::structs::RawGeckoPresContextOwned;
|
||||||
|
@ -460,21 +460,12 @@ impl Expression {
|
||||||
/// Returns whether this media query evaluates to true for the given device.
|
/// Returns whether this media query evaluates to true for the given device.
|
||||||
pub fn matches(&self, device: &Device) -> bool {
|
pub fn matches(&self, device: &Device) -> bool {
|
||||||
let mut css_value = nsCSSValue::null();
|
let mut css_value = nsCSSValue::null();
|
||||||
let result = unsafe {
|
unsafe {
|
||||||
(self.feature.mGetter.unwrap())(device.pres_context,
|
(self.feature.mGetter.unwrap())(device.pres_context,
|
||||||
self.feature,
|
self.feature,
|
||||||
&mut css_value)
|
&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) {
|
let value = match MediaExpressionValue::from_css_value(self, &css_value) {
|
||||||
Some(v) => v,
|
Some(v) => v,
|
||||||
None => return false,
|
None => return false,
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue