RESOLVED FIXED 77452
[chromium] Add the ability to turn off autoresize.
https://bugs.webkit.org/show_bug.cgi?id=77452
Summary [chromium] Add the ability to turn off autoresize.
David Levin
Reported 2012-01-31 10:24:00 PST
[chromium] Add the ability to turn off autoresize.
Attachments
Patch (7.15 KB, patch)
2012-01-31 10:28 PST, David Levin
no flags
Patch (10.15 KB, patch)
2012-01-31 10:54 PST, David Levin
no flags
Patch (11.05 KB, patch)
2012-02-27 17:32 PST, David Levin
no flags
Patch (11.18 KB, patch)
2012-02-28 15:05 PST, David Levin
no flags
Patch (13.39 KB, patch)
2012-02-28 22:52 PST, David Levin
no flags
Patch (1.73 KB, patch)
2012-03-01 03:20 PST, Kentaro Hara
no flags
David Levin
Comment 1 2012-01-31 10:28:08 PST
WebKit Review Bot
Comment 2 2012-01-31 10:32:47 PST
Attachment 124770 [details] did not pass style-queue: Failed to run "['Tools/Scripts/update-webkit']" exit_code: 9 Updating OpenSource First, rewinding head to replay your work on top of it... Applying: Fix compilation errors on build-webkit --debug --no-workers on mac. Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... Auto-merging LayoutTests/ChangeLog CONFLICT (content): Merge conflict in LayoutTests/ChangeLog Auto-merging LayoutTests/platform/qt/Skipped CONFLICT (content): Merge conflict in LayoutTests/platform/qt/Skipped Auto-merging Source/WebCore/ChangeLog CONFLICT (content): Merge conflict in Source/WebCore/ChangeLog Failed to merge in the changes. Patch failed at 0001 Fix compilation errors on build-webkit --debug --no-workers on mac. When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". To restore the original branch and stop rebasing run "git rebase --abort". rebase refs/remotes/origin/master: command returned error: 1 Died at Tools/Scripts/update-webkit line 164. If any of these errors are false positives, please file a bug against check-webkit-style.
David Levin
Comment 3 2012-01-31 10:54:08 PST
WebKit Review Bot
Comment 4 2012-01-31 10:56:17 PST
Attachment 124775 [details] did not pass style-queue: Failed to run "['Tools/Scripts/update-webkit']" exit_code: 9 Updating OpenSource First, rewinding head to replay your work on top of it... Applying: Fix compilation errors on build-webkit --debug --no-workers on mac. Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... Auto-merging LayoutTests/ChangeLog CONFLICT (content): Merge conflict in LayoutTests/ChangeLog Auto-merging LayoutTests/platform/qt/Skipped CONFLICT (content): Merge conflict in LayoutTests/platform/qt/Skipped Auto-merging Source/WebCore/ChangeLog CONFLICT (content): Merge conflict in Source/WebCore/ChangeLog Failed to merge in the changes. Patch failed at 0001 Fix compilation errors on build-webkit --debug --no-workers on mac. When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". To restore the original branch and stop rebasing run "git rebase --abort". rebase refs/remotes/origin/master: command returned error: 1 Died at Tools/Scripts/update-webkit line 164. If any of these errors are false positives, please file a bug against check-webkit-style.
Dmitry Titov
Comment 5 2012-01-31 11:54:20 PST
Comment on attachment 124775 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=124775&action=review Couple of questions (perhaps just needs clarification): > Source/WebKit/chromium/src/WebViewImpl.cpp:2120 > + ASSERT(!m_shouldAutoResize || minSize == maxSize); I would understand: ASSERT(enable || minSize == maxSize); .. because it would check incoming parameters for consistency. > Source/WebKit/chromium/src/WebViewImpl.cpp:2131 > + resize(m_minAutoSize); It would be good to add a comment describing the mechanism of turning off auto-resize, to clarify why the 'new size' parameter and a resize to it is needed. Otherwise, first look at API brings a question, why not have: enableAutoSize(minSize, maxSize) disableAutoSize() // w/o prameters since when auto-resize if off, the layout should be seeded with the current window size...
David Levin
Comment 6 2012-02-27 17:32:04 PST
WebKit Review Bot
Comment 7 2012-02-27 17:35:32 PST
Please wait for approval from fishd@chromium.org before submitting because this patch contains changes to the Chromium public API.
WebKit Review Bot
Comment 8 2012-02-27 20:28:00 PST
Comment on attachment 129146 [details] Patch Attachment 129146 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11647330 New failing tests: fast/autoresize/turn-off-autoresize.html
Darin Fisher (:fishd, Google)
Comment 9 2012-02-27 22:24:38 PST
Comment on attachment 129146 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=129146&action=review > Source/WebKit/chromium/public/WebView.h:261 > + // content within the given bounds. When turning off auto-resize, the why require this? it seems more sensible for this function to ignore min/maxSize when disabling auto-resize mode as that is telling the WebView to do nothing special. doesn't the WebView already know its size?
David Levin
Comment 10 2012-02-28 15:05:19 PST
David Levin
Comment 11 2012-02-28 15:21:42 PST
(In reply to comment #9) > (From update of attachment 129146 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=129146&action=review > > > Source/WebKit/chromium/public/WebView.h:261 > > + // content within the given bounds. When turning off auto-resize, the > > why require this? it seems more sensible for this function to ignore min/maxSize > when disabling auto-resize mode as that is telling the WebView to do nothing special. > doesn't the WebView already know its size? When autoresize is off initially, all sizing is driven by the RenderViewHost. When autoresize is on, all sizing is driven by the WebView. When autoresize is turned off, there may be resize changes in flight from the WebView to the RenderViewHost, so they may be out of sync. By setting the size on the WebView, we start the process of having the RenderViewHost drive the sizing again (and this size change will propagate back to RenderWidgetHostImpl::OnMsgUpdateRect as needed so that everything gets in sync). I hope that makes sense. (Let me know if I should improve the comment where I tried to explain this.) (The latest patch only changes the description text in the test to match changes done to the html so now it will pass.)
Darin Fisher (:fishd, Google)
Comment 12 2012-02-28 15:26:20 PST
(In reply to comment #11) > (In reply to comment #9) > > (From update of attachment 129146 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=129146&action=review > > > > > Source/WebKit/chromium/public/WebView.h:261 > > > + // content within the given bounds. When turning off auto-resize, the > > > > why require this? it seems more sensible for this function to ignore min/maxSize > > when disabling auto-resize mode as that is telling the WebView to do nothing special. > > doesn't the WebView already know its size? > > When autoresize is off initially, all sizing is driven by the RenderViewHost. > > When autoresize is on, all sizing is driven by the WebView. > > When autoresize is turned off, there may be resize changes in flight from the WebView to the RenderViewHost, so they may be out of sync. By setting the size on the WebView, we start the process of having the RenderViewHost drive the sizing again (and this size change will propagate back to RenderWidgetHostImpl::OnMsgUpdateRect as needed so that everything gets in sync). > > I hope that makes sense. (Let me know if I should improve the comment where I tried to explain this.) > > (The latest patch only changes the description text in the test to match changes done to the html so now it will pass.) Would an alternative be for the embedder to call WebWidget::resize() after disabling auto-size mode?
David Levin
Comment 13 2012-02-28 15:28:16 PST
(In reply to comment #12) > (In reply to comment #11) > > (In reply to comment #9) > > > (From update of attachment 129146 [details] [details] [details]) > > > View in context: https://bugs.webkit.org/attachment.cgi?id=129146&action=review > > > > > > > Source/WebKit/chromium/public/WebView.h:261 > > > > + // content within the given bounds. When turning off auto-resize, the > > > > > > why require this? it seems more sensible for this function to ignore min/maxSize > > > when disabling auto-resize mode as that is telling the WebView to do nothing special. > > > doesn't the WebView already know its size? > > > > When autoresize is off initially, all sizing is driven by the RenderViewHost. > > > > When autoresize is on, all sizing is driven by the WebView. > > > > When autoresize is turned off, there may be resize changes in flight from the WebView to the RenderViewHost, so they may be out of sync. By setting the size on the WebView, we start the process of having the RenderViewHost drive the sizing again (and this size change will propagate back to RenderWidgetHostImpl::OnMsgUpdateRect as needed so that everything gets in sync). > > > > I hope that makes sense. (Let me know if I should improve the comment where I tried to explain this.) > > > > (The latest patch only changes the description text in the test to match changes done to the html so now it will pass.) > > Would an alternative be for the embedder to call WebWidget::resize() after disabling auto-size mode? They could do that but if they didn't, who knows what would happen. I could also separate this api into enable and disable. Get rid of the bool and make disable take "new_size".
Darin Fisher (:fishd, Google)
Comment 14 2012-02-28 16:31:37 PST
(In reply to comment #13) > I could also separate this api into enable and disable. Get rid of the bool and make disable take "new_size". That sounds pretty good to me. I know it means more busy work though :-(
David Levin
Comment 15 2012-02-28 22:52:15 PST
David Levin
Comment 16 2012-02-28 22:56:58 PST
(In reply to comment #14) > (In reply to comment #13) > > I could also separate this api into enable and disable. Get rid of the bool and make disable take "new_size". > > That sounds pretty good to me. I know it means more busy work though :-( All done. I though about the resize being combined with disabling auto-resize. It really only happens due to the fact that chromium has multiple processes but the WebKit api has no notion of that, so I moved the resize to the chromium side of things and out of the WebKit api (which can be seen here https://chromiumcodereview.appspot.com/9517010/).
David Levin
Comment 17 2012-02-29 17:31:39 PST
Kentaro Hara
Comment 18 2012-03-01 03:13:48 PST
Comment on attachment 129393 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=129393&action=review > Source/WebKit/chromium/src/WebViewImpl.cpp:2285 > + enableAutoResizeMode(enable, minSize, maxSize); webkit_unit_tests start to fail. I guess the failure is due to this line. The line should be enableAutoResizeMode(minSize, maxSize);
Kentaro Hara
Comment 19 2012-03-01 03:19:58 PST
Reopening to attach new patch.
Kentaro Hara
Comment 20 2012-03-01 03:20:02 PST
Hajime Morrita
Comment 21 2012-03-01 03:24:00 PST
Comment on attachment 129675 [details] Patch r=me
WebKit Review Bot
Comment 22 2012-03-01 05:43:09 PST
Comment on attachment 129675 [details] Patch Rejecting attachment 129675 [details] from commit-queue. New failing tests: fast/workers/storage/use-same-database-in-page-and-workers.html Full output: http://queues.webkit.org/results/11770436
David Levin
Comment 23 2012-03-01 08:01:30 PST
(In reply to comment #18) > (From update of attachment 129393 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=129393&action=review > > > Source/WebKit/chromium/src/WebViewImpl.cpp:2285 > > + enableAutoResizeMode(enable, minSize, maxSize); > > webkit_unit_tests start to fail. I guess the failure is due to this line. The line should be > > enableAutoResizeMode(minSize, maxSize); Wow. Thanks for figuring that out. (You could have just rolled it out too and left it for me.)
WebKit Review Bot
Comment 24 2012-03-01 09:15:18 PST
Comment on attachment 129675 [details] Patch Clearing flags on attachment: 129675 Committed r109350: <http://trac.webkit.org/changeset/109350>
WebKit Review Bot
Comment 25 2012-03-01 09:15:27 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.