OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 } |
OLD | NEW |