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 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 } | 952 } |
953 | 953 |
954 void Editor::setBaseWritingDirection(WritingDirection direction) | 954 void Editor::setBaseWritingDirection(WritingDirection direction) |
955 { | 955 { |
956 Element* focusedElement = frame().document()->focusedElement(); | 956 Element* focusedElement = frame().document()->focusedElement(); |
957 if (isHTMLTextFormControlElement(focusedElement)) { | 957 if (isHTMLTextFormControlElement(focusedElement)) { |
958 if (direction == NaturalWritingDirection) | 958 if (direction == NaturalWritingDirection) |
959 return; | 959 return; |
960 focusedElement->setAttribute(dirAttr, direction == LeftToRightWritingDir
ection ? "ltr" : "rtl"); | 960 focusedElement->setAttribute(dirAttr, direction == LeftToRightWritingDir
ection ? "ltr" : "rtl"); |
961 focusedElement->dispatchInputEvent(); | 961 focusedElement->dispatchInputEvent(); |
962 frame().document()->updateStyleIfNeeded(); | 962 frame().document()->updateRenderTreeIfNeeded(); |
963 return; | 963 return; |
964 } | 964 } |
965 | 965 |
966 RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet:
:create(); | 966 RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet:
:create(); |
967 style->setProperty(CSSPropertyDirection, direction == LeftToRightWritingDire
ction ? "ltr" : direction == RightToLeftWritingDirection ? "rtl" : "inherit", fa
lse); | 967 style->setProperty(CSSPropertyDirection, direction == LeftToRightWritingDire
ction ? "ltr" : direction == RightToLeftWritingDirection ? "rtl" : "inherit", fa
lse); |
968 applyParagraphStyleToSelection(style.get(), EditActionSetWritingDirection); | 968 applyParagraphStyleToSelection(style.get(), EditActionSetWritingDirection); |
969 } | 969 } |
970 | 970 |
971 void Editor::revealSelectionAfterEditingOperation(const ScrollAlignment& alignme
nt, RevealExtentOption revealExtentOption) | 971 void Editor::revealSelectionAfterEditingOperation(const ScrollAlignment& alignme
nt, RevealExtentOption revealExtentOption) |
972 { | 972 { |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 return m_frame.spellChecker(); | 1229 return m_frame.spellChecker(); |
1230 } | 1230 } |
1231 | 1231 |
1232 void Editor::toggleOverwriteModeEnabled() | 1232 void Editor::toggleOverwriteModeEnabled() |
1233 { | 1233 { |
1234 m_overwriteModeEnabled = !m_overwriteModeEnabled; | 1234 m_overwriteModeEnabled = !m_overwriteModeEnabled; |
1235 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); | 1235 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); |
1236 } | 1236 } |
1237 | 1237 |
1238 } // namespace WebCore | 1238 } // namespace WebCore |
OLD | NEW |