Bug 57941 - Web Inspector: it should be possible to use TextViewer to display and edit both javascript and css.
Summary: Web Inspector: it should be possible to use TextViewer to display and edit bo...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-06 05:43 PDT by Pavel Podivilov
Modified: 2011-05-24 08:09 PDT (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Podivilov 2011-04-06 05:43:13 PDT
Web Inspector: it should be possible to use TextViewer to display and edit both javascript and css.

Currently, TextViewer can only be used when wrapped with SourceFrame. SourceFrame is mostly javascript-specific and should not be used for css editing and displaying resource contents in resources panel.
We should decouple TextViewer from SourceFrame (SourceFrame knows too much about TextViewer internal details) and introduce CSSEditor class based on TextViewer.

TextViewer gets a TextViewerDelegate with the following interface:
 - populateContextMenu, mouseDown, mouseHover, etc
 - editable, startEditing, finishEditing

SourceFrame becomes a TextViewerDelegate implementation for viewing and editing javascript in scripts panel.
Resources panel uses its own TextViewerDelegate implementations to show and edit (when applicable) css, html, xhrs etc.

Any thoughts?