webdriver icon indicating copy to clipboard operation
webdriver copied to clipboard

base64 encoding a canvas does not actually specify base64 encoding

Open schmorp opened this issue 5 years ago • 2 comments

The algorithm for encoding a canvas element to abse64 effectively says to convert it into a data url and then remove the url part, leaving only the data part after the comma.

This is a weird way of specifying things (print does it much better, it simply says to base64 encode the pdf file - why not just say base64 encode the png file?).

The real problem is, however, that this does not result in base464 encoded data - the algorithm only says to encode it in "a" data url, but fails to enforce that it must be a base64 data url (as opposed to uri-escaped or any other encodings which are legal for data urls).

schmorp avatar Mar 27 '20 16:03 schmorp

We should fix this.

Could we reuse the Infra wording for forgiving base64-encode in both places?

andreastt avatar Mar 27 '20 21:03 andreastt

I hope you didn't ask me for the wording - but for what its worth that wording looks just fine to me :)

schmorp avatar Mar 27 '20 23:03 schmorp