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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 void Editor::registerCommandGroup(CompositeEditCommand* commandGroupWrapper) { | 728 void Editor::registerCommandGroup(CompositeEditCommand* commandGroupWrapper) { |
729 DCHECK(commandGroupWrapper->isCommandGroupWrapper()); | 729 DCHECK(commandGroupWrapper->isCommandGroupWrapper()); |
730 m_lastEditCommand = commandGroupWrapper; | 730 m_lastEditCommand = commandGroupWrapper; |
731 } | 731 } |
732 | 732 |
733 void Editor::clearLastEditCommand() { | 733 void Editor::clearLastEditCommand() { |
734 m_lastEditCommand.clear(); | 734 m_lastEditCommand.clear(); |
735 } | 735 } |
736 | 736 |
737 Element* Editor::findEventTargetFrom(const VisibleSelection& selection) const { | 737 Element* Editor::findEventTargetFrom(const VisibleSelection& selection) const { |
738 Element* target = associatedElementOf(selection.start()); | 738 Element* target = selection.hasEditableStyle() |
| 739 ? associatedElementOf(selection.start()) |
| 740 : frame().document()->activeElement(); |
739 if (!target) | 741 if (!target) |
740 target = frame().document()->body(); | 742 target = frame().document()->body(); |
741 | 743 |
742 return target; | 744 return target; |
743 } | 745 } |
744 | 746 |
745 Element* Editor::findEventTargetFromSelection() const { | 747 Element* Editor::findEventTargetFromSelection() const { |
746 return findEventTargetFrom(frame().selection().selection()); | 748 return findEventTargetFrom(frame().selection().selection()); |
747 } | 749 } |
748 | 750 |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1698 | 1700 |
1699 DEFINE_TRACE(Editor) { | 1701 DEFINE_TRACE(Editor) { |
1700 visitor->trace(m_frame); | 1702 visitor->trace(m_frame); |
1701 visitor->trace(m_lastEditCommand); | 1703 visitor->trace(m_lastEditCommand); |
1702 visitor->trace(m_undoStack); | 1704 visitor->trace(m_undoStack); |
1703 visitor->trace(m_mark); | 1705 visitor->trace(m_mark); |
1704 visitor->trace(m_typingStyle); | 1706 visitor->trace(m_typingStyle); |
1705 } | 1707 } |
1706 | 1708 |
1707 } // namespace blink | 1709 } // namespace blink |
OLD | NEW |