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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "core/dom/NodeTraversal.h" | 44 #include "core/dom/NodeTraversal.h" |
45 #include "core/dom/Range.h" | 45 #include "core/dom/Range.h" |
46 #include "core/editing/Editor.h" | 46 #include "core/editing/Editor.h" |
47 #include "core/editing/MarkupAccumulator.h" | 47 #include "core/editing/MarkupAccumulator.h" |
48 #include "core/editing/TextIterator.h" | 48 #include "core/editing/TextIterator.h" |
49 #include "core/editing/VisibleSelection.h" | 49 #include "core/editing/VisibleSelection.h" |
50 #include "core/editing/VisibleUnits.h" | 50 #include "core/editing/VisibleUnits.h" |
51 #include "core/editing/htmlediting.h" | 51 #include "core/editing/htmlediting.h" |
52 #include "core/html/HTMLBodyElement.h" | 52 #include "core/html/HTMLBodyElement.h" |
53 #include "core/html/HTMLElement.h" | 53 #include "core/html/HTMLElement.h" |
| 54 #include "core/html/HTMLTableElement.h" |
54 #include "core/html/HTMLTextFormControlElement.h" | 55 #include "core/html/HTMLTextFormControlElement.h" |
55 #include "core/page/Frame.h" | 56 #include "core/page/Frame.h" |
56 #include "core/rendering/RenderObject.h" | 57 #include "core/rendering/RenderObject.h" |
57 #include "weborigin/KURL.h" | 58 #include "weborigin/KURL.h" |
58 #include "wtf/StdLibExtras.h" | 59 #include "wtf/StdLibExtras.h" |
59 #include "wtf/text/StringBuilder.h" | 60 #include "wtf/text/StringBuilder.h" |
60 | 61 |
61 using namespace std; | 62 using namespace std; |
62 | 63 |
63 namespace WebCore { | 64 namespace WebCore { |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 || isNonTableCellHTMLBlockElement(node); | 425 || isNonTableCellHTMLBlockElement(node); |
425 } | 426 } |
426 | 427 |
427 static Node* ancestorToRetainStructureAndAppearanceForBlock(Node* commonAncestor
Block) | 428 static Node* ancestorToRetainStructureAndAppearanceForBlock(Node* commonAncestor
Block) |
428 { | 429 { |
429 if (!commonAncestorBlock) | 430 if (!commonAncestorBlock) |
430 return 0; | 431 return 0; |
431 | 432 |
432 if (commonAncestorBlock->hasTagName(tbodyTag) || commonAncestorBlock->hasTag
Name(trTag)) { | 433 if (commonAncestorBlock->hasTagName(tbodyTag) || commonAncestorBlock->hasTag
Name(trTag)) { |
433 ContainerNode* table = commonAncestorBlock->parentNode(); | 434 ContainerNode* table = commonAncestorBlock->parentNode(); |
434 while (table && !table->hasTagName(tableTag)) | 435 while (table && !isHTMLTableElement(table)) |
435 table = table->parentNode(); | 436 table = table->parentNode(); |
436 | 437 |
437 return table; | 438 return table; |
438 } | 439 } |
439 | 440 |
440 if (isNonTableCellHTMLBlockElement(commonAncestorBlock)) | 441 if (isNonTableCellHTMLBlockElement(commonAncestorBlock)) |
441 return commonAncestorBlock; | 442 return commonAncestorBlock; |
442 | 443 |
443 return 0; | 444 return 0; |
444 } | 445 } |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 if (hasOneChild(containerNode.get())) { | 1084 if (hasOneChild(containerNode.get())) { |
1084 containerNode->replaceChild(textNode.release(), containerNode->firstChil
d(), ec); | 1085 containerNode->replaceChild(textNode.release(), containerNode->firstChil
d(), ec); |
1085 return; | 1086 return; |
1086 } | 1087 } |
1087 | 1088 |
1088 containerNode->removeChildren(); | 1089 containerNode->removeChildren(); |
1089 containerNode->appendChild(textNode.release(), ec); | 1090 containerNode->appendChild(textNode.release(), ec); |
1090 } | 1091 } |
1091 | 1092 |
1092 } | 1093 } |
OLD | NEW |