canvas2d clearRect ignores clipping region

RESOLVED FIXED

Status

()

Core
Graphics
P3
normal
RESOLVED FIXED
2 years ago
5 months ago

People

(Reporter: neil.morrison44, Unassigned)

Tracking

({regression, testcase})

44 Branch
Unspecified
Mac OS X
regression, testcase
Points:
---

Firefox Tracking Flags

(firefox44- wontfix, firefox45- wontfix, firefox46 fixed, firefox-esr38 unaffected)

Details

(Whiteboard: gfx-noted)

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36

Steps to reproduce:

http://jsfiddle.net/wbf2930a/3/

within a canvas 2d context, begin a path, draw an arc, then clip(), clearRect an area containing the clipped region.

FireFox 44.0.2 on OSX El Capitan version 10.11.3


Actual results:

The entirety of the canvas will be cleared, not just the rect defined in clearRect.


Expected results:

The cleared area should have been limited to the clipped region.
(as happens in Chrome, Safari, IE etc)

Updated

2 years ago
Component: Untriaged → Canvas: 2D
Keywords: testcase
Product: Firefox → Core
(Reporter)

Updated

2 years ago
Version: 44 Branch → unspecified
Possibly same issue as bug 1248525.

it's already fixed in firefox 46, but firefox 44 and 45 are affected.

Regression range:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=e5746165c704a82fc92d059ef9303562d6b3c886&tochange=5ed72fdd632767e03d6862efd10fc15a34256845

and fixed by bug 1082598:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=d8e260e1535f0ff3877b21d6846380dedf449453&tochange=6630a176477ef903dcf3057db755abc43ba5018d
status-firefox44: --- → affected
status-firefox45: --- → affected
status-firefox46: --- → fixed
status-firefox-esr38: --- → unaffected
Component: Canvas: 2D → Graphics
Keywords: regression
OS: Unspecified → Mac OS X
[Tracking Requested - why for this release]: regression from enabling SkiaGL on Mac OS X (bug 1150944) and fixed with a Skia update in Firefox 46. As highlighted in bug 1248525 this is probably too risky to uplift and the alternative is turning off SkiaGL in Beta/Release. The work around is to simply use Developer Edition.
Blocks: 1150944
tracking-firefox44: --- → ?
tracking-firefox45: --- → ?
Whiteboard: gfx-noted
Version: unspecified → 44 Branch
Status: UNCONFIRMED → NEW
Ever confirmed: true
Same as in bug 1248525
status-firefox44: affected → wontfix
status-firefox45: affected → wontfix
tracking-firefox44: ? → -
tracking-firefox45: ? → -
(In reply to Sylvestre Ledru [:sylvestre] from comment #3)
> Same as in bug 1248525

Noting here as well that I had looked into this. I could not manage to isolat ea simple fix to backport for this one from the Skia update. So I agree on waiting for 46 for the fix to come in.

Comment 5

2 years ago
I have seen this in Firefox 44 and 45 with this simple use case: http://jsfiddle.net/6r63fan0/3/. It should show a red square with two overlapping white squares in the top left corner. But in firefox on two macs it just shows a white square. (but not on my linux machine).

the user agents and graphics cards for the machines I saw it on are below:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:45.0) Gecko/20100101 Firefox/45.0
AMD Radeon HD 6750M 512 MB

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:44.0) Gecko/20100101 Firefox/44.0
Intel HD Graphics 5000 (1536 MB VRAM)

Comment 6

2 years ago
A workaround that worked for me, is using globalCompositeOperation = 'destination-out' and using fillRect instead of clearRect.
Priority: -- → P3
Fixed since long ago in 46 with Skia update, and older branches than that are wontfix, so just closing this out.
Status: NEW → RESOLVED
Last Resolved: 5 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.