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

Unified Diff: components/url_formatter/url_formatter.cc

Issue 2595723003: url_formatter: Update comments for clarity. (Closed)
Patch Set: Rebase. Created 3 years, 10 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
Index: components/url_formatter/url_formatter.cc
diff --git a/components/url_formatter/url_formatter.cc b/components/url_formatter/url_formatter.cc
index a93bf1154c333fbd7b268855f60a3eac3b250353..3c6e53e158c7813089bead9d6466b2b819ae3846 100644
--- a/components/url_formatter/url_formatter.cc
+++ b/components/url_formatter/url_formatter.cc
@@ -459,20 +459,25 @@ void IDNSpoofChecker::SetAllowedUnicodeSet(UErrorCode* status) {
#error "Update aspirational_scripts per Unicode 10.0"
#endif
- // U+0338 is included in the recommended set, while U+05F4 and U+2027 are in
- // the inclusion set. However, they are blacklisted as a part of Mozilla's
- // IDN blacklist (http://kb.mozillazine.org/Network.IDN.blacklist_chars).
- // U+2010 is in the inclusion set, but we drop it because it can be confused
- // with an ASCII U+002D (Hyphen-Minus).
- // U+0338 and U+2027 are dropped; the former can look like a slash when
- // rendered with a broken font, and the latter can be confused with U+30FB
- // (Katakana Middle Dot). U+05F4 (Hebrew Punctuation Gershayim) is kept,
- // even though it can look like a double quotation mark. Using it in Hebrew
- // should be safe. When used with a non-Hebrew script, it'd be filtered by
- // other checks in place.
- allowed_set.remove(0x338u); // Combining Long Solidus Overlay
- allowed_set.remove(0x2010u); // Hyphen
- allowed_set.remove(0x2027u); // Hyphenation Point
+ // The sections below refer to Mozilla's IDN blacklist:
+ // http://kb.mozillazine.org/Network.IDN.blacklist_chars
+ //
+ // U+0338 (Combining Long Solidus Overlay) is included in the recommended set,
+ // but is blacklisted by Mozilla. It is dropped because it can look like a
+ // slash when rendered with a broken font.
+ allowed_set.remove(0x338u);
+ // U+05F4 (Hebrew Punctuation Gershayim) is in the inclusion set, but is
+ // blacklisted by Mozilla. We keep it, even though it can look like a double
+ // quotation mark. Using it in Hebrew should be safe. When used with a
+ // non-Hebrew script, it'd be filtered by other checks in place.
+ //
+ // U+2010 (Hyphen) is in the inclusion set, but we drop it because it can be
+ // confused with an ASCII U+002D (Hyphen-Minus).
+ allowed_set.remove(0x2010u);
+ // U+2027 (Hyphenation Point) is in the inclusion set, but is blacklisted by
+ // Mozilla. It is dropped, as it can be confused with U+30FB (Katakana Middle
+ // Dot).
+ allowed_set.remove(0x2027u);
uspoof_setAllowedUnicodeSet(checker_, &allowed_set, status);
}
« no previous file with comments | « no previous file | components/url_formatter/url_formatter_unittest.cc » ('j') | components/url_formatter/url_formatter_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698