Bug 164092 - Web Inspector: Creating a new pseudo-selector in the Styles sidebar doesn't work on first attempt
Summary: Web Inspector: Creating a new pseudo-selector in the Styles sidebar doesn't w...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-10-27 16:10 PDT by Nikita Vasilyev
Modified: 2016-11-01 19:41 PDT (History)
8 users (show)

See Also:


Attachments
[Animated GIF] Bug (103.72 KB, image/gif)
2016-10-27 16:10 PDT, Nikita Vasilyev
no flags Details
Patch (8.21 KB, patch)
2016-10-28 15:44 PDT, Devin Rousso
timothy: review+
Details | Formatted Diff | Diff
Patch (8.26 KB, patch)
2016-11-01 19:05 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2016-10-27 16:10:29 PDT
Created attachment 293074 [details]
[Animated GIF] Bug

1. Inspect <body> on this page.
2. At the bottom of the styles sidebar press "+" icon.
3. Click on the selector name ("body")
4. Append "::after".
5. Press Tab

Expected:
The selector remains to be "body::after".

Actual:
The selector reverts to "body".

Notes:
Renaming "body" to "body::after" second time works as expected.
Comment 1 Devin Rousso 2016-10-28 15:44:37 PDT
Created attachment 293233 [details]
Patch
Comment 2 Timothy Hatcher 2016-11-01 14:55:59 PDT
Comment on attachment 293233 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=293233&action=review

> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js:580
> +        for (let element of this._selectorElements) {
> +            let {top, right, bottom, left} = element.getBoundingClientRect();
> +            if (event.clientX >= left && event.clientX <= right && event.clientY >= top && event.clientY <= bottom) {
> +                this._selectorInput.title = element.title;
> +                return;
> +            }
> +        }

This could use a comment.
Comment 3 Radar WebKit Bug Importer 2016-11-01 16:50:46 PDT
<rdar://problem/29055344>
Comment 4 Devin Rousso 2016-11-01 19:05:35 PDT
Created attachment 293631 [details]
Patch
Comment 5 WebKit Commit Bot 2016-11-01 19:41:53 PDT
Comment on attachment 293631 [details]
Patch

Clearing flags on attachment: 293631

Committed r208270: <http://trac.webkit.org/changeset/208270>
Comment 6 WebKit Commit Bot 2016-11-01 19:41:56 PDT
All reviewed patches have been landed.  Closing bug.