Bug 82949

Summary: [chromium] Apply viewport tag initial-scale only once
Product: WebKit Reporter: Alexandre Elias <aelias>
Component: New BugsAssignee: Alexandre Elias <aelias>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, aelias, fishd, fsamuel, hausmann, kenneth, tomz, webkit.review.bot, zalan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 80554    
Bug Blocks: 66687    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch for landing
none
Patch for landing none

Description Alexandre Elias 2012-04-02 14:38:19 PDT
[chromium] Apply viewport tag initial-scale only once
Comment 1 Alexandre Elias 2012-04-02 14:44:47 PDT
Created attachment 135194 [details]
Patch
Comment 2 Fady Samuel 2012-04-02 14:48:19 PDT
This looks good to me. Do we know that isNewNavigation is only called on the first commit? Are there any other cases where it might get called?
Comment 3 Alexandre Elias 2012-04-02 15:00:40 PDT
Yes.  The only time isNewNavigation will be set is when m_observedNewNavigation is true, and grepping shows that this is only set by BackForwardListChromium::addItem().  The comment there says:

    // If WebCore adds a new HistoryItem, it means this is a new navigation (ie,
    // not a reload or back/forward).
    m_webView->observeNewNavigation();

This matches the behavior we want.
Comment 4 Darin Fisher (:fishd, Google) 2012-04-02 15:21:16 PDT
Comment on attachment 135194 [details]
Patch

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

> Source/WebKit/chromium/ChangeLog:9
> +        initial-scale.  We need to call dispatchViewportPropertiesDidChange()

funny character before "We"?

> Source/WebKit/chromium/ChangeLog:15
> +        isPageScaleFactorIsSet in didCommitLoad.  We only want to clear it on

again, funny character before "We"

> Source/WebKit/chromium/ChangeLog:17
> +        the user zooms in before the load is complete.

i'm not sure I completely understand the bug you are fixing.  what is your test case?
Comment 5 Alexandre Elias 2012-04-02 15:38:40 PDT
It's for when a user does a pinch or double-tap zoom while a slow-loading site hasn't finished loading.  I'll try and write a test case in WebFrameTest, as it's too racey to be tested reliably in DRT.
Comment 6 Alexandre Elias 2012-04-02 17:12:54 PDT
Created attachment 135234 [details]
Patch
Comment 7 Alexandre Elias 2012-04-02 17:14:53 PDT
OK, I wrote a test in WebFrameImpl and confirms it reliably fails if this patch is not applied.  It's an extension of the test I originally wrote for http://webk.it/80554 so to avoid conflicts I moved the whole test into this patch.
Comment 8 Alexandre Elias 2012-04-02 17:21:12 PDT
Created attachment 135238 [details]
Patch
Comment 9 Alexandre Elias 2012-04-02 17:21:53 PDT
Fixed copy-paste mistake.
Comment 10 Alexandre Elias 2012-04-13 13:43:42 PDT
Ping to review this CL and http://webk.it/80554 , as I believe they should be ready to submit now.
Comment 11 Adam Barth 2012-05-09 16:35:29 PDT
Comment on attachment 135238 [details]
Patch

I'm happy to R+ this given that Fady is happy and that you've added a test case.  Thanks for the patch.  (If I'm correct, we'll need to wait for Bug 80554 to land before we actually commit this change.)
Comment 12 Alexandre Elias 2012-05-09 16:40:16 PDT
(In reply to comment #11)
> (From update of attachment 135238 [details])
> I'm happy to R+ this given that Fady is happy and that you've added a test case.  Thanks for the patch.  (If I'm correct, we'll need to wait for Bug 80554 to land before we actually commit this change.)

Right, thanks for taking a look.  Feel free to r+ cq+ Bug 80554 first, then we can commit this one.
Comment 13 Kenneth Rohde Christiansen 2012-05-15 15:45:51 PDT
I am a bit afraid that removing this from FrameView will break Qt. I am cc'ing Zalan to see if this is the case.

Zalan it might make sense to write a autotest similar to the one apparently asserting for Chromium. That should be possible using my new UI side testing framework.
Comment 14 Kenneth Rohde Christiansen 2012-05-15 15:47:16 PDT
(In reply to comment #13)
> I am a bit afraid that removing this from FrameView will break Qt. I am cc'ing Zalan to see if this is the case.
> 
> Zalan it might make sense to write a autotest similar to the one apparently asserting for Chromium. That should be possible using my new UI side testing framework.

Sorry, I meant to comment in bug 80554 :-)
Comment 15 Tom Zakrajsek 2012-05-15 22:50:34 PDT
Kenneth, I think this can be cq+ now since Bug 80554 is resolved, but wasn't sure because of your comment https://bugs.webkit.org/show_bug.cgi?id=80554#c30.  What do you think?
Comment 16 Kenneth Rohde Christiansen 2012-05-16 00:11:33 PDT
Comment on attachment 135238 [details]
Patch

Fine with me
Comment 17 WebKit Review Bot 2012-05-16 00:14:23 PDT
Comment on attachment 135238 [details]
Patch

Rejecting attachment 135238 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
ded at 2973 (offset 21 lines).
patching file Source/WebKit/chromium/tests/WebFrameTest.cpp
Hunk #1 FAILED at 31.
Hunk #2 succeeded at 236 with fuzz 2 (offset 85 lines).
1 out of 2 hunks FAILED -- saving rejects to file Source/WebKit/chromium/tests/WebFrameTest.cpp.rej
patching file Source/WebKit/chromium/tests/data/fixed_layout.html

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'Adam Barth']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue/

Full output: http://queues.webkit.org/results/12694899
Comment 18 Adam Barth 2012-05-16 17:23:16 PDT
@Alex: That message from the commit-queue usually means that there's a conflict applying your patch to top-of-tree.  Would you be willing to upload a new version that resolves the conflict?  Thanks.
Comment 19 Alexandre Elias 2012-05-17 01:03:25 PDT
Created attachment 142438 [details]
Patch
Comment 20 Alexandre Elias 2012-05-17 01:05:23 PDT
Resolved conflict and added new viewportEnabled setting to unit test.
Comment 21 WebKit Review Bot 2012-05-22 18:03:23 PDT
Comment on attachment 142438 [details]
Patch

Rejecting attachment 142438 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
ded at 3102 (offset 129 lines).
patching file Source/WebKit/chromium/tests/WebFrameTest.cpp
Hunk #1 FAILED at 31.
Hunk #2 succeeded at 243 with fuzz 2 (offset 9 lines).
1 out of 2 hunks FAILED -- saving rejects to file Source/WebKit/chromium/tests/WebFrameTest.cpp.rej
patching file Source/WebKit/chromium/tests/data/fixed_layout.html

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'Adam Barth']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue/

Full output: http://queues.webkit.org/results/12772033
Comment 22 Adam Barth 2012-05-22 18:09:39 PDT
Looks like the conflict was in WebFrameTest.cpp.  I'll try to merge it.
Comment 23 Adam Barth 2012-05-22 18:28:41 PDT
Created attachment 143427 [details]
Patch for landing
Comment 24 Alexandre Elias 2012-05-22 18:29:38 PDT
Looks good, thanks!
Comment 25 WebKit Review Bot 2012-05-22 18:33:04 PDT
Attachment 143427 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit/chromium/ChangeLog', u'Sourc..." exit_code: 1
Source/WebKit/chromium/tests/WebFrameTest.cpp:50:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 26 Adam Barth 2012-05-22 18:59:28 PDT
Created attachment 143433 [details]
Patch for landing
Comment 27 WebKit Review Bot 2012-05-22 22:02:31 PDT
Comment on attachment 143433 [details]
Patch for landing

Clearing flags on attachment: 143433

Committed r118121: <http://trac.webkit.org/changeset/118121>
Comment 28 WebKit Review Bot 2012-05-22 22:02:38 PDT
All reviewed patches have been landed.  Closing bug.