Auto merge of #15140 - Manishearth:regen, r=emilio

Regen bindings

r? @heycam @emilio

Don't land yet.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15140)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-01-21 18:03:50 -08:00 committed by GitHub
commit 8544c8c489
4 changed files with 1285 additions and 254 deletions

View file

@ -388,10 +388,15 @@ mod bindings {
"StyleTransition",
"mozilla::UniquePtr",
"mozilla::DefaultDelete",
// bindgen can't find these
"mozilla::binding_danger::TErrorResult",
"mozilla::binding_danger::AssertAndSuppressCleanupPolicy",
];
let opaque_types = [
"std::pair__PCCP",
"std::namespace::atomic___base", "std::atomic__My_base",
"std::atomic___base",
"nsAString_internal_char_traits",
"nsAString_internal_incompatible_char_type",
"nsACString_internal_char_traits",

View file

@ -8,7 +8,7 @@ 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::{nsCSSValue, nsCSSUnit, nsStringBuffer};
use gecko_bindings::structs::{nsMediaExpression_Range, nsMediaFeature};
use gecko_bindings::structs::{nsMediaFeature_ValueType, nsMediaFeature_RangeType, nsMediaFeature_RequirementFlags};
use gecko_bindings::structs::RawGeckoPresContextOwned;
@ -460,21 +460,12 @@ impl Expression {
/// 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 {
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,

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff