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

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

Issue 435733002: Have getChildNodes() take a ContainerNode in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008, 2009 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 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 if (!highestAncestor) 1052 if (!highestAncestor)
1053 return; 1053 return;
1054 1054
1055 // The outer loop is traversing the tree vertically from highestAncestor to targetNode 1055 // The outer loop is traversing the tree vertically from highestAncestor to targetNode
1056 RefPtrWillBeRawPtr<Node> current = highestAncestor; 1056 RefPtrWillBeRawPtr<Node> current = highestAncestor;
1057 // Along the way, styled elements that contain targetNode are removed and ac cumulated into elementsToPushDown. 1057 // Along the way, styled elements that contain targetNode are removed and ac cumulated into elementsToPushDown.
1058 // Each child of the removed element, exclusing ancestors of targetNode, is then wrapped by clones of elements in elementsToPushDown. 1058 // Each child of the removed element, exclusing ancestors of targetNode, is then wrapped by clones of elements in elementsToPushDown.
1059 WillBeHeapVector<RefPtrWillBeMember<Element> > elementsToPushDown; 1059 WillBeHeapVector<RefPtrWillBeMember<Element> > elementsToPushDown;
1060 while (current && current != targetNode && current->contains(targetNode)) { 1060 while (current && current != targetNode && current->contains(targetNode)) {
1061 NodeVector currentChildren; 1061 NodeVector currentChildren;
1062 getChildNodes(*current, currentChildren); 1062 getChildNodes(toContainerNode(*current), currentChildren);
Inactive 2014/07/31 20:32:55 Safe because of contains() call above.
1063 RefPtrWillBeRawPtr<Element> styledElement = nullptr; 1063 RefPtrWillBeRawPtr<Element> styledElement = nullptr;
1064 if (current->isStyledElement() && isStyledInlineElementToRemove(toElemen t(current))) { 1064 if (current->isStyledElement() && isStyledInlineElementToRemove(toElemen t(current))) {
1065 styledElement = toElement(current); 1065 styledElement = toElement(current);
1066 elementsToPushDown.append(styledElement); 1066 elementsToPushDown.append(styledElement);
1067 } 1067 }
1068 1068
1069 RefPtrWillBeRawPtr<EditingStyle> styleToPushDown = EditingStyle::create( ); 1069 RefPtrWillBeRawPtr<EditingStyle> styleToPushDown = EditingStyle::create( );
1070 if (current->isHTMLElement()) 1070 if (current->isHTMLElement())
1071 removeInlineStyleFromElement(style, toHTMLElement(current), RemoveIf Needed, styleToPushDown.get()); 1071 removeInlineStyleFromElement(style, toHTMLElement(current), RemoveIf Needed, styleToPushDown.get());
1072 1072
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1571 void ApplyStyleCommand::trace(Visitor* visitor) 1571 void ApplyStyleCommand::trace(Visitor* visitor)
1572 { 1572 {
1573 visitor->trace(m_style); 1573 visitor->trace(m_style);
1574 visitor->trace(m_start); 1574 visitor->trace(m_start);
1575 visitor->trace(m_end); 1575 visitor->trace(m_end);
1576 visitor->trace(m_styledInlineElement); 1576 visitor->trace(m_styledInlineElement);
1577 CompositeEditCommand::trace(visitor); 1577 CompositeEditCommand::trace(visitor);
1578 } 1578 }
1579 1579
1580 } 1580 }
OLDNEW
« no previous file with comments | « Source/core/dom/ContainerNode.cpp ('k') | Source/core/editing/MergeIdenticalElementsCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698