Changeset 268473 in webkit
- Timestamp:
- Oct 14, 2020 10:50:54 AM (3 years ago)
- Location:
- trunk/Source
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r268456 r268473 1 2020-10-14 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: REGRESSION(r267148): new Big Sur styles are not used 4 https://bugs.webkit.org/show_bug.cgi?id=217682 5 <rdar://problem/70269030> 6 7 Reviewed by Brian Burg. 8 9 r267148 changed `navigator.userAgent` from `11_0` to `10_15_7`. This breaks Web Inspector 10 styling, which relied on this value to know what OS version it was running on in order to 11 know which styles to use. 12 13 * inspector/InspectorFrontendHost.idl: 14 * inspector/InspectorFrontendHost.h: 15 * inspector/InspectorFrontendHost.cpp: 16 (WebCore::InspectorFrontendHost::platformVersionName const): Added. 17 Derive a lowercased kekab-cased platform version name from `__MAC_OS_X_VERSION_MIN_REQUIRED`. 18 1 19 2020-10-14 Zalan Bujtas <zalan@apple.com> 2 20 -
trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp
r267411 r268473 390 390 } 391 391 392 String InspectorFrontendHost::platformVersionName() const 393 { 394 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000 395 return "big-sur"_s; 396 #elif PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500 397 return "catalina"_s; 398 #elif PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 399 return "mojave"_s; 400 #else 401 return emptyString(); 402 #endif 403 } 404 392 405 String InspectorFrontendHost::port() const 393 406 { -
trunk/Source/WebCore/inspector/InspectorFrontendHost.h
r267411 r268473 90 90 91 91 String platform() const; 92 String platformVersionName() const; 92 93 String port() const; 93 94 -
trunk/Source/WebCore/inspector/InspectorFrontendHost.idl
r267411 r268473 80 80 readonly attribute DOMString port; 81 81 readonly attribute DOMString platform; 82 readonly attribute DOMString platformVersionName; 82 83 83 84 undefined showContextMenu(Event event, sequence<ContextMenuItem> items); -
trunk/Source/WebInspectorUI/ChangeLog
r268427 r268473 1 2020-10-14 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: REGRESSION(r267148): new Big Sur styles are not used 4 https://bugs.webkit.org/show_bug.cgi?id=217682 5 <rdar://problem/70269030> 6 7 Reviewed by Brian Burg. 8 9 r267148 changed `navigator.userAgent` from `11_0` to `10_15_7`. This breaks Web Inspector 10 styling, which relied on this value to know what OS version it was running on in order to 11 know which styles to use. 12 13 * UserInterface/Base/Platform.js: 14 * UserInterface/Views/Variables.css: 15 (body.mac-platform): Added. 16 (body.mac-platform:not(.sierra, .high-sierra)): Deleted. 17 Use `InspectorFrontendHost.platformVersionName` instead of `navigator.userAgent`. Remove 18 unnecessary platform version names and other unused data. 19 20 * UserInterface/Base/Main.js: 21 (WI.contentLoaded): 22 (WI.undockedTitleAreaHeight): Added. 23 * UserInterface/Views/Popover.js: 24 (WI.Popover.prototype._update): 25 Provide a way to get the undocked title area height for use in JavaScript calculations. 26 27 * UserInterface/Controllers/HARBuilder.js: 28 (WI.HARBuilder.creator): 29 The `WI.Platform.version.build` hasn't changed in a long time, so just remove it. 30 1 31 2020-10-13 Devin Rousso <drousso@apple.com> 2 32 -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r267411 r268473 221 221 // Add platform style classes so the UI can be tweaked per-platform. 222 222 document.body.classList.add(WI.Platform.name + "-platform"); 223 if (WI.Platform.isNightlyBuild) 224 document.body.classList.add("nightly-build"); 225 226 if (WI.Platform.name === "mac") 223 if (WI.Platform.version.name) 227 224 document.body.classList.add(WI.Platform.version.name); 228 225 … … 2774 2771 }; 2775 2772 2773 WI.undockedTitleAreaHeight = function() 2774 { 2775 if (WI.dockConfiguration !== WI.DockConfiguration.Undocked) 2776 return 0; 2777 2778 if (WI.Platform.name === "mac") { 2779 switch (WI.Platform.version.name) { 2780 case "big-sur": 2781 /* keep in sync with `body.mac-platform.big-sur:not(.docked)` */ 2782 return 27 / WI.getZoomFactor(); 2783 2784 case "catalina": 2785 case "mojave": 2786 /* keep in sync with `body.mac-platform:not(.big-sur):not(.docked)` */ 2787 return 22 / WI.getZoomFactor(); 2788 } 2789 } 2790 2791 return 0; 2792 }; 2793 2776 2794 WI._showTabAtIndexFromShortcut = function(i) 2777 2795 { -
trunk/Source/WebInspectorUI/UserInterface/Base/Platform.js
r263377 r268473 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 })(); -
trunk/Source/WebInspectorUI/UserInterface/Controllers/HARBuilder.js
r249504 r268473 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 } -
trunk/Source/WebInspectorUI/UserInterface/Views/Popover.js
r242174 r268473 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. -
trunk/Source/WebInspectorUI/UserInterface/Views/Variables.css
r267038 r268473 246 246 247 247 body.mac-platform:not(.big-sur):not(.docked) { 248 /* keep in sync with `WI.undockedTitleAreaHeight` */ 248 249 --undocked-title-area-height: calc(22px / var(--zoom-factor)); 249 250 } 250 251 251 252 body.mac-platform.big-sur:not(.docked) { 253 /* keep in sync with `WI.undockedTitleAreaHeight` */ 252 254 --undocked-title-area-height: calc(27px / var(--zoom-factor)); 253 255 } … … 413 415 } 414 416 415 body.mac-platform :not(.sierra, .high-sierra){417 body.mac-platform { 416 418 --selected-foreground-color: -apple-system-alternate-selected-text; 417 419 --selected-background-color: -apple-system-selected-content-background;
Note: See TracChangeset
for help on using the changeset viewer.