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 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 void CompositeEditCommand::setNodeAttribute(Element* element, | 683 void CompositeEditCommand::setNodeAttribute(Element* element, |
684 const QualifiedName& attribute, | 684 const QualifiedName& attribute, |
685 const AtomicString& value) { | 685 const AtomicString& value) { |
686 // SetNodeAttributeCommand is never aborted. | 686 // SetNodeAttributeCommand is never aborted. |
687 applyCommandToComposite( | 687 applyCommandToComposite( |
688 SetNodeAttributeCommand::create(element, attribute, value), | 688 SetNodeAttributeCommand::create(element, attribute, value), |
689 ASSERT_NO_EDITING_ABORT); | 689 ASSERT_NO_EDITING_ABORT); |
690 } | 690 } |
691 | 691 |
692 bool CompositeEditCommand::canRebalance(const Position& position) const { | 692 bool CompositeEditCommand::canRebalance(const Position& position) const { |
| 693 // TODO(editing-dev): Use of updateStyleAndLayoutIgnorePendingStylesheets() |
| 694 // needs to be audited. See http://crbug.com/590369 for more details. |
| 695 document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 696 |
693 Node* node = position.computeContainerNode(); | 697 Node* node = position.computeContainerNode(); |
694 if (!position.isOffsetInAnchor() || !node || !node->isTextNode() || | 698 if (!position.isOffsetInAnchor() || !node || !node->isTextNode() || |
695 !hasRichlyEditableStyle(*node)) | 699 !hasRichlyEditableStyle(*node)) |
696 return false; | 700 return false; |
697 | 701 |
698 Text* textNode = toText(node); | 702 Text* textNode = toText(node); |
699 if (textNode->length() == 0) | 703 if (textNode->length() == 0) |
700 return false; | 704 return false; |
701 | 705 |
702 LayoutText* layoutText = textNode->layoutObject(); | 706 LayoutText* layoutText = textNode->layoutObject(); |
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1972 | 1976 |
1973 DEFINE_TRACE(CompositeEditCommand) { | 1977 DEFINE_TRACE(CompositeEditCommand) { |
1974 visitor->trace(m_commands); | 1978 visitor->trace(m_commands); |
1975 visitor->trace(m_startingSelection); | 1979 visitor->trace(m_startingSelection); |
1976 visitor->trace(m_endingSelection); | 1980 visitor->trace(m_endingSelection); |
1977 visitor->trace(m_undoStep); | 1981 visitor->trace(m_undoStep); |
1978 EditCommand::trace(visitor); | 1982 EditCommand::trace(visitor); |
1979 } | 1983 } |
1980 | 1984 |
1981 } // namespace blink | 1985 } // namespace blink |
OLD | NEW |