Skip to content

Commit

Permalink
Modify WPTs to check for standards mode documents
Browse files Browse the repository at this point in the history
The [1] PR will change the standard so that media and
text documents are in standard (no quirks) mode. This
CL updates the tests accordingly.

Chromium already made this change in code in Sept 2020
(see CLs on crbug.com/1131185) and found no compat
issues.

[1] whatwg/html#6745

Bug: 1131185
Change-Id: Ie5f5ae5eb802008bf27794c152620bdcc9948ba2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2945338
Auto-Submit: Mason Freed <masonf@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#889933}
  • Loading branch information
mfreed7 authored and chromium-wpt-export-bot committed Jun 7, 2021
1 parent 32407bd commit 7553bc7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
function frameLoaded() {
var testframe = document.getElementById('testframe');
assert_equals(testframe.contentDocument.contentType, "image/png");
assert_equals(testframe.contentDocument.compatMode, "CSS1Compat", "Media documents should be in standards mode");
var testframeChildren = testframe.contentDocument.body.childNodes;
assert_equals(testframeChildren.length, 1, "Body of image document has 1 child");
assert_equals(testframeChildren[0].nodeName, "IMG", "Only child of body must be an <img> element");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
var contentType = getMediaContentType(url);
testframe.onload = this.step_func_done(function() {
assert_equals(testframe.contentDocument.contentType, contentType);
assert_equals(testframe.contentDocument.compatMode, "CSS1Compat", "Media documents should be in standards mode");
var testframeChildren = testframe.contentDocument.body.childNodes;
assert_equals(testframeChildren.length, 1, "Body of image document has 1 child");
assert_equals(testframeChildren[0].nodeName, "VIDEO", "Only child of body must be an <video> element");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
iframe.onload = function(e) {
var doc = iframe.contentDocument;
t.step(function() {
assert_equals(doc.compatMode, "BackCompat");
assert_equals(doc.compatMode, "CSS1Compat");
assert_equals(doc.contentType, "text/plain");
assert_equals(doc.doctype, null);
t.done();
Expand Down

0 comments on commit 7553bc7

Please sign in to comment.