aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/fragment_tree/base_fragment.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2025-03-26 09:33:12 +0100
committerGitHub <noreply@github.com>2025-03-26 08:33:12 +0000
commita9b393a854cea733c8e157072d374d89e93ea469 (patch)
treeaff992e5a169899ccbef046af2f77af799ddc4b9 /components/layout_2020/fragment_tree/base_fragment.rs
parent09041e77a044fdc771338d8e3023a830608d4264 (diff)
downloadservo-a9b393a854cea733c8e157072d374d89e93ea469.tar.gz
servo-a9b393a854cea733c8e157072d374d89e93ea469.zip
script: Eliminate `PseudoElementType` (#36146)
Servo has a `PseudoElementType` which more or less duplicate's Stylo's `PseudoElement` with the addition of a non-pseudo element variant. This type needs to be converted into `PseudoElement` anyway when asking for the style of an element from Stylo, so eliminate Servo's version and simply use `Option<PseudoElement>` with the `None` variant meaning the non-pseudo. This is preparation for adding support for the `::marker` pseudo element. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/layout_2020/fragment_tree/base_fragment.rs')
-rw-r--r--components/layout_2020/fragment_tree/base_fragment.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/components/layout_2020/fragment_tree/base_fragment.rs b/components/layout_2020/fragment_tree/base_fragment.rs
index 45d10d5e282..2b23e42100d 100644
--- a/components/layout_2020/fragment_tree/base_fragment.rs
+++ b/components/layout_2020/fragment_tree/base_fragment.rs
@@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use bitflags::bitflags;
-use script_layout_interface::{FragmentType, combine_id_with_fragment_type};
+use script_layout_interface::combine_id_with_fragment_type;
use style::dom::OpaqueNode;
use style::selector_parser::PseudoElement;
@@ -132,11 +132,6 @@ impl Tag {
}
pub(crate) fn to_display_list_fragment_id(self) -> u64 {
- let fragment_type = match self.pseudo {
- Some(PseudoElement::Before) => FragmentType::BeforePseudoContent,
- Some(PseudoElement::After) => FragmentType::AfterPseudoContent,
- _ => FragmentType::FragmentBody,
- };
- combine_id_with_fragment_type(self.node.id(), fragment_type)
+ combine_id_with_fragment_type(self.node.id(), self.pseudo.into())
}
}