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

pfeldman at chromium.org pfeldman at chromium.org
Thu Feb 4 21:32:12 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 64ba7f51e3a8a940253ec2b6fb876ecd2d256d78
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 29 14:10:54 2010 +0000

    2010-01-29  Alexander Pavlov  <apavlov at chromium.org>
    
            Reviewed by Timothy Hatcher.
    
            Web Inspector: Source view displays text using wrong fonts
            https://bugs.webkit.org/show_bug.cgi?id=34269
    
            * inspector/front-end/TextEditor.js:
            (WebInspector.TextEditor):
            (WebInspector.TextEditor.prototype._initFont):
            * inspector/front-end/inspector.js:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54059 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b8cc99c..c2bbc8b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-29  Alexander Pavlov  <apavlov at chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Source view displays text using wrong fonts
+        https://bugs.webkit.org/show_bug.cgi?id=34269
+
+        * inspector/front-end/TextEditor.js:
+        (WebInspector.TextEditor):
+        (WebInspector.TextEditor.prototype._initFont):
+        * inspector/front-end/inspector.js:
+
 2010-01-29  Philippe Normand  <pnormand at igalia.com>
 
         Reviewed by Gustavo Noronha Silva.
diff --git a/WebCore/inspector/front-end/TextEditor.js b/WebCore/inspector/front-end/TextEditor.js
index aef5d9a..5554365 100644
--- a/WebCore/inspector/front-end/TextEditor.js
+++ b/WebCore/inspector/front-end/TextEditor.js
@@ -78,10 +78,7 @@ WebInspector.TextEditor = function(textModel, platform)
     this._ctx = this._canvas.getContext("2d");
     this._selection = new WebInspector.TextSelectionModel(this._selectionChanged.bind(this));
 
-    this._isMacTiger = platform === "mac-tiger";
-    this._isMacLeopard = platform === "mac-leopard";
-    this._isMac = this._isMacTiger || this._isMacLeopard;
-    this._isWin = platform === "windows";
+    this._isMac = platform && (platform.indexOf("mac") === 0);
 
     this._initFont();
 
@@ -948,20 +945,27 @@ WebInspector.TextEditor.prototype = {
         this._updateCursor(this._selection.endLine, this._selection.endColumn);
     },
 
-    _initFont: function(sansSerif, fontSize)
+    _initFont: function(sansSerif)
     {
+        if (!WebInspector.TextEditor.PlatformFonts) {
+            WebInspector.TextEditor.PlatformFonts = {};
+            WebInspector.TextEditor.PlatformFonts[WebInspector.OS.Windows] = {size: 12, face: "Lucida Console"};
+            WebInspector.TextEditor.PlatformFonts[WebInspector.OS.WindowsVistaOrLater] = {size: 12, face: "Courier"};
+            WebInspector.TextEditor.PlatformFonts[WebInspector.OS.MacSnowLeopard] = {size: 11, face: "Menlo"};
+            WebInspector.TextEditor.PlatformFonts[WebInspector.OS.MacLeopard] = {size: 10, face: "Monaco"};
+            WebInspector.TextEditor.PlatformFonts[WebInspector.OS.MacTiger] = {size: 10, face: "Monaco"};
+        }
+
         if (sansSerif) {
             this._isMonospace = false;
-            this._fontSize = fontSize || 11;
+            this._fontSize = 11;
             this._font = this._fontSize + "px sans-serif";
         } else {
             this._isMonospace = true;
-            this._fontSize = fontSize || 10;
-            this._font = this._fontSize + "px monospace";
-            if (this._isMac)
-                this._font = this._fontSize + "px Monaco";
-            else if (this._isWin)
-                this._font = (this._fontSize + 1) + "px Courier New";
+            const platform = WebInspector.platform;
+            const fontInfo = WebInspector.TextEditor.PlatformFonts[platform] || {size: 10, face: "monospace"};
+            this._fontSize = fontInfo.size;
+            this._font = this._fontSize + "px " + fontInfo.face;
         }
         this._ctx.font = this._font;
         this._digitWidth = this._ctx.measureText("0").width;
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index ca763dc..c8532d8 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -55,13 +55,6 @@ var WebInspector = {
     cookieDomains: {},
     missingLocalizedStrings: {},
     pendingDispatches: 0,
-    OS: {
-        Windows: "windows",
-        WindowsVistaOrLater: "windows-vista-or-later",
-        MacTiger: "mac-tiger",
-        MacLeopard: "mac-leopard",
-        MacSnowLeopard: "mac-snowleopard"
-    },
 
     // RegExp groups:
     // 1 - scheme
@@ -422,6 +415,14 @@ var WebInspector = {
     }
 }
 
+WebInspector.OS = {
+    Windows: "windows",
+    WindowsVistaOrLater: "windows-vista-or-later",
+    MacTiger: "mac-tiger",
+    MacLeopard: "mac-leopard",
+    MacSnowLeopard: "mac-snowleopard"
+}
+
 WebInspector.loaded = function()
 {
     InspectorBackend.setInjectedScriptSource("(" + injectedScriptConstructor + ");");

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list