Commit 5f37c0d4 authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

Use ASCII case conversion in ScriptLoader.

No behavior change since "window", "onload" and "onload()" don't
contain any sequences that could match (with Unicode case folding)
a string that wouldn't also match with ASCII case folding alone.

However, this is what the spec asks us to do, and it's more efficient
anyhow.

Bug: 627682
Change-Id: Id262e058658192f8177082a1ddb03746253a568b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1578430
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: default avatarHiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653631}
parent 2f261183
......@@ -943,14 +943,14 @@ bool ScriptLoader::IsScriptForEventSupported() const {
for_attribute = for_attribute.StripWhiteSpace();
// <spec step="14.4">If for is not an ASCII case-insensitive match for the
// string "window", then return. The script is not executed.</spec>
if (!DeprecatedEqualIgnoringCase(for_attribute, "window"))
if (!EqualIgnoringASCIICase(for_attribute, "window"))
return false;
event_attribute = event_attribute.StripWhiteSpace();
// <spec step="14.5">If event is not an ASCII case-insensitive match for
// either the string "onload" or the string "onload()", then return. The
// script is not executed.</spec>
return DeprecatedEqualIgnoringCase(event_attribute, "onload") ||
DeprecatedEqualIgnoringCase(event_attribute, "onload()");
return EqualIgnoringASCIICase(event_attribute, "onload") ||
EqualIgnoringASCIICase(event_attribute, "onload()");
}
PendingScript*
......
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