Closed Bug 1260094 Opened 7 years ago Closed 6 years ago

Implement margin-box value support for mask-origin and mask-clip properties.

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: bmo, Assigned: daoshengmu)

References

(Blocks 1 open bug, )

Details

Attachments

(2 files)

Per spec, need to support margin-box value parsing and computation and relevant rendering.

mask-origin: margin-box
https://www.w3.org/TR/css-masking-1/#valuedef-margin-box

mask-clip: margin-box
https://www.w3.org/TR/css-masking-1/#valuedef-margin-box0
Ref tests:
http://dsmu.me/css-masking/bug1260094/mask-clip-margin-box.html
http://dsmu.me/css-masking/bug1260094/mask-origin-margin-box.html

Using -webkit-mask-image can't get my mask image. Probably, it is not be supported...
(In reply to Daosheng Mu[:daoshengmu] from comment #1)
> Ref tests:
> http://dsmu.me/css-masking/bug1260094/mask-clip-margin-box.html
> http://dsmu.me/css-masking/bug1260094/mask-origin-margin-box.html
> 
> Using -webkit-mask-image can't get my mask image. Probably, it is not be
> supported...

In current implementation, mask-repeat initial value is set to repeat instead of no-repeat, this is why in your test cases the masking is not working as expected. You can refer to bug1258623 for more details.
Update the ref test to the new link, http://dsmu.me/css-masking/bug1260094/mask-clip_origin-margin-box.html.

I have confirmed -webkit-mask-image is not supported in FF 48, but Chrome and Safari are good.

Regarding to mask-origin and mask-clip, Chrome and Safari are only supported border-box, FF is still waiting for implementation.
Assignee: nobody → dmu
In nsCSSRendering::GetImageLayerClip, the aClipState->mBGClipArea has been clipped without referring the background-clip attribute. So, when I change the clip rect, the image is shifted but the visible region is still like before. 

The bounds of nsDisplayBackgroundImage get from nsBackgroundLayerState.mFillArea. We need to make it handle background-clip attribute internally.
(In reply to Daosheng Mu[:daoshengmu] from comment #3)
> Update the ref test to the new link,
> http://dsmu.me/css-masking/bug1260094/mask-clip_origin-margin-box.html.

This test seems to show that Chrome does NOT support -webkit-mask-origin: margin-box.  But I don't see how the test would do anything differently if -webkit-mask-clip: margin-box were supported.

(I'd also note that background-origin does not have a margin-box value.)

> Regarding to mask-origin and mask-clip, Chrome and Safari are only supported
> border-box, FF is still waiting for implementation.

I'm not quite sure what you mean here, but if Chrome and Safari don't support the margin-box value, then it might make more sense to ask for the spec not to include the value, rather than spending work on implementing it.  Do they support margin-box?
(In reply to David Baron [:dbaron] ⌚️UTC-7 (review requests must explain patch) from comment #6)
> (In reply to Daosheng Mu[:daoshengmu] from comment #3)
> > Update the ref test to the new link,
> > http://dsmu.me/css-masking/bug1260094/mask-clip_origin-margin-box.html.
> 
> This test seems to show that Chrome does NOT support -webkit-mask-origin:
> margin-box.  But I don't see how the test would do anything differently if
> -webkit-mask-clip: margin-box were supported.
> 
> (I'd also note that background-origin does not have a margin-box value.)
> 
> > Regarding to mask-origin and mask-clip, Chrome and Safari are only supported
> > border-box, FF is still waiting for implementation.
> 
> I'm not quite sure what you mean here, but if Chrome and Safari don't
> support the margin-box value, then it might make more sense to ask for the
> spec not to include the value, rather than spending work on implementing it.
> Do they support margin-box?

Indeed, Chrome and Safari don't support margin-box value on mask-origin and mask-clip. We should stop implementing this bug and ask for modifying the spec.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.