Title: [259842] trunk/Source/WebInspectorUI
Revision
259842
Author
[email protected]
Date
2020-04-09 17:40:02 -0700 (Thu, 09 Apr 2020)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (259841 => 259842)


--- trunk/Source/WebInspectorUI/ChangeLog	2020-04-10 00:28:11 UTC (rev 259841)
+++ trunk/Source/WebInspectorUI/ChangeLog	2020-04-10 00:40:02 UTC (rev 259842)
@@ -1,5 +1,26 @@
 2020-04-09  Devin Rousso  <[email protected]>
 
+        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.
+
+2020-04-09  Devin Rousso  <[email protected]>
+
         Web Inspector: Debugger: debug hooks should also be emitted for the first sub-_expression_ in a comma _expression_
         https://bugs.webkit.org/show_bug.cgi?id=210253
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CookiePopover.css (259841 => 259842)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CookiePopover.css	2020-04-10 00:28:11 UTC (rev 259841)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CookiePopover.css	2020-04-10 00:40:02 UTC (rev 259842)
@@ -56,8 +56,8 @@
     -webkit-appearance: none;
 }
 
-.popover .cookie-popover-content > table > tr > td > input:matches([type="text"], [type="datetime-local"]).invalid {
-    color: var(--error-text-color);
+.popover .cookie-popover-content > table > tr > td > input:matches([type="text"], [type="datetime-local"]):matches(:invalid, .invalid) {
+    border-color: var(--error-text-color);
 }
 
 @media (prefers-color-scheme: dark) {

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CookiePopover.js (259841 => 259842)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CookiePopover.js	2020-04-10 00:28:11 UTC (rev 259841)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CookiePopover.js	2020-04-10 00:40:02 UTC (rev 259842)
@@ -51,14 +51,10 @@
         if (!this._targetElement)
             return null;
 
-        let name = this._nameInputElement.value || this._nameInputElement.placeholder;
+        let name = this._nameInputElement.value;
         if (!name)
             return null;
 
-        let value = this._valueInputElement.value || this._valueInputElement.placeholder;
-        if (!value)
-            return null;
-
         let domain = this._domainInputElement.value || this._domainInputElement.placeholder;
         if (!domain)
             return null;
@@ -83,7 +79,7 @@
 
         let data = {
             name,
-            value,
+            value: this._valueInputElement.value,
             domain,
             path,
             httpOnly: this._httpOnlyCheckboxElement.checked,
@@ -124,8 +120,8 @@
             data.sameSite = cookie.sameSite;
         } else {
             let urlComponents = WI.networkManager.mainFrame.mainResource.urlComponents;
-            data.name = WI.unlocalizedString("name");
-            data.value = WI.unlocalizedString("value");
+            data.name = "";
+            data.value = "";
             data.domain = urlComponents.host;
             data.path = urlComponents.path;
             data.expires = this._defaultExpires().toLocaleString();
@@ -180,6 +176,7 @@
         }
 
         this._nameInputElement = createInputRow("name", WI.UIString("Name"), "text", data.name).inputElement;
+        this._nameInputElement.required = true;
 
         this._valueInputElement = createInputRow("value", WI.UIString("Value"), "text", data.value).inputElement;
 
@@ -202,8 +199,10 @@
         this._sameSiteSelectElement = document.createElement("select");
         for (let sameSiteType of Object.values(WI.Cookie.SameSiteType)) {
             let optionElement = this._sameSiteSelectElement.appendChild(document.createElement("option"));
-            optionElement.textContent = sameSiteType;
+            optionElement.value = sameSiteType;
+            optionElement.textContent = WI.Cookie.displayNameForSameSiteType(sameSiteType);
         }
+        this._sameSiteSelectElement.value = data.sameSite;
         createRow("same-site", WI.unlocalizedString("SameSite"), this._sameSiteSelectElement);
 
         let toggleExpiresRow = () => {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to