Revision 23ecf31d3486c72b4fda870b0a5b5de5340aafb9 authored by Timothy Gu on 19 October 2018, 20:46:11 UTC, committed by Chromium WPT Sync on 19 October 2018, 20:46:11 UTC
This change aligns document.open() with the current HTML Standard, which
mandates that in addition to setting the document's URL to the last-entered
document's, the document's current history item's URL must also be updated à la
history.replaceState().

To accomplish that, this CL reuses the logic in History::StateObjectAdded(),
including the throttling behavior, for Document::open() as well. The update
steps are run unconditionally, no matter what the document's current URL is, in
order to have consistent behavior for other things in the history entry like
POST form data, which document.open() now erases.

This also means that document.open() now also counts as a navigation, just like
history.replaceState(). Several browsertests are updated as such.

In this CL, we also enables some WPTs that were previously disabled; in
particular, reload.window.html has been enabled to converge to WebKit's
behavior.

Bug: 68833, 866274
Change-Id: Iea6d665fd97bcaee44bcfaa45f8e92c356003d8a
1 parent 64fed93
Raw File
unsupported-encodings.any.js
// META: title=Encoding API: unsupported encodings
// META: script=resources/decoding-helpers.js

// Attempting to decode '<' as UTF-7 (+AD4) ends up as '+AD4'.
['UTF-7', 'utf-7'].forEach(label => {
  decode_test(label, '+AD4', 'U+002B/U+0041/U+0044/U+0034',
              `${label} should not be supported`);
});

// UTF-32 will be detected as UTF-16LE if leading BOM, or windows-1252 otherwise.
['UTF-32', 'utf-32', 'UTF-32LE', 'utf-32le'].forEach(label => {
  decode_test(label,
              '%FF%FE%00%00%41%00%00%00%42%00%00%00',
              'U+0000/U+0041/U+0000/U+0042/U+0000',
              `${label} with BOM should decode as UTF-16LE`);

  decode_test(label,
              '%41%00%00%00%42%00%00%00',
              'U+0041/U+0000/U+0000/U+0000/U+0042/U+0000/U+0000/U+0000',
              `${label} with no BOM should decode as windows-1252`);;
});
['UTF-32be', 'utf-32be'].forEach(label => {
  decode_test(label,
            '%00%00%00%41%00%00%00%42',
            'U+0000/U+0000/U+0000/U+0041/U+0000/U+0000/U+0000/U+0042',
            `${label} with no BOM should decode as windows-1252`);

  decode_test(label,
              '%00%00%FE%FF%00%00%00%41%00%00%00%42',
              'U+0000/U+0000/U+00FE/U+00FF/U+0000/U+0000/U+0000/U+0041/U+0000/U+0000/U+0000/U+0042',
              `${label} with BOM should decode as windows-1252`);
});
back to top