Skip to content

Commit

Permalink
Add a WPT to check for standards mode plugin document
Browse files Browse the repository at this point in the history
The [1] PR will change the standard so that plugin documents
are in standard (no quirks) mode. This CL adds a test, as
much as this is testable. Some UAs display PDF documents
using "content that uses plugins" [2] while others use
"inline content that doesn't have a DOM [3]. This test will
pass in either case.

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
[2] https://html.spec.whatwg.org/#read-plugin
[3] https://html.spec.whatwg.org/#read-ua-inline

Bug: 1131185
Change-Id: Iccd1668199ac8b3b1c90a69b97a0adbaf8d02655
  • Loading branch information
mfreed7 authored and chromium-wpt-export-bot committed Jun 8, 2021
1 parent b7f425b commit 288e4f9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions html/browsers/browsing-the-web/read-plugin/load-plugin.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<title>Page load processing model for plugins</title>
<link rel="author" href="masonf@chromium.org">
<link rel="help" href="https://html.spec.whatwg.org/#read-plugin">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>

<object type="application/pdf" data="support/sandbox.pdf"></object>

<script>
const t = async_test("Checking document metadata for PDF file");
const obj = document.querySelector('object');
obj.onload = () => {
t.step(function() {
const doc = obj.contentDocument;
if (doc === null) {
// Some UA's render PDF as "inline content that doesn't have a DOM", which is ok
t.done();
} else {
assert_equals(doc.compatMode, "CSS1Compat");
assert_equals(doc.contentType, "application/pdf");
t.done();
}
});
};
</script>
Binary file not shown.

0 comments on commit 288e4f9

Please sign in to comment.