Changeset 47363 in webkit


Ignore:
Timestamp:
Aug 17, 2009 8:57:39 AM (15 years ago)
Author:
ariya@webkit.org
Message:

2009-08-13 Joseph Pecoraro <joepeck02@gmail.com>

Reviewed by Timothy Hatcher.

Inspector: Improve Cookie DataGrid to Show Hidden Data
https://bugs.webkit.org/show_bug.cgi?id=28269

  • English.lproj/localizedStrings.js: DataGrid Headers "Name", "Value", "Size", ...
  • WebCore.gypi: added missing files

Implemented Bindings for InspectorController.deleteCookie(name)

  • inspector/InspectorBackend.idl:
  • bindings/js/JSInspectorBackendCustom.cpp: (WebCore::JSInspectorBackend::cookies): (WebCore::JSInspectorBackend::deleteCookie):

v8 Bindings Stubs

  • bindings/v8/custom/V8CustomBinding.h:
  • bindings/v8/custom/V8InspectorBackendCustom.cpp: (WebCore::CALLBACK_FUNC_DECL):

Removed WebInspector.Cookie

  • inspector/front-end/Cookie.js: Removed.
  • inspector/front-end/inspector.html:
  • inspector/front-end/WebKit.qrc:

Improved DataGrid and Kept Fallback Behavior for Platforms that don't
yet provide access to raw cookies.

  • inspector/front-end/CookieItemsView.js: (WebInspector.CookieItemsView): (WebInspector.CookieItemsView.prototype.get statusBarItems): (WebInspector.CookieItemsView.prototype.update): (WebInspector.CookieItemsView.prototype.buildCookies): (WebInspector.CookieItemsView.prototype.dataGridForCookies): (WebInspector.CookieItemsView.prototype.fallbackUpdate.callback): (WebInspector.CookieItemsView.prototype.fallbackUpdate): (WebInspector.CookieItemsView.prototype.fallbackBuildCookiesFromString): (WebInspector.CookieItemsView.prototype.fallbackDataGridForCookies): (WebInspector.CookieItemsView.prototype._deleteButtonClicked):

Interaction with the page through Injected Script (for fallback behavior)

  • inspector/front-end/DOMAgent.js: (InspectorController.getCookies):
  • inspector/front-end/InjectedScript.js: (InjectedScript.setStyleProperty): style fix (InjectedScript.getCookies):

Allow alignment of text inside DataGrids.

  • inspector/front-end/DataGrid.js: (WebInspector.DataGrid): (WebInspector.DataGridNode.prototype.createCell):
  • inspector/front-end/DatabasesPanel.js: (WebInspector.DatabasesPanel.prototype.dataGridForDOMStorage):
  • inspector/front-end/inspector.css:

Added deleteCookie(., ., String name)
Modified getRawCookies to return a bool to know if its implemented

  • platform/CookieJar.h:

Implemented deleteCookie for Macs

  • platform/mac/CookieJar.mm: (WebCore::getRawCookies): (WebCore::deleteCookie):

Stub Implementations for Other Platforms

  • platform/haiku/CookieJarHaiku.cpp: (WebCore::getRawCookies): (WebCore::deleteCookie):
  • platform/network/chromium/CookieJarChromium.cpp: (WebCore::getRawCookies): (WebCore::deleteCookie):
  • platform/network/curl/CookieJarCurl.cpp: (WebCore::getRawCookies): (WebCore::deleteCookie):
  • platform/network/soup/CookieJarSoup.cpp: (WebCore::getRawCookies): (WebCore::deleteCookie):
  • platform/network/win/CookieJarCFNetWin.cpp: (WebCore::getRawCookies): (WebCore::deleteCookie):
  • platform/network/win/CookieJarWin.cpp: (WebCore::getRawCookies): (WebCore::deleteCookie):
  • platform/qt/CookieJarQt.cpp: (WebCore::getRawCookies): (WebCore::deleteCookie):
Location:
trunk/WebCore
Files:
1 deleted
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r47362 r47363  
     12009-08-13  Joseph Pecoraro  <joepeck02@gmail.com>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Inspector: Improve Cookie DataGrid to Show Hidden Data
     6        https://bugs.webkit.org/show_bug.cgi?id=28269
     7
     8        * English.lproj/localizedStrings.js: DataGrid Headers "Name", "Value", "Size", ...
     9        * WebCore.gypi: added missing files
     10
     11          Implemented Bindings for InspectorController.deleteCookie(name)
     12
     13        * inspector/InspectorBackend.idl:
     14        * bindings/js/JSInspectorBackendCustom.cpp:
     15        (WebCore::JSInspectorBackend::cookies):
     16        (WebCore::JSInspectorBackend::deleteCookie):
     17
     18          v8 Bindings Stubs
     19
     20        * bindings/v8/custom/V8CustomBinding.h:
     21        * bindings/v8/custom/V8InspectorBackendCustom.cpp:
     22        (WebCore::CALLBACK_FUNC_DECL):
     23
     24          Removed WebInspector.Cookie
     25
     26        * inspector/front-end/Cookie.js: Removed.
     27        * inspector/front-end/inspector.html:
     28        * inspector/front-end/WebKit.qrc:
     29
     30          Improved DataGrid and Kept Fallback Behavior for Platforms that don't
     31          yet provide access to raw cookies.
     32
     33        * inspector/front-end/CookieItemsView.js:
     34        (WebInspector.CookieItemsView):
     35        (WebInspector.CookieItemsView.prototype.get statusBarItems):
     36        (WebInspector.CookieItemsView.prototype.update):
     37        (WebInspector.CookieItemsView.prototype.buildCookies):
     38        (WebInspector.CookieItemsView.prototype.dataGridForCookies):
     39        (WebInspector.CookieItemsView.prototype.fallbackUpdate.callback):
     40        (WebInspector.CookieItemsView.prototype.fallbackUpdate):
     41        (WebInspector.CookieItemsView.prototype.fallbackBuildCookiesFromString):
     42        (WebInspector.CookieItemsView.prototype.fallbackDataGridForCookies):
     43        (WebInspector.CookieItemsView.prototype._deleteButtonClicked):
     44
     45          Interaction with the page through Injected Script (for fallback behavior)
     46
     47        * inspector/front-end/DOMAgent.js:
     48        (InspectorController.getCookies):
     49        * inspector/front-end/InjectedScript.js:
     50        (InjectedScript.setStyleProperty): style fix
     51        (InjectedScript.getCookies):
     52
     53          Allow alignment of text inside DataGrids.
     54
     55        * inspector/front-end/DataGrid.js:
     56        (WebInspector.DataGrid):
     57        (WebInspector.DataGridNode.prototype.createCell):
     58        * inspector/front-end/DatabasesPanel.js:
     59        (WebInspector.DatabasesPanel.prototype.dataGridForDOMStorage):
     60        * inspector/front-end/inspector.css:
     61
     62          Added deleteCookie(., ., String name)
     63          Modified getRawCookies to return a bool to know if its implemented
     64
     65        * platform/CookieJar.h:
     66
     67
     68          Implemented deleteCookie for Macs
     69
     70        * platform/mac/CookieJar.mm:
     71        (WebCore::getRawCookies):
     72        (WebCore::deleteCookie):
     73
     74          Stub Implementations for Other Platforms
     75
     76        * platform/haiku/CookieJarHaiku.cpp:
     77        (WebCore::getRawCookies):
     78        (WebCore::deleteCookie):
     79        * platform/network/chromium/CookieJarChromium.cpp:
     80        (WebCore::getRawCookies):
     81        (WebCore::deleteCookie):
     82        * platform/network/curl/CookieJarCurl.cpp:
     83        (WebCore::getRawCookies):
     84        (WebCore::deleteCookie):
     85        * platform/network/soup/CookieJarSoup.cpp:
     86        (WebCore::getRawCookies):
     87        (WebCore::deleteCookie):
     88        * platform/network/win/CookieJarCFNetWin.cpp:
     89        (WebCore::getRawCookies):
     90        (WebCore::deleteCookie):
     91        * platform/network/win/CookieJarWin.cpp:
     92        (WebCore::getRawCookies):
     93        (WebCore::deleteCookie):
     94        * platform/qt/CookieJarQt.cpp:
     95        (WebCore::getRawCookies):
     96        (WebCore::deleteCookie):
     97
    1982009-08-17  Adam Treat  <adam.treat@torchmobile.com>
    299
  • trunk/WebCore/WebCore.gypi

    r47313 r47363  
    25402540            'platform/ContextMenu.h',
    25412541            'platform/ContextMenuItem.h',
     2542            'platform/Cookie.h',
    25422543            'platform/CookieJar.h',
    25432544            'platform/CrossThreadCopier.h',
     
    34273428            'inspector/front-end/Color.js',
    34283429            'inspector/front-end/ConsoleView.js',
     3430            'inspector/front-end/CookieItemsView.js',
    34293431            'inspector/front-end/Database.js',
    34303432            'inspector/front-end/DatabaseQueryView.js',
     
    34843486            'inspector/front-end/Images/closeButtons.png',
    34853487            'inspector/front-end/Images/consoleButtonGlyph.png',
     3488            'inspector/front-end/Images/cookie.png',
    34863489            'inspector/front-end/Images/database.png',
    34873490            'inspector/front-end/Images/databasesIcon.png',
  • trunk/WebCore/bindings/js/JSInspectorBackendCustom.cpp

    r47231 r47363  
    33 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
    44 * Copyright (C) 2009 Google Inc. All rights reserved.
     5 * Copyright (C) 2009 Joseph Pecoraro
    56 *
    67 * Redistribution and use in source and binary forms, with or without
     
    164165    Document* document = ic->inspectedPage()->mainFrame()->document();
    165166    Vector<Cookie> cookies;
    166     getRawCookies(document, document->cookieURL(), cookies);
     167    bool isImplemented = getRawCookies(document, document->cookieURL(), cookies);
     168
     169    if (!isImplemented)
     170        return jsUndefined();
    167171
    168172    MarkedArgumentBuffer result;
     
    194198
    195199    return constructArray(exec, result);
     200}
     201
     202JSValue JSInspectorBackend::deleteCookie(ExecState* exec, const ArgList& args)
     203{
     204    if (args.size() < 1)
     205        return jsUndefined();
     206
     207    InspectorController* ic = impl()->inspectorController();
     208    if (!ic)
     209        return jsUndefined();
     210
     211    String cookieName = args.at(0).toString(exec);
     212    if (exec->hadException())
     213        return jsUndefined();
     214
     215    Document* document = ic->inspectedPage()->mainFrame()->document();
     216    WebCore::deleteCookie(document, document->cookieURL(), cookieName);
     217
     218    return jsUndefined();
    196219}
    197220
  • trunk/WebCore/bindings/v8/custom/V8CustomBinding.h

    r47231 r47363  
    404404        DECLARE_CALLBACK(InspectorBackendSetSetting);
    405405        DECLARE_CALLBACK(InspectorBackendCookies);
     406        DECLARE_CALLBACK(InspectorBackendDeleteCookie);
    406407        DECLARE_CALLBACK(InspectorBackendCurrentCallFrame);
    407408        DECLARE_CALLBACK(InspectorBackendDebuggerEnabled);
  • trunk/WebCore/bindings/v8/custom/V8InspectorBackendCustom.cpp

    r47231 r47363  
    212212}
    213213
     214CALLBACK_FUNC_DECL(InspectorBackendDeleteCookie)
     215{
     216    INC_STATS("InspectorBackend.deleteCookie()");
     217    // FIXME: Not yet implemented. (see WebCore/bindings/js/JSInspectorBackendCustom.cpp#deleteCookie)
     218    return v8::Undefined();
     219}
     220
    214221CALLBACK_FUNC_DECL(InspectorBackendWrapCallback)
    215222{
  • trunk/WebCore/inspector/InspectorBackend.idl

    r47339 r47363  
    7070
    7171        [Custom] Array cookies();
     72        [Custom] void deleteCookie(in DOMString cookieName);
    7273
    7374#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
  • trunk/WebCore/inspector/front-end/CookieItemsView.js

    r47192 r47363  
    3232    WebInspector.View.call(this);
    3333
     34    // Some Platforms have not yet implemented access to raw cookies
     35    // Those platforms will return undefined instead of an Array
     36    // For these platforms we:
     37    //   - resort to document.cookie
     38    //   - do not show the delete cookie status bar button
     39    this._useFallback = typeof InspectorController.cookies() === "undefined";
     40
    3441    this.element.addStyleClass("storage-view");
    3542    this.element.addStyleClass("table");
     
    4653    get statusBarItems()
    4754    {
    48         return [this.refreshButton.element, this.deleteButton.element];
     55        if (this._useFallback)
     56            return [this.refreshButton.element];
     57        else
     58            return [this.refreshButton.element, this.deleteButton.element];
    4959    },
    5060
     
    6373    update: function()
    6474    {
     75        if (this._useFallback) {
     76            this.fallbackUpdate();
     77            return;
     78        }
     79
    6580        this.element.removeChildren();
    6681        var dataGrid = this.dataGridForCookies();
     
    8196    buildCookies: function()
    8297    {
    83         var rawCookieString = InspectorController.inspectedWindow().document.cookie;
     98        var rawCookies = InspectorController.cookies();
     99        var cookies = [];
     100        for (var i = 0; i < rawCookies.length; ++i) {
     101            var cookie = rawCookies[i];
     102            cookie.expires = new Date(cookie.expires);
     103            cookies.push(cookie);
     104        }
     105
     106        return cookies;
     107    },
     108
     109    dataGridForCookies: function()
     110    {
     111        var cookies = this.buildCookies();
     112        if (!cookies.length)
     113            return null;
     114
     115        var columns = { 0: {}, 1: {}, 2: {}, 3: {}, 4: {}, 5: {}, 6: {}, 7: {} };
     116        columns[0].title = WebInspector.UIString("Name");
     117        columns[0].width = columns[0].title.length;
     118        columns[1].title = WebInspector.UIString("Value");
     119        columns[1].width = columns[1].title.length;
     120        columns[2].title = WebInspector.UIString("Domain");
     121        columns[2].width = columns[2].title.length;
     122        columns[3].title = WebInspector.UIString("Path");
     123        columns[3].width = columns[3].title.length;
     124        columns[4].title = WebInspector.UIString("Expires");
     125        columns[4].width = columns[4].title.length;
     126        columns[5].title = WebInspector.UIString("Size");
     127        columns[5].width = columns[5].title.length;
     128        columns[5].aligned = "right";
     129        columns[6].title = WebInspector.UIString("HTTP");
     130        columns[6].width = columns[6].title.length;
     131        columns[6].aligned = "centered";
     132        columns[7].title = WebInspector.UIString("Secure");
     133        columns[7].width = columns[7].title.length;
     134        columns[7].aligned = "centered";
     135
     136        function updateDataAndColumn(index, value) {
     137            data[index] = value;
     138            if (value.length > columns[index].width)
     139                columns[index].width = value.length;
     140        }
     141
     142        var data;
     143        var nodes = [];
     144        for (var i = 0; i < cookies.length; ++i) {
     145            var cookie = cookies[i];
     146            data = {};
     147
     148            updateDataAndColumn(0, cookie.name);
     149            updateDataAndColumn(1, cookie.value);
     150            updateDataAndColumn(2, cookie.domain);
     151            updateDataAndColumn(3, cookie.path);
     152            updateDataAndColumn(4, (cookie.session ? "Session" : cookie.expires.toGMTString()));
     153            updateDataAndColumn(5, Number.bytesToString(cookie.size, WebInspector.UIString));
     154            updateDataAndColumn(6, (cookie.httpOnly ? "\u2713" : "")); // Checkmark
     155            updateDataAndColumn(7, (cookie.secure ? "\u2713" : "")); // Checkmark
     156
     157            var node = new WebInspector.DataGridNode(data, false);
     158            node.cookie = cookie;
     159            node.selectable = true;
     160            nodes.push(node);
     161        }
     162
     163        var totalColumnWidths = 0;
     164        for (var columnIdentifier in columns)
     165            totalColumnWidths += columns[columnIdentifier].width;
     166
     167        // Enforce the Value column (the 2nd column) to be a max of 33%
     168        // tweaking the raw total width because may massively outshadow the others
     169        var valueColumnWidth = columns[1].width;
     170        if (valueColumnWidth / totalColumnWidths > 0.33) {
     171            totalColumnWidths -= valueColumnWidth;
     172            totalColumnWidths *= 1.33;
     173            columns[1].width = totalColumnWidths * 0.33;
     174        }
     175
     176        // Calculate the percentage width for the columns.
     177        const minimumPrecent = 6;
     178        var recoupPercent = 0;
     179        for (var columnIdentifier in columns) {
     180            var width = columns[columnIdentifier].width;
     181            width = Math.round((width / totalColumnWidths) * 100);
     182            if (width < minimumPrecent) {
     183                recoupPercent += (minimumPrecent - width);
     184                width = minimumPrecent;
     185            }
     186            columns[columnIdentifier].width = width;
     187        }
     188
     189        // Enforce the minimum percentage width. (need to narrow total percentage due to earlier additions)
     190        while (recoupPercent > 0) {
     191            for (var columnIdentifier in columns) {
     192                if (columns[columnIdentifier].width > minimumPrecent) {
     193                    --columns[columnIdentifier].width;
     194                    --recoupPercent;
     195                    if (!recoupPercent)
     196                        break;
     197                }
     198            }
     199        }
     200
     201        for (var columnIdentifier in columns)
     202            columns[columnIdentifier].width += "%";
     203
     204        var dataGrid = new WebInspector.DataGrid(columns);
     205        var length = nodes.length;
     206        for (var i = 0; i < length; ++i)
     207            dataGrid.appendChild(nodes[i]);
     208        if (length > 0)
     209            nodes[0].selected = true;
     210
     211        return dataGrid;
     212    },
     213
     214    fallbackUpdate: function()
     215    {
     216        this.element.removeChildren();
     217
     218        var self = this;
     219        function callback(rawCookieString) {
     220            var cookies = self.fallbackBuildCookiesFromString(rawCookieString);
     221            var dataGrid = self.fallbackDataGridForCookies(cookies);
     222            if (dataGrid) {
     223                self._dataGrid = dataGrid;
     224                self.element.appendChild(dataGrid.element);
     225                self.deleteButton.visible = true;
     226            } else {
     227                var emptyMsgElement = document.createElement("div");
     228                emptyMsgElement.className = "storage-table-empty";
     229                emptyMsgElement.textContent = WebInspector.UIString("This site has no cookies.");
     230                self.element.appendChild(emptyMsgElement);
     231                self._dataGrid = null;
     232                self.deleteButton.visible = false;
     233            }
     234        }
     235
     236        InspectorController.getCookies(callback);
     237    },
     238
     239    fallbackBuildCookiesFromString: function(rawCookieString)
     240    {
    84241        var rawCookies = rawCookieString.split(/;\s*/);
    85242        var cookies = [];
     
    91248                var name = cookie.substring(0, delimIndex);
    92249                var value = cookie.substring(delimIndex + 1);
    93                 cookies.push(new WebInspector.Cookie(name, value));
    94             }               
     250                var size = name.length + value.length;
     251                cookies.push({ name: name, value: value, size: size });
     252            }
    95253        }
    96254
     
    98256    },
    99257
    100     dataGridForCookies: function()
    101     {
    102         var cookies = this.buildCookies();
     258    fallbackDataGridForCookies: function(cookies)
     259    {
    103260        if (!cookies.length)
    104261            return null;
     
    107264        columns[0] = {};
    108265        columns[1] = {};
    109         columns[0].title = WebInspector.UIString("Key");
     266        columns[0].title = WebInspector.UIString("Name");
    110267        columns[0].width = columns[0].title.length;
    111268        columns[1].title = WebInspector.UIString("Value");
    112         columns[1].width = columns[0].title.length;
     269        columns[1].width = columns[1].title.length;
    113270
    114271        var nodes = [];
     
    117274            var data = {};
    118275
    119             var key = cookie.key;
    120             data[0] = key;
    121             if (key.length > columns[0].width)
    122                 columns[0].width = key.length;
     276            var name = cookie.name;
     277            data[0] = name;
     278            if (name.length > columns[0].width)
     279                columns[0].width = name.length;
    123280
    124281            var value = cookie.value;
     
    130287            node.selectable = true;
    131288            nodes.push(node);
    132       }
    133 
    134       var totalColumnWidths = columns[0].width + columns[1].width;
    135       width = Math.round((columns[0].width * 100) / totalColumnWidths);
    136       const minimumPrecent = 20;
    137       if (width < minimumPrecent)
    138           width = minimumPrecent;
    139       if (width > 100 - minimumPrecent)
    140           width = 100 - minimumPrecent;
    141       columns[0].width = width;
    142       columns[1].width = 100 - width;
    143       columns[0].width += "%";
    144       columns[1].width += "%";
    145 
    146       var dataGrid = new WebInspector.DataGrid(columns);
    147       var length = nodes.length;
    148       for (var i = 0; i < length; ++i)
    149           dataGrid.appendChild(nodes[i]);
    150       if (length > 0)
    151           nodes[0].selected = true;
    152 
    153       return dataGrid;
     289        }
     290
     291        var totalColumnWidths = columns[0].width + columns[1].width;
     292        var width = Math.round((columns[0].width * 100) / totalColumnWidths);
     293        const minimumPrecent = 20;
     294        if (width < minimumPrecent)
     295            width = minimumPrecent;
     296        if (width > 100 - minimumPrecent)
     297            width = 100 - minimumPrecent;
     298        columns[0].width = width;
     299        columns[1].width = 100 - width;
     300        columns[0].width += "%";
     301        columns[1].width += "%";
     302
     303        var dataGrid = new WebInspector.DataGrid(columns);
     304        var length = nodes.length;
     305        for (var i = 0; i < length; ++i)
     306            dataGrid.appendChild(nodes[i]);
     307        if (length > 0)
     308            nodes[0].selected = true;
     309
     310        return dataGrid;
    154311    },
    155312
    156313    _deleteButtonClicked: function(event)
    157314    {
    158         if (!this._dataGrid)
     315        if (!this._dataGrid || this._useFallback)
    159316            return;
    160317
    161         var node = this._dataGrid.selectedNode;
    162         var key = node.data[0].replace(/"/,"\\\"");
    163         var expire = "Thu, 01 Jan 1970 00:00:00 GMT"; // (new Date(0)).toGMTString();
    164         var evalStr = "document.cookie = \""+ key + "=; expires=" + expire + "; path=/\";" +
    165                       "document.cookie = \""+ key + "=; expires=" + expire + "\";";
    166         WebInspector.console.doEvalInWindow(evalStr, this.update.bind(this));
     318        var cookie = this._dataGrid.selectedNode.cookie;
     319        InspectorController.deleteCookie(cookie.name);
     320        this.update();
    167321    },
    168322
  • trunk/WebCore/inspector/front-end/DOMAgent.js

    r47339 r47363  
    714714    }, 0);
    715715}
     716
     717InspectorController.getCookies = function(callback)
     718{
     719    setTimeout(function() {
     720        callback(InjectedScript.getCookies());
     721    }, 0);
     722}
  • trunk/WebCore/inspector/front-end/DataGrid.js

    r46891 r47363  
    4040    this._dataTable.addEventListener("click", this._clickInDataTable.bind(this), true);
    4141
     42    this.aligned = {};
     43
    4244    var scrollContainer = document.createElement("div");
    4345    scrollContainer.className = "data-container";
     
    7779            cell.addEventListener("click", this._clickInHeaderCell.bind(this), false);
    7880            cell.addStyleClass("sortable");
     81        }
     82
     83        if (column.aligned) {
     84            cell.addStyleClass(column.aligned);
     85            this.aligned[columnIdentifier] = column.aligned;
    7986        }
    8087
     
    753760        cell.className = columnIdentifier + "-column";
    754761
     762        var alignment = this.dataGrid.aligned[columnIdentifier];
     763        if (alignment)
     764            cell.addStyleClass(alignment);
     765
    755766        var div = document.createElement("div");
    756767        div.textContent = this.data[columnIdentifier];
  • trunk/WebCore/inspector/front-end/DatabasesPanel.js

    r47181 r47363  
    401401        columns[0].width = columns[0].title.length;
    402402        columns[1].title = WebInspector.UIString("Value");
    403         columns[1].width = columns[0].title.length;
     403        columns[1].width = columns[1].title.length;
    404404
    405405        var nodes = [];
     
    424424
    425425        var totalColumnWidths = columns[0].width + columns[1].width;
    426         width = Math.round((columns[0].width * 100) / totalColumnWidths);
     426        var width = Math.round((columns[0].width * 100) / totalColumnWidths);
    427427        const minimumPrecent = 10;
    428428        if (width < minimumPrecent)
  • trunk/WebCore/inspector/front-end/InjectedScript.js

    r47339 r47363  
    246246}
    247247
    248 InjectedScript.setStyleProperty = function(styleId, name, value) {
     248InjectedScript.setStyleProperty = function(styleId, name, value)
     249{
    249250    var style = InjectedScript._styles[styleId];
    250251    if (!style)
     
    767768    InjectedScript._searchResults = [];
    768769    return true;
     770}
     771
     772InjectedScript.getCookies = function()
     773{
     774    return InjectedScript._window().document.cookie;
    769775}
    770776
  • trunk/WebCore/inspector/front-end/WebKit.qrc

    r47192 r47363  
    1010    <file>Color.js</file>
    1111    <file>ConsoleView.js</file>
    12     <file>Cookie.js</file>
    1312    <file>CookieItemsView.js</file>
    1413    <file>Database.js</file>
  • trunk/WebCore/inspector/front-end/inspector.css

    r47192 r47363  
    17901790}
    17911791
     1792.data-grid .centered div {
     1793    text-align: center;
     1794}
     1795
     1796.data-grid .right div {
     1797    text-align: right;
     1798}
     1799
    17921800.data-grid th.sortable div {
    17931801    position: relative;
  • trunk/WebCore/inspector/front-end/inspector.html

    r47192 r47363  
    5050    <script type="text/javascript" src="DataGrid.js"></script>
    5151    <script type="text/javascript" src="DOMStorageDataGrid.js"></script>
    52     <script type="text/javascript" src="Cookie.js"></script>
    5352    <script type="text/javascript" src="CookieItemsView.js"></script>
    5453    <script type="text/javascript" src="Script.js"></script>
  • trunk/WebCore/platform/CookieJar.h

    r47205 r47363  
    4040    void setCookies(Document*, const KURL&, const String&);
    4141    bool cookiesEnabled(const Document*);
    42     void getRawCookies(const Document*, const KURL&, Vector<Cookie>&);
     42    bool getRawCookies(const Document*, const KURL&, Vector<Cookie>&);
     43    void deleteCookie(const Document*, const KURL&, const String&);
    4344
    4445}
  • trunk/WebCore/platform/haiku/CookieJarHaiku.cpp

    r47205 r47363  
    5959}
    6060
    61 void getRawCookies(const Document*, const KURL&, Vector<Cookie>& rawCookies)
     61bool getRawCookies(const Document*, const KURL&, Vector<Cookie>& rawCookies)
    6262{
    6363    // FIXME: Not yet implemented
    6464    rawCookies.clear();
     65    return false; // return true when implemented
     66}
     67
     68void deleteCookie(const Document*, const KURL&, const String&)
     69{
     70    // FIXME: Not yet implemented
    6571}
    6672
  • trunk/WebCore/platform/mac/CookieJar.mm

    r47205 r47363  
    118118}
    119119
    120 void getRawCookies(const Document*, const KURL& url, Vector<Cookie>& rawCookies)
     120bool getRawCookies(const Document*, const KURL& url, Vector<Cookie>& rawCookies)
    121121{
    122122    rawCookies.clear();
     
    142142
    143143    END_BLOCK_OBJC_EXCEPTIONS;
     144    return true;
     145}
     146
     147void deleteCookie(const Document*, const KURL& url, const String& cookieName)
     148{
     149    BEGIN_BLOCK_OBJC_EXCEPTIONS;
     150
     151    NSURL *cookieURL = url;
     152    NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
     153    NSArray *cookies = [cookieStorage cookiesForURL:cookieURL];
     154    NSString *cookieNameString = (NSString *) cookieName;
     155
     156    NSUInteger count = [cookies count];
     157    for (NSUInteger i = 0; i < count; ++i) {
     158        NSHTTPCookie *cookie = (NSHTTPCookie *)[cookies objectAtIndex:i];
     159        if ([[cookie name] isEqualToString:cookieNameString]) {
     160            [cookieStorage deleteCookie:cookie];
     161            break;
     162        }
     163    }
     164
     165    END_BLOCK_OBJC_EXCEPTIONS;
    144166}
    145167
  • trunk/WebCore/platform/network/chromium/CookieJarChromium.cpp

    r47205 r47363  
    5454}
    5555
    56 void getRawCookies(const Document*, const KURL&, Vector<Cookie>& rawCookies)
     56bool getRawCookies(const Document*, const KURL&, Vector<Cookie>& rawCookies)
    5757{
    5858    // FIXME: Not yet implemented
    5959    rawCookies.clear();
     60    return false; // return true when implemented
     61}
     62
     63void deleteCookie(const Document*, const KURL&, const String&)
     64{
     65    // FIXME: Not yet implemented
    6066}
    6167
  • trunk/WebCore/platform/network/curl/CookieJarCurl.cpp

    r47205 r47363  
    4545}
    4646
    47 void getRawCookies(const Document*, const KURL&, Vector<Cookie>& rawCookies)
     47bool getRawCookies(const Document*, const KURL&, Vector<Cookie>& rawCookies)
    4848{
    4949    // FIXME: Not yet implemented
    5050    rawCookies.clear();
     51    return false; // return true when implemented
     52}
     53
     54void deleteCookie(const Document*, const KURL&, const String&)
     55{
     56    // FIXME: Not yet implemented
    5157}
    5258
  • trunk/WebCore/platform/network/soup/CookieJarSoup.cpp

    r47205 r47363  
    8888}
    8989
    90 void getRawCookies(const Document*, const KURL&, Vector<Cookie>& rawCookies)
     90bool getRawCookies(const Document*, const KURL&, Vector<Cookie>& rawCookies)
    9191{
    9292    // FIXME: Not yet implemented
    9393    rawCookies.clear();
     94    return false; // return true when implemented
     95}
     96
     97void deleteCookie(const Document*, const KURL&, const String&)
     98{
     99    // FIXME: Not yet implemented
    94100}
    95101
  • trunk/WebCore/platform/network/win/CookieJarCFNetWin.cpp

    r47205 r47363  
    115115}
    116116
    117 void getRawCookies(const Document*, const KURL&, Vector<Cookie>& rawCookies)
     117bool getRawCookies(const Document*, const KURL&, Vector<Cookie>& rawCookies)
    118118{
    119119    // FIXME: Not yet implemented
    120120    rawCookies.clear();
     121    return false; // return true when implemented
     122}
     123
     124void deleteCookie(const Document*, const KURL&, const String&)
     125{
     126    // FIXME: Not yet implemented
    121127}
    122128
  • trunk/WebCore/platform/network/win/CookieJarWin.cpp

    r47205 r47363  
    6565}
    6666
    67 void getRawCookies(const Document*, const KURL&, Vector<Cookie>& rawCookies)
     67bool getRawCookies(const Document*, const KURL&, Vector<Cookie>& rawCookies)
    6868{
    6969    // FIXME: Not yet implemented
    7070    rawCookies.clear();
     71    return false; // return true when implemented
     72}
     73
     74void deleteCookie(const Document*, const KURL&, const String&)
     75{
     76    // FIXME: Not yet implemented
    7177}
    7278
  • trunk/WebCore/platform/qt/CookieJarQt.cpp

    r47205 r47363  
    130130}
    131131
    132 void getRawCookies(const Document*, const KURL&, Vector<Cookie>& rawCookies)
     132bool getRawCookies(const Document*, const KURL&, Vector<Cookie>& rawCookies)
    133133{
    134134    // FIXME: Not yet implemented
    135135    rawCookies.clear();
     136    return false; // return true when implemented
     137}
     138
     139void deleteCookie(const Document*, const KURL&, const String&)
     140{
     141    // FIXME: Not yet implemented
    136142}
    137143
Note: See TracChangeset for help on using the changeset viewer.