Bug 87357 - Web Inspector: introduce virtual resource for inspector stylesheet.
Summary: Web Inspector: introduce virtual resource for inspector stylesheet.
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: Pavel Feldman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-24 02:03 PDT by Pavel Feldman
Modified: 2012-05-24 07:35 PDT (History)
12 users (show)

See Also:


Attachments
Patch (47.42 KB, patch)
2012-05-24 02:09 PDT, Pavel Feldman
no flags Details | Formatted Diff | Diff
Patch (50.72 KB, patch)
2012-05-24 02:57 PDT, Pavel Feldman
vsevik: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ec2-cr-linux-02 (487.47 KB, application/zip)
2012-05-24 04:29 PDT, WebKit Review Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2012-05-24 02:03:04 PDT
This change introduces virtual resource that represents inspector stylesheet (that is added for styles added via inspector).
New resource has url of form "inspector://<page url folder>/inspector-stylesheet. It enables live editing and revision history of the inspector stylesheet.
Comment 1 Pavel Feldman 2012-05-24 02:09:07 PDT
Created attachment 143765 [details]
Patch
Comment 2 Pavel Feldman 2012-05-24 02:57:54 PDT
Created attachment 143774 [details]
Patch
Comment 3 WebKit Review Bot 2012-05-24 04:29:20 PDT
Comment on attachment 143774 [details]
Patch

Attachment 143774 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12799144

New failing tests:
inspector/styles/css-live-edit.html
inspector/debugger/live-edit.html
Comment 4 WebKit Review Bot 2012-05-24 04:29:24 PDT
Created attachment 143783 [details]
Archive of layout-test-results from ec2-cr-linux-02

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: ec2-cr-linux-02  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 5 Vsevolod Vlasov 2012-05-24 07:00:39 PDT
Comment on attachment 143774 [details]
Patch

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

> Source/WebCore/inspector/front-end/CSSStyleModel.js:953
> +        if (this._frameAndURLToStyleSheetId[resource.frameId + ":" + resource.url]) {

Please extract resource.frameId + ":" + resource.url

> Source/WebCore/inspector/front-end/CSSStyleModel.js:1096
> +    _getViaInspectorResource: function(styleSheetId, callback)

_requestViaInspectorResource

> Source/WebCore/inspector/front-end/CSSStyleModel.js:1104
> +        function hadersLoaded()

headersLoaded

> Source/WebCore/inspector/front-end/CSSStyleModel.js:1119
> +    _viaInspectorResource: function(header)

_getOrCreateViaInspectorResource

> Source/WebCore/inspector/front-end/SourceFrame.js:56
> +    this._textViewer.setReadOnly(!this.canEditSource(), false);

Second parameter is not needed.

> LayoutTests/inspector/styles/edit-inspector-stylesheet.html:3
> +<meta http-equiv="x-webkit-csp" content="style-src https://*:443">

Is this needed? Why?

> LayoutTests/inspector/styles/edit-inspector-stylesheet.html:28
> +        // setTimeout(function() { InspectorTest.completeTest(); }, 1000);

Please remove this line.

> LayoutTests/inspector/styles/edit-inspector-stylesheet.html:49
> +        styleSource.requestContent(printContent);

Looks like your are doing two potentially asynchronous things here, this looks very confusing.
Comment 6 Vsevolod Vlasov 2012-05-24 07:12:46 PDT
Comment on attachment 143774 [details]
Patch

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

> Source/WebCore/inspector/front-end/ScriptsPanel.js:45
> +    this._stylesUISourceCodeProvider = new WebInspector.StylesUISourceCodeProvider();

This could be reverted.
Comment 7 Pavel Feldman 2012-05-24 07:24:07 PDT
(In reply to comment #5)
> (From update of attachment 143774 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=143774&action=review
> 
> > Source/WebCore/inspector/front-end/CSSStyleModel.js:953
> > +        if (this._frameAndURLToStyleSheetId[resource.frameId + ":" + resource.url]) {
> 
> Please extract resource.frameId + ":" + resource.url
> 

Done.

> > Source/WebCore/inspector/front-end/CSSStyleModel.js:1096
> > +    _getViaInspectorResource: function(styleSheetId, callback)
> 
> _requestViaInspectorResource

Done.

> 
> > Source/WebCore/inspector/front-end/CSSStyleModel.js:1104
> > +        function hadersLoaded()
> 
> headersLoaded

Done.

> 
> > Source/WebCore/inspector/front-end/CSSStyleModel.js:1119
> > +    _viaInspectorResource: function(header)
> 
> _getOrCreateViaInspectorResource

Done.

> 
> > Source/WebCore/inspector/front-end/SourceFrame.js:56
> > +    this._textViewer.setReadOnly(!this.canEditSource(), false);
> 
> Second parameter is not needed.

Removed.

> 
> > LayoutTests/inspector/styles/edit-inspector-stylesheet.html:3
> > +<meta http-equiv="x-webkit-csp" content="style-src https://*:443">
> 
> Is this needed? Why?

Removed.

> 
> > LayoutTests/inspector/styles/edit-inspector-stylesheet.html:28
> > +        // setTimeout(function() { InspectorTest.completeTest(); }, 1000);
> 
> Please remove this line.

Done.

> 
> > LayoutTests/inspector/styles/edit-inspector-stylesheet.html:49
> > +        styleSource.requestContent(printContent);
> 
> Looks like your are doing two potentially asynchronous things here, this looks very confusing.

Done.

(In reply to comment #6)
> (From update of attachment 143774 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=143774&action=review
> 
> > Source/WebCore/inspector/front-end/ScriptsPanel.js:45
> > +    this._stylesUISourceCodeProvider = new WebInspector.StylesUISourceCodeProvider();
> 
> This could be reverted.

Done.
Comment 8 Pavel Feldman 2012-05-24 07:35:05 PDT
Committed r118367: <http://trac.webkit.org/changeset/118367>