RESOLVED FIXED 102790
PageViewportControllerClient::didChangeViewportAttributes called twice
https://bugs.webkit.org/show_bug.cgi?id=102790
Summary PageViewportControllerClient::didChangeViewportAttributes called twice
Allan Sandfeld Jensen
Reported 2012-11-20 03:44:00 PST
Both PageViewportController::updateMinimumScaleToFit and PageViewportController::didChangeViewportAttributes calls didChangeViewportAttributes on the PageViewportControllerClient, and since the former calls the later this means we end up firing didChangeViewportAttributes twice on the client.
Attachments
Patch (3.78 KB, patch)
2012-11-20 03:46 PST, Allan Sandfeld Jensen
no flags
Patch (3.16 KB, patch)
2012-11-20 03:47 PST, Allan Sandfeld Jensen
no flags
Patch (3.44 KB, patch)
2012-11-20 06:59 PST, Allan Sandfeld Jensen
kenneth: review+
Allan Sandfeld Jensen
Comment 1 2012-11-20 03:46:32 PST
Allan Sandfeld Jensen
Comment 2 2012-11-20 03:47:42 PST
Created attachment 175182 [details] Patch Accidently uploaded unrelated change
Kenneth Rohde Christiansen
Comment 3 2012-11-20 04:48:38 PST
Comment on attachment 175182 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=175182&action=review > Source/WebKit2/UIProcess/PageViewportController.cpp:218 > + updateMinimumScaleToFit(false); wouldn't it be nicer if it returned a bool instead?
Allan Sandfeld Jensen
Comment 4 2012-11-20 04:57:39 PST
(In reply to comment #3) > (From update of attachment 175182 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=175182&action=review > > > Source/WebKit2/UIProcess/PageViewportController.cpp:218 > > + updateMinimumScaleToFit(false); > > wouldn't it be nicer if it returned a bool instead? Perhaps. I am fine with either way.
Andras Becsi
Comment 5 2012-11-20 05:36:19 PST
(In reply to comment #4) > (In reply to comment #3) > > (From update of attachment 175182 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=175182&action=review > > > > > Source/WebKit2/UIProcess/PageViewportController.cpp:218 > > > + updateMinimumScaleToFit(false); > > > > wouldn't it be nicer if it returned a bool instead? > > Perhaps. I am fine with either way. I also think returning a bool indicating whether it updated the minimum size or not is the preferred pattern instead of a bool argument.
Allan Sandfeld Jensen
Comment 6 2012-11-20 06:59:10 PST
Kenneth Rohde Christiansen
Comment 7 2012-11-20 07:58:29 PST
Comment on attachment 175209 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=175209&action=review > Source/WebKit2/UIProcess/PageViewportController.cpp:108 > + if (updateMinimumScaleToFit()) Maybe that should ahve IfNeeded() added?
Allan Sandfeld Jensen
Comment 8 2012-11-20 08:15:34 PST
(In reply to comment #7) > (From update of attachment 175209 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=175209&action=review > > > Source/WebKit2/UIProcess/PageViewportController.cpp:108 > > + if (updateMinimumScaleToFit()) > > Maybe that should ahve IfNeeded() added? I don't feel that is necessary for a method name starting with update, since update usually means to change something if needed.
Allan Sandfeld Jensen
Comment 9 2012-11-20 08:23:47 PST
Note You need to log in before you can comment on or make changes to this bug.