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 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
943 } | 943 } |
944 } | 944 } |
945 | 945 |
946 if (visibleParagraphEnd.isNull()) | 946 if (visibleParagraphEnd.isNull()) |
947 return nullptr; | 947 return nullptr; |
948 | 948 |
949 RefPtrWillBeRawPtr<Node> newBlock = insertNewDefaultParagraphElementAt(upstr eamStart); | 949 RefPtrWillBeRawPtr<Node> newBlock = insertNewDefaultParagraphElementAt(upstr eamStart); |
950 | 950 |
951 bool endWasBr = isHTMLBRElement(*visibleParagraphEnd.deepEquivalent().deprec atedNode()); | 951 bool endWasBr = isHTMLBRElement(*visibleParagraphEnd.deepEquivalent().deprec atedNode()); |
952 | 952 |
953 visiblePos = VisiblePosition(pos, VP_DEFAULT_AFFINITY); | |
Yuta Kitamura
2014/06/04 08:22:46
It may be good to have some comments explaining wh
yosin_UTC9
2014/06/05 01:30:56
Done.
| |
954 visibleParagraphStart = VisiblePosition(startOfParagraph(visiblePos)); | |
955 visibleParagraphEnd = VisiblePosition(endOfParagraph(visiblePos)); | |
953 moveParagraphs(visibleParagraphStart, visibleParagraphEnd, VisiblePosition(f irstPositionInNode(newBlock.get()))); | 956 moveParagraphs(visibleParagraphStart, visibleParagraphEnd, VisiblePosition(f irstPositionInNode(newBlock.get()))); |
954 | 957 |
955 if (newBlock->lastChild() && isHTMLBRElement(*newBlock->lastChild()) && !end WasBr) | 958 if (newBlock->lastChild() && isHTMLBRElement(*newBlock->lastChild()) && !end WasBr) |
956 removeNode(newBlock->lastChild()); | 959 removeNode(newBlock->lastChild()); |
957 | 960 |
958 return newBlock.release(); | 961 return newBlock.release(); |
959 } | 962 } |
960 | 963 |
961 void CompositeEditCommand::pushAnchorElementDown(Node* anchorNode) | 964 void CompositeEditCommand::pushAnchorElementDown(Node* anchorNode) |
962 { | 965 { |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1492 } | 1495 } |
1493 | 1496 |
1494 void CompositeEditCommand::trace(Visitor* visitor) | 1497 void CompositeEditCommand::trace(Visitor* visitor) |
1495 { | 1498 { |
1496 visitor->trace(m_commands); | 1499 visitor->trace(m_commands); |
1497 visitor->trace(m_composition); | 1500 visitor->trace(m_composition); |
1498 EditCommand::trace(visitor); | 1501 EditCommand::trace(visitor); |
1499 } | 1502 } |
1500 | 1503 |
1501 } // namespace WebCore | 1504 } // namespace WebCore |
OLD | NEW |