Regen bindings

This commit is contained in:
Manish Goregaokar 2017-01-21 16:54:17 -08:00
parent c3c4805c82
commit 9c69b3d0a5
4 changed files with 1285 additions and 254 deletions

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,