fune/testing/web-platform/tests/css/css-pseudo/target-text-dynamic-002.html
Manuel Rego Casasnovas 2492266675 Bug 1733612 [wpt PR 31057] - [css-pseudo] Support dynamic changes on highlight pseudos, a=testonly
Automatic update from web-platform-tests
[css-pseudo] Support dynamic changes on highlight pseudos

Take into account changes on highlight pseudos (::target-text,
::spelling-error and ::grammar-error) in order to
compute StyleDifference in LayoutObject::SetStyle().

002 tests fail due to a problem that is being fixed in CL:3197850.
Apart from that target-text tests fail due to a repainting issue
(see https://crbug.com/1179938).

BUG=1035708,1251193
TEST=external/wpt/css/css-pseudo/target-text-dynamic-00*.html
TEST=wpt_internal/css/css-pseudo/grammar-error-color-dynamic-00*.html
TEST=wpt_internal/css/css-pseudo/spelling-error-color-dynamic-00*.html

Change-Id: I83ab02ab1225df86fbb9251eb0954409c17f9843
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3177663
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Delan Azabani <dazabani@igalia.com>
Commit-Queue: Manuel Rego <rego@igalia.com>
Cr-Commit-Position: refs/heads/main@{#927277}

--

wpt-commits: 3d48c9d646b1434c0956a088b414a335fda24a42
wpt-pr: 31057
2021-10-05 12:49:17 +00:00

26 lines
980 B
HTML

<!DOCTYPE html>
<html lang="en" class="reftest-wait">
<meta charset="utf-8" />
<title>CSS Pseudo-Elements Test: Dynamic change ::target-text background color</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#selectordef-target-text">
<meta name="assert" content="This test checks that it's possible to modify dinamically the background color of a targeted text through ::target-text pseudo-element.">
<link rel="match" href="target-text-dynamic-001-ref.html">
<script src="/common/reftest-wait.js"></script>
<style>
.magenta::target-text {
background-color: magenta;
}
</style>
<p>The test passes if the following word has a magenta background.</p>
<div id="target">Example</div>
<script>
location.href = "#:~:text=Example";
requestAnimationFrame(() => requestAnimationFrame(() => {
target.classList.add("magenta");
takeScreenshot();
}));
</script>
</html>