Bug 146176

Summary: Web Inspector: Duplication of style attribute in rules panel for shadow content
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dino, graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, tobi+webkit, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix
none
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2015-06-19 17:58:54 PDT
* SUMMARY
Duplicate of style attribute in rules panel for shadow content.

Regressed with: <http://trac.webkit.org/changeset/184000>

* TEST
<audio controls></audio>

* STEPS TO REPRODUCE
1. Inspect any page with <audio>
2. Enable Shadow DOM (Elements tab)
3. Expand the audio
4. Select the <input pseudo="-webkit-media-controls-timeline" style="background-image: -webkit-canvas(_webkit-media-controls-timeline-6bd0eaf2-ef13-461e-86f2-fc4d3c7794f2);" min="0" max="NaN" class="hidden">
5. Show Style Rules sidebar
  => the CSS is duplicated in the Styles Attribute section

* NOTES
- CSSStyleDeclarationTextEditor.js's CSSStyleDeclarationTextEditor.prototype._resetContent makes an assumption that styleText will always be empty for a readOnly editor. It turns out that for a Style Attribute that is Read Only, that is not the case. I think the only way that can happen is a Shadow DOM node with a Style Attribute (as we are seeing it here). We should more gracefully handle this.
Comment 1 Joseph Pecoraro 2015-06-19 17:59:06 PDT
<rdar://problem/21467669>
Comment 2 Joseph Pecoraro 2015-06-19 18:00:55 PDT
Created attachment 255259 [details]
[PATCH] Proposed Fix
Comment 3 Joseph Pecoraro 2015-06-19 18:01:43 PDT
Created attachment 255260 [details]
[PATCH] Proposed Fix

Fixed title.
Comment 4 Tobias Reiss 2015-06-19 18:18:04 PDT
Good catch and good fix! I would add it to the commit-queue.
Comment 5 WebKit Commit Bot 2015-06-19 23:21:05 PDT
Comment on attachment 255260 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 255260

Committed r185789: <http://trac.webkit.org/changeset/185789>
Comment 6 WebKit Commit Bot 2015-06-19 23:21:11 PDT
All reviewed patches have been landed.  Closing bug.