Closed Bug 1533491 Opened 2 years ago Closed 1 year ago

CSS "clip-path" doesn't work (clips everything?) inside marker

Categories

(Core :: SVG, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox67 --- wontfix
firefox68 --- fixed

People

(Reporter: dholbert, Assigned: violet.bugreport)

References

Details

Attachments

(3 files)

STR:

  1. Load attached testcase.

EXPECTED RESULTS:
Three rects: skinny, square, skinny.

ACTUAL RESULTS:
Only the top rect is visible (the one that's not in a marker).

NOTES:
The first and third rect use the same clip-path; the only difference is that the third one is inside of a marker.

The second rect (also inside of a marker) uses a trivial clip-path, "inset(0px)", which clips away everything even though it shouldn't clip anything.

Chrome gives EXPECTED RESULTS.
Firefox gives ACTUAL RESULTS.
Edge/Safari don't do any clipping at all. (They render 3 squares).

Here's another testcase, which is expected to render the same as the first (but produces the same bad results).

This one uses 'polygon' to do the clipping on the first and third rect, and fill-box to produce a trivial no-op clipping region for the second rect.

Priority: -- → P3

This may be a version of (or related to) bug 1323962... Maybe we implement CSS clip-path in a way that depends on display lists, which means indirectly rendered things don't work with it? (not sure)

Anyway, adding dependency for now.

Depends on: 1323962

Note: bug 1323962 is now fixed in latest Nightly (2019-04-23), but I'm still seeing the same "ACTUAL RESULTS" on the testcases in this bug here.

So, this was not a duplicate of bug 1323962 [though I had suspected it might be].

violet.bugreport: if you're looking for other similar bugs, perhaps this one might interest you. :)

Assignee: nobody → violet.bugreport
Status: NEW → ASSIGNED
See Also: → 1546636

The cause is that nsCSSClipPathInstance::ApplyBasicShapeOrPathClip fails to consider transforms under a certain code path. However, even if it's fixed, there is still a missing box in testcase2, because clip-path: fill-box is simply not implemented (https://searchfox.org/mozilla-central/source/layout/svg/nsCSSClipPathInstance.cpp#97). Filed a new bug as "See Also".

nsSVGUtils::PaintFrameWithEffects needs to pass its transform to
nsCSSClipPathInstance::ApplyBasicShapeOrPathClip so that the latter
can compute the correct box.

Pushed by violet.bugreport@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/2a3c00a2d761
nsCSSClipPathInstance::ApplyBasicShapeOrPathClip should consider transform r=longsonr
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.