Bug 81187

Summary: Platforms without USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) don't need to query the page's displayID
Product: WebKit Reporter: James Robinson <jamesr>
Component: New BugsAssignee: James Robinson <jamesr>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarrin, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch simon.fraser: review+

Description James Robinson 2012-03-14 20:29:30 PDT
Platforms without USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) don't need to query the page's displayID
Comment 1 James Robinson 2012-03-14 20:30:03 PDT
Created attachment 131980 [details]
Patch
Comment 2 James Robinson 2012-03-14 20:37:36 PDT
In r97405 Chris Marrin added a PlatformDisplayID parameter to ScriptedAnimationController::create(). This is only used if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) is set, which is only set on mac and blackberry (?).  Unfortunately this code tries to grab the display ID from Document::page() whenever a callback is set, bug that's not correct - the page() on a Document might be NULL.  We have crash reports in chromium from this exact situation.  Having the display ID on a Document-owned object seems inherently a bit broken - Documents aren't always associated with a Page and can move between Pages.

I had a patch series underway in https://bugs.webkit.org/show_bug.cgi?id=74165 to move the controller up to the Page, which I think will make it clearer how to deal with issues like this.  I haven't had time to get around to this, but this patch avoids doing the unnecessary call (and resulting crash) on most platforms.
Comment 3 Simon Fraser (smfr) 2012-03-14 21:37:49 PDT
Comment on attachment 131980 [details]
Patch

Can you please file a separate bug on page() possibly being null?
Comment 4 James Robinson 2012-03-14 22:00:40 PDT
https://bugs.webkit.org/show_bug.cgi?id=81189
Comment 5 James Robinson 2012-03-14 22:07:39 PDT
Committed r110821: <http://trac.webkit.org/changeset/110821>