Make CanvasRenderingContext2D use WebIDL unions / Variants for createPattern and drawImage
Created attachment 295475 [details] Patch
Comment on attachment 295475 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=295475&action=review r=me but please check GTK/EFL build. > Source/WebCore/html/canvas/CanvasRenderingContext2D.idl:137 > + // FIXME: All the unrestricted float arguments below should be unrestricted doubles. I think we can get away with doing this change in tis patch (only in the IDL).
Comment on attachment 295475 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=295475&action=review Some compilation problems with gcc on the GTK and EFL bots. Not sure what’s going on there. Maybe [&] isn’t supposed to capture "this"? > Source/WebCore/html/canvas/CanvasRenderingContext2D.h:58 > +using CanvasImageSource = Variant<RefPtr<HTMLImageElement>, RefPtr<HTMLVideoElement>, RefPtr<HTMLCanvasElement>>; So sad that these all have to be RefPtr, when none are allowed to be null.
Created attachment 295501 [details] Patch
Created attachment 295539 [details] Patch
(In reply to comment #3) > Comment on attachment 295475 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=295475&action=review > > Some compilation problems with gcc on the GTK and EFL bots. Not sure what’s > going on there. Maybe [&] isn’t supposed to capture "this"? It's a GCC bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61636) I can work around it using an explicit this->. > > > Source/WebCore/html/canvas/CanvasRenderingContext2D.h:58 > > +using CanvasImageSource = Variant<RefPtr<HTMLImageElement>, RefPtr<HTMLVideoElement>, RefPtr<HTMLCanvasElement>>; > > So sad that these all have to be RefPtr, when none are allowed to be null. Yeah, it's something I would like to improve at some point, but I am not quite sure how yet.
Committed r209048: <http://trac.webkit.org/changeset/209048>