aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-10-13 18:00:14 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-10-14 00:44:08 +0530
commitbb736f41d32c1cb6117bbf327f2a6efa7deebd0c (patch)
tree4bcba24d593c77c4c31b4e11a9263d60903abb08 /components
parent17a46418dc3f313d3ceed8bd2bc46f42ade58eb9 (diff)
downloadservo-bb736f41d32c1cb6117bbf327f2a6efa7deebd0c.tar.gz
servo-bb736f41d32c1cb6117bbf327f2a6efa7deebd0c.zip
implement |quotes| property
MozReview-Commit-ID: 5eAaJGXSkob
Diffstat (limited to 'components')
-rw-r--r--components/style/properties/gecko.mako.rs23
-rw-r--r--components/style/properties/longhand/list.mako.rs2
2 files changed, 23 insertions, 2 deletions
diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs
index 8d06234a3fb..9dc9e8ceb96 100644
--- a/components/style/properties/gecko.mako.rs
+++ b/components/style/properties/gecko.mako.rs
@@ -1448,7 +1448,7 @@ fn static_assert() {
</%self:simple_image_array_property>
</%self:impl_trait>
-<%self:impl_trait style_struct_name="List" skip_longhands="list-style-type" skip_additionals="*">
+<%self:impl_trait style_struct_name="List" skip_longhands="list-style-type quotes" skip_additionals="*">
${impl_keyword_setter("list_style_type", "__LIST_STYLE_TYPE__",
data.longhands_by_name["list-style-type"].keyword)}
@@ -1458,6 +1458,27 @@ fn static_assert() {
}
}
+ pub fn set_quotes(&mut self, other: longhands::quotes::computed_value::T) {
+ use gecko_bindings::bindings::Gecko_NewStyleQuoteValues;
+ use gecko_bindings::sugar::refptr::UniqueRefPtr;
+ use nsstring::nsCString;
+
+ let mut refptr = unsafe {
+ UniqueRefPtr::from_addrefed(Gecko_NewStyleQuoteValues(other.0.len() as u32))
+ };
+
+ for (servo, gecko) in other.0.into_iter().zip(refptr.mQuotePairs.iter_mut()) {
+ gecko.first.assign_utf8(&nsCString::from(&*servo.0));
+ gecko.second.assign_utf8(&nsCString::from(&*servo.1));
+ }
+
+ unsafe { self.gecko.mQuotes.set_move(refptr.get()) }
+ }
+
+ pub fn copy_quotes_from(&mut self, other: &Self) {
+ unsafe { self.gecko.mQuotes.set(&other.gecko.mQuotes); }
+ }
+
</%self:impl_trait>
<%self:impl_trait style_struct_name="Effects"
diff --git a/components/style/properties/longhand/list.mako.rs b/components/style/properties/longhand/list.mako.rs
index 62eed32f53b..77e0af5797a 100644
--- a/components/style/properties/longhand/list.mako.rs
+++ b/components/style/properties/longhand/list.mako.rs
@@ -104,7 +104,7 @@ ${helpers.single_keyword("list-style-type", """
}
</%helpers:longhand>
-<%helpers:longhand name="quotes" products="servo" animatable="False">
+<%helpers:longhand name="quotes" animatable="False">
use std::borrow::Cow;
use std::fmt;
use values::NoViewportPercentage;