Skip to content

Commit 108f335

Browse files
lukewarlowmozilla@keithcirkel.co.uk
authored andcommitted
Bug 1959597 - Fix tab crash with details-content enabled; r=emilio
This patch ensures that we don't try to share styles when there's a mismatch between the backing pseudo elements. This fixes a debug assert that's hit by the details element when ::details-content is enabled. Differential Revision: https://phabricator.services.mozilla.com/D254208
1 parent a34b558 commit 108f335

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

servo/components/style/sharing/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,11 @@ impl<E: TElement> StyleSharingCache<E> {
809809
return None;
810810
}
811811

812+
if target.implemented_pseudo_element() != candidate.implemented_pseudo_element() {
813+
trace!("Miss: Element backed pseudo-element");
814+
return None;
815+
}
816+
812817
if target.element.shadow_root().is_some() {
813818
trace!("Miss: Shadow host");
814819
return None;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE HTML>
2+
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#the-details-and-summary-elements">
3+
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#details-content-pseudo">
4+
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1959597">
5+
6+
<!-- This test passes if it does not crash. -->
7+
8+
<style>
9+
:is([open],) {}
10+
</style>
11+
<details open></details>

0 commit comments

Comments
 (0)