bool absolute = false;
- // for compatibility with Win IE, we must treat backslashes as if they were slashes
+ // for compatibility with Win IE, we must treat backslashes as if they were slashes, as long as we're not dealing with the javascript: schema
DeprecatedString substitutedRelative;
- bool containsBackslash = relative.contains('\\');
- if (containsBackslash) {
+ bool shouldSubstituteBackslashes = relative.contains('\\') && !relative.startsWith("javascript:", false);
+ if (shouldSubstituteBackslashes) {
substitutedRelative = substituteBackslashes(relative);
}
- const DeprecatedString &rel = containsBackslash ? substitutedRelative : relative;
+ const DeprecatedString &rel = shouldSubstituteBackslashes ? substitutedRelative : relative;
bool allASCII = rel.isAllASCII();
char *strBuffer;