Closed Bug 1759621 Opened 2 years ago Closed 2 years ago

[css] th's text-align:center should be set in UA origin instead of as a preshint

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

VERIFIED FIXED
100 Branch
Tracking Status
firefox100 --- verified

People

(Reporter: Oriol, Assigned: dshin, Mentored)

Details

(Keywords: good-first-bug, perf-alert, Whiteboard: [lang=rust], [wptsync upstream])

Attachments

(1 file)

From https://html.spec.whatwg.org/multipage/rendering.html#tables-2

User agents are expected to have a rule in their user agent style sheet that matches th elements that have a parent node whose computed value for the 'text-align' property is its initial value, whose declaration block consists of just a single declaration that sets the 'text-align' property to the value 'center'.

Then, load https://software.hixie.ch/utilities/js/live-dom-viewer/saved/10126

<!DOCTYPE html>
<table style="text-align: initial">
  <th style="text-align: revert"></th>
</table>
<script>
var th = document.querySelector("th");
document.body.append(getComputedStyle(th).textAlign);
</script>

Actual: start
Expected: center

The parent has text-align set to the initial value, so the th should get text-align: center in UA origin, so text-align: revert should roll back to center.

It seems that Firefox set's text-align: center as a preshint (which is considered author origin for revert) rather than in UA origin.

This bug causes 1 failure in http://wpt.live/css/css-cascade/all-prop-revert-noop.html

this would need to be turned into a UA rule in here

So for that we need to expose the -moz-center-or-inherit value to UA sheets, replacing the #[css(skip)] here by something like #[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]. Then we need to just remove the TH_RULE code and implement it in html.css instead.

Mentor: emilio
Keywords: good-first-bug
Whiteboard: [lang=rust]

The severity field is not set for this bug.
:dholbert, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(dholbert)
Severity: -- → S3
Flags: needinfo?(dholbert)
Assignee: nobody → dshin
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/caf3fd368a8e
Migrate `<th>` `text-align` behaviour from presentation hint to UA CSS. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/33476 for changes under testing/web-platform/tests
Whiteboard: [lang=rust] → [lang=rust], [wptsync upstream]

Backed out for causing xpc failures in /test_css-properties-db.js

Backout link: https://hg.mozilla.org/integration/autoland/rev/d5f7b6d474a989619b8fdf2a8332912b9a8e970e

Push with failures

Failure log

INFO -  TEST-START | devtools/shared/tests/xpcshell/test_css-properties-db.js
[task 2022-04-01T21:16:34.490Z] 21:16:34  WARNING -  TEST-UNEXPECTED-FAIL | devtools/shared/tests/xpcshell/test_css-properties-db.js | xpcshell return code: 0
[task 2022-04-01T21:16:34.490Z] 21:16:34     INFO -  TEST-INFO took 537ms
[task 2022-04-01T21:16:34.490Z] 21:16:34     INFO -  >>>>>>>
[task 2022-04-01T21:16:34.492Z] 21:16:34     INFO -  PID 8006 | [Parent 8006, Main Thread] WARNING: Couldn't get the user appdata directory. Crash events may not be produced.: file /builds/worker/checkouts/gecko/toolkit/crashreporter/nsExceptionHandler.cpp:2945
[task 2022-04-01T21:16:34.492Z] 21:16:34     INFO -  (xpcshell/head.js) | test MAIN run_test pending (1)
Flags: needinfo?(dshin)
Upstream PR was closed without merging

Forgot to update css properties db. Will Fix.

Flags: needinfo?(dshin)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/24ac67f18277
Migrate `<th>` `text-align` behaviour from presentation hint to UA CSS. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
Upstream PR merged by moz-wptsync-bot
QA Whiteboard: [qa-100b-p2]

(In reply to Sandor Molnar from comment #7)

Backed out for causing xpc failures in /test_css-properties-db.js

Backout link: https://hg.mozilla.org/integration/autoland/rev/d5f7b6d474a989619b8fdf2a8332912b9a8e970e

Push with failures

Failure log

INFO -  TEST-START | devtools/shared/tests/xpcshell/test_css-properties-db.js
[task 2022-04-01T21:16:34.490Z] 21:16:34  WARNING -  TEST-UNEXPECTED-FAIL | devtools/shared/tests/xpcshell/test_css-properties-db.js | xpcshell return code: 0
[task 2022-04-01T21:16:34.490Z] 21:16:34     INFO -  TEST-INFO took 537ms
[task 2022-04-01T21:16:34.490Z] 21:16:34     INFO -  >>>>>>>
[task 2022-04-01T21:16:34.492Z] 21:16:34     INFO -  PID 8006 | [Parent 8006, Main Thread] WARNING: Couldn't get the user appdata directory. Crash events may not be produced.: file /builds/worker/checkouts/gecko/toolkit/crashreporter/nsExceptionHandler.cpp:2945
[task 2022-04-01T21:16:34.492Z] 21:16:34     INFO -  (xpcshell/head.js) | test MAIN run_test pending (1)

== Change summary for alert #33741 (as of Mon, 04 Apr 2022 23:18:42 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
5% welcome FirstVisualChange macosx1015-64-shippable-qr cold fission webrender 1,290.00 -> 1,230.00

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=33741

Keywords: perf-alert

Probably wrong culprit? How did a backout of a change cause a progression, if the change itself didn't cause the regression?

Flags: needinfo?(afinder)

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

Probably wrong culprit? How did a backout of a change cause a progression, if the change itself didn't cause the regression?

Thank you for the reply Emilio. There does seem to be an earlier revision which may have caused the actual trend change. Retriggered the job for the previous revisions.

Reproducible on Firefox 98.0(20220304153049) on macOS. Verified as fixed on Firefox 100.0(20220428192727) and Nightly 101.0a1(20220501190841) on Win10 64-bits, macOS 11 and Ubuntu 20.04

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-100b-p2]

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

Probably wrong culprit? How did a backout of a change cause a progression, if the change itself didn't cause the regression?

Looks like the improvement was actually related to a different bug after all. Sorry for the confusion!

Flags: needinfo?(afinder)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: