Changeset 268832 in webkit
- Timestamp:
- Oct 21, 2020, 3:15:52 PM (6 years ago)
- Location:
- branches/safari-610-branch/Source
- Files:
-
- 10 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/inspector/InspectorFrontendHost.cpp (modified) (1 diff)
-
WebCore/inspector/InspectorFrontendHost.h (modified) (1 diff)
-
WebCore/inspector/InspectorFrontendHost.idl (modified) (1 diff)
-
WebInspectorUI/ChangeLog (modified) (1 diff)
-
WebInspectorUI/UserInterface/Base/Main.js (modified) (2 diffs)
-
WebInspectorUI/UserInterface/Base/Platform.js (modified) (1 diff)
-
WebInspectorUI/UserInterface/Controllers/HARBuilder.js (modified) (1 diff)
-
WebInspectorUI/UserInterface/Views/Popover.js (modified) (1 diff)
-
WebInspectorUI/UserInterface/Views/Variables.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-610-branch/Source/WebCore/ChangeLog
r268831 r268832 1 2020-10-21 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r268473. rdar://problem/70541789 4 5 Web Inspector: REGRESSION(r267148): new Big Sur styles are not used 6 https://bugs.webkit.org/show_bug.cgi?id=217682 7 <rdar://problem/70269030> 8 9 Reviewed by Brian Burg. 10 11 r267148 changed `navigator.userAgent` from `11_0` to `10_15_7`. This breaks Web Inspector 12 styling, which relied on this value to know what OS version it was running on in order to 13 know which styles to use. 14 15 Source/WebCore: 16 17 * inspector/InspectorFrontendHost.idl: 18 * inspector/InspectorFrontendHost.h: 19 * inspector/InspectorFrontendHost.cpp: 20 (WebCore::InspectorFrontendHost::platformVersionName const): Added. 21 Derive a lowercased kekab-cased platform version name from `__MAC_OS_X_VERSION_MIN_REQUIRED`. 22 23 Source/WebInspectorUI: 24 25 * UserInterface/Base/Platform.js: 26 * UserInterface/Views/Variables.css: 27 (body.mac-platform): Added. 28 (body.mac-platform:not(.sierra, .high-sierra)): Deleted. 29 Use `InspectorFrontendHost.platformVersionName` instead of `navigator.userAgent`. Remove 30 unnecessary platform version names and other unused data. 31 32 * UserInterface/Base/Main.js: 33 (WI.contentLoaded): 34 (WI.undockedTitleAreaHeight): Added. 35 * UserInterface/Views/Popover.js: 36 (WI.Popover.prototype._update): 37 Provide a way to get the undocked title area height for use in JavaScript calculations. 38 39 * UserInterface/Controllers/HARBuilder.js: 40 (WI.HARBuilder.creator): 41 The `WI.Platform.version.build` hasn't changed in a long time, so just remove it. 42 43 44 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268473 268f45cc-cd09-0410-ab3c-d52691b4dbfc 45 46 2020-10-14 Devin Rousso <drousso@apple.com> 47 48 Web Inspector: REGRESSION(r267148): new Big Sur styles are not used 49 https://bugs.webkit.org/show_bug.cgi?id=217682 50 <rdar://problem/70269030> 51 52 Reviewed by Brian Burg. 53 54 r267148 changed `navigator.userAgent` from `11_0` to `10_15_7`. This breaks Web Inspector 55 styling, which relied on this value to know what OS version it was running on in order to 56 know which styles to use. 57 58 * inspector/InspectorFrontendHost.idl: 59 * inspector/InspectorFrontendHost.h: 60 * inspector/InspectorFrontendHost.cpp: 61 (WebCore::InspectorFrontendHost::platformVersionName const): Added. 62 Derive a lowercased kekab-cased platform version name from `__MAC_OS_X_VERSION_MIN_REQUIRED`. 63 1 64 2020-10-21 Russell Epstein <repstein@apple.com> 2 65 -
branches/safari-610-branch/Source/WebCore/inspector/InspectorFrontendHost.cpp
r262302 r268832 389 389 } 390 390 391 String InspectorFrontendHost::platformVersionName() const 392 { 393 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000 394 return "big-sur"_s; 395 #elif PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500 396 return "catalina"_s; 397 #elif PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 398 return "mojave"_s; 399 #else 400 return emptyString(); 401 #endif 402 } 403 391 404 String InspectorFrontendHost::port() const 392 405 { -
branches/safari-610-branch/Source/WebCore/inspector/InspectorFrontendHost.h
r257835 r268832 90 90 91 91 String platform() const; 92 String platformVersionName() const; 92 93 String port() const; 93 94 -
branches/safari-610-branch/Source/WebCore/inspector/InspectorFrontendHost.idl
r262203 r268832 80 80 readonly attribute DOMString port; 81 81 readonly attribute DOMString platform; 82 readonly attribute DOMString platformVersionName; 82 83 83 84 void showContextMenu(Event event, sequence<ContextMenuItem> items); -
branches/safari-610-branch/Source/WebInspectorUI/ChangeLog
r268469 r268832 1 2020-10-21 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r268473. rdar://problem/70541789 4 5 Web Inspector: REGRESSION(r267148): new Big Sur styles are not used 6 https://bugs.webkit.org/show_bug.cgi?id=217682 7 <rdar://problem/70269030> 8 9 Reviewed by Brian Burg. 10 11 r267148 changed `navigator.userAgent` from `11_0` to `10_15_7`. This breaks Web Inspector 12 styling, which relied on this value to know what OS version it was running on in order to 13 know which styles to use. 14 15 Source/WebCore: 16 17 * inspector/InspectorFrontendHost.idl: 18 * inspector/InspectorFrontendHost.h: 19 * inspector/InspectorFrontendHost.cpp: 20 (WebCore::InspectorFrontendHost::platformVersionName const): Added. 21 Derive a lowercased kekab-cased platform version name from `__MAC_OS_X_VERSION_MIN_REQUIRED`. 22 23 Source/WebInspectorUI: 24 25 * UserInterface/Base/Platform.js: 26 * UserInterface/Views/Variables.css: 27 (body.mac-platform): Added. 28 (body.mac-platform:not(.sierra, .high-sierra)): Deleted. 29 Use `InspectorFrontendHost.platformVersionName` instead of `navigator.userAgent`. Remove 30 unnecessary platform version names and other unused data. 31 32 * UserInterface/Base/Main.js: 33 (WI.contentLoaded): 34 (WI.undockedTitleAreaHeight): Added. 35 * UserInterface/Views/Popover.js: 36 (WI.Popover.prototype._update): 37 Provide a way to get the undocked title area height for use in JavaScript calculations. 38 39 * UserInterface/Controllers/HARBuilder.js: 40 (WI.HARBuilder.creator): 41 The `WI.Platform.version.build` hasn't changed in a long time, so just remove it. 42 43 44 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268473 268f45cc-cd09-0410-ab3c-d52691b4dbfc 45 46 2020-10-14 Devin Rousso <drousso@apple.com> 47 48 Web Inspector: REGRESSION(r267148): new Big Sur styles are not used 49 https://bugs.webkit.org/show_bug.cgi?id=217682 50 <rdar://problem/70269030> 51 52 Reviewed by Brian Burg. 53 54 r267148 changed `navigator.userAgent` from `11_0` to `10_15_7`. This breaks Web Inspector 55 styling, which relied on this value to know what OS version it was running on in order to 56 know which styles to use. 57 58 * UserInterface/Base/Platform.js: 59 * UserInterface/Views/Variables.css: 60 (body.mac-platform): Added. 61 (body.mac-platform:not(.sierra, .high-sierra)): Deleted. 62 Use `InspectorFrontendHost.platformVersionName` instead of `navigator.userAgent`. Remove 63 unnecessary platform version names and other unused data. 64 65 * UserInterface/Base/Main.js: 66 (WI.contentLoaded): 67 (WI.undockedTitleAreaHeight): Added. 68 * UserInterface/Views/Popover.js: 69 (WI.Popover.prototype._update): 70 Provide a way to get the undocked title area height for use in JavaScript calculations. 71 72 * UserInterface/Controllers/HARBuilder.js: 73 (WI.HARBuilder.creator): 74 The `WI.Platform.version.build` hasn't changed in a long time, so just remove it. 75 1 76 2020-10-14 Alan Coon <alancoon@apple.com> 2 77 -
branches/safari-610-branch/Source/WebInspectorUI/UserInterface/Base/Main.js
r267267 r268832 248 248 // Add platform style classes so the UI can be tweaked per-platform. 249 249 document.body.classList.add(WI.Platform.name + "-platform"); 250 if (WI.Platform.isNightlyBuild) 251 document.body.classList.add("nightly-build"); 252 253 if (WI.Platform.name === "mac") 250 if (WI.Platform.version.name) 254 251 document.body.classList.add(WI.Platform.version.name); 255 252 … … 2801 2798 }; 2802 2799 2800 WI.undockedTitleAreaHeight = function() 2801 { 2802 if (WI.dockConfiguration !== WI.DockConfiguration.Undocked) 2803 return 0; 2804 2805 if (WI.Platform.name === "mac") { 2806 switch (WI.Platform.version.name) { 2807 case "big-sur": 2808 /* keep in sync with `body.mac-platform.big-sur:not(.docked)` */ 2809 return 27 / WI.getZoomFactor(); 2810 2811 case "catalina": 2812 case "mojave": 2813 /* keep in sync with `body.mac-platform:not(.big-sur):not(.docked)` */ 2814 return 22 / WI.getZoomFactor(); 2815 } 2816 } 2817 2818 return 0; 2819 }; 2820 2803 2821 WI._showTabAtIndexFromShortcut = function(i) 2804 2822 { -
branches/safari-610-branch/Source/WebInspectorUI/UserInterface/Base/Platform.js
r263377 r268832 26 26 WI.Platform = { 27 27 name: InspectorFrontendHost.platform, 28 isNightlyBuild: false,29 28 version: { 30 base: 0, 31 release: 0, 32 name: "", 33 build: "", 29 name: InspectorFrontendHost.platformVersionName, 34 30 } 35 31 }; 36 37 (function () {38 let versionMatch = / AppleWebKit\/([^ ]+)/.exec(navigator.userAgent);39 if (versionMatch) {40 WI.Platform.version.build = versionMatch[1];41 42 // Check for a nightly build by looking for a plus in the version number and a small number of stylesheets (indicating combined resources).43 if (versionMatch[1].indexOf("+") !== -1 && document.styleSheets.length < 10)44 WI.Platform.isNightlyBuild = true;45 }46 47 let osVersionMatch = / Mac OS X (\d+)_(\d+)/.exec(navigator.appVersion);48 if (osVersionMatch) {49 WI.Platform.version.base = parseInt(osVersionMatch[1]);50 WI.Platform.version.release = parseInt(osVersionMatch[2]);51 52 switch (WI.Platform.version.base) {53 case 10:54 switch (WI.Platform.version.release) {55 case 15:56 WI.Platform.version.name = "catalina";57 break;58 case 14:59 WI.Platform.version.name = "mojave";60 break;61 case 13:62 WI.Platform.version.name = "high-sierra";63 break;64 case 12:65 WI.Platform.version.name = "sierra";66 break;67 default:68 WI.Platform.version.name = "unknown-mac";69 break;70 }71 break;72 73 case 11:74 switch (WI.Platform.version.release) {75 case 0:76 WI.Platform.version.name = "big-sur";77 break;78 default:79 WI.Platform.version.name = "unknown-mac";80 break;81 }82 break;83 }84 }85 })(); -
branches/safari-610-branch/Source/WebInspectorUI/UserInterface/Controllers/HARBuilder.js
r249504 r268832 61 61 return { 62 62 name: "WebKit Web Inspector", 63 version: WI.Platform.version.build ||"1.0",63 version: "1.0", 64 64 }; 65 65 } -
branches/safari-610-branch/Source/WebInspectorUI/UserInterface/Views/Popover.js
r242174 r268832 236 236 } 237 237 238 var titleBarOffset = WI. Platform.name === "mac" ? 22 : 0;238 var titleBarOffset = WI.undockedTitleAreaHeight(); 239 239 var containerFrame = new WI.Rect(0, titleBarOffset, window.innerWidth, window.innerHeight - titleBarOffset); 240 240 // The frame of the window with a little inset to make sure we have room for shadows. -
branches/safari-610-branch/Source/WebInspectorUI/UserInterface/Views/Variables.css
r265237 r268832 239 239 240 240 body.mac-platform:not(.big-sur):not(.docked) { 241 /* keep in sync with `WI.undockedTitleAreaHeight` */ 241 242 --undocked-title-area-height: calc(22px / var(--zoom-factor)); 242 243 } 243 244 244 245 body.mac-platform.big-sur:not(.docked) { 246 /* keep in sync with `WI.undockedTitleAreaHeight` */ 245 247 --undocked-title-area-height: calc(27px / var(--zoom-factor)); 246 248 } … … 409 411 } 410 412 411 body.mac-platform :not(.sierra, .high-sierra){413 body.mac-platform { 412 414 --selected-foreground-color: -apple-system-alternate-selected-text; 413 415 --selected-background-color: -apple-system-selected-content-background;
Note:
See TracChangeset
for help on using the changeset viewer.