Bug 199090

Summary: Web Inspector: Styles: unbalanced quotes and parenthesis aren't displayed as property closed after editing values
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Severity: Normal CC: commit-queue, inspector-bugzilla-changes, mattbaker, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Description Flags
Patch none

Description Nikita Vasilyev 2019-06-20 16:27:02 PDT
I added auto-closing unbalanced quotes and parenthesis in Bug 182523, but I didn't realize there're two code paths to finish value edit.

Committing the value by pressing Enter or Tab works as expected, but it doesn't when caused by a blur event (by clicking somewhere else in Web Inspector, for instance). There should be only one code-path.

1. Open https://webkit.org
2. Inspect <body>
3. Add `font-family: "helv` CSS property to the Style Attribute rule.
4. Click on the white space somewhere in Web Inspector (to trigger blur event on the CSS value field).


    font-family: "helv};
                      Incorrectly shown } character

    font-family: "helv"
                      Inserted quote character

After focusing on the value ("helv}) again, it replaces it the correct value ("helv").
Comment 1 Radar WebKit Bug Importer 2019-06-20 16:28:27 PDT
Comment 2 Nikita Vasilyev 2019-06-21 18:19:15 PDT
Created attachment 372663 [details]

Here's a one-line fix.

I still plan to refactor spreadsheetTextFieldDidCommit and spreadsheetTextFieldDidBlur, but since it's only tangentially related to the bug, I don't plan to do it in this patch.
Comment 3 Matt Baker 2019-06-22 10:35:28 PDT
I also noticed that repeating the steps above but with Add `font-family: "Helv` (capitalized) will cause the value to autocomplete to `"Helvetica}`.
Comment 4 Matt Baker 2019-06-22 10:35:52 PDT
Comment on attachment 372663 [details]

Comment 5 WebKit Commit Bot 2019-06-22 11:05:34 PDT
Comment on attachment 372663 [details]

Clearing flags on attachment: 372663

Committed r246712: <https://trac.webkit.org/changeset/246712>
Comment 6 WebKit Commit Bot 2019-06-22 11:05:36 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Nikita Vasilyev 2019-06-22 15:32:56 PDT
(In reply to Matt Baker from comment #3)
> I also noticed that repeating the steps above but with Add `font-family:
> "Helv` (capitalized) will cause the value to autocomplete to `"Helvetica}`.

That's not good. Filled Bug 199130 - Web Inspector: Styles: curly brace incorrectly added after completed value inside unclosed quote