Closed
Bug 759726
Opened 13 years ago
Closed 13 years ago
Make nsICanvasRenderingContextInternal::SetCanvasElement return void
Categories
(Core :: Graphics: Canvas2D, defect)
Core
Graphics: Canvas2D
Tracking
()
RESOLVED
FIXED
mozilla16
People
(Reporter: Ms2ger, Assigned: Ms2ger)
Details
Attachments
(1 file)
51.98 KB,
patch
|
bjacob
:
review+
bzbarsky
:
feedback+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•13 years ago
|
||
I ended up doing a bit more.
Attachment #629787 -
Flags: review?(bjacob)
Assignee | ||
Updated•13 years ago
|
Attachment #629787 -
Flags: feedback?(bzbarsky)
![]() |
||
Comment 2•13 years ago
|
||
Comment on attachment 629787 [details] [diff] [review]
Patch v1
Looks good to me.
Attachment #629787 -
Flags: feedback?(bzbarsky) → feedback+
Comment 3•13 years ago
|
||
Comment on attachment 629787 [details] [diff] [review]
Patch v1
Review of attachment 629787 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/canvas/public/nsICanvasRenderingContextInternal.h
@@ +47,5 @@
> };
>
> + void SetCanvasElement(nsHTMLCanvasElement* aParentCanvas)
> + {
> + mCanvasElement = aParentCanvas;
This is making me nervous: there was this comment saying exactly to NOT do this, but not explaining why that would be a bad thing; now you're doing this; I need an explanation.
Comment 4•13 years ago
|
||
Comment on attachment 629787 [details] [diff] [review]
Patch v1
Review of attachment 629787 [details] [diff] [review]:
-----------------------------------------------------------------
r=me modulo a nontrivial question about the removed do_QueryInterface. Also some style nits, not duplicated everywhere where they apply. Note that comments/questions on the xxx2d file apply as well to the xxx2dAzure file.
::: content/canvas/src/nsCanvasRenderingContext2D.cpp
@@ +839,5 @@
> nsresult rv;
> nscolor color;
>
> if (!aStr.IsVoid()) {
> + nsIDocument* document = mCanvasElement ? mCanvasElement->OwnerDoc() : nsnull;
Suggest MFBT style:
x = a
? b
: c;
@@ +2434,5 @@
> * string is equal to the old one.
> */
>
> + if (!mCanvasElement && !mDocShell) {
> + NS_WARNING("Canvas element must be non-null or a docshell must be provided");
If this case is a plain c++ coding mistake (which I don't know) then this should be a fatal-in-debug assert.
@@ +2812,5 @@
> // arg, and there is no way to tell if the default was used
> if (aMaxWidth < 0)
> return NS_ERROR_INVALID_ARG;
>
> + if (!mCanvasElement && !mDocShell) {
Was the do_QueryInterface useless?
Attachment #629787 -
Flags: review?(bjacob) → review+
Assignee | ||
Comment 5•13 years ago
|
||
<Ms2ger> sorta, mCanvasElement was an nsIDOMHTMLCanvasElement
<Ms2ger> It could have used HTMLCanvasElement()
Assignee | ||
Comment 6•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in
before you can comment on or make changes to this bug.
Description
•