[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

apavlov at chromium.org apavlov at chromium.org
Thu Feb 4 21:36:55 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 6a6fefc21e966ae31ebda8aa48a4f0add4d5ac2b
Author: apavlov at chromium.org <apavlov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 2 17:08:02 2010 +0000

    2010-02-02  Alexander Pavlov  <apavlov at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Web Inspector: Eliminate some of the platform flavor-specific stylesheet selectors
    
            Extract OS version into WebInspector.platformFlavor
            https://bugs.webkit.org/show_bug.cgi?id=34469
    
            * inspector/front-end/InspectorBackendStub.js:
            * inspector/front-end/InspectorFrontendHostStub.js:
            (.WebInspector.InspectorFrontendHostStub.prototype.platform):
            * inspector/front-end/inspector.css:
            * inspector/front-end/inspector.js:
            (WebInspector.pendingDispatches.0.URLRegExp.i.get platform):
            (WebInspector.get platformFlavor):
            (WebInspector._detectPlatformFlavor):
            (WebInspector.loaded):
            (WebInspector.toolbarDragStart):
            (WebInspector.isMac):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54240 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index fda5e13..413a76f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-02-02  Alexander Pavlov  <apavlov at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Eliminate some of the platform flavor-specific stylesheet selectors
+
+        Extract OS version into WebInspector.platformFlavor
+        https://bugs.webkit.org/show_bug.cgi?id=34469
+
+        * inspector/front-end/InspectorBackendStub.js:
+        * inspector/front-end/InspectorFrontendHostStub.js:
+        (.WebInspector.InspectorFrontendHostStub.prototype.platform):
+        * inspector/front-end/inspector.css:
+        * inspector/front-end/inspector.js:
+        (WebInspector.pendingDispatches.0.URLRegExp.i.get platform):
+        (WebInspector.get platformFlavor):
+        (WebInspector._detectPlatformFlavor):
+        (WebInspector.loaded):
+        (WebInspector.toolbarDragStart):
+        (WebInspector.isMac):
+
 2010-02-02  Steve Block  <steveblock at google.com>
 
         Reviewed by Ariya Hidayat.
diff --git a/WebCore/inspector/front-end/InspectorBackendStub.js b/WebCore/inspector/front-end/InspectorBackendStub.js
index 5ddb74a..ed03f73 100644
--- a/WebCore/inspector/front-end/InspectorBackendStub.js
+++ b/WebCore/inspector/front-end/InspectorBackendStub.js
@@ -46,17 +46,6 @@ WebInspector.InspectorBackendStub.prototype = {
         return func;
     },
 
-    platform: function()
-    {
-        return "mac-leopard";
-    },
-
-    port: function()
-    {
-        return "unknown";
-    },
-
-
     closeWindow: function()
     {
         this._windowVisible = false;
diff --git a/WebCore/inspector/front-end/InspectorFrontendHostStub.js b/WebCore/inspector/front-end/InspectorFrontendHostStub.js
index dc7da61..f1decb6 100644
--- a/WebCore/inspector/front-end/InspectorFrontendHostStub.js
+++ b/WebCore/inspector/front-end/InspectorFrontendHostStub.js
@@ -35,10 +35,12 @@ WebInspector.InspectorFrontendHostStub = function()
     this._attachedWindowHeight = 0;
 }
 
+WebInspector._platformFlavor = WebInspector.PlatformFlavor.MacLeopard;
+
 WebInspector.InspectorFrontendHostStub.prototype = {
     platform: function()
     {
-        return "mac-leopard";
+        return "mac";
     },
 
     port: function()
diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css
index 42e213a..45b8ec3 100644
--- a/WebCore/inspector/front-end/inspector.css
+++ b/WebCore/inspector/front-end/inspector.css
@@ -246,13 +246,11 @@ body.attached.port-qt .toolbar-item.close-left, body.attached.port-qt .toolbar-i
     display: none;
 }
 
-body.platform-mac-tiger .toolbar-item.close-right,
-body.platform-mac-leopard .toolbar-item.close-right,
-body.platform-mac-snowleopard .toolbar-item.close-right {
+body.platform-mac .toolbar-item.close-right {
     display: none;
 }
 
-body:not(.platform-mac-tiger):not(.platform-mac-leopard):not(.platform-mac-snowleopard) .toolbar-item.close-left {
+body:not(.platform-mac) .toolbar-item.close-left {
     display: none;
 }
 
@@ -503,19 +501,18 @@ body.drawer-visible #drawer {
     font-family: monospace;
 }
 
-body.platform-mac-tiger .monospace, body.platform-mac-leopard .monospace,
-body.platform-mac-tiger .source-code, body.platform-mac-leopard .source-code {
+body.platform-mac .monospace, body.platform-mac .source-code {
     font-family: Monaco, monospace;
 }
 
-body.platform-mac-snowleopard .monospace,
-body.platform-mac-snowleopard .source-code {
+/* Keep .platform-mac to make the rule more specific than the general one above. */
+body.platform-mac.platform-mac-snowleopard .monospace,
+body.platform-mac.platform-mac-snowleopard .source-code {
     font-size: 11px;
     font-family: Menlo, monospace;
 }
 
-body.platform-windows .monospace, body.platform-windows-vista-or-later .monospace,
-body.platform-windows .source-code, body.platform-windows-vista-or-later .source-code {
+body.platform-windows .monospace, body.platform-windows .source-code {
     font-size: 12px;
     font-family: Consolas, Lucida Console, monospace;
 }
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index f28d975..de20739 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -67,37 +67,44 @@ var WebInspector = {
     get platform()
     {
         if (!("_platform" in this))
-            this._platform = this._detectPlatform();
+            this._platform = InspectorFrontendHost.platform();
 
         return this._platform;
     },
 
-    _detectPlatform: function()
+    get platformFlavor()
+    {
+        if (!("_platformFlavor" in this))
+            this._platformFlavor = this._detectPlatformFlavor();
+
+        return this._platformFlavor;
+    },
+
+    _detectPlatformFlavor: function()
     {
         const userAgent = navigator.userAgent;
-        var nativePlatform = InspectorFrontendHost.platform();
 
-        if (nativePlatform === "windows") {
+        if (this.platform === "windows") {
             var match = userAgent.match(/Windows NT (\d+)\.(?:\d+)/);
             if (match && match[1] >= 6)
-                return WebInspector.OS.WindowsVistaOrLater;
-            return WebInspector.OS.Windows;
-        } else if (nativePlatform === "mac") {
+                return WebInspector.PlatformFlavor.WindowsVista;
+            return null;
+        } else if (this.platform === "mac") {
             var match = userAgent.match(/Mac OS X\s*(?:(\d+)_(\d+))?/);
             if (!match || match[1] != 10)
-                return WebInspector.OS.MacSnowLeopard;
+                return WebInspector.PlatformFlavor.MacSnowLeopard;
             switch (Number(match[2])) {
                 case 4:
-                    return WebInspector.OS.MacTiger;
+                    return WebInspector.PlatformFlavor.MacTiger;
                 case 5:
-                    return WebInspector.OS.MacLeopard;
+                    return WebInspector.PlatformFlavor.MacLeopard;
                 case 6:
                 default:
-                    return WebInspector.OS.MacSnowLeopard;
+                    return WebInspector.PlatformFlavor.MacSnowLeopard;
             }
         }
 
-        return nativePlatform;
+        return null;
     },
 
     get port()
@@ -415,9 +422,8 @@ var WebInspector = {
     }
 }
 
-WebInspector.OS = {
-    Windows: "windows",
-    WindowsVistaOrLater: "windows-vista-or-later",
+WebInspector.PlatformFlavor = {
+    WindowsVista: "windows-vista",
     MacTiger: "mac-tiger",
     MacLeopard: "mac-leopard",
     MacSnowLeopard: "mac-snowleopard"
@@ -429,6 +435,9 @@ WebInspector.loaded = function()
 
     var platform = WebInspector.platform;
     document.body.addStyleClass("platform-" + platform);
+    var flavor = WebInspector.platformFlavor;
+    if (flavor)
+        document.body.addStyleClass("platform-" + flavor);
     var port = WebInspector.port;
     document.body.addStyleClass("port-" + port);
 
@@ -871,7 +880,7 @@ WebInspector.toggleAttach = function()
 
 WebInspector.toolbarDragStart = function(event)
 {
-    if ((!WebInspector.attached && WebInspector.platform !== "mac-leopard") || WebInspector.port == "qt")
+    if ((!WebInspector.attached && WebInspector.platformFlavor !== WebInspector.PlatformFlavor.MacLeopard && WebInspector.platformFlavor !== WebInspector.PlatformFlavor.MacSnowLeopard) || WebInspector.port == "qt")
         return;
 
     var target = event.target;
@@ -1699,7 +1708,7 @@ WebInspector.UIString = function(string)
 WebInspector.isMac = function()
 {
     if (!("_isMac" in this))
-        this._isMac = WebInspector.platform.indexOf("mac-") === 0;
+        this._isMac = WebInspector.platform === "mac";
 
     return this._isMac;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list