From 7c1412682e0c9de4ccd864c94d81579fcfbe9488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 7 Mar 2024 14:24:47 +0000 Subject: [PATCH] Bug 1883796 - Deal with an assert that doesn't hold always. r=dshin During an animation restyle, two links might share the same rules while not sharing the same link-ness. This is a temporary state, but let's deal with it correctly. Differential Revision: https://phabricator.services.mozilla.com/D203891 --- servo/components/style/sharing/mod.rs | 7 +------ .../tests/css/selectors/link-sharing-crash.html | 11 +++++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 testing/web-platform/tests/css/selectors/link-sharing-crash.html diff --git a/servo/components/style/sharing/mod.rs b/servo/components/style/sharing/mod.rs index eeea135c06c3..28592a02c5f2 100644 --- a/servo/components/style/sharing/mod.rs +++ b/servo/components/style/sharing/mod.rs @@ -908,12 +908,7 @@ impl StyleSharingCache { // RELEVANT_LINK_VISITED flag, so we can't share by rule node between visited and // unvisited styles. We don't check for visitedness and just refuse to share for links // entirely, so that visitedness doesn't affect timing. - debug_assert_eq!( - target.is_link(), - candidate.element.is_link(), - "Linkness mismatch" - ); - if target.is_link() { + if target.is_link() || candidate.element.is_link() { return None; } diff --git a/testing/web-platform/tests/css/selectors/link-sharing-crash.html b/testing/web-platform/tests/css/selectors/link-sharing-crash.html new file mode 100644 index 000000000000..3bcce92d49d6 --- /dev/null +++ b/testing/web-platform/tests/css/selectors/link-sharing-crash.html @@ -0,0 +1,11 @@ + +