| 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 UChar c = 0; | 372 UChar c = 0; |
| 373 for (unsigned int start = 0; start < length; ) { | 373 for (unsigned int start = 0; start < length; ) { |
| 374 | 374 |
| 375 // Find next line break. | 375 // Find next line break. |
| 376 for (i = start; i < length; i++) { | 376 for (i = start; i < length; i++) { |
| 377 c = text[i]; | 377 c = text[i]; |
| 378 if (c == '\r' || c == '\n') | 378 if (c == '\r' || c == '\n') |
| 379 break; | 379 break; |
| 380 } | 380 } |
| 381 | 381 |
| 382 fragment->appendChild(Text::create(document(), text.substring(start, i -
start)), es); | 382 fragment->appendChild(Text::create(document(), text.substring(start, i -
start)), es, DeprecatedAttachNow); |
| 383 if (es.hadException()) | 383 if (es.hadException()) |
| 384 return 0; | 384 return 0; |
| 385 | 385 |
| 386 if (c == '\r' || c == '\n') { | 386 if (c == '\r' || c == '\n') { |
| 387 fragment->appendChild(HTMLBRElement::create(document()), es); | 387 fragment->appendChild(HTMLBRElement::create(document()), es, Depreca
tedAttachNow); |
| 388 if (es.hadException()) | 388 if (es.hadException()) |
| 389 return 0; | 389 return 0; |
| 390 // Make sure \r\n doesn't result in two line breaks. | 390 // Make sure \r\n doesn't result in two line breaks. |
| 391 if (c == '\r' && i + 1 < length && text[i + 1] == '\n') | 391 if (c == '\r' && i + 1 < length && text[i + 1] == '\n') |
| 392 i++; | 392 i++; |
| 393 } | 393 } |
| 394 | 394 |
| 395 start = i + 1; // Character after line break. | 395 start = i + 1; // Character after line break. |
| 396 } | 396 } |
| 397 | 397 |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1098 #ifndef NDEBUG | 1098 #ifndef NDEBUG |
| 1099 | 1099 |
| 1100 // For use in the debugger | 1100 // For use in the debugger |
| 1101 void dumpInnerHTML(WebCore::HTMLElement*); | 1101 void dumpInnerHTML(WebCore::HTMLElement*); |
| 1102 | 1102 |
| 1103 void dumpInnerHTML(WebCore::HTMLElement* element) | 1103 void dumpInnerHTML(WebCore::HTMLElement* element) |
| 1104 { | 1104 { |
| 1105 printf("%s\n", element->innerHTML().ascii().data()); | 1105 printf("%s\n", element->innerHTML().ascii().data()); |
| 1106 } | 1106 } |
| 1107 #endif | 1107 #endif |
| OLD | NEW |