Closed Bug 1277788 Opened 8 years ago Closed 8 years ago

The initial value of mask-position should be center

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: u459114, Assigned: u459114)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 2 obsolete files)

According to css-bg spec[1], the initial value of background-position is "0% 0%"
According to css-mask spec[2], the initial value of mask-position[1] is "center"

Current implementation uses "0% 0%" for both background-position and mask-position, which is not correct.

[1] https://drafts.csswg.org/css-backgrounds-3/#the-background-position
[2] https://drafts.fxtf.org/css-masking-1/#propdef-mask-position
Chrome and Safari has the same problem.
(In reply to percyley from comment #1)
> Chrome and Safari has the same problem.

Exactly, I don't even find out any relevant bugs on Chromium and Webkit as well.  However, defaulting mask position to the center seems making sense to me. Presumably we can throw this issue to w3c and get more feedback from widely voices...
This was an explicit decision of the WG to do something different from background-position:
https://lists.w3.org/Archives/Public/www-style/2013Sep/0875.html

At this point, though, we should see what the other implementations think.
Blocks: mask-ship
Assignee: nobody → cku
I heard back that Chrome folks intend to conform to the spec when they unprefix... although that's not particularly comforting in terms of compatibility risk, especially if they take a long time to unprefix and/or don't fix the prefixed version too.

I guess we should follow the spec, although we might need to switch back the other way.
Attachment #8772785 - Flags: review?(dbaron)
Attachment #8772786 - Flags: review?(dbaron)
Comment on attachment 8772785 [details]
Bug 1277788 - Part 1. Set initial value of mask-position as center.

https://reviewboard.mozilla.org/r/65522/#review67678
Attachment #8772785 - Flags: review?(dbaron) → review+
Comment on attachment 8772786 [details]
Bug 1277788 - Part 2. Correct mochitest. .

https://reviewboard.mozilla.org/r/65524/#review67680

::: layout/style/test/property_database.js:7010
(Diff revision 1)
>    gCSSProperties["mask-position"] = {
>      domProp: "maskPosition",
>      inherited: false,
>      type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
> -    initial_values: [ "top 0% left 0%", "top 0% left", "top left", "left top", "0% 0%", "0% top", "left 0%" ],
> -    other_values: [ "top", "left", "right", "bottom", "center", "center bottom", "bottom center", "center right", "right center", "center top", "top center", "center left", "left center", "right bottom", "bottom right", "50%", "top left, top left", "top left, top right", "top right, top left", "left top, 0% 0%", "10% 20%, 30%, 40%", "top left, bottom right", "right bottom, left top", "0%", "0px", "30px", "0%, 10%, 20%, 30%", "top, top, top, top, top",
> +    initial_values: [ "left 50% top 50%", "left 50% center", "center", "center center", "50% 50%", "50% center", "center 50%" ],
> +    other_values: [ "top", "left", "right", "bottom", "center bottom", "bottom center", "center right", "right center", "center top", "top center", "center left", "left center", "right bottom", "bottom right", "0%", "top left, top left", "top left, top right", "top right, top left", "left top, 0% 0%", "10% 20%, 30%, 40%", "top left, bottom right", "right bottom, left top", "0%", "0px", "30px", "0%, 10%, 20%, 30%", "top, top, top, top, top",

Please add all of the values that are in the old initial_values list to the other_values list.
Attachment #8772786 - Flags: review?(dbaron) → review+
Attachment #8772785 - Attachment is obsolete: true
Attachment #8779735 - Attachment is obsolete: true
Attachment #8779736 - Flags: review+
Pushed by cku@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/32d0e1e159f0
Part 1. Set initial value of mask-position as center. r=dbaron.
https://hg.mozilla.org/integration/mozilla-inbound/rev/4ba8c9847083
Part 2. Correct mochitest. r=dbaron.
https://hg.mozilla.org/mozilla-central/rev/32d0e1e159f0
https://hg.mozilla.org/mozilla-central/rev/4ba8c9847083
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
https://hg.mozilla.org/integration/mozilla-inbound/rev/97140d66888d66135a39fbb9e8d8b94f56a5c007
Bug 1277788 - (follow-up) Part 3. correct typo(centerp -> center). r=me
https://hg.mozilla.org/integration/mozilla-inbound/rev/f823117225343b73be4df1ee89c904580d66d148
Bug 1277788 - (follow-up) Part 4. Correct the initial value of mask-position-x/y in property_database.js. r=me
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: