Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include.postload.js

Issue 4567408790470656: Issue 1393 - Block element dialog suggests decoded URLs (Closed)
Patch Set: Created Sept. 22, 2014, 1:13 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
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: include.postload.js
===================================================================
--- a/include.postload.js
+++ b/include.postload.js
@@ -279,11 +279,6 @@
else if (elt.src)
url = elt.src;
- // Only normalize when the element contains a URL (issue 328.)
- // The URL is not always normalized, so do it here
- if (url)
- url = normalizeURL(relativeToAbsoluteUrl(url));
-
// Construct filters. The popup will retrieve these.
// Only one ID
var elementId = elt.id ? elt.id.split(' ').join('') : null;
@@ -349,8 +344,11 @@
if(params[0])
url = params[0].getAttribute("value");
}
+
+ if (url)
+ url = normalizeURL(relativeToAbsoluteUrl(url));
Sebastian Noack 2014/09/22 13:27:49 I just realized that Chrome preserves slashes in U
Sebastian Noack 2014/09/22 13:37:36 Also unencoded special characters aren't encoded b
Thomas Greiner 2014/09/22 15:08:28 The question is whether we need to have a well-for
Sebastian Noack 2014/09/22 15:25:16 I don't say that the we should strip repeated slas
Sebastian Noack 2014/09/22 15:50:59 Actually using an <iframe> element is notable fast
Wladimir Palant 2014/09/22 17:39:21 That should be because Chrome does some caching of
Sebastian Noack 2014/09/23 09:40:34 Very interesting. So I agree with your point for u
Sebastian Noack 2014/09/25 07:53:18 LGTM. I created a separate issue, for using an <a>
} else if(!url) {
- url = elt.getAttribute("src") || elt.getAttribute("href");
+ url = elt.src || elt.href;
}
return url;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld