Unwrap to dom::Element instead of nsIDOMElement in texSubImage2D/texImage2D

RESOLVED DUPLICATE of bug 730554

Status

()

Core
Canvas: WebGL
RESOLVED DUPLICATE of bug 730554
6 years ago
6 years ago

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

6 years ago
After bug 704088, that's all we need in WebGLContext::{TexSubImage2D_dom,TexImage2D_dom}.
(Assignee)

Comment 1

6 years ago
Created attachment 584403 [details] [diff] [review]
Unwrap to dom::Element instead of nsIDOMElement in texSubImage2D/texImage2D;
Attachment #584403 - Flags: review?(bzbarsky)
Comment on attachment 584403 [details] [diff] [review]
Unwrap to dom::Element instead of nsIDOMElement in texSubImage2D/texImage2D;

This looks ok, but we can speed this up even more by adding a dom::Element specialization of xpc_qsUnwrapArg, right?  Should be pretty easy...
Attachment #584403 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 3

6 years ago
Doesn't bug 563659 make that hard? (There is a specialization for nsGenericElement, but that unwraps to nsIContent first, so I don't see how it would be much of an improvement.)
> (There is a specialization for nsGenericElement, but that unwraps to nsIContent first,
> so I don't see how it would be much of an improvement.)

It's an improvement because unrwapping to nsIContent does the fast-path unwrap using castNativeFromWrapper instead of having to call QueryInterface (which is what unwrap to dom::Element has to do right now).

So adding a specialization for dom::Element that looks just like the nsGenericElement one would be a win.
(Assignee)

Comment 5

6 years ago
Created attachment 584812 [details] [diff] [review]
Part b: dom::Element specialization

Ah, that was the missing bit. I did xpc_qsUnwrapThis as well while I was there. (Never mind the NS_SPECIALIZE_TEMPLATE bits, this is an old tree without bug 706010.)
Attachment #584812 - Flags: review?(bzbarsky)
Comment on attachment 584812 [details] [diff] [review]
Part b: dom::Element specialization

r=me
Attachment #584812 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 7

6 years ago
Applying the two patches causes crashes in M1:

https://tbpl.mozilla.org/?tree=Try&rev=ef8775dc7503

And just the first gives timeouts:

https://tbpl.mozilla.org/?tree=Try&rev=09222a9f4307
(Assignee)

Comment 8

6 years ago
I guess the timeouts were because of the "if (NS_FAILED(rv)) return JS_FALSE;", which triggered because we were no longer unwrapping to a scriptable interface.

Anyway, fixed in bug 730554.
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 730554
You need to log in before you can comment on or make changes to this bug.