mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
style: Remove ThinBoxedSlice
The only remaining consumers are ::-moz-tree pseudo-elements (we used to use ThinBoxedSlice for other data structures in the past). Those are not particularly performance sensitive so I think just double-boxing is fine. In the future, if we wanted to avoid the double indirection, we could probably use the "thin" crate (https://docs.rs/thin) or similar, which stores the length of the slice along with the allocation, making the pointer thin in all configurations, much like "ThinArc" does: https://searchfox.org/mozilla-central/rev/1ce2eea39442190a71a1f8f650d098f286bf4a01/servo/components/servo_arc/lib.rs#891 In practice though, I don't think it's particularly worth it for this specific case. Differential Revision: https://phabricator.services.mozilla.com/D134672
This commit is contained in:
parent
fc4d185079
commit
5b62f66f6e
7 changed files with 5 additions and 43 deletions
|
@ -17,8 +17,7 @@ path = "lib.rs"
|
|||
doctest = false
|
||||
|
||||
[features]
|
||||
gecko = ["style_traits/gecko", "bindgen", "regex", "toml",
|
||||
"num_cpus", "thin-slice"]
|
||||
gecko = ["style_traits/gecko", "bindgen", "regex", "toml", "num_cpus"]
|
||||
servo = ["serde", "style_traits/servo", "servo_atoms", "servo_config", "html5ever",
|
||||
"cssparser/serde", "encoding_rs", "malloc_size_of/servo", "servo_url",
|
||||
"string_cache", "to_shmem/servo",
|
||||
|
@ -68,7 +67,6 @@ smallvec = "1.0"
|
|||
string_cache = { version = "0.8", optional = true }
|
||||
style_derive = { path = "../style_derive" }
|
||||
style_traits = { path = "../style_traits" }
|
||||
thin-slice = { version = "0.1.0", optional = true }
|
||||
time = "0.1"
|
||||
to_shmem = { path = "../to_shmem" }
|
||||
to_shmem_derive = { path = "../to_shmem_derive" }
|
||||
|
|
|
@ -17,7 +17,6 @@ use crate::string_cache::Atom;
|
|||
use crate::values::serialize_atom_identifier;
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use thin_slice::ThinBoxedSlice;
|
||||
|
||||
include!(concat!(
|
||||
env!("OUT_DIR"),
|
||||
|
|
|
@ -3,12 +3,15 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/// Gecko's pseudo-element definition.
|
||||
///
|
||||
/// We intentionally double-box legacy ::-moz-tree pseudo-elements to keep the
|
||||
/// size of PseudoElement (and thus selector components) small.
|
||||
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToShmem)]
|
||||
pub enum PseudoElement {
|
||||
% for pseudo in PSEUDOS:
|
||||
/// ${pseudo.value}
|
||||
% if pseudo.is_tree_pseudo_element():
|
||||
${pseudo.capitalized_pseudo()}(ThinBoxedSlice<Atom>),
|
||||
${pseudo.capitalized_pseudo()}(Box<Box<[Atom]>>),
|
||||
% else:
|
||||
${pseudo.capitalized_pseudo()},
|
||||
% endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue