Bug 145294

Summary: Web Inspector: Unable to get cursor in new Rule section after creating multiple New Rules
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix none

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.