Bug 70721 - Web Inspector: [Styles] Adding a new style rule breaks things
Summary: Web Inspector: [Styles] Adding a new style rule breaks things
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexander Pavlov (apavlov)
Depends on:
Reported: 2011-10-24 05:59 PDT by Alexander Pavlov (apavlov)
Modified: 2011-10-24 08:22 PDT (History)
10 users (show)

See Also:

[PATCH] Suggested fix (8.50 KB, patch)
2011-10-24 07:30 PDT, Alexander Pavlov (apavlov)
pfeldman: review-
Details | Formatted Diff | Diff
[PATCH] Comments addressed (8.73 KB, patch)
2011-10-24 08:19 PDT, Alexander Pavlov (apavlov)
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pavlov (apavlov) 2011-10-24 05:59:13 PDT
1. Go to about:blank
2. Open the devtools at the 'elements' page
3. Add a new style with the 'plus' button on the right.
4. For the style target, type '#foo'
5. Press enter
6. Try to add rules to the style

- double clicking in/around the body of the style does not add a new rule. As far as I can tell, there is no way to add a new rule.
- pressing 'esc' no longer causes the console to disappear.

Upstreaming http://code.google.com/p/chromium/issues/detail?id=101256
Comment 1 Alexander Pavlov (apavlov) 2011-10-24 07:30:13 PDT
Created attachment 112184 [details]
[PATCH] Suggested fix
Comment 2 Pavel Feldman 2011-10-24 07:44:56 PDT
Comment on attachment 112184 [details]
[PATCH] Suggested fix

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

> Source/WebCore/inspector/front-end/StylesSidebarPane.js:1358
> +    get isBlank()

make it a function please.

> Source/WebCore/inspector/front-end/StylesSidebarPane.js:1387
> +        if (this.isBlank)

Could you move this check to the top and make it a guard? Also putting a FIXME suggesting re-creating object would be great.

> Source/WebCore/inspector/front-end/StylesSidebarPane.js:1395
> +        if (this.isBlank)

Please convert to the guard.
Comment 3 Alexander Pavlov (apavlov) 2011-10-24 08:19:05 PDT
Created attachment 112188 [details]
[PATCH] Comments addressed

Impossible to convert isBlank into function - requires defining same-named method on all style sections.
Comment 4 Alexander Pavlov (apavlov) 2011-10-24 08:22:35 PDT
Committed r98243: <http://trac.webkit.org/changeset/98243>