Closed Bug 1557857 Opened 5 years ago Closed 5 years ago

Adding web-platform tests ref-tests for text-underline-offset

Categories

(Core :: Layout, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: cmarlow, Assigned: cmarlow)

References

Details

Attachments

(1 file, 1 obsolete file)

No description provided.
Attachment #9071104 - Attachment description: Bug 1557857: adding web-platform reftests for text-underline offset r?TYLin → Bug 1557857: adding web-platform reftests for text-underline offset r?jfkthame
Attachment #9071104 - Attachment is obsolete: true

Pretty sure this needs to wait until bug 1561657 has been addressed (per the recent patch-update to invert the sign in some tests here).

Adding bug-dependency as a reminder / to make that explicit.

Depends on: 1561657
Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3fd103a9fce8
Added reftests for text-underline-offset r=dholbert

This patch is tests-only, so it's just uncovering an until-now-undiscovered issue, it seems.

Specifically, this patch's new test text-underline-offset-scroll-001.html , here in the commit, is triggering this fatal assertion:

Assertion failure: cachedStyles[i]->EqualForCachedAnonymousContentStyle(*cs)
(cached anonymous content styles should be identical to those we would compute normally),
at z:/build/build/src/layout/base/nsCSSFrameConstructor.cpp:3962

This is an assertion that was added quite recently in bug 1554571 part 3.

It looks like we have bug 1562359 filed on one way that we know of to trigger that assertion. Not sure yet if this test is the same as that bug or a different issue.

heycam, do you know why this web platform test would be causing this assertion failure (only on Windows 10), and do you have a suggestion for what Charlie can do to fix or work around it? And is this the same issue as bug 1562359?

For example: would it be sane to mark the test as disabled on Windows for now, so that we can land these tests for text-underline-offset without having to be blocked on the assertion-failure? (e.g. with a reference to bug 1562359 alongside the disabling in the .ini file)

Flags: needinfo?(cam)

So this is because we enable the pref at runtime, which changes what the all property expands to, but we don't reparse UA stylesheets. This is quite an annoying problem looks like...

This code restrict the expanded properties to the ones enabled for all content, which does the pref check. We may want to fix this making it origin-aware, maybe, but that looks a bit too annoying since we don't have that information from everywhere AFAIK.

Fixed it by separating the text styling into a span, avoiding issues on Windows with scrollable divs since the div's style that was cached before turning text-underline-offset pref on did not match the style that was applied once the pref was flipped on.

Flags: needinfo?(charles.w.marlow)
Flags: needinfo?(cam)

This fix (comment 9) seems to avoid the assertion-failure on my Win10 debug build.

For folks who want to investigate the assertion-failure (heycam/emilio?), e.g. over on bug 1562359: you'll probably be able to reliably trigger it (on Windows at least) by adjusting the soon-to-be-landed WPT test text-underline-offset-scroll-001.html such that its text-decoration styling is all on the scrollable div, and then running

./mach wpt --headless testing/web-platform/tests/css/css-text-decor/text-underline-offset-scroll-001.html

That may not work on its own, it may depend on whether the test before had that pref enabled or not. As I said I can see how this bug can happen (comment 8), I'd like to check with Cam what's the best way to fix this.

Cam, do you have any opinion on comment 8?

Flags: needinfo?(cam)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #11)

That may not work on its own, it may depend on whether the test before had that pref enabled or not.

(this was referring to my ./mach wpt command from comment 10, where "work" = "trigger the assertion")

It does seem to work (trigger the assertion) on its own, FWIW (in my local debug build on Win10 with Charlie's original patch that landed here). Apparently we do enough spin-up work before this test's dynamic pref-flip to get the styles cached, even in a single-test WPT run.

Depends on: 1564597

I am glad I added the assertions. :-) Making the all shorthand include properties that are disabled for content sounds like the right thing to do. I will see how hard it is -- filed bug 1564597.

Flags: needinfo?(cam)
Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ed32865ed737
Added reftests for text-underline-offset r=dholbert
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/17767 for changes under testing/web-platform/tests
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: