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