mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
stylo: Add mako template for URLOrNone, use for marker-* properties
MozReview-Commit-ID: 4QKKzJ1DVYP
This commit is contained in:
parent
3b0840d187
commit
fa9881b829
7 changed files with 92 additions and 39 deletions
|
@ -173,20 +173,19 @@ impl SpecifiedUrl {
|
|||
/// Create a bundled URI suitable for sending to Gecko
|
||||
/// to be constructed into a css::URLValue
|
||||
#[cfg(feature = "gecko")]
|
||||
pub fn for_ffi(&self) -> ServoBundledURI {
|
||||
use std::ptr;
|
||||
pub fn for_ffi(&self) -> Option<ServoBundledURI> {
|
||||
let extra_data = self.extra_data();
|
||||
let (ptr, len) = match self.as_slice_components() {
|
||||
Ok(value) => value,
|
||||
Err(_) => (ptr::null(), 0),
|
||||
Err(_) => return None,
|
||||
};
|
||||
ServoBundledURI {
|
||||
Some(ServoBundledURI {
|
||||
mURLString: ptr,
|
||||
mURLStringLength: len as u32,
|
||||
mBaseURI: extra_data.base.get(),
|
||||
mReferrer: extra_data.referrer.get(),
|
||||
mPrincipal: extra_data.principal.get(),
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue