+ if ( canvas.toDataURL().length < 3000 ) {
+ return false;
+ }
+
+ context.clearRect( 0, 0, canvas.width, canvas.height );
+
+ /*
+ * Test for rainbow flag compatibility. As the rainbow flag was added out of sequence with
+ * the usual Unicode release cycle, some browsers support it, and some don't, even if their
+ * Unicode support is up to date.
+ *
+ * To test for support, we try to render it, and compare the rendering to how it would look if
+ * the browser doesn't render it correctly (white flag emoji + rainbow emoji).
+ */
+ context.fillText( stringFromCharCode( 55356, 57331, 65039, 8205, 55356, 57096 ), 0, 0 );
+ flag = canvas.toDataURL();
+
+ context.clearRect( 0, 0, canvas.width, canvas.height );
+
+ context.fillText( stringFromCharCode( 55356, 57331, 55356, 57096 ), 0, 0 );
+ flag2 = canvas.toDataURL();
+
+ return flag !== flag2;