Bug 82989

Summary: Auto-size may not work on first load
Product: WebKit Reporter: Andrei Burago <aburago>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, levin, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Archive of layout-test-results from ec2-cq-02
none
Archive of layout-test-results from ec2-cr-linux-01
none
Patch none

Description Andrei Burago 2012-04-02 17:46:46 PDT
Auto-size may not work on first load
Comment 1 Andrei Burago 2012-04-02 17:51:50 PDT
Created attachment 135246 [details]
Patch
Comment 2 WebKit Review Bot 2012-04-02 17:55:41 PDT
Attachment 135246 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/ChangeLog:8:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Andrei Burago 2012-04-02 17:59:22 PDT
Repro steps: 

1) Run Chrome and Install https://chrome.google.com/webstore/detail/gighmmpiobklfepjocnamgkkbiglidom
2.) left-click on the AdblockForChrome toolbar icon
3.) the pop-up menu is not completely to see.

TESTS: Manually repeat the repro steps

While layout is called from Document::implicitClose(), the tree does not seem to be ready. As soon as layout is called again for a different reason (activation, etc.) the layout results are back to normal.

This patch makes sure that the autosize does not shrink the visible area because of this temporary change in layout results.
Comment 4 David Levin 2012-04-02 18:12:59 PDT
Comment on attachment 135246 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=135246&action=review

>> Source/WebCore/ChangeLog:8
>> +        No new tests. (OOPS!)
> 
> You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]

What style queue said.

> Source/WebCore/dom/Document.cpp:2382
> +    m_processingLoadEvent = false;

There are two places where "return" is done above without setting this to false above.

I wonder if we should use TemporaryChange here (although that can be tricky because where you want to do the reset isn't the end of a scope, so you either need to create a new scope, add a method to reset it early or allocate a TemporaryChange into an OwnPtr and then clear it here).
Comment 5 David Levin 2012-04-02 18:13:25 PDT
Thank you very much for working on this!
Comment 6 Andrei Burago 2012-04-03 11:15:39 PDT
Created attachment 135370 [details]
Patch
Comment 7 David Levin 2012-04-03 11:18:46 PDT
Comment on attachment 135370 [details]
Patch

Thanks again!
Comment 8 WebKit Review Bot 2012-04-03 12:05:57 PDT
Comment on attachment 135370 [details]
Patch

Rejecting attachment 135370 [details] from commit-queue.

New failing tests:
fast/autoresize/turn-off-autoresize.html
fast/autoresize/basic.html
Full output: http://queues.webkit.org/results/12320323
Comment 9 WebKit Review Bot 2012-04-03 12:06:02 PDT
Created attachment 135385 [details]
Archive of layout-test-results from ec2-cq-02

The attached test failures were seen while running run-webkit-tests on the commit-queue.
Bot: ec2-cq-02  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 10 WebKit Review Bot 2012-04-03 13:03:06 PDT
Comment on attachment 135370 [details]
Patch

Attachment 135370 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12325241

New failing tests:
fast/autoresize/turn-off-autoresize.html
fast/autoresize/basic.html
Comment 11 WebKit Review Bot 2012-04-03 13:03:11 PDT
Created attachment 135403 [details]
Archive of layout-test-results from ec2-cr-linux-01

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: ec2-cr-linux-01  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 12 Andrei Burago 2012-04-04 14:30:49 PDT
Created attachment 135684 [details]
Patch
Comment 13 Andrei Burago 2012-04-04 18:10:19 PDT
Updated the patch. The previous version did not give the window a chance to shrink (if needed) when autosize was enabled on load.
Comment 14 WebKit Review Bot 2012-04-04 21:23:05 PDT
Comment on attachment 135684 [details]
Patch

Clearing flags on attachment: 135684

Committed r113287: <http://trac.webkit.org/changeset/113287>
Comment 15 WebKit Review Bot 2012-04-04 21:23:26 PDT
All reviewed patches have been landed.  Closing bug.