OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 333 |
334 // Find next line break. | 334 // Find next line break. |
335 for (i = start; i < length; i++) { | 335 for (i = start; i < length; i++) { |
336 c = text[i]; | 336 c = text[i]; |
337 if (c == '\r' || c == '\n') | 337 if (c == '\r' || c == '\n') |
338 break; | 338 break; |
339 } | 339 } |
340 | 340 |
341 fragment->appendChild(Text::create(document(), text.substring(start, i -
start)), exceptionState); | 341 fragment->appendChild(Text::create(document(), text.substring(start, i -
start)), exceptionState); |
342 if (exceptionState.hadException()) | 342 if (exceptionState.hadException()) |
343 return 0; | 343 return nullptr; |
344 | 344 |
345 if (c == '\r' || c == '\n') { | 345 if (c == '\r' || c == '\n') { |
346 fragment->appendChild(HTMLBRElement::create(document()), exceptionSt
ate); | 346 fragment->appendChild(HTMLBRElement::create(document()), exceptionSt
ate); |
347 if (exceptionState.hadException()) | 347 if (exceptionState.hadException()) |
348 return 0; | 348 return nullptr; |
349 // Make sure \r\n doesn't result in two line breaks. | 349 // Make sure \r\n doesn't result in two line breaks. |
350 if (c == '\r' && i + 1 < length && text[i + 1] == '\n') | 350 if (c == '\r' && i + 1 < length && text[i + 1] == '\n') |
351 i++; | 351 i++; |
352 } | 352 } |
353 | 353 |
354 start = i + 1; // Character after line break. | 354 start = i + 1; // Character after line break. |
355 } | 355 } |
356 | 356 |
357 return fragment; | 357 return fragment; |
358 } | 358 } |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 #ifndef NDEBUG | 950 #ifndef NDEBUG |
951 | 951 |
952 // For use in the debugger | 952 // For use in the debugger |
953 void dumpInnerHTML(WebCore::HTMLElement*); | 953 void dumpInnerHTML(WebCore::HTMLElement*); |
954 | 954 |
955 void dumpInnerHTML(WebCore::HTMLElement* element) | 955 void dumpInnerHTML(WebCore::HTMLElement* element) |
956 { | 956 { |
957 printf("%s\n", element->innerHTML().ascii().data()); | 957 printf("%s\n", element->innerHTML().ascii().data()); |
958 } | 958 } |
959 #endif | 959 #endif |
OLD | NEW |