Changeset 259842 in webkit


Ignore:
Timestamp:
Apr 9, 2020, 5:40:02 PM (5 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Storage: should be able to set a cookie with no value
https://bugs.webkit.org/show_bug.cgi?id=210237

Reviewed by Timothy Hatcher.

  • UserInterface/Views/CookiePopover.js:

(WI.CookiePopover.prototype.get serializedData):
Require an explicitly set name instead of falling back to the placeholder. Allow the
value to be an empty string.

(WI.CookiePopover.prototype.show):
Don't have default placeholder values for name or value for the reasons above.
Drive-by: if an existing WI.Cookie is provided, use its SameSite value.

  • UserInterface/Views/CookiePopover.css: Added.

(.popover .cookie-popover-content > table > tr > td > input:matches([type="text"], [type="datetime-local"]):matches(:invalid, .invalid)): Added.
(.popover .cookie-popover-content > table > tr > td > input:matches([type="text"], [type="datetime-local"]).invalid): Deleted.
Instead of changing the text color, change the border color.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r259810 r259842  
     12020-04-09  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Storage: should be able to set a cookie with no value
     4        https://bugs.webkit.org/show_bug.cgi?id=210237
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UserInterface/Views/CookiePopover.js:
     9        (WI.CookiePopover.prototype.get serializedData):
     10        Require an explicitly set `name` instead of falling back to the `placeholder`. Allow the
     11        `value` to be an empty string.
     12
     13        (WI.CookiePopover.prototype.show):
     14        Don't have default placeholder values for `name` or `value` for the reasons above.
     15        Drive-by: if an existing `WI.Cookie` is provided, use its `SameSite` value.
     16
     17        * UserInterface/Views/CookiePopover.css: Added.
     18        (.popover .cookie-popover-content > table > tr > td > input:matches([type="text"], [type="datetime-local"]):matches(:invalid, .invalid)): Added.
     19        (.popover .cookie-popover-content > table > tr > td > input:matches([type="text"], [type="datetime-local"]).invalid): Deleted.
     20        Instead of changing the text color, change the border color.
     21
    1222020-04-09  Devin Rousso  <drousso@apple.com>
    223
  • trunk/Source/WebInspectorUI/UserInterface/Views/CookiePopover.css

    r259173 r259842  
    5757}
    5858
    59 .popover .cookie-popover-content > table > tr > td > input:matches([type="text"], [type="datetime-local"]).invalid {
    60     color: var(--error-text-color);
     59.popover .cookie-popover-content > table > tr > td > input:matches([type="text"], [type="datetime-local"]):matches(:invalid, .invalid) {
     60    border-color: var(--error-text-color);
    6161}
    6262
  • trunk/Source/WebInspectorUI/UserInterface/Views/CookiePopover.js

    r259173 r259842  
    5252            return null;
    5353
    54         let name = this._nameInputElement.value || this._nameInputElement.placeholder;
     54        let name = this._nameInputElement.value;
    5555        if (!name)
    56             return null;
    57 
    58         let value = this._valueInputElement.value || this._valueInputElement.placeholder;
    59         if (!value)
    6056            return null;
    6157
     
    8480        let data = {
    8581            name,
    86             value,
     82            value: this._valueInputElement.value,
    8783            domain,
    8884            path,
     
    125121        } else {
    126122            let urlComponents = WI.networkManager.mainFrame.mainResource.urlComponents;
    127             data.name = WI.unlocalizedString("name");
    128             data.value = WI.unlocalizedString("value");
     123            data.name = "";
     124            data.value = "";
    129125            data.domain = urlComponents.host;
    130126            data.path = urlComponents.path;
     
    181177
    182178        this._nameInputElement = createInputRow("name", WI.UIString("Name"), "text", data.name).inputElement;
     179        this._nameInputElement.required = true;
    183180
    184181        this._valueInputElement = createInputRow("value", WI.UIString("Value"), "text", data.value).inputElement;
     
    203200        for (let sameSiteType of Object.values(WI.Cookie.SameSiteType)) {
    204201            let optionElement = this._sameSiteSelectElement.appendChild(document.createElement("option"));
    205             optionElement.textContent = sameSiteType;
    206         }
     202            optionElement.value = sameSiteType;
     203            optionElement.textContent = WI.Cookie.displayNameForSameSiteType(sameSiteType);
     204        }
     205        this._sameSiteSelectElement.value = data.sameSite;
    207206        createRow("same-site", WI.unlocalizedString("SameSite"), this._sameSiteSelectElement);
    208207
Note: See TracChangeset for help on using the changeset viewer.