The paint ordering in these tests (of the highlight-background vs. ink of adjacent glyphs) is different in the testcase and reference case, at least in Gecko and WebKit (though not in Chromium[1]). This creates the potential for spurious failures in Gecko and WebKit, if the chosen font happens to have glyphs that draw close together (such that one glyph might have a piece that protrudes to overlap the bounding-box of the next glyph). This patch avoids these spurious failures by explicitly using a monospace font; this reduces the likelihood of glyphs drawing close together and experiencing the sort of overlap that would reveal the paint-order differences between the testcase & reference case. This patch also adds some letter-spacing to one of the testscases; this is needed to fully avoid overlap in the case of an "O" glyph that's adjacent to a highlight and is wide enough in the Windows monospace font to still trigger this problematic overlap (if it weren't for this added letter-spacing). [1] https://issues.chromium.org/issues/465531995 Differential Revision: https://phabricator.services.mozilla.com/D274954
18 lines
316 B
HTML
18 lines
316 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<style>
|
|
:root {
|
|
font-family: monospace;
|
|
}
|
|
#highlight {
|
|
background-color: yellow;
|
|
color:green;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
One<span id="highlight"> </span>t<span id="highlight">w</span>o three
|
|
</body>
|
|
</html>
|