Remove the extra level of GeckoDeclarationBlock.

This commit is contained in:
Xidorn Quan 2016-10-18 15:53:41 +11:00
parent f967647226
commit 0b5c6fb701
4 changed files with 64 additions and 148 deletions

View file

@ -9,10 +9,11 @@
#![allow(unsafe_code)]
use app_units::Au;
use gecko_bindings::bindings::{RawServoStyleSheet, ServoComputedValues};
use gecko_bindings::bindings::{RawServoStyleSheet, ServoComputedValues, RawServoDeclarationBlock};
use gecko_bindings::structs::nsStyleCoord_CalcValue;
use gecko_bindings::sugar::ownership::{HasArcFFI, HasFFI};
use properties::ComputedValues;
use parking_lot::RwLock;
use properties::{ComputedValues, PropertyDeclarationBlock};
use stylesheets::Stylesheet;
use values::computed::{CalcLengthOrPercentage, LengthOrPercentage, LengthOrPercentageOrAuto};
@ -25,6 +26,11 @@ unsafe impl HasFFI for ComputedValues {
}
unsafe impl HasArcFFI for ComputedValues {}
unsafe impl HasFFI for RwLock<PropertyDeclarationBlock> {
type FFIType = RawServoDeclarationBlock;
}
unsafe impl HasArcFFI for RwLock<PropertyDeclarationBlock> {}
impl From<CalcLengthOrPercentage> for nsStyleCoord_CalcValue {
fn from(other: CalcLengthOrPercentage) -> nsStyleCoord_CalcValue {
let has_percentage = other.percentage.is_some();