Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4460daca377eee69fecc02563f3ed7023fc57ef2
https://github.com/WebKit/WebKit/commit/4460daca377eee69fecc02563f3ed7023fc57ef2
Author: Ahmad Saleem <[email protected]>
Date: 2026-07-14 (Tue, 14 Jul 2026)
Changed paths:
M LayoutTests/inspector/unit-tests/css-keyword-completions-expected.txt
M LayoutTests/inspector/unit-tests/css-keyword-completions.html
M Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js
Log Message:
-----------
Web Inspector: autocompleting a vendor/-apple- prefixed value in Styles
duplicates the prefix (e.g. -apple--apple-system)
https://bugs.webkit.org/show_bug.cgi?id=319374
rdar://182178871
Reviewed by Devin Rousso.
Typing a hyphen-prefixed CSS value such as `-apple-system` or `-webkit-flex`
in the Elements > Styles sidebar and then picking a completion produced a
duplicated prefix like `-apple--apple-system`, which is invalid and gets
dropped until the page is reloaded.
The CodeMirror CSS-mode tokenizer splits a hyphen-prefixed identifier in two
different ways: a value like `-name` becomes a bare `-` token followed by
`name`, while a value like `-apple-system` becomes a `-apple-` meta token
followed by `system`. `forPartialPropertyValue` only rejoined the preceding
token when it was exactly `-`, so once the second hyphen was typed the prefix
was computed as just the trailing segment (`system`). Applying the completion
then removed only that segment and inserted the full value on top of the
leftover `-apple-`, yielding `-apple--apple-system`.
Rejoin any hyphen-terminated preceding token (covering both the bare `-` and
the `-vendor-` meta token) so the whole identifier is used as the prefix.
* Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js:
(WI.CSSKeywordCompletions.forPartialPropertyValue): Rejoin the preceding
token when it ends with `-`, not only when it is exactly `-`.
* LayoutTests/inspector/unit-tests/css-keyword-completions-expected.txt:
* LayoutTests/inspector/unit-tests/css-keyword-completions.html:
* Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js:
Canonical link: https://commits.webkit.org/317167@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications