Changeset 153451 in webkit


Ignore:
Timestamp:
Jul 29, 2013 6:06:27 PM (11 years ago)
Author:
Simon Fraser
Message:

Page count can be incorrect if there is a pending style recalc
https://bugs.webkit.org/show_bug.cgi?id=119232

Reviewed by Beth Dakin.

If style is changed in a way that schedules a style recalc on the Document,
and then Page::pageCount() is called, we may give the wrong answer because
the existing code only checked FrameView::needsLayout(), not whether a style
recale was pending.

Fix by having Page::pageCount() call updateLayoutIgnorePendingStylesheets()
as we do for other properties that require layer, and are exposed to JS
or via API.

  • page/Page.cpp:

(WebCore::Page::pageCount):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r153450 r153451  
     12013-07-29  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Page count can be incorrect if there is a pending style recalc
     4        https://bugs.webkit.org/show_bug.cgi?id=119232
     5
     6        Reviewed by Beth Dakin.
     7
     8        If style is changed in a way that schedules a style recalc on the Document,
     9        and then Page::pageCount() is called, we may give the wrong answer because
     10        the existing code only checked FrameView::needsLayout(), not whether a style
     11        recale was pending.
     12       
     13        Fix by having Page::pageCount() call updateLayoutIgnorePendingStylesheets()
     14        as we do for other properties that require layer, and are exposed to JS
     15        or via API.
     16
     17        * page/Page.cpp:
     18        (WebCore::Page::pageCount):
     19
    1202013-07-29  Alex Christensen  <achristensen@apple.com>
    221
  • trunk/Source/WebCore/page/Page.cpp

    r152941 r153451  
    905905        return 0;
    906906
    907     FrameView* frameView = mainFrame()->view();
    908     if (frameView->needsLayout())
    909         frameView->layout();
     907    if (Document* document = mainFrame()->document())
     908        document->updateLayoutIgnorePendingStylesheets();
    910909
    911910    RenderView* contentRenderer = mainFrame()->contentRenderer();
Note: See TracChangeset for help on using the changeset viewer.