Closed
Bug 1119527
Opened 10 years ago
Closed 10 years ago
Implement clearHitRegions
Categories
(Core :: Graphics: Canvas2D, defect)
Core
Graphics: Canvas2D
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: fs, Assigned: fs)
References
(Blocks 1 open bug, )
Details
(Keywords: dev-doc-complete, Whiteboard: [parity-blink] gfx-noted)
Attachments
(1 file, 1 obsolete file)
void ctx.clearHitRegions() was added to canvas in https://html5.org/r/8747
"When the clearHitRegions() method is invoked, the user agent must remove all the hit regions from the rendering context's scratch bitmap's hit region list."
MDN https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.clearHitRegions
Assignee | ||
Comment 1•10 years ago
|
||
Assignee | ||
Comment 2•10 years ago
|
||
I usually only document and not implement features, but I thought I give this a shot. Feel free to tweak as needed or let me know what to do here.
Comment 3•10 years ago
|
||
Comment on attachment 8546293 [details] [diff] [review]
bug1119527.patch
Review of attachment 8546293 [details] [diff] [review]:
-----------------------------------------------------------------
Drive by feedback...
::: dom/canvas/CanvasRenderingContext2D.cpp
@@ +3232,5 @@
>
> +void
> +CanvasRenderingContext2D::ClearHitRegions()
> +{
> + mHitRegionsOptions.ClearAndRetainStorage();
Why not just Clear()?
::: dom/canvas/test/test_hitregion_canvas.html
@@ +39,5 @@
> ctx.removeHitRegion("b");
> +
> + ctx.addHitRegion("x");
> + ctx.addHitRegion("y");
> + ctx.clearHitRegions();
I don't think there are regions x and y - I'd just add clearHitRegions() after all the removes - to test if clear works properly when there are no regions, but also copy the whole try{} and do clear instead of the three removes, to test the clear when there are valid regions around.
Updated•10 years ago
|
Whiteboard: [parity-blink] → [parity-blink] gfx-noted
Assignee | ||
Comment 4•10 years ago
|
||
Attachment #8546293 -
Attachment is obsolete: true
Assignee | ||
Comment 5•10 years ago
|
||
(In reply to Milan Sreckovic [:milan] from comment #3)
> > + mHitRegionsOptions.ClearAndRetainStorage();
>
> Why not just Clear()?
>
No idea, I found that in CanvasRenderingContext2D::Reset() and thought it would do the right thing.
https://dxr.mozilla.org/mozilla-central/source/dom/canvas/CanvasRenderingContext2D.cpp#1037
Changed to just Clear() which seems to make more sense.
> I don't think there are regions x and y - I'd just add clearHitRegions()
> after all the removes - to test if clear works properly when there are no
> regions, but also copy the whole try{} and do clear instead of the three
> removes, to test the clear when there are valid regions around.
Done.
Updated•10 years ago
|
Attachment #8546729 -
Flags: review?(gwright)
Attachment #8546729 -
Flags: feedback+
Updated•10 years ago
|
Attachment #8546729 -
Flags: review?(gwright) → review+
Assignee | ||
Comment 7•10 years ago
|
||
I have no try server access. Could someone push that for me? :)
Comment 8•10 years ago
|
||
Assignee | ||
Comment 9•10 years ago
|
||
If I interpret the try run correctly, it looks all good. Setting checkin-needed.
Keywords: checkin-needed
Comment 10•10 years ago
|
||
this need Dom peer review for the change in WebIDL file dom/webidl/CanvasRenderingContext2D.webidl
Flags: needinfo?(fscholz)
Keywords: checkin-needed
Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(fscholz)
Attachment #8546729 -
Flags: review?(bzbarsky)
Comment 11•10 years ago
|
||
Attachment #8546729 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 12•10 years ago
|
||
Flags: in-testsuite+
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Assignee | ||
Comment 14•10 years ago
|
||
https://developer.mozilla.org/en-US/Firefox/Releases/38#Interfaces.2FAPIs.2FDOM
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.clearHitRegions
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•