Refactor style to be completely backend-independent

This commit refactors the style crate to be completely independent of
the actual implementation and pseudo-elements supported.

This also adds a gecko backend which introduces parsing for the
anonymous box pseudo-elements[1], although there's still no way of
querying them.

https://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSAnonBoxList.h
This commit is contained in:
Emilio Cobos Álvarez 2016-02-08 02:53:22 +01:00
parent a164176876
commit dd503dfacb
41 changed files with 767 additions and 310 deletions

View file

@ -27,6 +27,6 @@ path = "../../../components/util"
app_units = {version = "0.2.1", features = ["plugins"]}
cssparser = {version = "0.5.3", features = ["heap_size"]}
euclid = {version = "0.6.2", features = ["plugins"]}
selectors = {version = "0.4.2", features = ["heap_size"]}
selectors = {version = "0.5", features = ["heap_size"]}
string_cache = {version = "0.2.9", features = ["heap_size"]}
url = {version = "0.5.5", features = ["heap_size"]}

View file

@ -8,7 +8,8 @@ use euclid::size::Size2D;
use std::borrow::ToOwned;
use style::error_reporting::ParseErrorReporter;
use style::media_queries::*;
use style::stylesheets::{Origin, Stylesheet, CSSRuleIteratorExt};
use style::servo::Stylesheet;
use style::stylesheets::{Origin, CSSRuleIteratorExt};
use style::values::specified;
pub struct CSSErrorReporterTest;

View file

@ -10,8 +10,9 @@ use std::sync::Arc;
use std::sync::Mutex;
use string_cache::Atom;
use style::properties::{PropertyDeclaration, PropertyDeclarationBlock, DeclaredValue, longhands};
use style::stylesheets::{CSSRule, StyleRule, Origin, Stylesheet};
use style::stylesheets::{CSSRule, StyleRule, Origin};
use style::error_reporting::ParseErrorReporter;
use style::servo::Stylesheet;
#[test]
fn test_parse_stylesheet() {

View file

@ -9,7 +9,8 @@ use media_queries::CSSErrorReporterTest;
use style::error_reporting::ParseErrorReporter;
use style::media_queries::{Device, MediaType};
use style::parser::ParserContext;
use style::stylesheets::{Origin, Stylesheet, CSSRuleIteratorExt};
use style::servo::Stylesheet;
use style::stylesheets::{Origin, CSSRuleIteratorExt};
use style::values::specified::Length::{self, ViewportPercentage};
use style::values::specified::LengthOrPercentageOrAuto::{self, Auto};
use style::values::specified::ViewportPercentageLength::Vw;