diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2023-04-12 21:58:29 +0000 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-11-21 15:36:35 +0100 |
commit | 0709e13446ed186d6868e82887ebda4850c69365 (patch) | |
tree | 169a9eefcadc2008600518106efce2329b3844af /components/style/gecko/wrapper.rs | |
parent | a2df8f7ea5e76e7753d9649b7dfb1b0329510078 (diff) | |
download | servo-0709e13446ed186d6868e82887ebda4850c69365.tar.gz servo-0709e13446ed186d6868e82887ebda4850c69365.zip |
style: Allow to use ThinVec/nsTArray in the style crate
This allows to clean-up the previous patches by using a single ThinVec
(which stores length / capacity along with the allocation).
Differential Revision: https://phabricator.services.mozilla.com/D175029
Diffstat (limited to 'components/style/gecko/wrapper.rs')
-rw-r--r-- | components/style/gecko/wrapper.rs | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 762ff037416..de2bd4c5f4c 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -1566,26 +1566,14 @@ impl<'le> TElement for GeckoElement<'le> { Some(Some(ref atom)) => atom.as_ptr(), _ => ptr::null_mut(), }; - match value { - Lang::Single(lang) => unsafe { - Gecko_MatchLang( - self.0, - override_lang_ptr, - override_lang.is_some(), - lang.as_slice().as_ptr(), - ) - }, - Lang::List(list) => { - list.iter().any(|lang| unsafe { - Gecko_MatchLang( - self.0, - override_lang_ptr, - override_lang.is_some(), - lang.as_slice().as_ptr(), - ) - }) - }, - } + value.0.iter().any(|lang| unsafe { + Gecko_MatchLang( + self.0, + override_lang_ptr, + override_lang.is_some(), + lang.as_slice().as_ptr(), + ) + }) } fn is_html_document_body_element(&self) -> bool { |