Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make filter property animatable. #17288

Merged
merged 5 commits into from Jun 19, 2017

Add function which convert from URLValueData to SpecifiedUrl.

We will need to convert from URLValueData to SpecifiedUrl when cloning the
stylo's data from gecko's data. Because the filter structure on gecko has url as
URLValue type. We will use this convert function when interpolating as
discrete also(Bug 1368610).
  • Loading branch information
mantaroh committed Jun 19, 2017
commit 0ca9a01be4b92ee8f9cdf6c650691008b42bedeb
@@ -5,6 +5,7 @@
//! Common handling for the specified value CSS url() values.

use gecko_bindings::structs::{ServoBundledURI, URLExtraData};
use gecko_bindings::structs::mozilla::css::URLValueData;
use gecko_bindings::structs::root::mozilla::css::ImageValue;
use gecko_bindings::sugar::refptr::RefPtr;
use parser::ParserContext;
@@ -51,6 +52,16 @@ impl SpecifiedUrl {
false
}

/// Convert from URLValueData to SpecifiedUrl.
pub unsafe fn from_url_value_data(url: &URLValueData)
-> Result<SpecifiedUrl, ()> {
Ok(SpecifiedUrl {
serialization: Arc::new(url.mString.to_string()),
extra_data: url.mExtraData.to_safe(),
image_value: None,
})
}

/// Returns true if this URL looks like a fragment.
/// See https://drafts.csswg.org/css-values/#local-urls
pub fn is_fragment(&self) -> bool {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.