OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 RefPtrWillBeRawPtr<Node> nodeToSplitTo = splitTreeToNode(node.get(), anc
estor.get(), true); | 668 RefPtrWillBeRawPtr<Node> nodeToSplitTo = splitTreeToNode(node.get(), anc
estor.get(), true); |
669 removeNode(node); | 669 removeNode(node); |
670 insertNodeBefore(node, nodeToSplitTo); | 670 insertNodeBefore(node, nodeToSplitTo); |
671 } | 671 } |
672 if (!ancestor->firstChild()) | 672 if (!ancestor->firstChild()) |
673 removeNode(ancestor.release()); | 673 removeNode(ancestor.release()); |
674 } | 674 } |
675 | 675 |
676 static inline bool nodeHasVisibleRenderText(Text& text) | 676 static inline bool nodeHasVisibleRenderText(Text& text) |
677 { | 677 { |
678 return text.renderer() && toRenderText(text.renderer())->renderedTextLength(
) > 0; | 678 return text.renderer() && text.renderer()->renderedTextLength() > 0; |
679 } | 679 } |
680 | 680 |
681 void ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds(InsertedNodes& ins
ertedNodes) | 681 void ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds(InsertedNodes& ins
ertedNodes) |
682 { | 682 { |
683 document().updateLayoutIgnorePendingStylesheets(); | 683 document().updateLayoutIgnorePendingStylesheets(); |
684 | 684 |
685 Node* lastLeafInserted = insertedNodes.lastLeafInserted(); | 685 Node* lastLeafInserted = insertedNodes.lastLeafInserted(); |
686 if (lastLeafInserted && lastLeafInserted->isTextNode() && !nodeHasVisibleRen
derText(toText(*lastLeafInserted)) | 686 if (lastLeafInserted && lastLeafInserted->isTextNode() && !nodeHasVisibleRen
derText(toText(*lastLeafInserted)) |
687 && !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted
), selectTag) | 687 && !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted
), selectTag) |
688 && !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted
), scriptTag)) { | 688 && !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted
), scriptTag)) { |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1530 void ReplaceSelectionCommand::trace(Visitor* visitor) | 1530 void ReplaceSelectionCommand::trace(Visitor* visitor) |
1531 { | 1531 { |
1532 visitor->trace(m_startOfInsertedContent); | 1532 visitor->trace(m_startOfInsertedContent); |
1533 visitor->trace(m_endOfInsertedContent); | 1533 visitor->trace(m_endOfInsertedContent); |
1534 visitor->trace(m_insertionStyle); | 1534 visitor->trace(m_insertionStyle); |
1535 visitor->trace(m_documentFragment); | 1535 visitor->trace(m_documentFragment); |
1536 CompositeEditCommand::trace(visitor); | 1536 CompositeEditCommand::trace(visitor); |
1537 } | 1537 } |
1538 | 1538 |
1539 } // namespace blink | 1539 } // namespace blink |
OLD | NEW |