| 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 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 | 913 |
| 914 return EditingStyle::elementIsStyledSpanOrHTMLEquivalent(element); | 914 return EditingStyle::elementIsStyledSpanOrHTMLEquivalent(element); |
| 915 } | 915 } |
| 916 | 916 |
| 917 static inline HTMLElement* elementToSplitToAvoidPastingIntoInlineElementsWithSty
le(const Position& insertionPos) | 917 static inline HTMLElement* elementToSplitToAvoidPastingIntoInlineElementsWithSty
le(const Position& insertionPos) |
| 918 { | 918 { |
| 919 Element* containingBlock = enclosingBlock(insertionPos.computeContainerNode(
)); | 919 Element* containingBlock = enclosingBlock(insertionPos.computeContainerNode(
)); |
| 920 return toHTMLElement(highestEnclosingNodeOfType(insertionPos, isInlineHTMLEl
ementWithStyle, CannotCrossEditingBoundary, containingBlock)); | 920 return toHTMLElement(highestEnclosingNodeOfType(insertionPos, isInlineHTMLEl
ementWithStyle, CannotCrossEditingBoundary, containingBlock)); |
| 921 } | 921 } |
| 922 | 922 |
| 923 void ReplaceSelectionCommand::doApply() | 923 void ReplaceSelectionCommand::doApply(EditingState*) |
| 924 { | 924 { |
| 925 const VisibleSelection selection = endingSelection(); | 925 const VisibleSelection selection = endingSelection(); |
| 926 ASSERT(selection.isCaretOrRange()); | 926 ASSERT(selection.isCaretOrRange()); |
| 927 ASSERT(selection.start().anchorNode()); | 927 ASSERT(selection.start().anchorNode()); |
| 928 if (!selection.isNonOrphanedCaretOrRange() || !selection.start().anchorNode(
)) | 928 if (!selection.isNonOrphanedCaretOrRange() || !selection.start().anchorNode(
)) |
| 929 return; | 929 return; |
| 930 | 930 |
| 931 if (!selection.rootEditableElement()) | 931 if (!selection.rootEditableElement()) |
| 932 return; | 932 return; |
| 933 | 933 |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1564 visitor->trace(m_startOfInsertedContent); | 1564 visitor->trace(m_startOfInsertedContent); |
| 1565 visitor->trace(m_endOfInsertedContent); | 1565 visitor->trace(m_endOfInsertedContent); |
| 1566 visitor->trace(m_insertionStyle); | 1566 visitor->trace(m_insertionStyle); |
| 1567 visitor->trace(m_documentFragment); | 1567 visitor->trace(m_documentFragment); |
| 1568 visitor->trace(m_startOfInsertedRange); | 1568 visitor->trace(m_startOfInsertedRange); |
| 1569 visitor->trace(m_endOfInsertedRange); | 1569 visitor->trace(m_endOfInsertedRange); |
| 1570 CompositeEditCommand::trace(visitor); | 1570 CompositeEditCommand::trace(visitor); |
| 1571 } | 1571 } |
| 1572 | 1572 |
| 1573 } // namespace blink | 1573 } // namespace blink |
| OLD | NEW |