| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 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 * Copyright (C) 2009 Igalia S.L. | 4 * Copyright (C) 2009 Igalia S.L. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // Related to Editor::selectionForCommand. | 89 // Related to Editor::selectionForCommand. |
| 90 // Certain operations continue to use the target control's selection even if the
event handler | 90 // Certain operations continue to use the target control's selection even if the
event handler |
| 91 // already moved the selection outside of the text control. | 91 // already moved the selection outside of the text control. |
| 92 static Frame* targetFrame(Frame& frame, Event* event) | 92 static Frame* targetFrame(Frame& frame, Event* event) |
| 93 { | 93 { |
| 94 if (!event) | 94 if (!event) |
| 95 return &frame; | 95 return &frame; |
| 96 Node* node = event->target()->toNode(); | 96 Node* node = event->target()->toNode(); |
| 97 if (!node) | 97 if (!node) |
| 98 return &frame; | 98 return &frame; |
| 99 return node->document()->frame(); | 99 return node->document().frame(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 static bool applyCommandToFrame(Frame& frame, EditorCommandSource source, EditAc
tion action, StylePropertySet* style) | 102 static bool applyCommandToFrame(Frame& frame, EditorCommandSource source, EditAc
tion action, StylePropertySet* style) |
| 103 { | 103 { |
| 104 // FIXME: We don't call shouldApplyStyle when the source is DOM; is there a
good reason for that? | 104 // FIXME: We don't call shouldApplyStyle when the source is DOM; is there a
good reason for that? |
| 105 switch (source) { | 105 switch (source) { |
| 106 case CommandFromMenuOrKeyBinding: | 106 case CommandFromMenuOrKeyBinding: |
| 107 frame.editor().applyStyleToSelection(style, action); | 107 frame.editor().applyStyleToSelection(style, action); |
| 108 return true; | 108 return true; |
| 109 case CommandFromDOM: | 109 case CommandFromDOM: |
| (...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1742 return m_command->state(*m_frame, triggeringEvent) == TrueTriState ? "tr
ue" : "false"; | 1742 return m_command->state(*m_frame, triggeringEvent) == TrueTriState ? "tr
ue" : "false"; |
| 1743 return m_command->value(*m_frame, triggeringEvent); | 1743 return m_command->value(*m_frame, triggeringEvent); |
| 1744 } | 1744 } |
| 1745 | 1745 |
| 1746 bool Editor::Command::isTextInsertion() const | 1746 bool Editor::Command::isTextInsertion() const |
| 1747 { | 1747 { |
| 1748 return m_command && m_command->isTextInsertion; | 1748 return m_command && m_command->isTextInsertion; |
| 1749 } | 1749 } |
| 1750 | 1750 |
| 1751 } // namespace WebCore | 1751 } // namespace WebCore |
| OLD | NEW |