diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-07-22 12:49:39 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-07-23 23:09:55 +0200 |
commit | 3d57c22e9cda982923dd184152d3f187910d7b46 (patch) | |
tree | 51d07653ebd19e68626a5a0b442e8dde98c9dbd0 /components/layout/generated_content.rs | |
parent | 2ff7cb5a3749d65bb7b7a8f637d8196e316179c9 (diff) | |
download | servo-3d57c22e9cda982923dd184152d3f187910d7b46.tar.gz servo-3d57c22e9cda982923dd184152d3f187910d7b46.zip |
Update euclid.
There are a few canvas2d-related dependencies that haven't updated, but they
only use euclid internally so that's not blocking landing the rest of the
changes.
Given the size of this patch, I think it's useful to get this landed as-is.
Diffstat (limited to 'components/layout/generated_content.rs')
-rw-r--r-- | components/layout/generated_content.rs | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/components/layout/generated_content.rs b/components/layout/generated_content.rs index 737dc3e84b8..683bb316897 100644 --- a/components/layout/generated_content.rs +++ b/components/layout/generated_content.rs @@ -25,6 +25,23 @@ use style::properties::ComputedValues; use style::selector_parser::RestyleDamage; use style::servo::restyle_damage::ServoRestyleDamage; use style::values::generics::counters::ContentItem; +use style::values::specified::list::{QuotePair, Quotes}; + +lazy_static! { + static ref INITIAL_QUOTES: style::ArcSlice<QuotePair> = style::ArcSlice::from_iter_leaked( + vec![ + QuotePair { + opening: "\u{201c}".to_owned().into(), + closing: "\u{201d}".to_owned().into(), + }, + QuotePair { + opening: "\u{2018}".to_owned().into(), + closing: "\u{2019}".to_owned().into(), + }, + ] + .into_iter() + ); +} // Decimal styles per CSS-COUNTER-STYLES § 6.1: static DECIMAL: [char; 10] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; @@ -326,14 +343,17 @@ impl<'a, 'b> ResolveGeneratedContentFragmentMutator<'a, 'b> { } fn quote(&self, style: &ComputedValues, close: bool) -> String { - let quotes = &style.get_list().quotes; - if quotes.0.is_empty() { + let quotes = match style.get_list().quotes { + Quotes::Auto => &*INITIAL_QUOTES, + Quotes::QuoteList(ref list) => &list.0, + }; + if quotes.is_empty() { return String::new(); } - let pair = if self.traversal.quote as usize >= quotes.0.len() { - quotes.0.last().unwrap() + let pair = if self.traversal.quote as usize >= quotes.len() { + quotes.last().unwrap() } else { - "es.0[self.traversal.quote as usize] + "es[self.traversal.quote as usize] }; if close { pair.closing.to_string() |