Bug 50107 - Web Inspector: implement "Revert to this revision" in resources panel.
Summary: Web Inspector: implement "Revert to this revision" in resources panel.
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: 2010-11-26 05:07 PST by Pavel Feldman
Modified: 2010-11-30 11:17 PST (History)
10 users (show)

See Also:


Attachments
[PATCH] Proposed change (17.90 KB, patch)
2010-11-30 08:01 PST, Pavel Feldman
yurys: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2010-11-26 05:07:11 PST
Patch to follow.
Comment 1 Pavel Feldman 2010-11-30 08:01:34 PST
Created attachment 75149 [details]
[PATCH] Proposed change
Comment 2 Alexander Pavlov (apavlov) 2010-11-30 08:56:13 PST
Comment on attachment 75149 [details]
[PATCH] Proposed change

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

You need to add:
m_pageStyleSheet->styleSheetChanged();
after
m_pageStyleSheet->parseString(text, m_pageStyleSheet->useStrictParsing());
in
InspectorStyleSheet::reparseStyleSheet(const String& text)
for the new stylesheet text to take effect after reparsing.

> WebCore/inspector/front-end/Resource.js:731
> +    }    

trailing whitespace

> WebCore/inspector/front-end/ResourcesPanel.js:1230
> +    var title = revision.timestamp ? revision.timestamp.toLocaleTimeString() : "(original)";

"(original)" should be localized
Comment 3 Yury Semikhatsky 2010-11-30 09:14:34 PST
Comment on attachment 75149 [details]
[PATCH] Proposed change

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

> WebCore/inspector/front-end/Resource.js:680
> +        function callback(content)

You're ignoring contentEncoded parameter here, is it intentional?

> WebCore/inspector/front-end/Resource.js:685
> +        this.requestContent(callback.bind(this));

Why do you need this call? if (this._content) this._fireOnRevert(this._content); should work just fine.

> WebCore/inspector/front-end/Resource.js:731
> +    }    

Trailing whitespace.
Comment 4 Pavel Feldman 2010-11-30 10:58:28 PST
Anyways, I am not landing this change unless setStyleSheetText2 is fixed. Currently, it hangs on every other revert on apple.com.

I see this:

dhcp-172-19-1-225:WebKit pfeldman$ run-safari --debug
Starting Safari with DYLD_FRAMEWORK_PATH set to point to built WebKit in /Users/pfeldman/WebKit/WebKitBuild/Debug.
ASSERTION FAILED: m_pendingStylesheets > 0
(/Users/pfeldman/WebKit/WebCore/dom/Document.cpp:2856 void WebCore::Document::removePendingSheet())

and other crashers.
Comment 5 Pavel Feldman 2010-11-30 11:17:36 PST
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/English.lproj/localizedStrings.js
	M	WebCore/inspector/Inspector.idl
	M	WebCore/inspector/InspectorCSSAgent.cpp
	M	WebCore/inspector/InspectorCSSAgent.h
	M	WebCore/inspector/InspectorStyleSheet.cpp
	M	WebCore/inspector/front-end/CSSStyleModel.js
	M	WebCore/inspector/front-end/Resource.js
	M	WebCore/inspector/front-end/ResourcesPanel.js
	M	WebCore/inspector/front-end/ScriptsPanel.js
	M	WebCore/inspector/front-end/SourceView.js
Committed r72938