style: Use ArcSlice for quotes.

This saves the intermediate allocation.

Differential Revision: https://phabricator.services.mozilla.com/D30546
This commit is contained in:
Emilio Cobos Álvarez 2019-05-16 23:04:31 +00:00
parent bbc77e3977
commit a109fbb7c8
9 changed files with 85 additions and 44 deletions

View file

@ -3302,7 +3302,7 @@ fn static_assert() {
</%self:impl_trait>
<%self:impl_trait style_struct_name="List"
skip_longhands="list-style-image list-style-type quotes -moz-image-region">
skip_longhands="list-style-image list-style-type -moz-image-region">
pub fn set_list_style_image(&mut self, image: longhands::list_style_image::computed_value::T) {
match image {
@ -3378,28 +3378,6 @@ fn static_assert() {
}
}
pub fn set_quotes(&mut self, other: longhands::quotes::computed_value::T) {
self.gecko.mQuotes.set_arc(other.0.clone());
}
pub fn copy_quotes_from(&mut self, other: &Self) {
self.set_quotes(other.clone_quotes());
}
pub fn reset_quotes(&mut self, other: &Self) {
self.copy_quotes_from(other)
}
pub fn clone_quotes(&self) -> longhands::quotes::computed_value::T {
use gecko_bindings::sugar::ownership::HasArcFFI;
use values::computed::QuotePair;
let quote_pairs = unsafe { &*self.gecko.mQuotes.mRawPtr };
longhands::quotes::computed_value::T(
Box::<[QuotePair]>::as_arc(&quote_pairs).clone_arc()
)
}
#[allow(non_snake_case)]
pub fn set__moz_image_region(&mut self, v: longhands::_moz_image_region::computed_value::T) {
use crate::values::Either;