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

Side by Side Diff: Source/web/PopupListBox.cpp

Issue 133273021: Use isSpaceOrNewline rather than its implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Oops, logic error... Created 6 years, 11 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 unified diff | Download patch
« no previous file with comments | « Source/core/html/forms/TypeAhead.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011, Google Inc. All rights reserved. 2 * Copyright (c) 2011, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 return m_popupClient->menuStyle().textDirection() == RTL; 281 return m_popupClient->menuStyle().textDirection() == RTL;
282 } 282 }
283 283
284 // From HTMLSelectElement.cpp 284 // From HTMLSelectElement.cpp
285 static String stripLeadingWhiteSpace(const String& string) 285 static String stripLeadingWhiteSpace(const String& string)
286 { 286 {
287 int length = string.length(); 287 int length = string.length();
288 int i; 288 int i;
289 for (i = 0; i < length; ++i) 289 for (i = 0; i < length; ++i)
290 if (string[i] != noBreakSpace 290 if (string[i] != noBreakSpace
291 && (string[i] <= 0x7F ? !isASCIISpace(string[i]) : (direction(string [i]) != WhiteSpaceNeutral))) 291 && !isSpaceOrNewline(string[i]))
292 break; 292 break;
293 293
294 return string.substring(i, length - i); 294 return string.substring(i, length - i);
295 } 295 }
296 296
297 // From HTMLSelectElement.cpp, with modifications 297 // From HTMLSelectElement.cpp, with modifications
298 void PopupListBox::typeAheadFind(const PlatformKeyboardEvent& event) 298 void PopupListBox::typeAheadFind(const PlatformKeyboardEvent& event)
299 { 299 {
300 TimeStamp now = static_cast<TimeStamp>(currentTime() * 1000.0f); 300 TimeStamp now = static_cast<TimeStamp>(currentTime() * 1000.0f);
301 TimeStamp delta = now - m_lastCharTime; 301 TimeStamp delta = now - m_lastCharTime;
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 { 817 {
818 return numItems() && IntRect(0, 0, width(), height()).contains(point); 818 return numItems() && IntRect(0, 0, width(), height()).contains(point);
819 } 819 }
820 820
821 int PopupListBox::popupContentHeight() const 821 int PopupListBox::popupContentHeight() const
822 { 822 {
823 return height(); 823 return height();
824 } 824 }
825 825
826 } // namespace WebCore 826 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/forms/TypeAhead.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698