Bug 145294 - Web Inspector: Unable to get cursor in new Rule section after creating multiple New Rules
Summary: Web Inspector: Unable to get cursor in new Rule section after creating multip...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-05-21 20:28 PDT by Joseph Pecoraro
Modified: 2015-05-22 13:32 PDT (History)
8 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (1.42 KB, patch)
2015-05-22 12:11 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-05-21 20:28:40 PDT
* SUMMARY
Unable to get cursor in new Rule section after creating multiple New Rules.

* STEPS TO REPRODUCE
1. Inspect <body> on about:blank
2. Show Styles Rules sidebar
3. Click "New Rule" => creates a new "body" section with cursor in editor
4. Click "New Rule" again
  => cannot focus the textfield in either new section
Comment 1 Radar WebKit Bug Importer 2015-05-21 20:29:21 PDT
<rdar://problem/21070246>
Comment 2 Joseph Pecoraro 2015-05-21 20:32:24 PDT
It appears as if the sections are "readOnly". Because they are getting the readonly placeholder string and not the editable placeholder string.
Comment 3 Joseph Pecoraro 2015-05-21 20:58:25 PDT
CSSStyleDeclarationTextEditor's _resetContent sets things readonly if:

    // Only allow editing if we have a style, it is editable and we have text range in the stylesheet.
    var readOnly = !this._style || !this._style.editable || !this._style.styleSheetTextRange;

In this case, the styleSheetTextRange is null...
Comment 4 Joseph Pecoraro 2015-05-21 21:30:24 PDT
I have a feeling this happened with the InspectorStyleSheet::styleSheetMutated changes. I'm going to try allowing InspectorStyleSheet parsed data always for the inspector style sheet, since we control modifications to it. Building now.
Comment 5 Joseph Pecoraro 2015-05-22 12:11:09 PDT
Created attachment 253599 [details]
[PATCH] Proposed Fix
Comment 6 WebKit Commit Bot 2015-05-22 13:31:58 PDT
Comment on attachment 253599 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 253599

Committed r184792: <http://trac.webkit.org/changeset/184792>
Comment 7 WebKit Commit Bot 2015-05-22 13:32:02 PDT
All reviewed patches have been landed.  Closing bug.