OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 | 993 |
994 // Insert each node from innerNode to outerNode (excluded) in a list. | 994 // Insert each node from innerNode to outerNode (excluded) in a list. |
995 for (Node* n = start.deprecatedNode(); n && n != outerNode; n = n->paren
tNode()) | 995 for (Node* n = start.deprecatedNode(); n && n != outerNode; n = n->paren
tNode()) |
996 ancestors.append(n); | 996 ancestors.append(n); |
997 | 997 |
998 // Clone every node between start.deprecatedNode() and outerBlock. | 998 // Clone every node between start.deprecatedNode() and outerBlock. |
999 | 999 |
1000 for (size_t i = ancestors.size(); i != 0; --i) { | 1000 for (size_t i = ancestors.size(); i != 0; --i) { |
1001 Node* item = ancestors[i - 1].get(); | 1001 Node* item = ancestors[i - 1].get(); |
1002 RefPtr<Node> child = item->cloneNode(isTableElement(item)); | 1002 RefPtr<Node> child = item->cloneNode(isTableElement(item)); |
1003 appendNode(child, static_cast<Element *>(lastNode.get())); | 1003 appendNode(child, toElement(lastNode.get())); |
1004 lastNode = child.release(); | 1004 lastNode = child.release(); |
1005 } | 1005 } |
1006 } | 1006 } |
1007 | 1007 |
1008 // Handle the case of paragraphs with more than one node, | 1008 // Handle the case of paragraphs with more than one node, |
1009 // cloning all the siblings until end.deprecatedNode() is reached. | 1009 // cloning all the siblings until end.deprecatedNode() is reached. |
1010 | 1010 |
1011 if (start.deprecatedNode() != end.deprecatedNode() && !start.deprecatedNode(
)->isDescendantOf(end.deprecatedNode())) { | 1011 if (start.deprecatedNode() != end.deprecatedNode() && !start.deprecatedNode(
)->isDescendantOf(end.deprecatedNode())) { |
1012 // If end is not a descendant of outerNode we need to | 1012 // If end is not a descendant of outerNode we need to |
1013 // find the first common ancestor to increase the scope | 1013 // find the first common ancestor to increase the scope |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1457 return node.release(); | 1457 return node.release(); |
1458 } | 1458 } |
1459 | 1459 |
1460 PassRefPtr<Element> createBlockPlaceholderElement(Document* document) | 1460 PassRefPtr<Element> createBlockPlaceholderElement(Document* document) |
1461 { | 1461 { |
1462 RefPtr<Element> breakNode = document->createElement(brTag, false); | 1462 RefPtr<Element> breakNode = document->createElement(brTag, false); |
1463 return breakNode.release(); | 1463 return breakNode.release(); |
1464 } | 1464 } |
1465 | 1465 |
1466 } // namespace WebCore | 1466 } // namespace WebCore |
OLD | NEW |