Closed Bug 1909797 Opened 2 years ago Closed 2 years ago

Cleanup in intrinsic sizing keywords in property_database.js

Categories

(Core :: CSS Parsing and Computation, task)

task

Tracking

()

RESOLVED FIXED
130 Branch
Tracking Status
firefox130 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(3 files, 2 external files)

When adding new sizing keywords in bug 1909773, I noticed property_database.js has some cleanup to do:

  • stale comments about sizing keywords computing to the initial value in certain cases, which they no longer do
  • intrinsic sizing keywords being listed in differing orders (particularly the prefixed aliases)

Filing this bug to address both of those, so that bug 1909773 can make consistent keyword-insertions into now-more-similar other_values lists, for the various properties.

The stale comments I'm looking at in particular are:

(1) https://searchfox.org/mozilla-central/rev/79f37e7fcd8994d86b0c610a87af4ef0343166ee/layout/style/test/property_database.js#6753,6759,6763-6766

"max-width": {
...
  other_values: [
...
    // these four keywords compute to the initial value only when the
    // writing mode is vertical, and we're testing with a horizontal
    // writing mode
    "max-content",

This one was added in bug 1122253, but became no-longer-accurate as of Bug 1496558.

(2) https://searchfox.org/mozilla-central/rev/79f37e7fcd8994d86b0c610a87af4ef0343166ee/layout/style/test/property_database.js#10444,10453,10457-10458

"block-size": {
...
  other_values: [
...
    // These keywords are treated as initial value.
    "max-content",

This comment used to be correct, but it became incorrect as of bug 1322780 (which is actually the bug that added the comment). :) At least: at that point, we started parsing -moz-max-content and properly reporting it (or rather its unprefixed form max-content) in the computed value for the corresponding width or height property (whichever corresponded to block-size). (testing with a node with display:none to actually get the value from style rather than the used value.)

Just for reference, I'll attach the testcases I wrote locally, to be sure that behavior had in fact changed here.

(They're not the best testcases in the world; they just show various computed values from getComputedStyle, and they show different behavior in builds from before/after the fixes landed for the bugs that I reference in the previous comment, confirming that behavior has indeed changed.)

Attachment #9414769 - Attachment description: test2.html → testcase 2: width/height set to -moz-max-content
Attachment #9414768 - Attachment description: testcase 1 → testcase 1: min-width/min-height set to -moz-max-content

It was just commented out because it behaves like the initial value in some
cases; but that seems to only have been needed to handle a special case in
test_value_computation.html, which has its own mechanism to work around this.

The workaround in test_value_computation.html was missing "inline-size", so
this patch adds that (otherwise we'd get a new test-failure).

While we're here, I'm also deduplicating the arrays in that test that are
associated with "height" and "block-size" -- those two properties are using the
same list there, so let's just make that more explicit.

Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/043786c48c9e part 1: Cleanup stale comments and inconsistent ordering for intrinsic sizing keywords in property_database.js. r=firefox-style-system-reviewers,emilio https://hg.mozilla.org/integration/autoland/rev/b0dc0b40b6c4 part 2: Uncomment -moz-available from some values lists in property_database.js. r=firefox-style-system-reviewers,emilio
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: