| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights
reserved. | 3 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights
reserved. |
| 4 * Copyright (C) 2009 Google Inc. All rights reserved. | 4 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 { | 556 { |
| 557 while (index < length) { | 557 while (index < length) { |
| 558 CharacterType c = characters[index++]; | 558 CharacterType c = characters[index++]; |
| 559 if ((c != '\n') && (c != '\r')) | 559 if ((c != '\n') && (c != '\r')) |
| 560 continue; | 560 continue; |
| 561 | 561 |
| 562 // There can only be a start of a new line if there are more characters | 562 // There can only be a start of a new line if there are more characters |
| 563 // beyond the current character. | 563 // beyond the current character. |
| 564 if (index < length) { | 564 if (index < length) { |
| 565 // The 3 common types of line terminators are 1. \r\n (Windows), | 565 // The 3 common types of line terminators are 1. \r\n (Windows), |
| 566 // 2. \r (old MacOS) and 3. \n (Unix'es). | 566 // 2. \r (old MacOS) and 3. \n (Unix'exceptionState). |
| 567 | 567 |
| 568 if (c == '\n') | 568 if (c == '\n') |
| 569 return index; // Case 3: just \n. | 569 return index; // Case 3: just \n. |
| 570 | 570 |
| 571 CharacterType c2 = characters[index]; | 571 CharacterType c2 = characters[index]; |
| 572 if (c2 != '\n') | 572 if (c2 != '\n') |
| 573 return index; // Case 2: just \r. | 573 return index; // Case 2: just \r. |
| 574 | 574 |
| 575 // Case 1: \r\n. | 575 // Case 1: \r\n. |
| 576 // But, there's only a start of a new line if there are more | 576 // But, there's only a start of a new line if there are more |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 } | 747 } |
| 748 | 748 |
| 749 using WTF::StringImpl; | 749 using WTF::StringImpl; |
| 750 using WTF::equal; | 750 using WTF::equal; |
| 751 using WTF::equalNonNull; | 751 using WTF::equalNonNull; |
| 752 using WTF::TextCaseSensitivity; | 752 using WTF::TextCaseSensitivity; |
| 753 using WTF::TextCaseSensitive; | 753 using WTF::TextCaseSensitive; |
| 754 using WTF::TextCaseInsensitive; | 754 using WTF::TextCaseInsensitive; |
| 755 | 755 |
| 756 #endif | 756 #endif |
| OLD | NEW |