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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 RefPtr<Node> next = nextSibling(); | 427 RefPtr<Node> next = nextSibling(); |
428 RefPtr<Node> newChild; | 428 RefPtr<Node> newChild; |
429 | 429 |
430 // Convert text to fragment with <br> tags instead of linebreaks if needed. | 430 // Convert text to fragment with <br> tags instead of linebreaks if needed. |
431 if (text.contains('\r') || text.contains('\n')) | 431 if (text.contains('\r') || text.contains('\n')) |
432 newChild = textToFragment(text, exceptionState); | 432 newChild = textToFragment(text, exceptionState); |
433 else | 433 else |
434 newChild = Text::create(document(), text); | 434 newChild = Text::create(document(), text); |
435 | 435 |
436 // textToFragment might cause mutation events. | 436 // textToFragment might cause mutation events. |
437 if (!this || !parentNode()) | 437 if (!parentNode()) |
438 exceptionState.throwDOMException(HierarchyRequestError, "The element has
no parent."); | 438 exceptionState.throwDOMException(HierarchyRequestError, "The element has
no parent."); |
439 | 439 |
440 if (exceptionState.hadException()) | 440 if (exceptionState.hadException()) |
441 return; | 441 return; |
442 | 442 |
443 parent->replaceChild(newChild.release(), this, exceptionState); | 443 parent->replaceChild(newChild.release(), this, exceptionState); |
444 | 444 |
445 RefPtr<Node> node = next ? next->previousSibling() : 0; | 445 RefPtr<Node> node = next ? next->previousSibling() : 0; |
446 if (!exceptionState.hadException() && node && node->isTextNode()) | 446 if (!exceptionState.hadException() && node && node->isTextNode()) |
447 mergeWithNextTextNode(node.release(), exceptionState); | 447 mergeWithNextTextNode(node.release(), exceptionState); |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 #ifndef NDEBUG | 968 #ifndef NDEBUG |
969 | 969 |
970 // For use in the debugger | 970 // For use in the debugger |
971 void dumpInnerHTML(WebCore::HTMLElement*); | 971 void dumpInnerHTML(WebCore::HTMLElement*); |
972 | 972 |
973 void dumpInnerHTML(WebCore::HTMLElement* element) | 973 void dumpInnerHTML(WebCore::HTMLElement* element) |
974 { | 974 { |
975 printf("%s\n", element->innerHTML().ascii().data()); | 975 printf("%s\n", element->innerHTML().ascii().data()); |
976 } | 976 } |
977 #endif | 977 #endif |
OLD | NEW |