Closed
Bug 1119527
Opened 9 years ago
Closed 9 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•9 years ago
|
||
Assignee | ||
Comment 2•9 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 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•9 years ago
|
Whiteboard: [parity-blink] → [parity-blink] gfx-noted
Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8546293 -
Attachment is obsolete: true
Assignee | ||
Comment 5•9 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•9 years ago
|
Attachment #8546729 -
Flags: review?(gwright)
Attachment #8546729 -
Flags: feedback+
Updated•9 years ago
|
Attachment #8546729 -
Flags: review?(gwright) → review+
A try run and this should be ready to go...
Assignee: nobody → fscholz
Assignee | ||
Comment 7•9 years ago
|
||
I have no try server access. Could someone push that for me? :)
Assignee | ||
Comment 9•9 years ago
|
||
If I interpret the try run correctly, it looks all good. Setting checkin-needed.
Keywords: checkin-needed
Comment 10•9 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•9 years ago
|
Flags: needinfo?(fscholz)
Attachment #8546729 -
Flags: review?(bzbarsky)
![]() |
||
Comment 11•9 years ago
|
||
Comment on attachment 8546729 [details] [diff] [review] bug1119527.patch r=me
Attachment #8546729 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 12•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/a0f3db72a62c
Flags: in-testsuite+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/a0f3db72a62c
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Assignee | ||
Comment 14•9 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
•