OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. |
4 * Copyright (C) 2011 Igalia S.L. | 4 * Copyright (C) 2011 Igalia S.L. |
5 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 5 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
6 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
9 * are met: | 9 * are met: |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 | 1066 |
1067 if (containerNode->hasOneChild()) { | 1067 if (containerNode->hasOneChild()) { |
1068 containerNode->replaceChild(textNode.release(), containerNode->firstChil
d(), es); | 1068 containerNode->replaceChild(textNode.release(), containerNode->firstChil
d(), es); |
1069 return; | 1069 return; |
1070 } | 1070 } |
1071 | 1071 |
1072 containerNode->removeChildren(); | 1072 containerNode->removeChildren(); |
1073 containerNode->appendChild(textNode.release(), es); | 1073 containerNode->appendChild(textNode.release(), es); |
1074 } | 1074 } |
1075 | 1075 |
| 1076 void mergeWithNextTextNode(PassRefPtr<Node> node, ExceptionState& es) |
| 1077 { |
| 1078 ASSERT(node && node->isTextNode()); |
| 1079 Node* next = node->nextSibling(); |
| 1080 if (!next || !next->isTextNode()) |
| 1081 return; |
| 1082 |
| 1083 RefPtr<Text> textNode = toText(node.get()); |
| 1084 RefPtr<Text> textNext = toText(next); |
| 1085 textNode->appendData(textNext->data()); |
| 1086 if (textNext->parentNode()) // Might have been removed by mutation event. |
| 1087 textNext->remove(es); |
1076 } | 1088 } |
| 1089 |
| 1090 } |
OLD | NEW |