Summary: | Web Inspector: Can't add a new class by editing class attribute in DOM outline | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Nikita Vasilyev <nvasilyev> | ||||||||||
Component: | Web Inspector | Assignee: | Nikita Vasilyev <nvasilyev> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | commit-queue, inspector-bugzilla-changes, mattbaker, rniwa | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | All | ||||||||||||
OS: | All | ||||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=123163 | ||||||||||||
Attachments: |
|
Description
Nikita Vasilyev
2017-12-15 16:05:04 PST
Created attachment 329534 [details]
[Image] Bug
Devin, if you're looking for more bugs to fix, this's a good one! If not, feel free to set it back to unassigned. This happens only on certain class names. Steps: 1. Open http://nv.github.io/webkit-inspector-bugs/styles-redesign/tests/color.html 2. Double-click on `class="item-1"` 3. Type "my-class " before the existing class name, so it looks like `class="my-class item-1"` 4. Press Enter It looks like DOMAgent.setAttributesAsText *sometimes* converts spaces to . (In reply to Nikita Vasilyev from comment #3) > It looks like DOMAgent.setAttributesAsText *sometimes* converts spaces to > . No, nbsp's are coming from contentEditable. Created attachment 335982 [details]
Patch
"ContentEditable: is forced on SPACE between text nodes" https://bugs.chromium.org/p/chromium/issues/detail?id=310149 Fixed in Chromium on July 27, 2016 but appears to be unresolved in WebKit. This makes we concerned about other places where we use contentEditable, such as the styles editor. (In reply to Nikita Vasilyev from comment #5) > Created attachment 335982 [details] > Patch To clarify, this patch makes it impossible to commit non-breaking spaces in HTML attributes and I'm fine with that. When would you want to add a non-breaking space in Web Inspector? I can't think of any common cases. Created attachment 336078 [details]
Patch
Comment on attachment 336078 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=336078&action=review > Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js:1069 > + let nbspRegex = /\xA0/g; Why not const? Comment on attachment 336078 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=336078&action=review >> Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js:1069 >> + let nbspRegex = /\xA0/g; > > Why not const? This should be const. We haven't settled on a convention for applying const in the WebInspector frontend. I think more widespread usage would be a benefit, but my thoughts on const-correctness come from C++, and I don't know how much of that applies to JS. Created attachment 336107 [details]
Patch
Comment on attachment 336107 [details] Patch Clearing flags on attachment: 336107 Committed r229744: <https://trac.webkit.org/changeset/229744> All reviewed patches have been landed. Closing bug. |