Bug 1304792: stylo: Implement @import. r=heycam

MozReview-Commit-ID: Hw1V66JxIBD
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2016-12-17 10:58:56 +01:00
parent b49eb6f566
commit a5f5e48c68
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
7 changed files with 177 additions and 16 deletions

View file

@ -11,7 +11,7 @@
use app_units::Au;
use gecko::values::{convert_rgba_to_nscolor, StyleCoordHelpers};
use gecko_bindings::bindings::{Gecko_CreateGradient, Gecko_SetGradientImageValue, Gecko_SetUrlImageValue};
use gecko_bindings::bindings::{RawServoStyleSheet, RawServoDeclarationBlock, RawServoStyleRule};
use gecko_bindings::bindings::{RawServoStyleSheet, RawServoDeclarationBlock, RawServoStyleRule, RawServoImportRule};
use gecko_bindings::bindings::{ServoComputedValues, ServoCssRules};
use gecko_bindings::structs::{nsStyleCoord_CalcValue, nsStyleImage};
use gecko_bindings::structs::nsresult;
@ -19,7 +19,7 @@ use gecko_bindings::sugar::ns_style_coord::{CoordDataValue, CoordDataMut};
use gecko_bindings::sugar::ownership::{HasArcFFI, HasFFI};
use parking_lot::RwLock;
use properties::{ComputedValues, PropertyDeclarationBlock};
use stylesheets::{CssRules, RulesMutateError, Stylesheet, StyleRule};
use stylesheets::{CssRules, RulesMutateError, Stylesheet, StyleRule, ImportRule};
use values::computed::{CalcLengthOrPercentage, Gradient, Image, LengthOrPercentage, LengthOrPercentageOrAuto};
unsafe impl HasFFI for Stylesheet {
@ -46,6 +46,11 @@ unsafe impl HasFFI for RwLock<StyleRule> {
}
unsafe impl HasArcFFI for RwLock<StyleRule> {}
unsafe impl HasFFI for RwLock<ImportRule> {
type FFIType = RawServoImportRule;
}
unsafe impl HasArcFFI for RwLock<ImportRule> {}
impl From<CalcLengthOrPercentage> for nsStyleCoord_CalcValue {
fn from(other: CalcLengthOrPercentage) -> nsStyleCoord_CalcValue {
let has_percentage = other.percentage.is_some();