mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Pass Gecko sheet base/referrer/principal from Servo_StylesheetFromUTF8Bytes through ParserContext.
This commit is contained in:
parent
6dfb51f272
commit
6d67aa8a01
5 changed files with 23 additions and 5 deletions
|
@ -11,7 +11,7 @@ name = "style"
|
|||
path = "lib.rs"
|
||||
|
||||
[features]
|
||||
gecko = []
|
||||
gecko = ["gecko_bindings"]
|
||||
|
||||
[dependencies]
|
||||
app_units = {version = "0.2.3", features = ["plugins"]}
|
||||
|
@ -20,6 +20,7 @@ cssparser = {version = "0.5.5", features = ["heap_size", "serde-serialization"]}
|
|||
encoding = "0.2"
|
||||
euclid = {version = "0.6.4", features = ["plugins"]}
|
||||
fnv = "1.0"
|
||||
gecko_bindings = {path = "../../ports/geckolib/gecko_bindings", optional = true}
|
||||
heapsize = "0.3.0"
|
||||
heapsize_plugin = "0.1.2"
|
||||
lazy_static = "0.2"
|
||||
|
|
|
@ -28,6 +28,8 @@ extern crate cssparser;
|
|||
extern crate encoding;
|
||||
extern crate euclid;
|
||||
extern crate fnv;
|
||||
#[cfg(feature = "gecko")]
|
||||
extern crate gecko_bindings;
|
||||
extern crate heapsize;
|
||||
#[allow(unused_extern_crates)]
|
||||
#[macro_use]
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
use cssparser::{Parser, SourcePosition};
|
||||
use error_reporting::ParseErrorReporter;
|
||||
#[cfg(feature = "gecko")]
|
||||
use gecko_bindings::ptr::{GeckoArcPrincipal, GeckoArcURI};
|
||||
use selectors::parser::ParserContext as SelectorParserContext;
|
||||
use stylesheets::Origin;
|
||||
use url::Url;
|
||||
|
@ -14,6 +16,9 @@ pub struct ParserContextExtraData;
|
|||
|
||||
#[cfg(feature = "gecko")]
|
||||
pub struct ParserContextExtraData {
|
||||
pub base: Option<GeckoArcURI>,
|
||||
pub referrer: Option<GeckoArcURI>,
|
||||
pub principal: Option<GeckoArcPrincipal>,
|
||||
}
|
||||
|
||||
impl ParserContextExtraData {
|
||||
|
@ -24,7 +29,7 @@ impl ParserContextExtraData {
|
|||
|
||||
#[cfg(feature = "gecko")]
|
||||
pub fn default() -> ParserContextExtraData {
|
||||
ParserContextExtraData { }
|
||||
ParserContextExtraData { base: None, referrer: None, principal: None }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue