Changeset 51242 in webkit


Ignore:
Timestamp:
Nov 20, 2009 10:40:57 AM (14 years ago)
Author:
bweinstein@apple.com
Message:

Fixes <http://webkit.org/b/31699>.
Web Inspector: Should Cache Values of InspectorController.platform() and port().

Reviewed by Tim Hatcher.

Refactor the Inspector to cache the value of InspectorController.platform
and InspectorController.port, because those need to call into C++, they are
being called more and more as we add platform specific keyboard shortcuts, and
they shouldn't change in the lifecycle of the Web Inspector.

  • inspector/front-end/AbstractTimelinePanel.js:

(WebInspector.AbstractTimelinePanel.prototype._updateFilter):

  • inspector/front-end/ConsoleView.js:

(WebInspector.ConsoleView.prototype._updateFilter):

  • inspector/front-end/ElementsPanel.js:

(WebInspector.ElementsPanel.prototype.handleKeyEvent):

  • inspector/front-end/ScriptsPanel.js:

(WebInspector.ScriptsPanel):

  • inspector/front-end/SourceFrame.js:

(WebInspector.SourceFrame.prototype._loaded):

  • inspector/front-end/inspector.js:

(WebInspector.get platform):
(WebInspector.get port):
(WebInspector.loaded):
(WebInspector.documentKeyDown):
(WebInspector.toolbarDragStart):

Location:
trunk/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r51240 r51242  
     12009-11-20  Brian Weinstein  <bweinstein@apple.com>
     2
     3        Reviewed by Tim Hatcher.
     4
     5        Fixes <http://webkit.org/b/31699>.
     6        Web Inspector: Should Cache Values of InspectorController.platform() and port().
     7
     8        Refactor the Inspector to cache the value of InspectorController.platform
     9        and InspectorController.port, because those need to call into C++, they are
     10        being called more and more as we add platform specific keyboard shortcuts, and
     11        they shouldn't change in the lifecycle of the Web Inspector.
     12
     13        * inspector/front-end/AbstractTimelinePanel.js:
     14        (WebInspector.AbstractTimelinePanel.prototype._updateFilter):
     15        * inspector/front-end/ConsoleView.js:
     16        (WebInspector.ConsoleView.prototype._updateFilter):
     17        * inspector/front-end/ElementsPanel.js:
     18        (WebInspector.ElementsPanel.prototype.handleKeyEvent):
     19        * inspector/front-end/ScriptsPanel.js:
     20        (WebInspector.ScriptsPanel):
     21        * inspector/front-end/SourceFrame.js:
     22        (WebInspector.SourceFrame.prototype._loaded):
     23        * inspector/front-end/inspector.js:
     24        (WebInspector.get platform):
     25        (WebInspector.get port):
     26        (WebInspector.loaded):
     27        (WebInspector.documentKeyDown):
     28        (WebInspector.toolbarDragStart):
     29
    1302009-11-20  Dirk Schulze  <krit@webkit.org>
    231
     
    104133        Test: fast/ruby/ruby-text-indent.html
    105134
    106         * css/html.css: reset text-indent on <ruby> and <rt> elements 
     135        * css/html.css: reset text-indent on <ruby> and <rt> elements
    107136
    1081372009-11-19  Brian Weinstein  <bweinstein@apple.com>
  • trunk/WebCore/inspector/front-end/AbstractTimelinePanel.js

    r51115 r51242  
    190190    _updateFilter: function(e)
    191191    {
    192         var isMac = InspectorController.platform().indexOf("mac-") === 0;
     192        var isMac = WebInspector.platform.indexOf("mac-") === 0;
    193193        var selectMultiple = false;
    194194        if (isMac && e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey)
  • trunk/WebCore/inspector/front-end/ConsoleView.js

    r50663 r51242  
    102102    _updateFilter: function(e)
    103103    {
    104         var isMac = InspectorController.platform().indexOf("mac-") === 0;
     104        var isMac = WebInspector.platform.indexOf("mac-") === 0;
    105105        var selectMultiple = false;
    106106        if (isMac && e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey)
  • trunk/WebCore/inspector/front-end/ElementsPanel.js

    r51225 r51242  
    10021002        // This shortcut matches Firebug.
    10031003        if (event.keyIdentifier === "U+0043") {     // C key
    1004             var isMac = InspectorController.platform().indexOf("mac-") === 0;
     1004            var isMac = WebInspector.platform.indexOf("mac-") === 0;
    10051005            if (isMac)
    10061006                var isNodeSearchKey = event.metaKey && !event.ctrlKey && !event.altKey && event.shiftKey;
  • trunk/WebCore/inspector/front-end/ScriptsPanel.js

    r51156 r51242  
    163163    this._shortcuts = {};
    164164
    165     var isMac = InspectorController.platform().indexOf("mac-") === 0;
     165    var isMac = WebInspector.platform.indexOf("mac-") === 0;
    166166    var platformSpecificModifier = isMac ? WebInspector.KeyboardShortcut.Modifiers.Meta : WebInspector.KeyboardShortcut.Modifiers.Ctrl;
    167167
  • trunk/WebCore/inspector/front-end/SourceFrame.js

    r51134 r51242  
    208208
    209209        // Register 'eval' shortcut.
    210         var isMac = InspectorController.platform().indexOf("mac-") === 0;
     210        var isMac = WebInspector.platform.indexOf("mac-") === 0;
    211211        var platformSpecificModifier = isMac ? WebInspector.KeyboardShortcut.Modifiers.Meta : WebInspector.KeyboardShortcut.Modifiers.Ctrl;
    212212        var shortcut = WebInspector.KeyboardShortcut.makeKey(69 /* 'E' */, platformSpecificModifier | WebInspector.KeyboardShortcut.Modifiers.Shift);
  • trunk/WebCore/inspector/front-end/inspector.js

    r51182 r51242  
    7373    cookieDomains: {},
    7474    missingLocalizedStrings: {},
     75   
     76    get platform()
     77    {
     78        if (!("_platform" in this))
     79            this._platform = InspectorController.platform();
     80       
     81        return this._platform;
     82    },
     83   
     84    get port()
     85    {
     86        if (!("_port" in this))
     87            this._port = InspectorController.port();
     88       
     89        return this._port;
     90    },
    7591
    7692    get previousFocusElement()
     
    391407WebInspector.loaded = function()
    392408{
    393     var platform = InspectorController.platform();
     409    var platform = WebInspector.platform;
    394410    document.body.addStyleClass("platform-" + platform);
    395     var port = InspectorController.port();
     411    var port = WebInspector.port;
    396412    document.body.addStyleClass("port-" + port);
    397413
     
    621637
    622638    if (!event.handled) {
    623         var isMac = InspectorController.platform().indexOf("mac-") === 0;
     639        var isMac = WebInspector.platform.indexOf("mac-") === 0;
    624640
    625641        switch (event.keyIdentifier) {
     
    846862WebInspector.toolbarDragStart = function(event)
    847863{
    848     if ((!WebInspector.attached && InspectorController.platform() !== "mac-leopard") || InspectorController.port() == "qt")
     864    if ((!WebInspector.attached && WebInspector.platform !== "mac-leopard") || WebInspector.port == "qt")
    849865        return;
    850866
Note: See TracChangeset for help on using the changeset viewer.