Bug 115199

Summary: When updating geometry, send JavaScript resize before before layout/paint.
Product: WebKit Reporter: Andreas Kling <kling>
Component: Layout and RenderingAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, ggaren, kling, rniwa
Priority: P2 Keywords: InRadar, Performance
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 115994    
Attachments:
Description Flags
Snack for EWS
buildbot: commit-queue-
Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2
none
Archive of layout-test-results from webkit-ews-05 for mac-mountainlion
none
Patch none

Description Andreas Kling 2013-04-25 13:02:18 PDT
<rdar://problem/13735535>
Comment 1 Andreas Kling 2013-04-25 13:05:32 PDT
Created attachment 199742 [details]
Snack for EWS
Comment 2 Build Bot 2013-04-25 15:24:47 PDT
Comment on attachment 199742 [details]
Snack for EWS

Attachment 199742 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/202104

New failing tests:
fast/replaced/frame-removed-during-resize.html
fast/replaced/frame-removed-during-resize-smaller.html
Comment 3 Build Bot 2013-04-25 15:24:48 PDT
Created attachment 199758 [details]
Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-12  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.2
Comment 4 Build Bot 2013-04-25 16:40:37 PDT
Comment on attachment 199742 [details]
Snack for EWS

Attachment 199742 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/220288

New failing tests:
fast/events/resize-subframe.html
fast/dynamic/paused-event-dispatch.html
fast/frames/flattening/iframe-flattening-crash.html
fast/replaced/frame-removed-during-resize-smaller.html
Comment 5 Build Bot 2013-04-25 16:40:38 PDT
Created attachment 199764 [details]
Archive of layout-test-results from webkit-ews-05 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-05  Port: mac-mountainlion  Platform: Mac OS X 10.8.2
Comment 6 Andreas Kling 2013-04-26 08:04:30 PDT
Created attachment 199837 [details]
Patch
Comment 7 Geoffrey Garen 2013-04-26 10:38:24 PDT
What do you make of these failures?

Regressions: Unexpected text-only failures (3)
  editing/execCommand/copy-without-selection.html [ Failure ]
  editing/pasteboard/copy-two-pasteboard-types-both-work.html [ Failure ]
  editing/pasteboard/pasting-empty-html-falls-back-to-text.html [ Failure ]

Also, do we need some kind of rate limiting for this event? -- i.e., send now, but only if enough time has passed since the last send, and set a timer to send one final event after resizing has stopped?
Comment 8 Andreas Kling 2013-04-27 10:02:39 PDT
(In reply to comment #7)
> What do you make of these failures?
> 
> Regressions: Unexpected text-only failures (3)
>   editing/execCommand/copy-without-selection.html [ Failure ]
>   editing/pasteboard/copy-two-pasteboard-types-both-work.html [ Failure ]
>   editing/pasteboard/pasting-empty-html-falls-back-to-text.html [ Failure ]

Looks like EWS goofery. It's green now, and I can't repro any failures locally.

> Also, do we need some kind of rate limiting for this event? -- i.e., send now, but only if enough time has passed since the last send, and set a timer to send one final event after resizing has stopped?

That's the $1.99 question; if we rate limit it, we still get JS-layout FOUCs, but will obviously alleviate some CPU churn.

One problem I've noticed when rate limiting is that some resize handlers do stuff like "if (window.outerWidth % 4 != 0) return;" to kind-of manually rate limit themselves. Of course, we don't end up sending resize events for every single pixel anyway, so that's not the best solution. And if we start rate limiting the events, it's even less likely that the resize event handler ever does *anything* on such pages.
Comment 9 Geoffrey Garen 2013-04-27 12:20:36 PDT
Comment on attachment 199837 [details]
Patch

OK, well, the patch looks correct to me, so I guess the next step is to try it out.
Comment 10 WebKit Commit Bot 2013-04-29 08:32:35 PDT
Comment on attachment 199837 [details]
Patch

Clearing flags on attachment: 199837

Committed r149287: <http://trac.webkit.org/changeset/149287>
Comment 11 WebKit Commit Bot 2013-04-29 08:32:37 PDT
All reviewed patches have been landed.  Closing bug.
Comment 12 Alexey Proskuryakov 2013-04-29 16:58:26 PDT
> fast/frames/flattening/iframe-flattening-crash.html

This test looks like it actually regressed, filed bug 115386.