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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2469983007: Fix document title with LINE SEPARATOR/PARAGRAPH SEPARATOR/LINE TABULATION (Closed)
Patch Set: upload with --similarity=100 --no-find-copies Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/LayoutTests/imported/wpt/html/dom/documents/dom-tree-accessors/document.title-05-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index d1a185e5527a3c99ea73004ace5e1bb2bd12e6ec..256b4146be9d1e0158699d2301e36b3a28673181 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -1313,11 +1313,13 @@ static inline String canonicalizedTitle(Document* document,
// Replace control characters with spaces and collapse whitespace.
bool pendingWhitespace = false;
+ const UChar lineTabulationCharacter = 0x0b;
tkent 2016/11/08 03:57:15 Please use symbols defined in wtf/text/CharacterNa
+ const UChar spaceCharacter = 0x20;
+ const UChar deleteCharacter = 0x7f;
for (unsigned i = 0; i < length; ++i) {
UChar32 c = characters[i];
- if (c <= 0x20 || c == 0x7F ||
- (WTF::Unicode::category(c) &
- (WTF::Unicode::Separator_Line | WTF::Unicode::Separator_Paragraph))) {
+ if ((c <= spaceCharacter && c != lineTabulationCharacter) ||
+ c == deleteCharacter) {
if (builderIndex != 0)
pendingWhitespace = true;
} else {
« no previous file with comments | « third_party/WebKit/LayoutTests/imported/wpt/html/dom/documents/dom-tree-accessors/document.title-05-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698