<?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>70632</bug_id>
          
          <creation_ts>2011-10-21 12:46:04 -0700</creation_ts>
          <short_desc>Page::setPageScaleFactor should layout the FrameView if it needs layout regardless of scroll position</short_desc>
          <delta_ts>2011-11-30 16:23:00 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>70559</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Fady Samuel">fsamuel</reporter>
          <assigned_to name="Fady Samuel">fsamuel</assigned_to>
          <cc>ap</cc>
    
    <cc>aroben</cc>
    
    <cc>bdakin</cc>
    
    <cc>darin</cc>
    
    <cc>rjkroege</cc>
    
    <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>488569</commentid>
    <comment_count>0</comment_count>
    <who name="Fady Samuel">fsamuel</who>
    <bug_when>2011-10-21 12:46:04 -0700</bug_when>
    <thetext>Trivial change, I need to come up with a simple test for it though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>489167</commentid>
    <comment_count>1</comment_count>
      <attachid>112147</attachid>
    <who name="Fady Samuel">fsamuel</who>
    <bug_when>2011-10-23 22:14:26 -0700</bug_when>
    <thetext>Created attachment 112147
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>489169</commentid>
    <comment_count>2</comment_count>
      <attachid>112147</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-10-23 22:16:33 -0700</bug_when>
    <thetext>Comment on attachment 112147
Patch

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

&gt; Source/WebCore/ChangeLog:3
&gt; +        Page::setPageScaleFactor should layout the FrameView if it needs layout regardless of scroll position

Why?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>489171</commentid>
    <comment_count>3</comment_count>
    <who name="Fady Samuel">fsamuel</who>
    <bug_when>2011-10-23 22:16:51 -0700</bug_when>
    <thetext>The change is trivial. I discovered the issue while implementing/testing the Viewport meta tag for Chromium. I don&apos;t yet have a reduction. I&apos;ll try to have something ready by tomorrow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>489172</commentid>
    <comment_count>4</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-10-23 22:17:22 -0700</bug_when>
    <thetext>Please supply the reason for the change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>489173</commentid>
    <comment_count>5</comment_count>
    <who name="Fady Samuel">fsamuel</who>
    <bug_when>2011-10-23 22:20:19 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; The change is trivial. I discovered the issue while implementing/testing the Viewport meta tag for Chromium. I don&apos;t yet have a reduction. I&apos;ll try to have something ready by tomorrow.

In a nutshell, I&apos;m seeing cases where FrameView::paintContents has an ASSERT(!needsLayout()) that&apos;s failing while testing setPageScaleFactor in conjugation with enabling fixed layout. This small change eliminates the problem. I&apos;m not sure if this is the right solution. I logged the bug anyway to remind myself to investigate this further.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>489176</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-10-23 22:26:49 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; I&apos;m seeing cases where FrameView::paintContents has an ASSERT(!needsLayout()) that&apos;s failing while testing setPageScaleFactor in conjugation with enabling fixed layout. This small change eliminates the problem. I&apos;m not sure if this is the right solution. I logged the bug anyway to remind myself to investigate this further.

Aha! Given your description, I am sure it is not the right solution. The code that depends on layout should be the code that triggers layout. We should not change this function because we want to rely on its side effect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>489177</commentid>
    <comment_count>7</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-10-23 22:27:14 -0700</bug_when>
    <thetext>If you show me the backtrace of the needsLayout assertion I can help you figure out what code should be responsible for doing the layout.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>490218</commentid>
    <comment_count>8</comment_count>
    <who name="Fady Samuel">fsamuel</who>
    <bug_when>2011-10-25 12:15:05 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; If you show me the backtrace of the needsLayout assertion I can help you figure out what code should be responsible for doing the layout.

Oddly enough, I can&apos;t repro this anymore. If I can&apos;t repro again for another day or two, I&apos;ll mark this bug as invalid and close it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>490253</commentid>
    <comment_count>9</comment_count>
    <who name="Fady Samuel">fsamuel</who>
    <bug_when>2011-10-25 12:45:39 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; If you show me the backtrace of the needsLayout assertion I can help you figure out what code should be responsible for doing the layout.
&gt; 
&gt; Oddly enough, I can&apos;t repro this anymore. If I can&apos;t repro again for another day or two, I&apos;ll mark this bug as invalid and close it.

Ah ha! Finally, repo&apos;ing again!


#0  0x00007ffff3b7e9c8 in WebCore::FrameView::paintContents (this=0x7fffd5fa2000, p=0x7fffdd6171d0, rect=...) at third_party/WebKit/Source/WebCore/page/FrameView.cpp:2732
#1  0x00007ffff3729118 in WebCore::ScrollView::paint (this=0x7fffd5fa2000, context=0x7fffdd6171d0, rect=...) at third_party/WebKit/Source/WebCore/platform/ScrollView.cpp:1046
#2  0x00007ffff3390f93 in WebKit::WebFrameImpl::paintWithContext (this=0x7fffde3301c0, gc=..., rect=...) at third_party/WebKit/Source/WebKit/chromium/src/WebFrameImpl.cpp:1977
#3  0x00007ffff33910a3 in WebKit::WebFrameImpl::paint (this=0x7fffde3301c0, canvas=0x7fffcda2fe00, rect=...) at third_party/WebKit/Source/WebKit/chromium/src/WebFrameImpl.cpp:1989
#4  0x00007ffff33b5ffc in WebKit::WebViewImpl::paint (this=0x7fffd8554c80, canvas=0x7fffcda2fe00, rect=...) at third_party/WebKit/Source/WebKit/chromium/src/WebViewImpl.cpp:1150
#5  0x00007ffff4b97de1 in RenderWidget::PaintRect (this=0x7fffd53b4400, rect=..., canvas_origin=..., canvas=0x7fffcda2fe00) at content/renderer/render_widget.cc:584
#6  0x00007ffff4b99d1b in RenderWidget::DoDeferredUpdate (this=0x7fffd53b4400) at content/renderer/render_widget.cc:822
#7  0x00007ffff4b98b6f in RenderWidget::DoDeferredUpdateAndSendInputAck (this=0x7fffd53b4400) at content/renderer/render_widget.cc:695
#8  0x00007ffff4b98b3f in RenderWidget::InvalidationCallback (this=0x7fffd53b4400) at content/renderer/render_widget.cc:691
#9  0x00007ffff4b9e7c7 in void DispatchToMethod&lt;RenderWidget, void (RenderWidget::*)()&gt;(RenderWidget*, void (RenderWidget::*)(), Tuple0 const&amp;) ()
#10 0x00007ffff4b9e70a in RunnableMethod&lt;RenderWidget, void (RenderWidget::*)(), Tuple0&gt;::Run() ()
#11 0x00007ffff2648ae7 in base::subtle::TaskClosureAdapter::Run (this=0x7fffd8ad9360) at base/task.cc:71
#12 0x00007ffff2601b30 in base::internal::Invoker1&lt;false, base::internal::InvokerStorage1&lt;void (base::subtle::TaskClosureAdapter::*)(), base::subtle::TaskClosureAdapter*&gt;, void (base::subtle::TaskClosureAdapter::*)()&gt;::DoInvoke (
    base=0x7fffd5235120) at ./base/bind_internal.h:596
#13 0x00007ffff1ca26bf in base::Callback&lt;void()&gt;::Run(void) const (this=0x7fffdd618560) at ./base/callback.h:269
#14 0x00007ffff25fe9ae in MessageLoop::RunTask (this=0x7fffdd618ba0, pending_task=...) at base/message_loop.cc:495
#15 0x00007ffff25feaed in MessageLoop::DeferOrRunPendingTask (this=0x7fffdd618ba0, pending_task=...) at base/message_loop.cc:509
#16 0x00007ffff25ff303 in MessageLoop::DoWork (this=0x7fffdd618ba0) at base/message_loop.cc:699
#17 0x00007ffff26071bc in base::MessagePumpDefault::Run (this=0x7fffe46532a0, delegate=0x7fffdd618ba0) at base/message_pump_default.cc:23
#18 0x00007ffff25fe633 in MessageLoop::RunInternal (this=0x7fffdd618ba0) at base/message_loop.cc:453
#19 0x00007ffff25fe4e6 in MessageLoop::RunHandler (this=0x7fffdd618ba0) at base/message_loop.cc:426
#20 0x00007ffff25fde9f in MessageLoop::Run (this=0x7fffdd618ba0) at base/message_loop.cc:341
#21 0x00007ffff264b6a6 in base::Thread::Run (this=0x7fffe4626c80, message_loop=0x7fffdd618ba0) at base/threading/thread.cc:129
#22 0x00007ffff264b839 in base::Thread::ThreadMain (this=0x7fffe4626c80) at base/threading/thread.cc:167
#23 0x00007ffff264a3cb in base::(anonymous namespace)::ThreadFunc (params=0x7fffdd9e5060) at base/threading/platform_thread_posix.cc:54
#24 0x00007fffec32c9ca in start_thread (arg=&lt;value optimized out&gt;) at pthread_create.c:300
#25 0x00007fffe9b1a70d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>490348</commentid>
    <comment_count>10</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-10-25 14:13:13 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; #1  0x00007ffff3729118 in WebCore::ScrollView::paint (this=0x7fffd5fa2000, context=0x7fffdd6171d0, rect=...) at third_party/WebKit/Source/WebCore/platform/ScrollView.cpp:1046
&gt; #2  0x00007ffff3390f93 in WebKit::WebFrameImpl::paintWithContext (this=0x7fffde3301c0, gc=..., rect=...) at third_party/WebKit/Source/WebKit/chromium/src/WebFrameImpl.cpp:1977
&gt; #3  0x00007ffff33910a3 in WebKit::WebFrameImpl::paint (this=0x7fffde3301c0, canvas=0x7fffcda2fe00, rect=...) at third_party/WebKit/Source/WebKit/chromium/src/WebFrameImpl.cpp:1989
&gt; #4  0x00007ffff33b5ffc in WebKit::WebViewImpl::paint (this=0x7fffd8554c80, canvas=0x7fffcda2fe00, rect=...) at third_party/WebKit/Source/WebKit/chromium/src/WebViewImpl.cpp:1150
&gt; #5  0x00007ffff4b97de1 in RenderWidget::PaintRect (this=0x7fffd53b4400, rect=..., canvas_origin=..., canvas=0x7fffcda2fe00) at content/renderer/render_widget.cc:584
&gt; #6  0x00007ffff4b99d1b in RenderWidget::DoDeferredUpdate (this=0x7fffd53b4400) at content/renderer/render_widget.cc:822

The bug is here somewhere in this Chromium platform code.

There’s a deferred paint. But between the time the paint was deferred and now, some change may have occurred that triggered the need for layout.

To accommodate that case one of these functions has to do a layout. Maybe RenderWidget::DoDeferredUpdate or maybe one of the five functions it calls.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>512187</commentid>
    <comment_count>11</comment_count>
    <who name="Fady Samuel">fsamuel</who>
    <bug_when>2011-11-30 15:36:10 -0800</bug_when>
    <thetext>Can be (more appropriately) fixed on the Chromium-side of the world.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>112147</attachid>
            <date>2011-10-23 22:14:26 -0700</date>
            <delta_ts>2011-11-30 16:23:00 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-70632-20111024011424.patch</filename>
            <type>text/plain</type>
            <size>1515</size>
            <attacher name="Fady Samuel">fsamuel</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogOTgyMDYKZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwppb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