Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

If a containing block element in small, then the ClickToFlash view wi…

…ll not be visible, even though -[NSView visibleRect] and the DOMNode's computed style says it should be visible. Fix for https://rentzsch.lighthouseapp.com/projects/24342/tickets/690-flash-does-not-load-when-expected
  • Loading branch information...
commit 2223e832c38a4bc55f2491a20360e674e374b9c4 1 parent 10ff0e0
Jeff Johnson authored June 12, 2010 rentzsch committed June 12, 2010
1  Plugin/Plugin.h
@@ -60,6 +60,7 @@ THE SOFTWARE.
60 60
 	NSURLConnection *connections[2];
61 61
 	unsigned expectedResponses;
62 62
 	NSTimer *_delayingTimer;
  63
+	NSRect _drawnRect;
63 64
 }
64 65
 
65 66
 + (NSView *)plugInViewWithArguments:(NSDictionary *)arguments;
15  Plugin/Plugin.m
@@ -123,6 +123,7 @@ - (id) initWithArguments:(NSDictionary *)arguments
123 123
 		_embeddedYouTubeView = NO;
124 124
 		_youTubeAutoPlay = NO;
125 125
 		_delayingTimer = nil;
  126
+		_drawnRect = NSZeroRect;
126 127
 		defaultWhitelist = [NSArray arrayWithObjects:	@"com.apple.frontrow",
127 128
 														@"com.apple.dashboard.client",
128 129
 														@"com.apple.ScreenSaver.Engine",
@@ -565,7 +566,10 @@ - (void) _addApplicationWhitelistArrayToPrefsFile
565 566
 - (void) drawRect:(NSRect)rect
566 567
 {
567 568
 	if(!_isLoadingFromWhitelist)
  569
+	{
  570
+		_drawnRect = NSUnionRect( _drawnRect, rect );
568 571
 		[self _drawBackground];
  572
+	}
569 573
 }
570 574
 
571 575
 - (BOOL) _gearVisible
@@ -659,10 +663,13 @@ - (BOOL) _isOptionPressed
659 663
 
660 664
 - (BOOL) isConsideredInvisible
661 665
 {
662  
-	int height = (int)([[self webView] frame].size.height);
663  
-	int width = (int)([[self webView] frame].size.width);
664  
-	
665  
-	if ( (height <= maxInvisibleDimension) && (width <= maxInvisibleDimension) )
  666
+	int height = NSHeight( _drawnRect );
  667
+	int width = NSWidth( _drawnRect );
  668
+	if ( height > 0 && height <= maxInvisibleDimension )
  669
+	{
  670
+		return YES;
  671
+	}
  672
+	if ( width > 0 && width <= maxInvisibleDimension )
666 673
 	{
667 674
 		return YES;
668 675
 	}

0 notes on commit 2223e83

Please sign in to comment.
Something went wrong with that request. Please try again.