Title: [229744] trunk/Source/WebInspectorUI
Revision
229744
Author
nvasil...@apple.com
Date
2018-03-20 01:22:03 -0700 (Tue, 20 Mar 2018)

Log Message

Web Inspector: Can't add a new class by editing class attribute in DOM outline
https://bugs.webkit.org/show_bug.cgi?id=180890

Reviewed by Ryosuke Niwa.

Typing "my-foo my-bar" creates a single "my-foo\xA0my-bar" class name because
contentEditable-based attribute editor sometimes inserts non-breaking space characters (\xA0).

Replace all non-breaking space characters with the regular space characters when
commiting attribute change.

* UserInterface/Views/DOMTreeElement.js:

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (229743 => 229744)


--- trunk/Source/WebInspectorUI/ChangeLog	2018-03-20 07:58:22 UTC (rev 229743)
+++ trunk/Source/WebInspectorUI/ChangeLog	2018-03-20 08:22:03 UTC (rev 229744)
@@ -1,3 +1,18 @@
+2018-03-20  Nikita Vasilyev  <nvasil...@apple.com>
+
+        Web Inspector: Can't add a new class by editing class attribute in DOM outline
+        https://bugs.webkit.org/show_bug.cgi?id=180890
+
+        Reviewed by Ryosuke Niwa.
+
+        Typing "my-foo my-bar" creates a single "my-foo\xA0my-bar" class name because
+        contentEditable-based attribute editor sometimes inserts non-breaking space characters (\xA0).
+
+        Replace all non-breaking space characters with the regular space characters when
+        commiting attribute change.
+
+        * UserInterface/Views/DOMTreeElement.js:
+
 2018-03-16  Nikita Vasilyev  <nvasil...@apple.com>
 
         Web Inspector: Elements: "Force Print Media Styles" should not persist across Web Inspector sessions

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js (229743 => 229744)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js	2018-03-20 07:58:22 UTC (rev 229743)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js	2018-03-20 08:22:03 UTC (rev 229744)
@@ -1065,6 +1065,10 @@
         if (!moveDirection && newText === oldText)
             return;
 
+        // FIXME: Workaround for <https://webkit.org/b/123163> &nbsp; is forced on SPACE between text nodes.
+        const nbspRegex = /\xA0/g;
+        newText = newText.replace(nbspRegex, " ");
+
         var treeOutline = this.treeOutline;
         function moveToNextAttributeIfNeeded(error)
         {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to