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 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 } | 947 } |
948 | 948 |
949 void Editor::redo() | 949 void Editor::redo() |
950 { | 950 { |
951 if (UndoStack* undoStack = this->undoStack()) | 951 if (UndoStack* undoStack = this->undoStack()) |
952 undoStack->redo(); | 952 undoStack->redo(); |
953 } | 953 } |
954 | 954 |
955 void Editor::setBaseWritingDirection(WritingDirection direction) | 955 void Editor::setBaseWritingDirection(WritingDirection direction) |
956 { | 956 { |
957 Node* focusedElement = frame().document()->focusedElement(); | 957 Element* focusedElement = frame().document()->focusedElement(); |
958 if (focusedElement && isHTMLTextFormControlElement(*focusedElement)) { | 958 if (isHTMLTextFormControlElement(focusedElement)) { |
959 if (direction == NaturalWritingDirection) | 959 if (direction == NaturalWritingDirection) |
960 return; | 960 return; |
961 toHTMLElement(focusedElement)->setAttribute(dirAttr, direction == LeftTo
RightWritingDirection ? "ltr" : "rtl"); | 961 focusedElement->setAttribute(dirAttr, direction == LeftToRightWritingDir
ection ? "ltr" : "rtl"); |
962 focusedElement->dispatchInputEvent(); | 962 focusedElement->dispatchInputEvent(); |
963 frame().document()->updateStyleIfNeeded(); | 963 frame().document()->updateStyleIfNeeded(); |
964 return; | 964 return; |
965 } | 965 } |
966 | 966 |
967 RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(); | 967 RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(); |
968 style->setProperty(CSSPropertyDirection, direction == LeftToRightWritingDire
ction ? "ltr" : direction == RightToLeftWritingDirection ? "rtl" : "inherit", fa
lse); | 968 style->setProperty(CSSPropertyDirection, direction == LeftToRightWritingDire
ction ? "ltr" : direction == RightToLeftWritingDirection ? "rtl" : "inherit", fa
lse); |
969 applyParagraphStyleToSelection(style.get(), EditActionSetWritingDirection); | 969 applyParagraphStyleToSelection(style.get(), EditActionSetWritingDirection); |
970 } | 970 } |
971 | 971 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 return m_frame.spellChecker(); | 1230 return m_frame.spellChecker(); |
1231 } | 1231 } |
1232 | 1232 |
1233 void Editor::toggleOverwriteModeEnabled() | 1233 void Editor::toggleOverwriteModeEnabled() |
1234 { | 1234 { |
1235 m_overwriteModeEnabled = !m_overwriteModeEnabled; | 1235 m_overwriteModeEnabled = !m_overwriteModeEnabled; |
1236 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); | 1236 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); |
1237 } | 1237 } |
1238 | 1238 |
1239 } // namespace WebCore | 1239 } // namespace WebCore |
OLD | NEW |