Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(725)

Side by Side Diff: Source/core/editing/CompositeEditCommand.cpp

Issue 16879016: Use toElement instead of static_cast<Element*> and static_cast<const Element*> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/editing/ApplyStyleCommand.cpp ('k') | Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/editing/ApplyStyleCommand.cpp ('k') | Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698