Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2187)

Unified Diff: WebCore/inspector/front-end/StylesSidebarPane.js

Issue 6115007: Merge 74710 - 2010-12-28 Alexander Pavlov <apavlov@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/inspector/front-end/StylesSidebarPane.js
===================================================================
--- WebCore/inspector/front-end/StylesSidebarPane.js (revision 75482)
+++ WebCore/inspector/front-end/StylesSidebarPane.js (working copy)
@@ -1202,6 +1202,8 @@
this.valueElement = valueElement;
if (value) {
+ var self = this;
+
function processValue(regex, processor, nextProcessor, valueText)
{
var container = document.createDocumentFragment();
@@ -1225,10 +1227,19 @@
function linkifyURL(url)
{
+ var hrefUrl = url;
+ var match = hrefUrl.match(/['"]?([^'"]+)/);
+ if (match)
+ hrefUrl = match[1];
var container = document.createDocumentFragment();
container.appendChild(document.createTextNode("url("));
- var hasResource = !!WebInspector.resourceForURL(url);
- container.appendChild(WebInspector.linkifyURLAsNode(url, url, null, hasResource));
+ if (self._styleRule.sourceURL)
+ hrefUrl = WebInspector.completeURL(self._styleRule.sourceURL, hrefUrl);
+ else if (WebInspector.panels.elements.focusedDOMNode)
+ hrefUrl = WebInspector.resourceURLForRelatedNode(WebInspector.panels.elements.focusedDOMNode, hrefUrl);
+ var hasResource = !!WebInspector.resourceForURL(hrefUrl);
+ // FIXME: WebInspector.linkifyURLAsNode() should really use baseURI.
+ container.appendChild(WebInspector.linkifyURLAsNode(hrefUrl, url, null, hasResource));
container.appendChild(document.createTextNode(")"));
return container;
}
@@ -1330,7 +1341,7 @@
var colorRegex = /((?:rgb|hsl)a?\([^)]+\)|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}|\b\w+\b(?!-))/g;
var colorProcessor = processValue.bind(window, colorRegex, processColor, null);
- valueElement.appendChild(processValue(/url\(([^)]+)\)/g, linkifyURL, colorProcessor, value));
+ valueElement.appendChild(processValue(/url\(\s*([^)\s]+)\s*\)/g, linkifyURL, colorProcessor, value));
}
this.listItemElement.removeChildren();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698