mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Avoid some allocations in selector serialization.
The allocations in display_to_css_identifier show up in the profiles of bug 1675628. Differential Revision: https://phabricator.services.mozilla.com/D97856
This commit is contained in:
parent
e9c1d490a9
commit
484cf5771b
2 changed files with 51 additions and 53 deletions
|
@ -113,7 +113,7 @@ pub trait Element: Sized + Clone + Debug {
|
|||
|
||||
fn has_class(
|
||||
&self,
|
||||
name: &<Self::Impl as SelectorImpl>::ClassName,
|
||||
name: &<Self::Impl as SelectorImpl>::Identifier,
|
||||
case_sensitivity: CaseSensitivity,
|
||||
) -> bool;
|
||||
|
||||
|
@ -121,10 +121,10 @@ pub trait Element: Sized + Clone + Debug {
|
|||
/// direction, that is, in an outer-tree -> inner-tree direction.
|
||||
fn imported_part(
|
||||
&self,
|
||||
name: &<Self::Impl as SelectorImpl>::PartName,
|
||||
) -> Option<<Self::Impl as SelectorImpl>::PartName>;
|
||||
name: &<Self::Impl as SelectorImpl>::Identifier,
|
||||
) -> Option<<Self::Impl as SelectorImpl>::Identifier>;
|
||||
|
||||
fn is_part(&self, name: &<Self::Impl as SelectorImpl>::PartName) -> bool;
|
||||
fn is_part(&self, name: &<Self::Impl as SelectorImpl>::Identifier) -> bool;
|
||||
|
||||
/// Returns whether this element matches `:empty`.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue