Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: LayoutTests/fast/events/resize-events-fixed-layout.html

Issue 14766010: Clarify the size of a document view (a.k.a layout size) that causes FrameView to emit the resize ev… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Apply aellas's review Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/events/resize-events-fixed-layout.html
diff --git a/LayoutTests/fast/events/resize-events.html b/LayoutTests/fast/events/resize-events-fixed-layout.html
similarity index 53%
copy from LayoutTests/fast/events/resize-events.html
copy to LayoutTests/fast/events/resize-events-fixed-layout.html
index a4dd5d54106443bcb91c266d2e0294b1ddc24e39..e3f3155b7ad76735978a62f2b38fc10d874440a1 100644
--- a/LayoutTests/fast/events/resize-events.html
+++ b/LayoutTests/fast/events/resize-events-fixed-layout.html
@@ -14,34 +14,52 @@
</head>
<body>
<div>
- Test how many resize events are emitted during page load and dynamic content generation.
+ Following actions must not emit resize events: page load, dynamic content generation and page scaling.<br/>
+
+ When fixed layout is enabled, changing fixed layout size must emit resize event.<br/>
+
+ The spec DOM Level 2 Events states that the resize event occurs when document view size (a.k.a layout size) is changed. Refer to http://www.w3.org/TR/DOM-Level-2-Events/events.html<br/>
+ However, showing/hiding scrollbars shouldn't be considered a layout size change. Refer to webkit.org/b/80242<br/>
Do not resize the page. It invalidates the test.
<p style="text-indent: 10px" id=result1>
- Resize events (should be 0): <span id=count1>0</span>
+ Resize events (should be 1): <span id=count1>0</span>
</div>
<div id=expandingblock>
</div>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
+ testRunner.enableFixedLayoutMode(true);
+ testRunner.setFixedLayoutSize(700, 240);
testRunner.waitUntilDone();
}
function test() {
- setTimeout(addBlock, 20);
+ setTimeout(showScrollbar, 20);
}
- function addBlock() {
+ // Add many div blocks to increase document height more than view height.
+ function showScrollbar() {
for (var i = 0; i < 10; i++) {
var el = document.createElement('div');
el.setAttribute('class','block');
document.getElementById('expandingblock').appendChild(el);
}
+ setTimeout(scalePage, 20);
+ }
+ function scalePage() {
+ if (window.internals)
+ window.internals.setPageScaleFactor(3, 0, 0);
+ setTimeout(changeFixedLayoutSize, 20);
+ }
+ function changeFixedLayoutSize() {
+ if (window.testRunner)
+ testRunner.setFixedLayoutSize(1600, 1600);
setTimeout(finish, 20);
}
function finish() {
var result;
// No resize events are acceptable.
leviw_travelin_and_unemployed 2013/06/26 16:14:19 Ditto comment.
- if (resizecount < 1)
+ if (resizecount == 1)
result = '<p style="color: green">PASS';
else
result = '<p style="color: red">FAIL';

Powered by Google App Engine
This is Rietveld 408576698