Commit 15db7685 authored by dpapad's avatar dpapad Committed by Commit Bot

WebUI cleanup: Remove cr.icon.getUrlForCss() obsolete workaround.

The code was adding a trailing space when the URL ends with "\", to work around
https://bugs.webkit.org/show_bug.cgi?id=28885 which no longer seems to be an issue.

Bug: None
Test: Run https://jsfiddle.net/m7brn0q4/, verify that a network request to "foo/bar/?\" is sent.
Change-Id: I351d60350ab43b99270edaef063da76b35955a1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1793789
Commit-Queue: Esmael Elmoslimany <aee@chromium.org>
Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: default avatarEsmael Elmoslimany <aee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695242}
parent 709f9853
......@@ -41,14 +41,8 @@ cr.define('cr.icon', function() {
// http://www.w3.org/TR/css3-values/#uris
// Parentheses, commas, whitespace characters, single quotes (') and double
// quotes (") appearing in a URI must be escaped with a backslash
let s2 = s.replace(/(\(|\)|\,|\s|\'|\"|\\)/g, '\\$1');
// WebKit has a bug when it comes to URLs that end with \
// https://bugs.webkit.org/show_bug.cgi?id=28885
if (/\\\\$/.test(s2)) {
// Add a space to work around the WebKit bug.
s2 += ' ';
}
return 'url("' + s2 + '")';
const s2 = s.replace(/(\(|\)|\,|\s|\'|\"|\\)/g, '\\$1');
return `url("${s2}")`;
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment