<?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>54123</bug_id>
          
          <creation_ts>2011-02-09 11:27:14 -0800</creation_ts>
          <short_desc>Assertion failure in BackingStore::BackingStore if new WebPage becomes active before receiving a size</short_desc>
          <delta_ts>2011-02-10 04:42:49 -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>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, PlatformOnly</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>53805</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Adam Roben (:aroben)">aroben</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andersca</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>348403</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-02-09 11:27:14 -0800</bug_when>
    <thetext>If a new WebPage becomes active before it receives a size, you&apos;ll hit this assertion in BackingStore::BackingStore:

    ASSERT(!m_size.isEmpty());


Continuing past the assertion shows no bad effects, so presumably Release builds are unaffected. Here&apos;s the backtrace:

&gt;	WebKit.dll!WebKit::BackingStore::BackingStore(const WebCore::IntSize &amp; size={...}, WebKit::WebPageProxy * webPageProxy=0x09755c90)  Line 49 + 0x2d bytes	C++
 	WebKit.dll!WebKit::BackingStore::create(const WebCore::IntSize &amp; size={...}, WebKit::WebPageProxy * webPageProxy=0x09755c90)  Line 42 + 0x23 bytes	C++
 	WebKit.dll!WebKit::DrawingAreaProxyImpl::incorporateUpdate(const WebKit::UpdateInfo &amp; updateInfo={...})  Line 203 + 0x14 bytes	C++
 	WebKit.dll!WebKit::DrawingAreaProxyImpl::update(unsigned __int64 sequenceNumber=2, const WebKit::UpdateInfo &amp; updateInfo={...})  Line 142	C++
 	WebKit.dll!CoreIPC::callMemberFunction&lt;WebKit::DrawingAreaProxy,void (__thiscall WebKit::DrawingAreaProxy::*)(unsigned __int64,WebKit::UpdateInfo const &amp;),unsigned __int64,WebKit::UpdateInfo&gt;(const CoreIPC::Arguments2&lt;unsigned __int64,WebKit::UpdateInfo&gt; &amp; args={...}, WebKit::DrawingAreaProxy * object=0x0972f508, void (unsigned __int64, const WebKit::UpdateInfo &amp;)* function=0x0382cab3)  Line 25 + 0x19 bytes	C++
 	WebKit.dll!CoreIPC::handleMessage&lt;Messages::DrawingAreaProxy::Update,WebKit::DrawingAreaProxy,void (__thiscall WebKit::DrawingAreaProxy::*)(unsigned __int64,WebKit::UpdateInfo const &amp;)&gt;(CoreIPC::ArgumentDecoder * argumentDecoder=0x0a218f28, WebKit::DrawingAreaProxy * object=0x0972f508, void (unsigned __int64, const WebKit::UpdateInfo &amp;)* function=0x0382cab3)  Line 246 + 0x11 bytes	C++
 	WebKit.dll!WebKit::DrawingAreaProxy::didReceiveDrawingAreaProxyMessage(CoreIPC::Connection * __formal=0x07943920, CoreIPC::MessageID messageID={...}, CoreIPC::ArgumentDecoder * arguments=0x0a218f28)  Line 41 + 0x12 bytes	C++
 	WebKit.dll!WebKit::WebPageProxy::didReceiveMessage(CoreIPC::Connection * connection=0x07943920, CoreIPC::MessageID messageID={...}, CoreIPC::ArgumentDecoder * arguments=0x0a218f28)  Line 1169	C++
 	WebKit.dll!WebKit::WebProcessProxy::didReceiveMessage(CoreIPC::Connection * connection=0x07943920, CoreIPC::MessageID messageID={...}, CoreIPC::ArgumentDecoder * arguments=0x0a218f28)  Line 245	C++
 	WebKit.dll!CoreIPC::Connection::dispatchMessages()  Line 450 + 0x31 bytes	C++
 	WebKit.dll!MemberFunctionWorkItem0&lt;CoreIPC::Connection&gt;::execute()  Line 76 + 0x10 bytes	C++
 	WebKit.dll!RunLoop::performWork()  Line 63 + 0x1a bytes	C++
 	WebKit.dll!RunLoop::wndProc(HWND__ * hWnd=0x00190762, unsigned int message=1025, unsigned int wParam=115649320, long lParam=0)  Line 57	C++
 	WebKit.dll!RunLoop::RunLoopWndProc(HWND__ * hWnd=0x00190762, unsigned int message=1025, unsigned int wParam=115649320, long lParam=0)  Line 39 + 0x18 bytes	C++</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>348404</commentid>
    <comment_count>1</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-02-09 11:27:24 -0800</bug_when>
    <thetext>&lt;rdar://problem/8978383&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>348406</commentid>
    <comment_count>2</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-02-09 11:28:10 -0800</bug_when>
    <thetext>It looks like we end up scheduling a display in the web process before the WebPage has received a size. The display is being scheduled at this point:

&gt;	WebKit.dll!WebKit::DrawingAreaImpl::scheduleDisplay()  Line 334	C++
 	WebKit.dll!WebKit::DrawingAreaImpl::setNeedsDisplay(const WebCore::IntRect &amp; rect={...})  Line 87	C++
 	WebKit.dll!WebKit::WebChromeClient::invalidateContentsAndWindow(const WebCore::IntRect &amp; rect={...}, bool __formal=false)  Line 362 + 0x21 bytes	C++
 	WebKit.dll!WebCore::Chrome::invalidateContentsAndWindow(const WebCore::IntRect &amp; updateRect={...}, bool immediate=false)  Line 77 + 0x20 bytes	C++
 	WebKit.dll!WebCore::FrameView::invalidateRect(const WebCore::IntRect &amp; rect={...})  Line 316 + 0x2e bytes	C++
 	WebKit.dll!WebCore::FrameView::invalidateScrollbarRect(WebCore::Scrollbar * scrollbar=0x022f8ab8, const WebCore::IntRect &amp; rect={...})  Line 2012 + 0x17 bytes	C++
 	WebKit.dll!WebCore::Scrollbar::invalidateRect(const WebCore::IntRect &amp; rect={...})  Line 453 + 0x1d bytes	C++
 	WebKit.dll!WebCore::Widget::invalidate()  Line 166 + 0x3a bytes	C++
 	WebKit.dll!WebCore::Scrollbar::setEnabled(bool e=false)  Line 432	C++
 	WebKit.dll!WebCore::ScrollView::updateScrollbars(const WebCore::IntSize &amp; desiredOffset={...})  Line 555 + 0x38 bytes	C++
 	WebKit.dll!WebCore::ScrollView::setScrollbarModes(WebCore::ScrollbarMode horizontalMode=ScrollbarAuto, WebCore::ScrollbarMode verticalMode=ScrollbarAlwaysOn, bool horizontalLock=false, bool verticalLock=false)  Line 161	C++
 	WebKit.dll!WebCore::ScrollView::setVerticalScrollbarMode(WebCore::ScrollbarMode mode=ScrollbarAlwaysOn, bool lock=false)  Line 94 + 0x30 bytes	C++
 	WebKit.dll!WebCore::FrameView::layout(bool allowSubtree=true)  Line 859	C++
 	WebKit.dll!WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive()  Line 2311	C++
 	WebKit.dll!WebCore::FocusController::setActive(bool active=true)  Line 409	C++
 	WebKit.dll!WebKit::WebPage::setActive(bool isActive=true)  Line 1061	C++
 	WebKit.dll!CoreIPC::callMemberFunction&lt;WebKit::WebPage,void (__thiscall WebKit::WebPage::*)(bool),bool&gt;(const CoreIPC::Arguments1&lt;bool&gt; &amp; args={...}, WebKit::WebPage * object=0x022fd148, void (bool)* function=0x10005d53)  Line 19 + 0x11 bytes	C++
 	WebKit.dll!CoreIPC::handleMessage&lt;Messages::WebPage::SetActive,WebKit::WebPage,void (__thiscall WebKit::WebPage::*)(bool)&gt;(CoreIPC::ArgumentDecoder * argumentDecoder=0x0231d308, WebKit::WebPage * object=0x022fd148, void (bool)* function=0x10005d53)  Line 246 + 0x15 bytes	C++
 	WebKit.dll!WebKit::WebPage::didReceiveWebPageMessage(CoreIPC::Connection * __formal=0x022be3a0, CoreIPC::MessageID messageID={...}, CoreIPC::ArgumentDecoder * arguments=0x0231d308)  Line 48 + 0x23 bytes	C++
 	WebKit.dll!WebKit::WebPage::didReceiveMessage(CoreIPC::Connection * connection=0x022be3a0, CoreIPC::MessageID messageID={...}, CoreIPC::ArgumentDecoder * arguments=0x0231d308)  Line 1718	C++
 	WebKit.dll!WebKit::WebProcess::didReceiveMessage(CoreIPC::Connection * connection=0x022be3a0, CoreIPC::MessageID messageID={...}, CoreIPC::ArgumentDecoder * arguments=0x0231d308)  Line 539	C++
 	WebKit.dll!CoreIPC::Connection::dispatchMessages()  Line 450 + 0x31 bytes	C++
 	WebKit.dll!MemberFunctionWorkItem0&lt;CoreIPC::Connection&gt;::execute()  Line 76 + 0x10 bytes	C++
 	WebKit.dll!RunLoop::performWork()  Line 63 + 0x1a bytes	C++
 	WebKit.dll!RunLoop::wndProc(HWND__ * hWnd=0x002f0a44, unsigned int message=1025, unsigned int wParam=36335296, long lParam=0)  Line 57	C++
 	WebKit.dll!RunLoop::RunLoopWndProc(HWND__ * hWnd=0x002f0a44, unsigned int message=1025, unsigned int wParam=36335296, long lParam=0)  Line 39 + 0x18 bytes	C++
 	user32.dll!_InternalCallWinProc@20()  + 0x28 bytes	
 	user32.dll!_UserCallWinProcCheckWow@32()  + 0xb7 bytes	
 	user32.dll!_DispatchMessageWorker@8()  + 0xdc bytes	
 	user32.dll!_DispatchMessageW@4()  + 0xf bytes	
 	WebKit.dll!RunLoop::run()  Line 73 + 0xc bytes	C++
 	WebKit.dll!WebKit::WebProcessMain(const WebKit::CommandLine &amp; commandLine={...})  Line 82	C++
 	WebKit.dll!WebKitMain(const WebKit::CommandLine &amp; commandLine={...})  Line 48 + 0x9 bytes	C++
 	WebKit.dll!WebKitMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpstrCmdLine=0x0002114c, int nCmdShow=10)  Line 172 + 0x9 bytes	C++
 	WebKit2WebProcess.exe!wWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpstrCmdLine=0x0002114c, int nCmdShow=10)  Line 66 + 0x18 bytes	C++
 	WebKit2WebProcess.exe!__tmainCRTStartup()  Line 589 + 0x1c bytes	C
 	kernel32.dll!_BaseProcessStart@4()  + 0x23 bytes	

I.e., the WebPage is becoming active, so invalidates its scrollbar, which is non-zero-sized due to this code in Scrollbar::Scrollbar:

    // FIXME: This is ugly and would not be necessary if we fix cross-platform code to actually query for
    // scrollbar thickness and use it when sizing scrollbars (rather than leaving one dimension of the scrollbar
    // alone when sizing).
    int thickness = m_theme-&gt;scrollbarThickness(controlSize);
    Widget::setFrameRect(IntRect(0, 0, thickness, thickness));

I think we should not schedule a display at all in this case, since the WebPage is zero-sized.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>348408</commentid>
    <comment_count>3</comment_count>
      <attachid>81840</attachid>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-02-09 11:30:54 -0800</bug_when>
    <thetext>Created attachment 81840
Don&apos;t invalidate outside of the WebPage&apos;s bounds</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>348942</commentid>
    <comment_count>4</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-02-10 04:42:49 -0800</bug_when>
    <thetext>Committed r78197: &lt;http://trac.webkit.org/changeset/78197&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>81840</attachid>
            <date>2011-02-09 11:30:54 -0800</date>
            <delta_ts>2011-02-09 11:36:51 -0800</delta_ts>
            <desc>Don&apos;t invalidate outside of the WebPage&apos;s bounds</desc>
            <filename>bug-54123-20110209143052.patch</filename>
            <type>text/plain</type>
            <size>2421</size>
            <attacher name="Adam Roben (:aroben)">aroben</attacher>
            
              <data enco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gICAgaWYgKG1fd2ViUGFnZS0+bWFpbkZyYW1l
SGFzQ3VzdG9tUmVwcmVzZW50YXRpb24oKSkK
</data>
<flag name="review"
          id="73451"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>