Bug 92490

Summary: [Qt]REGRESSION(r123786): It made 3 fast/animation tests fail
Product: WebKit Reporter: János Badics <jbadics>
Component: Tools / TestsAssignee: Zeno Albisser <zeno>
Status: RESOLVED FIXED    
Severity: Normal CC: bank, dglazkov, jbadics, jturcotte, kadam, noam, ossy, szledan, webkit.review.bot, zeno
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 79666    
Attachments:
Description Flags
patch for review.
noam: review-
patch for review.
none
patch
none
patch
none
Archive of layout-test-results from gce-cr-linux-06
none
patch for testing with cr-linux.
ossy: commit-queue-
patch for landing. - Unskip affected tests as well. none

Description János Badics 2012-07-27 04:50:58 PDT
fast/animation/request-animation-frame-cancel2.html :

--- /ramdisk/qt-linux-64-release/build/layout-test-results/fast/animation/request-animation-frame-cancel2-expected.txt 
+++ /ramdisk/qt-linux-64-release/build/layout-test-results/fast/animation/request-animation-frame-cancel2-actual.txt 
@@ -3,7 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS callbackFired is false
+FAIL callbackFired should be false. Was true.
 PASS cancelFired is true
 PASS successfullyParsed is true


fast/animation/request-animation-frame-detach-element.html :

--- /ramdisk/qt-linux-64-release/build/layout-test-results/fast/animation/request-animation-frame-detach-element-expected.txt 
+++ /ramdisk/qt-linux-64-release/build/layout-test-results/fast/animation/request-animation-frame-detach-element-actual.txt 
@@ -1,1 +1,3 @@
+CONSOLE MESSAGE: line 12: TypeError: 'undefined' is not an object (evaluating 'window.frames[1].webkitRequestAnimationFrame')
+FAIL: Timed out waiting for notifyDone to be called
 Test passes is there is no crash.



fast/animation/request-animation-frame-during-modal.html :

--- /ramdisk/qt-linux-64-release/build/layout-test-results/fast/animation/request-animation-frame-during-modal-expected.txt 
+++ /ramdisk/qt-linux-64-release/build/layout-test-results/fast/animation/request-animation-frame-during-modal-actual.txt 
@@ -4,9 +4,9 @@
 
 
 Setting callback
+Callback fired
 Showing modal dialog
 Returned from modal dialog
-Callback fired
 PASS successfullyParsed is true
 
 TEST COMPLETE
Comment 1 János Badics 2012-07-27 05:56:33 PDT
I skipped these tests until the proper fix in
http://trac.webkit.org/changeset/123868
Comment 2 Balazs Ankes 2012-07-27 06:58:10 PDT
There are some fails on Qt Wk2 bot also.

fast/animation/request-animation-frame-iframe.html:
--- /ramdisk/qt-linux-32-release-webkit2/build/layout-test-results/fast/animation/request-animation-frame-iframe-expected.txt 
+++ /ramdisk/qt-linux-32-release-webkit2/build/layout-test-results/fast/animation/request-animation-frame-iframe-actual.txt 
@@ -3,7 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS callbackInvoked is true
+FAIL callbackInvoked should be true. Was false.
 PASS successfullyParsed is true
 
 TEST COMPLETE

fast/animation/request-animation-frame-timestamps-advance.html:
--- /ramdisk/qt-linux-32-release-webkit2/build/layout-test-results/fast/animation/request-animation-frame-timestamps-advance-expected.txt 
+++ /ramdisk/qt-linux-32-release-webkit2/build/layout-test-results/fast/animation/request-animation-frame-timestamps-advance-actual.txt 
@@ -1,12 +1,2 @@
-Tests the timestamps provided to requestAnimationFrame callbacks advance
+FAIL: Timed out waiting for notifyDone to be called
 
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS firstTimestamp is defined.
-PASS secondTimestamp is defined.
-PASS secondTimestamp > firstTimestamp is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

fast/animation/request-animation-frame-timestamps.html:
--- /ramdisk/qt-linux-32-release-webkit2/build/layout-test-results/fast/animation/request-animation-frame-timestamps-expected.txt 
+++ /ramdisk/qt-linux-32-release-webkit2/build/layout-test-results/fast/animation/request-animation-frame-timestamps-actual.txt 
@@ -3,10 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS firstTimestamp is defined.
-PASS secondTimestamp is defined.
-PASS firstTimestamp is secondTimestamp
-PASS firstTimestamp is defined.
+FAIL firstTimestamp should be defined. Was undefined
 PASS successfullyParsed is true
 
 TEST COMPLETE

fast/animation/request-animation-frame-within-callback.html:
--- /ramdisk/qt-linux-32-release-webkit2/build/layout-test-results/fast/animation/request-animation-frame-within-callback-expected.txt 
+++ /ramdisk/qt-linux-32-release-webkit2/build/layout-test-results/fast/animation/request-animation-frame-within-callback-actual.txt 
@@ -3,7 +3,6 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS sameFrame is false
 PASS successfullyParsed is true
 
 TEST COMPLETE

fast/animation/request-animation-frame.html:
--- /ramdisk/qt-linux-32-release-webkit2/build/layout-test-results/fast/animation/request-animation-frame-expected.txt 
+++ /ramdisk/qt-linux-32-release-webkit2/build/layout-test-results/fast/animation/request-animation-frame-actual.txt 
@@ -3,7 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS callbackInvoked is true
+FAIL callbackInvoked should be true. Was false.
 PASS successfullyParsed is true
 
 TEST COMPLETE
Comment 3 Zeno Albisser 2012-07-29 05:18:38 PDT
Created attachment 155167 [details]
patch for review.
Comment 4 Noam Rosenthal 2012-07-29 09:33:20 PDT
Comment on attachment 155167 [details]
patch for review.

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

> Source/WebKit2/ChangeLog:8
> +        Make sure that an actual repaint happens, when flushPendingLayerChanges
> +        is exeuted from within forceRepaint. In this case we do not want to wait
> +        for the UIProcess.

This looks like a good fix, but is it related to the animation bug?

> Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.h:107
> +    bool flushPendingLayerChanges(bool forceRepaint = false);

Boolean trap. Please use an enum { ForceRepaint, DontForceRepaint }.
Comment 5 Jocelyn Turcotte 2012-07-30 00:46:20 PDT
Comment on attachment 155167 [details]
patch for review.

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

> Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp:254
> -    m_waitingForUIProcess = true;
> +    m_waitingForUIProcess = !forceRepaint;

Humm I know I hinted you this change, but I was wrong. I thought that the problem was that there was a m_waitingForUIProcess check when calling forceRepaint and it's not the case.
The problem seems to be that since forceRepaint calls flushPendingLayerChanges, it doesn't end up calling serviceScriptedAnimations.
So I think a more deterministic fix would be to move serviceScriptedAnimations deeper inside flushPendingLayerChange instead of performScheduledLayerFlush to make sure that it gets called when forceRepaint is called as well.
Comment 6 Zeno Albisser 2012-07-30 04:33:12 PDT
Created attachment 155255 [details]
patch for review.
Comment 7 Noam Rosenthal 2012-07-30 06:14:27 PDT
Comment on attachment 155255 [details]
patch for review.

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

> Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp:181
> +    m_webPage->layoutIfNeeded();

I thought flushPendingLayerChanges already calls layoutIfNeeded. isn't this superfluous?
Comment 8 Zeno Albisser 2012-07-30 06:16:58 PDT
Comment on attachment 155255 [details]
patch for review.

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

>> Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp:181
>> +    m_webPage->layoutIfNeeded();
> 
> I thought flushPendingLayerChanges already calls layoutIfNeeded. isn't this superfluous?

No, flushPendingLayerChanges does not. performScheduledLayerFlush does. But this one returns early due to m_waitingForUIProcess in case of running layout tests.
Comment 9 Noam Rosenthal 2012-07-30 06:21:12 PDT
Comment on attachment 155255 [details]
patch for review.

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

> Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp:180
> +    m_webPage->corePage()->mainFrame()->view()->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(currentTime()));

I prefer it if this moved to a different function, e.g. LayerTreeCoordinator::serviceScriptedAnimations()

>>> Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp:181
>>> +    m_webPage->layoutIfNeeded();
>> 
>> I thought flushPendingLayerChanges already calls layoutIfNeeded. isn't this superfluous?
> 
> No, flushPendingLayerChanges does not. performScheduledLayerFlush does. But this one returns early due to m_waitingForUIProcess in case of running layout tests.

OK, then shouldn't we move layoutIfNeeded into flushPendingLayerChanges?
I don't see how this behavior should be specific to rAF, it might break other tests as well.
Comment 10 Noam Rosenthal 2012-07-30 06:59:14 PDT
Comment on attachment 155255 [details]
patch for review.

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

>>>> Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp:181
>>>> +    m_webPage->layoutIfNeeded();
>>> 
>>> I thought flushPendingLayerChanges already calls layoutIfNeeded. isn't this superfluous?
>> 
>> No, flushPendingLayerChanges does not. performScheduledLayerFlush does. But this one returns early due to m_waitingForUIProcess in case of running layout tests.
> 
> OK, then shouldn't we move layoutIfNeeded into flushPendingLayerChanges?
> I don't see how this behavior should be specific to rAF, it might break other tests as well.

Or, even better, have something like a syncDisplayState() function that calls serviceAnimations, layout and flushLayerChanges, and call that function both from forceRepaint and from performFlush.
Comment 11 Zeno Albisser 2012-07-30 07:06:46 PDT
Created attachment 155284 [details]
patch
Comment 12 Zeno Albisser 2012-07-30 07:48:37 PDT
Created attachment 155289 [details]
patch
Comment 13 WebKit Review Bot 2012-07-30 10:02:56 PDT
Comment on attachment 155289 [details]
patch

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

New failing tests:
platform/chromium/compositing/accelerated-drawing/svg-filters.html
platform/chromium/compositing/accelerated-drawing/alpha.html
Comment 14 WebKit Review Bot 2012-07-30 10:03:00 PDT
Created attachment 155310 [details]
Archive of layout-test-results from gce-cr-linux-06

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: gce-cr-linux-06  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
Comment 15 Zeno Albisser 2012-07-31 02:50:45 PDT
Created attachment 155478 [details]
patch for testing with cr-linux.
Comment 16 WebKit Review Bot 2012-07-31 04:14:27 PDT
Comment on attachment 155289 [details]
patch

Cleared Noam Rosenthal's review+ from obsolete attachment 155289 [details] so that this bug does not appear in http://webkit.org/pending-commit.
Comment 17 Csaba Osztrogonác 2012-07-31 08:26:42 PDT
And it made one more test fail in debug mode:
expected.txt 
+++ /home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/layout-test-results/fast/animation/request-animation-frame-timestamps-actual.txt 
@@ -5,7 +5,7 @@

 PASS firstTimestamp is defined.
 PASS secondTimestamp is defined.
-PASS firstTimestamp is secondTimestamp
+FAIL firstTimestamp should be 1343744605297. Was 1343744605207.
 PASS firstTimestamp is defined.
 PASS successfullyParsed is true
Comment 18 Csaba Osztrogonác 2012-07-31 08:26:59 PDT
*** Bug 92759 has been marked as a duplicate of this bug. ***
Comment 19 Csaba Osztrogonác 2012-07-31 08:38:49 PDT
Comment on attachment 155478 [details]
patch for testing with cr-linux.

Please remove the tests from the skipped list before landing.
Comment 20 Csaba Osztrogonác 2012-07-31 09:49:29 PDT
And one more test on WK2:

--- /home/webkitbuildbot/slaves/release64bitWebKit2_EC2/buildslave/qt-linux-64-release-webkit2/build/layout-test-results/fast/dom/Window/post-message-crash-expected.txt
+++ /home/webkitbuildbot/slaves/release64bitWebKit2_EC2/buildslave/qt-linux-64-release-webkit2/build/layout-test-results/fast/dom/Window/post-message-crash-actual.txt
@@ -1,3 +1,3 @@
 This ensures that postMessage called in a callback does not crash.
 
-PASS
+FAIL
Comment 21 Zeno Albisser 2012-08-01 07:06:27 PDT
Created attachment 155806 [details]
patch for landing. - Unskip affected tests as well.
Comment 22 Noam Rosenthal 2012-08-01 08:04:23 PDT
(In reply to comment #21)
> Created an attachment (id=155806) [details]
> patch for landing. - Unskip affected tests as well.

If this is for landing - why the r? I thought we reviewed this patch already...
Comment 23 Zeno Albisser 2012-08-01 08:06:53 PDT
(In reply to comment #22)
> If this is for landing - why the r? I thought we reviewed this patch already...

I had to modify it slightly. The cr-linux bot was not happy with the reviewed one. Also i unskipped the tests.
Comment 24 Zeno Albisser 2012-08-01 08:45:46 PDT
Comment on attachment 155806 [details]
patch for landing. - Unskip affected tests as well.

Clearing flags on attachment: 155806

Committed r124336: <http://trac.webkit.org/changeset/124336>
Comment 25 Zeno Albisser 2012-08-01 08:45:55 PDT
All reviewed patches have been landed.  Closing bug.