Changeset 41977 in webkit
- Timestamp:
- Mar 25, 2009 10:30:01 AM (15 years ago)
- Location:
- trunk/WebKit/mac
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/mac/ChangeLog
r41937 r41977 1 2009-03-25 Mike Thole <mthole@apple.com> 2 3 Reviewed by Kevin Decker. 4 5 <rdar://problem/6453738> call SetWindow when user creates a new tab 6 7 CoreGraphics plug-ins now receive an NPP_SetWindow call when moving to a background tab. 8 Flash is excluded from this change in behavior, as it has historical WebKit-specific code 9 that isn't compatible with this change. 10 11 * Plugins/WebNetscapePluginView.h: 12 Added an _isFlash ivar. 13 * Plugins/WebNetscapePluginView.mm: 14 (-[WebNetscapePluginView _createPlugin]): 15 Set the new _isFlash ivar based on the bundle identifier. 16 (-[WebNetscapePluginView saveAndSetNewPortStateForUpdate:]): 17 When using the CG drawing model and in a non-drawable state, set the portState 18 to NULL and return early. 19 (-[WebNetscapePluginView updateAndSetWindow]): 20 When using the CG drawing model, call -setWindowIfNecessary even if the portState is NULL. 21 Flash is an exception to this, due to its historical behavior. 22 (-[WebNetscapePluginView setWindowIfNecessary]): 23 Removed an assertion that was no longer true. The [NSView focus] view 24 is no longer guaranteed to be 'self' at this point. 25 Also modified the debug logging for CG plug-ins to include the size of the 26 window's clipRect, which was useful in verifying the correct behavior of this patch. 27 1 28 2009-03-24 Dan Bernstein <mitz@apple.com> 2 29 -
trunk/WebKit/mac/Plugins/WebNetscapePluginView.h
r41674 r41977 100 100 RetainPtr<NSMutableDictionary> _pendingFrameLoads; 101 101 102 BOOL _isFlash; 102 103 BOOL _isSilverlight; 103 104 } -
trunk/WebKit/mac/Plugins/WebNetscapePluginView.mm
r41783 r41977 495 495 496 496 case NPDrawingModelCoreGraphics: { 497 if (![self canDraw]) { 498 portState = NULL; 499 break; 500 } 501 497 502 ASSERT([NSView focusView] == self); 498 503 … … 893 898 // A plug-in can only update if it's (1) already been started (2) isn't stopped 894 899 // and (3) is able to draw on-screen. To meet condition (3) the plug-in must not 895 // be hidden and be attached to a window. QuickDraw plug-ins are an important 896 // excpetion to rule (3) because they manually must be told when to stop writing 900 // be hidden and be attached to a window. There are two exceptions to this rule: 901 // 902 // Exception 1: QuickDraw plug-ins must be manually told when to stop writing 897 903 // bits to the window backing store, thus to do so requires a new call to 898 904 // NPP_SetWindow() with an empty NPWindow struct. 905 // 906 // Exception 2: CoreGraphics plug-ins expect to have their drawable area updated 907 // when they are moved to a background tab, via a NPP_SetWindow call. This is 908 // accomplished by allowing -saveAndSetNewPortStateForUpdate to "clip-out" the window's 909 // clipRect. Flash is curently an exception to this. See 6453738. 910 // 911 899 912 if (!_isStarted) 900 913 return; … … 906 919 if (drawingModel == NPDrawingModelQuickDraw) 907 920 [self tellQuickTimeToChill]; 908 else if (drawingModel == NPDrawingModelCoreGraphics && ![self canDraw]) 909 return; 910 921 else if (drawingModel == NPDrawingModelCoreGraphics && ![self canDraw] && _isFlash) { 922 // The Flash plug-in does not expect an NPP_SetWindow call from WebKit in this case. 923 // See Exception 2 above. 924 return; 925 } 911 926 #endif // NP_NO_QUICKDRAW 912 927 … … 919 934 if (portState != (PortState)1) 920 935 free(portState); 921 } 936 } else if (drawingModel == NPDrawingModelCoreGraphics) 937 [self setWindowIfNecessary]; 938 922 939 if (didLockFocus) 923 940 [self unlockFocus]; … … 937 954 ASSERT(!inSetWindow); 938 955 939 inSetWindow = YES; 940 941 // A CoreGraphics plugin's window may only be set while the plugin is being updated 942 ASSERT((drawingModel != NPDrawingModelCoreGraphics) || [NSView focusView] == self); 943 956 inSetWindow = YES; 944 957 [self willCallPlugInFunction]; 945 958 { … … 960 973 961 974 case NPDrawingModelCoreGraphics: 962 LOG(Plugins, "NPP_SetWindow (CoreGraphics): %d, window=%p, context=%p, window.x:%d window.y:%d window.width:%d window.height:%d", 963 npErr, nPort.cgPort.window, nPort.cgPort.context, (int)window.x, (int)window.y, (int)window.width, (int)window.height); 975 LOG(Plugins, "NPP_SetWindow (CoreGraphics): %d, window=%p, context=%p, window.x:%d window.y:%d window.width:%d window.height:%d window.clipRect size:%dx%d", 976 npErr, nPort.cgPort.window, nPort.cgPort.context, (int)window.x, (int)window.y, (int)window.width, (int)window.height, 977 window.clipRect.right - window.clipRect.left, window.clipRect.bottom - window.clipRect.top); 964 978 break; 965 979 … … 2060 2074 PluginMainThreadScheduler::scheduler().registerPlugin(plugin); 2061 2075 2076 _isFlash = [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.macromedia.Flash Player.plugin"]; 2062 2077 _isSilverlight = [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.microsoft.SilverlightPlugin"]; 2063 2078
Note: See TracChangeset
for help on using the changeset viewer.