<?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>4755</bug_id>
          
          <creation_ts>2005-08-30 07:32:25 -0700</creation_ts>
          <short_desc>&quot;CGContext*: invalid context&quot; messages dumped to the console (may indicate a performance hit)</short_desc>
          <delta_ts>2005-09-05 00:30: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>Layout and Rendering</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>mitz</reporter>
          <assigned_to name="Darin Adler">darin</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>17915</commentid>
    <comment_count>0</comment_count>
    <who name="">mitz</who>
    <bug_when>2005-08-30 07:32:25 -0700</bug_when>
    <thetext>After running Safari for a while, it starts dumping &quot;invalid context&quot; error messages from various 
CGContext routines to the console. Once it&apos;s in &quot;dumping errors&quot; state, merely switching Safari to the 
background and bringing it back to the foreground will generate a few of these messages.

Setting a breakpoint at CGPostError gives backtraces like this:

#0  0x9048e008 in CGPostError ()
#1  0x903cca0c in CGContextClipToRect ()
#2  0x937cad04 in +[NSBezierPath clipRect:] ()
#3  0x01624a30 in QPainter::addClip (this=0xbfffe304, rect=@0xbfffdf48) at WebCore/kwq/
KWQPainter.mm:762
#4  0x017f6c18 in setClip (p=0xbfffe304, paintDirtyRect=@0xbfffe2f4, clipRect=@0xbfffdf48) at 
WebCore/khtml/rendering/render_layer.cpp:846
#5  0x017fbae8 in khtml::RenderLayer::paintLayer (this=0xbc6c63c, rootLayer=0xbf8b4fc, 
p=0xbfffe304, paintDirtyRect=@0xbfffe2f4, haveTransparency=false, selectionOnly=false, 
paintingRoot=0x0) at WebCore/khtml/rendering/render_layer.cpp:904
#6  0x017fbf58 in khtml::RenderLayer::paintLayer (this=0xbf3da1c, rootLayer=0xbf8b4fc, 
p=0xbfffe304, paintDirtyRect=@0xbfffe2f4, haveTransparency=false, selectionOnly=false, 
paintingRoot=0x0) at WebCore/khtml/rendering/render_layer.cpp:963
#7  0x017fbf58 in khtml::RenderLayer::paintLayer (this=0xbf8b4fc, rootLayer=0xbf8b4fc, 
p=0xbfffe304, paintDirtyRect=@0xbfffe2f4, haveTransparency=false, selectionOnly=false, 
paintingRoot=0x0) at WebCore/khtml/rendering/render_layer.cpp:963
#8  0x017fc038 in khtml::RenderLayer::paint (this=0xbf8b4fc, p=0xbfffe304, 
damageRect=@0xbfffe2f4, selectionOnly=false, paintingRoot=0x0) at WebCore/khtml/rendering/
render_layer.cpp:835
#9  0x015f4478 in KWQKHTMLPart::paint (this=0x70f3200, p=0xbfffe304, rect=@0xbfffe2f4) at 
WebCore/kwq/KWQKHTMLPart.mm:1171
#10 0x015f5050 in KWQKHTMLPart::setDisplaysWithFocusAttributes (this=0x70f3200, flag=true) at 
WebCore/kwq/KWQKHTMLPart.mm:3752
#11 0x01656b9c in -[WebCoreBridge setDisplaysWithFocusAttributes:] (self=0xba9d580, 
_cmd=0x90a30150, flag=1 &apos;\001&apos;) at WebCore/kwq/WebCoreBridge.mm:1385
#12 0x00371cbc in -[WebHTMLView(WebHTMLViewFileInternal) updateFocusState] (self=0xc31a820, 
_cmd=0x4061cc) at WebKit/WebView.subproj/WebHTMLView.m:633
#13 0x0037d914 in -[WebHTMLView windowDidBecomeKey:] (self=0xc31a820, _cmd=0x90a3df80, 
notification=0xb821720) at WebKit/WebView.subproj/WebHTMLView.m:2490
#14 0x928d7838 in _nsnote_callback ()
#15 0x90785558 in __CFXNotificationPost ()
#16 0x9077d634 in _CFXNotificationPostNotification ()
#17 0x928c1c40 in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
#18 0x936df76c in -[NSWindow becomeKeyWindow] ()
#19 0x00017238 in ?? ()
#20 0x937328fc in _NXShowKeyAndMain ()
#21 0x936d8190 in -[NSWindow sendEvent:] ()
#22 0x0001d558 in ?? ()
#23 0x93681734 in -[NSApplication sendEvent:] ()
#24 0x0001a530 in ?? ()
#25 0x93678b70 in -[NSApplication run] ()
#26 0x93769658 in NSApplicationMain ()

In all cases that I checked of this, the CGContextRef that was passed was a 0 which was coming from 
[[NSGraphicsContext currentContext] graphicsPort] or such.

While I can&apos;t see that rendering is affected by this, maybe it indicates that everything is being rendered 
twice, once in &quot;nowhere&quot; and once in the window.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18712</commentid>
    <comment_count>1</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2005-09-04 15:01:24 -0700</bug_when>
    <thetext>The patch attached to bug 4274 will fix this.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>