<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>91038</bug_id>
          
          <creation_ts>2012-07-11 17:59:45 -0700</creation_ts>
          <short_desc>When in paginated mode, the layout timer fires continually</short_desc>
          <delta_ts>2012-08-10 12:40:11 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Fraser (smfr)">simon.fraser</reporter>
          <assigned_to>mitz</assigned_to>
          <cc>mitz</cc>
    
    <cc>rasasi78</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>667267</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2012-07-11 17:59:45 -0700</bug_when>
    <thetext>When I put MIniBrowser into paginated mode and load a simple page like http://www.smfr.org, FrameView::layout() is called over and over again; the layout timer keeps firing and never stops. The WebProcess eats over 100% cpu permanently.

mainFrameDidLayout() ends up calling pageCount():

    frame #0: 0x0000000103da1820 WebCore`WebCore::Page::pageCount() const + 16 at Page.cpp:706
    frame #1: 0x0000000101231b9d WebKit2`WebKit::WebPage::mainFrameDidLayout() + 45 at WebPage.cpp:2537
    frame #2: 0x00000001011db93d WebKit2`WebKit::WebFrameLoaderClient::dispatchDidLayout() + 189 at WebFrameLoaderClient.cpp:612
    frame #3: 0x00000001033d9183 WebCore`WebCore::FrameView::performPostLayoutTasks() + 627 at FrameView.cpp:2382
    frame #4: 0x00000001033d89c4 WebCore`WebCore::FrameView::layout(bool) + 4020 at FrameView.cpp:1176
    frame #5: 0x00000001033e1785 WebCore`WebCore::FrameView::forceLayout(bool) + 37 at FrameView.cpp:3241
    frame #6: 0x0000000103da1890 WebCore`WebCore::Page::pageCount() const + 128 at Page.cpp:713
    frame #7: 0x0000000101231b9d WebKit2`WebKit::WebPage::mainFrameDidLayout() + 45 at WebPage.cpp:2537
    frame #8: 0x00000001011db93d WebKit2`WebKit::WebFrameLoaderClient::dispatchDidLayout() + 189 at WebFrameLoaderClient.cpp:612
    frame #9: 0x00000001033d9183 WebCore`WebCore::FrameView::performPostLayoutTasks() + 627 at FrameView.cpp:2382
    frame #10: 0x00000001033d47b9 WebCore`WebCore::FrameView::postLayoutTimerFired(WebCore::Timer&lt;WebCore::FrameView&gt;*) + 25 at FrameView.cpp:2436
    frame #11: 0x00000001033ef043 WebCore`WebCore::Timer&lt;WebCore::FrameView&gt;::fired() + 115 at Timer.h:100
    frame #12: 0x000000010445b4fd WebCore`WebCore::ThreadTimers::sharedTimerFiredInternal() + 285 at ThreadTimers.cpp:115
    frame #13: 0x000000010445b299 WebCore`WebCore::ThreadTimers::sharedTimerFired() + 25 at ThreadTimers.cpp:93
    frame #14: 0x00000001041af8b3 WebCore`timerFired + 67 at SharedTimerMac.mm:166
    frame #15: 0x00007fff95dd44b4 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
    frame #16: 0x00007fff95dd3fcd CoreFoundation`__CFRunLoopDoTimer + 557
    frame #17: 0x00007fff95db97b9 CoreFoundation`__CFRunLoopRun + 1513
    frame #18: 0x00007fff95db8dd2 CoreFoundation`CFRunLoopRunSpecific + 290
    frame #19: 0x00007fff950f2774 HIToolbox`RunCurrentEventLoopInMode + 209
    frame #20: 0x00007fff950f2512 HIToolbox`ReceiveNextEventCommon + 356
    frame #21: 0x00007fff950f23a3 HIToolbox`BlockUntilNextEventMatchingListInMode + 62
    frame #22: 0x00007fff90687f73 AppKit`_DPSNextEvent + 685
    frame #23: 0x00007fff90687832 AppKit`-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
    frame #24: 0x00007fff9067ebd3 AppKit`-[NSApplication run] + 517
    frame #25: 0x00000001040fd64c WebCore`WebCore::RunLoop::run() + 92 at RunLoopMac.mm:36
    frame #26: 0x00000001012fbcd8 WebKit2`WebKit::WebProcessMain(WebKit::CommandLine const&amp;) + 3368 at WebProcessMainMac.mm:183
    frame #27: 0x000000010120f7a8 WebKit2`WebKitMain + 200 at WebKitMain.cpp:50
    frame #28: 0x000000010120f6c4 WebKit2`WebKitMain + 148 at WebKitMain.cpp:74
    frame #29: 0x0000000100000da2 WebProcess`main + 274 at MainMac.cpp:68

and Page::pageCount() calls 

    mainFrame()-&gt;view()-&gt;forceLayout();

which seems to be the cause.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>667269</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2012-07-11 18:00:34 -0700</bug_when>
    <thetext>&lt;rdar://problem/11855229&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>667272</commentid>
    <comment_count>2</comment_count>
    <who name="">mitz</who>
    <bug_when>2012-07-11 18:09:41 -0700</bug_when>
    <thetext>This is a WebKit2 bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>692737</commentid>
    <comment_count>3</comment_count>
    <who name="">mitz</who>
    <bug_when>2012-08-10 11:38:58 -0700</bug_when>
    <thetext>It can be addressed in WebCore.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>692752</commentid>
    <comment_count>4</comment_count>
      <attachid>157777</attachid>
    <who name="">mitz</who>
    <bug_when>2012-08-10 11:44:30 -0700</bug_when>
    <thetext>Created attachment 157777
Change Page::pageCount to only trigger layout if needed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>692815</commentid>
    <comment_count>5</comment_count>
    <who name="">mitz</who>
    <bug_when>2012-08-10 12:40:11 -0700</bug_when>
    <thetext>Fixed in &lt;http://trac.webkit.org/r125314&gt;.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>157777</attachid>
            <date>2012-08-10 11:44:30 -0700</date>
            <delta_ts>2012-08-10 11:49:15 -0700</delta_ts>
            <desc>Change Page::pageCount to only trigger layout if needed</desc>
            <filename>bug-91038-20120810114407.patch</filename>
            <type>text/plain</type>
            <size>1447</size>
            <attacher>mitz</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDEyNTMwNCkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDEzIEBACisyMDEyLTA4LTEwICBEYW4gQmVy
bnN0ZWluICA8bWl0ekBhcHBsZS5jb20+CisKKyAgICAgICAgPHJkYXI6Ly9wcm9ibGVtLzExODU1
MjI5PiBXaGVuIGluIHBhZ2luYXRlZCBtb2RlLCB0aGUgbGF5b3V0IHRpbWVyIGZpcmVzIGNvbnRp
bnVhbGx5CisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD05
MTAzOAorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgor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GVyZXItPmNvbHVtbkNvdW50KGNvbnRlbnRSZW5kZXJlci0+Y29sdW1uSW5m
bygpKTsKKyAgICByZXR1cm4gY29udGVudFJlbmRlcmVyID8gY29udGVudFJlbmRlcmVyLT5jb2x1
bW5Db3VudChjb250ZW50UmVuZGVyZXItPmNvbHVtbkluZm8oKSkgOiAwOwogfQogCiB2b2lkIFBh
Z2U6OmRpZE1vdmVPbnNjcmVlbigpCg==
</data>
<flag name="review"
          id="167743"
          type_id="1"
          status="+"
          setter="simon.fraser"
    />
          </attachment>
      

    </bug>

</bugzilla>