Title: [105167] trunk/Source/WebKit/mac
- Revision
- 105167
- Author
- [email protected]
- Date
- 2012-01-17 10:26:09 -0800 (Tue, 17 Jan 2012)
Log Message
<rdar://problem/10703228> ASSERTION FAILED: Uncaught exception - Cannot lock focus on image <NSImage 0x1206572a0 Size={0, 0} Reps=( )>, because it is size zero loading techcrunch.com
Reviewed by Anders Carlsson.
Avoid trying to create image snapshots for zero-sized plugins, because
it causes -[NSView lockFocus] to throw an exception.
* Plugins/WebBaseNetscapePluginView.mm:
(-[WebBaseNetscapePluginView cacheSnapshot]):
Modified Paths
Diff
Modified: trunk/Source/WebKit/mac/ChangeLog (105166 => 105167)
--- trunk/Source/WebKit/mac/ChangeLog 2012-01-17 18:11:24 UTC (rev 105166)
+++ trunk/Source/WebKit/mac/ChangeLog 2012-01-17 18:26:09 UTC (rev 105167)
@@ -1,3 +1,15 @@
+2012-01-16 Simon Fraser <[email protected]>
+
+ <rdar://problem/10703228> ASSERTION FAILED: Uncaught exception - Cannot lock focus on image <NSImage 0x1206572a0 Size={0, 0} Reps=( )>, because it is size zero loading techcrunch.com
+
+ Reviewed by Anders Carlsson.
+
+ Avoid trying to create image snapshots for zero-sized plugins, because
+ it causes -[NSView lockFocus] to throw an exception.
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView cacheSnapshot]):
+
2012-01-16 Alexey Proskuryakov <[email protected]>
A follow-up fix for:
Modified: trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm (105166 => 105167)
--- trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm 2012-01-17 18:11:24 UTC (rev 105166)
+++ trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm 2012-01-17 18:26:09 UTC (rev 105167)
@@ -476,7 +476,12 @@
- (void)cacheSnapshot
{
- NSImage *snapshot = [[NSImage alloc] initWithSize: [self bounds].size];
+ NSSize boundsSize = [self bounds].size;
+ if (!boundsSize.height || !boundsSize.width)
+ return;
+
+ NSImage *snapshot = [[NSImage alloc] initWithSize:boundsSize];
+
_snapshotting = YES;
[snapshot lockFocus];
[self drawRect:[self bounds]];
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes