If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

B2G reftest runs have errors like "E/GeckoConsole( 812): [JavaScript Error: "The character encoding of the HTML document was not declared..." between each test, from data URI for "<!--CLEAR-->"

RESOLVED FIXED in mozilla21

Status

Testing
Reftest
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

Trunk
mozilla21
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
When glancing at an Android reftest run, I noticed lines like these between each test:
{
16:38:02     INFO -  E/GeckoConsole(  812): [JavaScript Error: "The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol." {file: "data:text/html,%3C%21%2D%2DCLEAR%2D%2D%3E" line: 0}]
}
https://tbpl.mozilla.org/php/getParsedLog.php?id=18943080&tree=Mozilla-Inbound 

That is for data:text/html,<!--CLEAR-->, which is hardcoded into the reftest harness to be loaded between each test. Sure enough, If I load that URI directly, I get a similar error spammed to the error console.

If I add <meta charset="UTF-8"> after <!--CLEAR-->, there's no error reported. I suggest we add this to the hardcoded URI in reftest.js, so that we save 1 line of JS-error-spam per test, in each reftest log.
(Assignee)

Comment 1

5 years ago
Created attachment 704184 [details] [diff] [review]
fix v1

This replaces <!--CLEAR--> with the following document:
<!DOCTYPE html><meta charset="UTF-8"><!--CLEAR-->

I added the DOCTYPE as well because view-source was complaining at me (highlighting <meta> in red) if I didn't declare a doctype. With that and the <meta> tag, both view-source and the error console are happy with this, so I think it should silence the JS-error-output.
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #704184 - Flags: review?(dbaron)
Comment on attachment 704184 [details] [diff] [review]
fix v1

With data URIs, I'd rather have the charset in the MIME type than in the contents, i.e., the properly-escaped version of:

data:text/html;charset=UTF-8,<!DOCTYPE HTML><!--CLEAR-->

r=dbaron with that (assuming it works)
Attachment #704184 - Flags: review?(dbaron) → review+
(Assignee)

Comment 3

5 years ago
That's cleaner, thanks! We won't need <!DOCTYPE html> after all then -- that was only to make the parser happy about the <meta> tag.

Also, it looks like semicolon, equals, dash, and comma characters in ";charset=UTF-8," have to be unescaped, or else it's not recognized (we still post an error-console warning and/or the page pops up a 'save' dialog because it doesn't get to correctly parsing the mimetype).  So I've left those unescaped.

So, the fix is literally to just insert ";charset=UTF-8" into the hardcoded string, just before the comma.

I'll push that later today.
(Assignee)

Comment 4

5 years ago
Try run, for the same platform/test-run as in comment 0, w/ the patch applied, has no character encoding errors reported, so I think that demonstrates that this works:
  https://tbpl.mozilla.org/php/getParsedLog.php?id=18965437&tree=Try
(Incidentally, I misspoke in comment 0 -- this is for b2g test-runs, not Android test-runs)
Summary: On Android, reftest runs trigger "E/GeckoConsole( 812): [JavaScript Error: "The character encoding of the HTML document was not declared..." between each test, from data URI for "<!--CLEAR-->" → B2G reftest runs have errors like "E/GeckoConsole( 812): [JavaScript Error: "The character encoding of the HTML document was not declared..." between each test, from data URI for "<!--CLEAR-->"
(Assignee)

Comment 5

5 years ago
Pushed: https://hg.mozilla.org/integration/mozilla-inbound/rev/1d122eaa9070
(Assignee)

Updated

5 years ago
Version: unspecified → Trunk
https://hg.mozilla.org/mozilla-central/rev/1d122eaa9070
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.