| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 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 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 DCHECK(frame().document()); | 748 DCHECK(frame().document()); |
| 749 RemoveFormatCommand::create(*frame().document())->apply(); | 749 RemoveFormatCommand::create(*frame().document())->apply(); |
| 750 } | 750 } |
| 751 | 751 |
| 752 void Editor::registerCommandGroup(CompositeEditCommand* commandGroupWrapper) { | 752 void Editor::registerCommandGroup(CompositeEditCommand* commandGroupWrapper) { |
| 753 DCHECK(commandGroupWrapper->isCommandGroupWrapper()); | 753 DCHECK(commandGroupWrapper->isCommandGroupWrapper()); |
| 754 m_lastEditCommand = commandGroupWrapper; | 754 m_lastEditCommand = commandGroupWrapper; |
| 755 } | 755 } |
| 756 | 756 |
| 757 Element* Editor::findEventTargetFrom(const VisibleSelection& selection) const { | 757 Element* Editor::findEventTargetFrom(const VisibleSelection& selection) const { |
| 758 Element* target = selection.hasEditableStyle() | 758 Element* target = associatedElementOf(selection.start()); |
| 759 ? associatedElementOf(selection.start()) | |
| 760 : frame().document()->activeElement(); | |
| 761 if (!target) | 759 if (!target) |
| 762 target = frame().document()->body(); | 760 target = frame().document()->body(); |
| 763 | 761 |
| 764 return target; | 762 return target; |
| 765 } | 763 } |
| 766 | 764 |
| 767 Element* Editor::findEventTargetFromSelection() const { | 765 Element* Editor::findEventTargetFromSelection() const { |
| 768 return findEventTargetFrom( | 766 return findEventTargetFrom( |
| 769 frame().selection().computeVisibleSelectionInDOMTreeDeprecated()); | 767 frame().selection().computeVisibleSelectionInDOMTreeDeprecated()); |
| 770 } | 768 } |
| (...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1759 | 1757 |
| 1760 DEFINE_TRACE(Editor) { | 1758 DEFINE_TRACE(Editor) { |
| 1761 visitor->trace(m_frame); | 1759 visitor->trace(m_frame); |
| 1762 visitor->trace(m_lastEditCommand); | 1760 visitor->trace(m_lastEditCommand); |
| 1763 visitor->trace(m_undoStack); | 1761 visitor->trace(m_undoStack); |
| 1764 visitor->trace(m_mark); | 1762 visitor->trace(m_mark); |
| 1765 visitor->trace(m_typingStyle); | 1763 visitor->trace(m_typingStyle); |
| 1766 } | 1764 } |
| 1767 | 1765 |
| 1768 } // namespace blink | 1766 } // namespace blink |
| OLD | NEW |