Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[Extra zoom mode] Disabled adaptations are not reset upon mainframe n…
…avigation https://bugs.webkit.org/show_bug.cgi?id=185735 <rdar://problem/40335311> Reviewed by Tim Horton. Source/WebCore: When performing mainframe navigation, we currently don't update the Page's ViewportConfiguration's disabled adaptations. This causes disabled adaptations from the previous main document to persist. To fix this, propagate the new document's disabled adaptations to the client when it becomes the main document in the page. Test: fast/viewport/extrazoom/viewport-adaptations-after-navigation.html * dom/Document.cpp: (WebCore::Document::didBecomeCurrentDocumentInFrame): (WebCore::Document::processDisabledAdaptations): (WebCore::Document::dispatchDisabledAdaptationsDidChangeForMainFrame): * dom/Document.h: LayoutTests: Adds a new layout test that disables extra zoom mode adaptations, navigates to a new document, and checks that the innerWidth and innerHeight are reset to their expected (default) values. * fast/viewport/extrazoom/viewport-adaptations-after-navigation.html: Added. Canonical link: https://commits.webkit.org/201202@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231915 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
5 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] --> | ||
<html> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<head> | ||
<script src="../../../resources/ui-helper.js"></script> | ||
<style> | ||
body, html { | ||
margin: 0; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
</style> | ||
<script> | ||
async function runTest() { | ||
if (!window.testRunner) { | ||
description("Please use WebKitTestRunner to run this test."); | ||
return; | ||
} | ||
|
||
const matches = location.search.match(/previousSize=([0-9]+),([0-9]+)/); | ||
if (matches) { | ||
document.write(`previous size: (${parseInt(matches[1])}, ${parseInt(matches[2])}); current size: (${innerWidth}, ${innerHeight})`); | ||
testRunner.notifyDone(); | ||
return; | ||
} | ||
|
||
testRunner.dumpAsText(); | ||
testRunner.waitUntilDone(); | ||
|
||
const meta = document.createElement("meta"); | ||
meta.setAttribute("name", "disabled-adaptations"); | ||
meta.setAttribute("content", internals.extraZoomModeAdaptationName()); | ||
document.head.appendChild(meta); | ||
await UIHelper.ensureVisibleContentRectUpdate(); | ||
|
||
location.href += `?previousSize=${innerWidth},${innerHeight}`; | ||
} | ||
</script> | ||
</head> | ||
<body onload="runTest()"></body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters