Changeset 98403 in webkit
- Timestamp:
- Oct 25, 2011, 4:00:37 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 19 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/mac-wk2/plugins/contents-scale-factor-expected.txt (added)
-
LayoutTests/platform/mac-wk2/plugins/contents-scale-factor.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/plugins/npapi.h (modified) (1 diff)
-
Source/WebKit2/ChangeLog (modified) (1 diff)
-
Source/WebKit2/PluginProcess/PluginControllerProxy.cpp (modified) (1 diff)
-
Source/WebKit2/PluginProcess/PluginControllerProxy.h (modified) (2 diffs)
-
Source/WebKit2/PluginProcess/PluginCreationParameters.cpp (modified) (3 diffs)
-
Source/WebKit2/PluginProcess/PluginCreationParameters.h (modified) (1 diff)
-
Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm (modified) (1 diff)
-
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp (modified) (1 diff)
-
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h (modified) (1 diff)
-
Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm (modified) (1 diff)
-
Source/WebKit2/WebProcess/Plugins/PluginController.h (modified) (1 diff)
-
Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp (modified) (2 diffs)
-
Source/WebKit2/WebProcess/Plugins/PluginView.cpp (modified) (1 diff)
-
Source/WebKit2/WebProcess/Plugins/PluginView.h (modified) (1 diff)
-
Source/WebKit2/WebProcess/WebPage/WebPage.cpp (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj (modified) (4 diffs)
-
Tools/DumpRenderTree/TestNetscapePlugIn/Tests/mac/ContentsScaleFactor.cpp (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r98397 r98403 1 2011-10-25 Anders Carlsson <andersca@apple.com> 2 3 Plug-ins have to use JavaScript to find out the current device scale factor 4 https://bugs.webkit.org/show_bug.cgi?id=67225 5 <rdar://problem/10048258> 6 7 Reviewed by Darin Adler. 8 9 Add tests. 10 11 * platform/mac-wk2/plugins/contents-scale-factor-expected.txt: Added. 12 * platform/mac-wk2/plugins/contents-scale-factor.html: Added. 13 1 14 2011-10-25 Julien Chaffraix <jchaffraix@webkit.org> 2 15 -
trunk/Source/WebCore/ChangeLog
r98402 r98403 1 2011-10-25 Anders Carlsson <andersca@apple.com> 2 3 Plug-ins have to use JavaScript to find out the current device scale factor 4 https://bugs.webkit.org/show_bug.cgi?id=67225 5 6 Reviewed by Darin Adler. 7 8 Test: platform/mac-wk2/plugins/contents-scale-factor.html 9 10 Add NPNVcontentsScaleFactor, as per https://wiki.mozilla.org/NPAPI:ContentsScaleFactor. 11 12 * plugins/npapi.h: 13 1 14 2011-10-25 Adam Klein <adamk@chromium.org> 2 15 -
trunk/Source/WebCore/plugins/npapi.h
r97557 r98403 417 417 /* Used for negotiating drawing models */ 418 418 , NPNVpluginDrawingModel = 1000 419 , NPNVcontentsScaleFactor = 1001 419 420 #ifndef NP_NO_QUICKDRAW 420 421 , NPNVsupportsQuickDrawBool = 2000 -
trunk/Source/WebKit2/ChangeLog
r98399 r98403 1 2011-10-25 Anders Carlsson <andersca@apple.com> 2 3 Plug-ins have to use JavaScript to find out the current device scale factor 4 https://bugs.webkit.org/show_bug.cgi?id=67225 5 <rdar://problem/10048258> 6 7 Reviewed by Darin Adler. 8 9 * PluginProcess/PluginControllerProxy.cpp: 10 (WebKit::PluginControllerProxy::PluginControllerProxy): 11 Initialize m_contentsScaleFactor. 12 13 * PluginProcess/PluginControllerProxy.h: 14 Add contentsScaleFactor member function and m_contentsScaleFactor member variable. 15 16 * PluginProcess/PluginCreationParameters.cpp: 17 (WebKit::PluginCreationParameters::PluginCreationParameters): 18 (WebKit::PluginCreationParameters::encode): 19 (WebKit::PluginCreationParameters::decode): 20 * PluginProcess/PluginCreationParameters.h: 21 Add contentsScaleFactor to the creation parameters. 22 23 * PluginProcess/mac/PluginControllerProxyMac.mm: 24 (WebKit::PluginControllerProxy::contentsScaleFactor): 25 Return the cached m_contentsScaleFactor. 26 27 * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: 28 (WebKit::NPN_GetValue): 29 Handle getting the scale factor by calling NetscapePlugin::contentsScaleFactor. 30 31 * WebProcess/Plugins/Netscape/NetscapePlugin.h: 32 * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: 33 (WebKit::NetscapePlugin::contentsScaleFactor): 34 Ask the plug-in controller for the contents scale factor. 35 36 * WebProcess/Plugins/PluginController.h: 37 Add contentsScaleFactor pure virtual member function. 38 39 * WebProcess/Plugins/PluginProxy.cpp: 40 (WebKit::PluginProxy::initialize): 41 Set contentsScaleFactor in the creation parameters. 42 43 * WebProcess/Plugins/PluginView.cpp: 44 (WebKit::PluginView::contentsScaleFactor): 45 Get the device scale factor from the page. 46 47 * WebProcess/Plugins/PluginView.h: 48 Add contentsScaleFactor(). 49 50 * WebProcess/WebPage/WebPage.cpp: 51 (WebKit::WebPage::setDeviceScaleFactor): 52 Bail if the scale factor didn't change. 53 1 54 2011-10-25 Sam Weinig <sam@webkit.org> 2 55 -
trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
r95901 r98403 71 71 #if PLATFORM(MAC) 72 72 , m_isComplexTextInputEnabled(false) 73 , m_contentsScaleFactor(creationParameters.contentsScaleFactor) 73 74 #endif 74 75 , m_windowNPObject(0) -
trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h
r95901 r98403 100 100 virtual void setComplexTextInputState(PluginComplexTextInputState); 101 101 virtual mach_port_t compositingRenderServerPort(); 102 virtual float contentsScaleFactor(); 102 103 #endif 103 104 … … 192 193 bool m_isComplexTextInputEnabled; 193 194 195 // The contents scale factor of this plug-in. 196 float m_contentsScaleFactor; 197 194 198 // For CA plug-ins, this holds the information needed to export the layer hierarchy to the UI process. 195 199 RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient; -
trunk/Source/WebKit2/PluginProcess/PluginCreationParameters.cpp
r95901 r98403 40 40 , isAcceleratedCompositingEnabled(false) 41 41 #endif 42 #if PLATFORM(MAC) 43 , contentsScaleFactor(1) 44 #endif 42 45 { 43 46 } … … 53 56 #if USE(ACCELERATED_COMPOSITING) 54 57 encoder->encode(isAcceleratedCompositingEnabled); 58 #endif 59 60 #if PLATFORM(MAC) 61 encoder->encode(contentsScaleFactor); 55 62 #endif 56 63 } … … 78 85 #endif 79 86 87 #if PLATFORM(MAC) 88 if (!decoder->decode(result.contentsScaleFactor)) 89 return false; 90 #endif 91 80 92 return true; 81 93 } -
trunk/Source/WebKit2/PluginProcess/PluginCreationParameters.h
r95901 r98403 63 63 bool isAcceleratedCompositingEnabled; 64 64 #endif 65 66 #if PLATFORM(MAC) 67 // The current contents scale factor that this plug-in should have. 68 float contentsScaleFactor; 69 #endif 65 70 }; 66 71 -
trunk/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm
r95901 r98403 52 52 { 53 53 return PluginProcess::shared().compositingRenderServerPort(); 54 } 55 56 float PluginControllerProxy::contentsScaleFactor() 57 { 58 return m_contentsScaleFactor; 54 59 } 55 60 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
r95901 r98403 459 459 460 460 *(NPBool*)value = plugin->isAcceleratedCompositingEnabled(); 461 break; 462 } 463 case NPNVcontentsScaleFactor: { 464 RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp); 465 466 *(double*)value = plugin->contentsScaleFactor(); 461 467 break; 462 468 } -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
r98369 r98403 64 64 65 65 mach_port_t compositingRenderServerPort(); 66 double contentsScaleFactor(); 66 67 67 68 #ifndef NP_NO_CARBON -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
r95901 r98403 180 180 } 181 181 182 double NetscapePlugin::contentsScaleFactor() 183 { 184 return controller()->contentsScaleFactor(); 185 } 186 182 187 #ifndef NP_NO_CARBON 183 188 typedef HashMap<WindowRef, NetscapePlugin*> WindowMap; -
trunk/Source/WebKit2/WebProcess/Plugins/PluginController.h
r95901 r98403 121 121 // Returns the mach port of the compositing render server. 122 122 virtual mach_port_t compositingRenderServerPort() = 0; 123 124 // Returns the contents scale factor. 125 virtual float contentsScaleFactor() = 0; 123 126 #endif 124 127 -
trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
r98369 r98403 102 102 creationParameters.isAcceleratedCompositingEnabled = controller()->isAcceleratedCompositingEnabled(); 103 103 #endif 104 #if PLATFORM(MAC) 105 creationParameters.contentsScaleFactor = controller()->contentsScaleFactor(); 106 #endif 104 107 105 108 bool result = false; … … 376 379 m_connection->connection()->send(Messages::PluginControllerProxy::SendComplexTextInput(textInput), m_pluginInstanceID); 377 380 } 378 379 381 #endif 380 382 -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
r98394 r98403 1141 1141 return WebProcess::shared().compositingRenderServerPort(); 1142 1142 } 1143 1144 float PluginView::contentsScaleFactor() 1145 { 1146 if (Page* page = frame() ? frame()->page() : 0) 1147 return page->deviceScaleFactor(); 1148 1149 return 1; 1150 } 1143 1151 #endif 1144 1152 -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h
r98369 r98403 151 151 virtual void setComplexTextInputState(PluginComplexTextInputState); 152 152 virtual mach_port_t compositingRenderServerPort(); 153 virtual float contentsScaleFactor(); 153 154 #endif 154 155 virtual String proxiesForURL(const String&); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r98325 r98403 847 847 void WebPage::setDeviceScaleFactor(float scaleFactor) 848 848 { 849 if (scaleFactor == m_page->deviceScaleFactor()) 850 return; 851 849 852 m_page->setDeviceScaleFactor(scaleFactor); 850 853 } -
trunk/Tools/ChangeLog
r98399 r98403 1 2011-10-25 Anders Carlsson <andersca@apple.com> 2 3 Plug-ins have to use JavaScript to find out the current device scale factor 4 https://bugs.webkit.org/show_bug.cgi?id=67225 5 <rdar://problem/10048258> 6 7 Reviewed by Darin Adler. 8 9 Add a plug-in test for getting the contents scale factor. 10 11 * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: 12 * DumpRenderTree/TestNetscapePlugIn/Tests/mac/ContentsScaleFactor.cpp: Added. 13 (ContentsScaleFactor::ContentsScaleFactor): 14 (ContentsScaleFactor::contentsScaleFactor): 15 (ContentsScaleFactor::ScriptableObject::hasProperty): 16 (ContentsScaleFactor::ScriptableObject::getProperty): 17 (ContentsScaleFactor::ScriptableObject::pluginTest): 18 (ContentsScaleFactor::NPP_GetValue): 19 1 20 2011-10-25 Sam Weinig <sam@webkit.org> 2 21 -
trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
r94430 r98403 42 42 1A3E28AA1311D73B00501349 /* GetURLWithJavaScriptURLDestroyingPlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3E28A91311D73B00501349 /* GetURLWithJavaScriptURLDestroyingPlugin.cpp */; }; 43 43 1A5CC1F5137DD2EC00A5D7E7 /* GetURLWithJavaScriptURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5CC1F3137DD2EC00A5D7E7 /* GetURLWithJavaScriptURL.cpp */; }; 44 1A66C35114576A920099A115 /* ContentsScaleFactor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A66C34F14576A920099A115 /* ContentsScaleFactor.cpp */; }; 44 45 1A8F02E80BB9B4EC008CFA34 /* TestObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8F024C0BB9B056008CFA34 /* TestObject.h */; }; 45 46 1AC6C8490D07638600CD3161 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC6C77F0D07589B00CD3161 /* main.cpp */; }; … … 226 227 1A3E28A91311D73B00501349 /* GetURLWithJavaScriptURLDestroyingPlugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetURLWithJavaScriptURLDestroyingPlugin.cpp; sourceTree = "<group>"; }; 227 228 1A5CC1F3137DD2EC00A5D7E7 /* GetURLWithJavaScriptURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetURLWithJavaScriptURL.cpp; sourceTree = "<group>"; }; 229 1A66C34F14576A920099A115 /* ContentsScaleFactor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentsScaleFactor.cpp; sourceTree = "<group>"; }; 228 230 1A8F024C0BB9B056008CFA34 /* TestObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestObject.h; sourceTree = "<group>"; }; 229 231 1AC6C77F0D07589B00CD3161 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; }; … … 526 528 1A31EB3713466AC100017372 /* ConvertPoint.cpp */, 527 529 1A14C8A31406DE0400B254F7 /* SupportsCarbonEventModel.cpp */, 530 1A66C34F14576A920099A115 /* ContentsScaleFactor.cpp */, 528 531 ); 529 532 path = mac; … … 836 839 1A14C8A51406DE0400B254F7 /* SupportsCarbonEventModel.cpp in Sources */, 837 840 1A1E4298141141C400388758 /* PrivateBrowsing.cpp in Sources */, 841 1A66C35114576A920099A115 /* ContentsScaleFactor.cpp in Sources */, 838 842 ); 839 843 runOnlyForDeploymentPostprocessing = 0;
Note:
See TracChangeset
for help on using the changeset viewer.