Changeset 161402 in webkit
- Timestamp:
- Jan 6, 2014 9:19:38 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r161401 r161402 1 2014-01-06 Seokju Kwon <seokju@webkit.org> 2 3 Web Inspector: Remove canOverrideDeviceMetrics and setDeviceMetricsOverride from protocol 4 https://bugs.webkit.org/show_bug.cgi?id=126149 5 6 Reviewed by Joseph Pecoraro. 7 8 No new tests, No changes in behavior. 9 10 These are not used anywhere in WebInspectorUI. 11 So, it removes unused Protocols and APIs. 12 13 * inspector/InspectorClient.h: 14 * inspector/InspectorPageAgent.cpp: 15 (WebCore::InspectorPageAgent::InspectorPageAgent): 16 (WebCore::InspectorPageAgent::disable): 17 * inspector/InspectorPageAgent.h: 18 * inspector/protocol/Page.json: 19 1 20 2014-01-06 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 21 -
trunk/Source/WebCore/inspector/InspectorClient.h
r161380 r161402 62 62 virtual bool canMonitorMainThread() { return false; } 63 63 64 virtual bool canOverrideDeviceMetrics() { return false; }65 66 64 virtual void overrideDeviceMetrics(int /*width*/, int /*height*/, float /*fontScaleFactor*/, bool /*fitWindow*/) 67 65 { -
trunk/Source/WebCore/inspector/InspectorPageAgent.cpp
r160588 r161402 363 363 , m_screenWidthOverride(0) 364 364 , m_screenHeightOverride(0) 365 , m_fontScaleFactorOverride(1)366 , m_fitWindowOverride(false)367 365 , m_enabled(false) 368 366 , m_isFirstLayoutAfterOnLoad(false) … … 414 412 setContinuousPaintingEnabled(0, false); 415 413 416 if (!deviceMetricsChanged(0, 0, 1, false))417 return;418 419 414 // When disabling the agent, reset the override values if necessary. 420 updateViewMetrics(0, 0, 1, false);421 415 m_screenWidthOverride = 0; 422 416 m_screenHeightOverride = 0; 423 m_fontScaleFactorOverride = 1;424 m_fitWindowOverride = false;425 417 } 426 418 … … 693 685 } 694 686 695 void InspectorPageAgent::canOverrideDeviceMetrics(ErrorString*, bool* result)696 {697 *result = m_client->canOverrideDeviceMetrics();698 }699 700 void InspectorPageAgent::setDeviceMetricsOverride(ErrorString* errorString, int width, int height, double fontScaleFactor, bool fitWindow)701 {702 const static long maxDimension = 10000000;703 704 if (width < 0 || height < 0 || width > maxDimension || height > maxDimension) {705 *errorString = makeString("Width and height values must be positive, not greater than ", String::number(maxDimension));706 return;707 }708 709 if (!width ^ !height) {710 *errorString = "Both width and height must be either zero or non-zero at once";711 return;712 }713 714 if (fontScaleFactor <= 0) {715 *errorString = "fontScaleFactor must be positive";716 return;717 }718 719 if (!deviceMetricsChanged(width, height, fontScaleFactor, fitWindow))720 return;721 722 m_screenWidthOverride = width;723 m_screenHeightOverride = height;724 m_fontScaleFactorOverride = fontScaleFactor;725 m_fitWindowOverride = fitWindow;726 727 updateViewMetrics(width, height, fontScaleFactor, fitWindow);728 }729 730 bool InspectorPageAgent::deviceMetricsChanged(int width, int height, double fontScaleFactor, bool fitWindow)731 {732 return width != m_screenWidthOverride || height != m_screenHeightOverride || fontScaleFactor != m_fontScaleFactorOverride || fitWindow != m_fitWindowOverride;733 }734 735 687 void InspectorPageAgent::setShowPaintRects(ErrorString*, bool show) 736 688 { … … 1095 1047 } 1096 1048 1097 void InspectorPageAgent::updateViewMetrics(int width, int height, double fontScaleFactor, bool fitWindow)1098 {1099 m_client->overrideDeviceMetrics(width, height, static_cast<float>(fontScaleFactor), fitWindow);1100 1101 Document* document = mainFrame()->document();1102 if (document)1103 document->styleResolverChanged(RecalcStyleImmediately);1104 InspectorInstrumentation::mediaQueryResultChanged(document);1105 }1106 1107 1049 #if ENABLE(TOUCH_EVENTS) 1108 1050 void InspectorPageAgent::updateTouchEventEmulationInPage(bool enabled) -
trunk/Source/WebCore/inspector/InspectorPageAgent.h
r160588 r161402 113 113 virtual void searchInResources(ErrorString*, const String&, const bool* caseSensitive, const bool* isRegex, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Page::SearchResult>>&); 114 114 virtual void setDocumentContent(ErrorString*, const String& frameId, const String& html); 115 virtual void canOverrideDeviceMetrics(ErrorString*, bool*);116 virtual void setDeviceMetricsOverride(ErrorString*, int width, int height, double fontScaleFactor, bool fitWindow);117 115 virtual void setShowPaintRects(ErrorString*, bool show); 118 116 virtual void canShowDebugBorders(ErrorString*, bool*); … … 186 184 private: 187 185 InspectorPageAgent(InstrumentingAgents*, Page*, InspectorAgent*, InjectedScriptManager*, InspectorClient*, InspectorOverlay*); 188 bool deviceMetricsChanged(int width, int height, double fontScaleFactor, bool fitWindow);189 void updateViewMetrics(int, int, double, bool);190 186 #if ENABLE(TOUCH_EVENTS) 191 187 void updateTouchEventEmulationInPage(bool); … … 214 210 int m_screenWidthOverride; 215 211 int m_screenHeightOverride; 216 double m_fontScaleFactorOverride;217 bool m_fitWindowOverride;218 212 bool m_enabled; 219 213 bool m_isFirstLayoutAfterOnLoad; -
trunk/Source/WebCore/inspector/protocol/Page.json
r160827 r161402 193 193 }, 194 194 { 195 "name": "canOverrideDeviceMetrics",196 "description": "Checks whether <code>setDeviceMetricsOverride</code> can be invoked.",197 "returns": [198 { "name": "result", "type": "boolean", "description": "If true, <code>setDeviceMetricsOverride</code> can safely be invoked on the agent." }199 ]200 },201 {202 "name": "setDeviceMetricsOverride",203 "description": "Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and \"device-width\"/\"device-height\"-related CSS media query results) and the font scale factor.",204 "parameters": [205 { "name": "width", "type": "integer", "description": "Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override." },206 { "name": "height", "type": "integer", "description": "Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override." },207 { "name": "fontScaleFactor", "type": "number", "description": "Overriding font scale factor value (must be positive). 1 disables the override." },208 { "name": "fitWindow", "type": "boolean", "description": "Whether a view that exceeds the available browser window area should be scaled down to fit." }209 ]210 },211 {212 195 "name": "setShowPaintRects", 213 196 "description": "Requests that backend shows paint rectangles", -
trunk/Source/WebInspectorUI/ChangeLog
r161385 r161402 1 2014-01-06 Seokju Kwon <seokju@webkit.org> 2 3 Web Inspector: Remove canOverrideDeviceMetrics and setDeviceMetricsOverride from protocol 4 https://bugs.webkit.org/show_bug.cgi?id=126149 5 6 Reviewed by Joseph Pecoraro. 7 8 * UserInterface/InspectorWebBackendCommands.js: Remove unused codes. 9 * UserInterface/Legacy/6.0/InspectorWebBackendCommands.js: Ditto. 10 * UserInterface/Legacy/7.0/InspectorWebBackendCommands.js: Ditto. 11 * Versions/Inspector-iOS-6.0.json: Ditto. 12 * Versions/Inspector-iOS-7.0.json: Ditto. 13 1 14 2014-01-06 Seokju Kwon <seokju@webkit.org> 2 15 -
trunk/Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js
r161385 r161402 261 261 InspectorBackend.registerCommand("Page.searchInResources", [{"name": "text", "type": "string", "optional": false}, {"name": "caseSensitive", "type": "boolean", "optional": true}, {"name": "isRegex", "type": "boolean", "optional": true}], ["result"]); 262 262 InspectorBackend.registerCommand("Page.setDocumentContent", [{"name": "frameId", "type": "string", "optional": false}, {"name": "html", "type": "string", "optional": false}], []); 263 InspectorBackend.registerCommand("Page.canOverrideDeviceMetrics", [], ["result"]);264 InspectorBackend.registerCommand("Page.setDeviceMetricsOverride", [{"name": "width", "type": "number", "optional": false}, {"name": "height", "type": "number", "optional": false}, {"name": "fontScaleFactor", "type": "number", "optional": false}, {"name": "fitWindow", "type": "boolean", "optional": false}], []);265 263 InspectorBackend.registerCommand("Page.setShowPaintRects", [{"name": "result", "type": "boolean", "optional": false}], []); 266 264 InspectorBackend.registerCommand("Page.canShowDebugBorders", [], ["show"]); -
trunk/Source/WebInspectorUI/UserInterface/Legacy/6.0/InspectorWebBackendCommands.js
r161385 r161402 40 40 InspectorBackend.registerCommand("Page.searchInResources", [{"name": "text", "type": "string", "optional": false}, {"name": "caseSensitive", "type": "boolean", "optional": true}, {"name": "isRegex", "type": "boolean", "optional": true}], ["result"]); 41 41 InspectorBackend.registerCommand("Page.setDocumentContent", [{"name": "frameId", "type": "string", "optional": false}, {"name": "html", "type": "string", "optional": false}], []); 42 InspectorBackend.registerCommand("Page.canOverrideDeviceMetrics", [], ["result"]);43 InspectorBackend.registerCommand("Page.setDeviceMetricsOverride", [{"name": "width", "type": "number", "optional": false}, {"name": "height", "type": "number", "optional": false}, {"name": "fontScaleFactor", "type": "number", "optional": false}, {"name": "fitWindow", "type": "boolean", "optional": false}], []);44 42 InspectorBackend.registerCommand("Page.setShowPaintRects", [{"name": "result", "type": "boolean", "optional": false}], []); 45 43 InspectorBackend.registerCommand("Page.getScriptExecutionStatus", [], ["result"]); -
trunk/Source/WebInspectorUI/UserInterface/Legacy/7.0/InspectorWebBackendCommands.js
r161385 r161402 47 47 InspectorBackend.registerCommand("Page.searchInResources", [{"name": "text", "type": "string", "optional": false}, {"name": "caseSensitive", "type": "boolean", "optional": true}, {"name": "isRegex", "type": "boolean", "optional": true}], ["result"]); 48 48 InspectorBackend.registerCommand("Page.setDocumentContent", [{"name": "frameId", "type": "string", "optional": false}, {"name": "html", "type": "string", "optional": false}], []); 49 InspectorBackend.registerCommand("Page.canOverrideDeviceMetrics", [], ["result"]);50 InspectorBackend.registerCommand("Page.setDeviceMetricsOverride", [{"name": "width", "type": "number", "optional": false}, {"name": "height", "type": "number", "optional": false}, {"name": "fontScaleFactor", "type": "number", "optional": false}, {"name": "fitWindow", "type": "boolean", "optional": false}], []);51 49 InspectorBackend.registerCommand("Page.setShowPaintRects", [{"name": "result", "type": "boolean", "optional": false}], []); 52 50 InspectorBackend.registerCommand("Page.canShowDebugBorders", [], ["show"]); -
trunk/Source/WebInspectorUI/Versions/Inspector-iOS-6.0.json
r161385 r161402 307 307 { "name": "frameId", "$ref": "Network.FrameId", "description": "Frame id to set HTML for." }, 308 308 { "name": "html", "type": "string", "description": "HTML content to set." } 309 ],310 "hidden": true311 },312 {313 "name": "canOverrideDeviceMetrics",314 "description": "Checks whether <code>setDeviceMetricsOverride</code> can be invoked.",315 "returns": [316 { "name": "result", "type": "boolean", "description": "If true, <code>setDeviceMetricsOverride</code> can safely be invoked on the agent." }317 ],318 "hidden": true319 },320 {321 "name": "setDeviceMetricsOverride",322 "description": "Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and \"device-width\"/\"device-height\"-related CSS media query results) and the font scale factor.",323 "parameters": [324 { "name": "width", "type": "integer", "description": "Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override." },325 { "name": "height", "type": "integer", "description": "Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override." },326 { "name": "fontScaleFactor", "type": "number", "description": "Overriding font scale factor value (must be positive). 1 disables the override." },327 { "name": "fitWindow", "type": "boolean", "description": "Whether a view that exceeds the available browser window area should be scaled down to fit." }328 309 ], 329 310 "hidden": true -
trunk/Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json
r161385 r161402 261 261 { "name": "frameId", "$ref": "Network.FrameId", "description": "Frame id to set HTML for." }, 262 262 { "name": "html", "type": "string", "description": "HTML content to set." } 263 ]264 },265 {266 "name": "canOverrideDeviceMetrics",267 "description": "Checks whether <code>setDeviceMetricsOverride</code> can be invoked.",268 "returns": [269 { "name": "result", "type": "boolean", "description": "If true, <code>setDeviceMetricsOverride</code> can safely be invoked on the agent." }270 ]271 },272 {273 "name": "setDeviceMetricsOverride",274 "description": "Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and \"device-width\"/\"device-height\"-related CSS media query results) and the font scale factor.",275 "parameters": [276 { "name": "width", "type": "integer", "description": "Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override." },277 { "name": "height", "type": "integer", "description": "Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override." },278 { "name": "fontScaleFactor", "type": "number", "description": "Overriding font scale factor value (must be positive). 1 disables the override." },279 { "name": "fitWindow", "type": "boolean", "description": "Whether a view that exceeds the available browser window area should be scaled down to fit." }280 263 ] 281 264 }, -
trunk/Source/WebKit/blackberry/ChangeLog
r161223 r161402 1 2014-01-06 Seokju Kwon <seokju@webkit.org> 2 3 Web Inspector: Remove canOverrideDeviceMetrics and setDeviceMetricsOverride from protocol 4 https://bugs.webkit.org/show_bug.cgi?id=126149 5 6 Reviewed by Joseph Pecoraro. 7 8 * WebCoreSupport/InspectorClientBlackBerry.cpp: Remove dead codes. 9 * WebCoreSupport/InspectorClientBlackBerry.h: Ditto. 10 1 11 2014-01-02 Gavin Barraclough <barraclough@apple.com> 2 12 -
trunk/Source/WebKit/blackberry/WebCoreSupport/InspectorClientBlackBerry.cpp
r158415 r161402 87 87 } 88 88 89 bool InspectorClientBlackBerry::canOverrideDeviceMetrics()90 {91 return true;92 }93 94 89 void InspectorClientBlackBerry::overrideDeviceMetrics(int width, int height, float fontScaleFactor, bool) 95 90 { -
trunk/Source/WebKit/blackberry/WebCoreSupport/InspectorClientBlackBerry.h
r160099 r161402 56 56 virtual void paintInspectorOverlay(WebCore::GraphicsContext&); 57 57 58 virtual bool canOverrideDeviceMetrics();59 58 virtual void overrideDeviceMetrics(int, int, float, bool); 60 59 virtual bool supportsFrameInstrumentation();
Note: See TracChangeset
for help on using the changeset viewer.