Closed Bug 1559276 Opened 5 years ago Closed 5 years ago

Retiring support for 3-valued <position> (excluding background)

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox69 --- wontfix
firefox70 --- fixed

People

(Reporter: boris, Assigned: boris)

References

()

Details

(Keywords: dev-doc-complete, site-compat)

Attachments

(3 files)

Based on spec issue 2140, the 3-valued positions shouldn't be accepted, except for background. Blink retires the support in Chrome 68, and they added some tests into wpt [1][2][3]. Perhaps we should update the parser of these properties (or values::generics::position::Position type).

Besides, the spec, https://drafts.csswg.org/css-values-4/#position, mention:

Note: The background-position property also accepts a three-value syntax. This has been disallowed generically because it creates parsing ambiguities when combined with other length or percentage components in a property value.

[1] <object-position>
[2] <perspective-origin>
[3] <offset-anchor>

Summary: Retiring support for 3-valued positions (excluding background) → Retiring support for 3-valued <position> (excluding background)

Perhaps we should update the parser of these properties (or values::generics::position::Position type).

Sounds good, moving the current parse implementation to something like parse_three_value or parse_legacy, then implementing a simpler parse seems reasonable.

Cool. Thanks for the suggestion. This should be easy to fix.

Assignee: nobody → boris.chiou
Keywords: dev-doc-needed

Update the existing reftests to not use 3 valued syntax.

I run the script to update the syntax in
layout/reftests/w3c-css/submitted/images3/*,
layout/reftests/xul/*, and
layout/reftests/webm-video/*:

function rename() {
    find layout/reftests/\
         -type f\
         ! -path "./obj*"\
         ! -path "./.git"\
         ! -path "./.hg"\
         \( -name "*.html" -or\
            -name "*.xul" \)\
            -exec sed -i -e "s/$1/$2/g" "{}" \;
}

rename "object-position: top 3px center" "object-position: top 3px left 50%"
rename "object-position: center right 25%" "object-position: top 50% right 25%"

For others, I just manually update them.

According to this resolved spec issue:
https://github.com/w3c/csswg-drafts/issues/2140,
we retire the 3-valued <position> on

  1. object-position
  2. perspective-origin,
  3. mask-position
  4. circle() and ellipse()
    , but still keep the support for background-position.
Attachment #9076296 - Attachment description: Bug 1559276 - Retire the support for 3-valued syntax for <position>. → Bug 1559276 - Part 2: Retire the support for 3-valued syntax for <position>.
Attachment #9076296 - Attachment description: Bug 1559276 - Part 2: Retire the support for 3-valued syntax for <position>. → Bug 1559276 - Part 2: Retire the support for 3-valued syntax for position.
Keywords: site-compat
Pushed by bchiou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7018488ca120
Part 1: Avoid using 3 valued syntax for position. r=emilio
https://hg.mozilla.org/integration/autoland/rev/6ec2809da4e3
Part 2: Retire the support for 3-valued syntax for position. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/17777 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70

(In reply to Kohei Yoshino [:kohei] (Bugzilla UX) (FxSiteCompat) from comment #11)

Posted site compatibility note: https://www.fxsitecompat.dev/en-CA/docs/2019/3-valued-css-position-is-no-longer-supported-except-for-background-position/

Looks great. Thanks for this.

Pushed by bchiou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5f78ce29be79
Drop stale WPT annotation .ini files after vendor-imports was synced. r=dholbert
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: