Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: Source/core/editing/Editor.cpp

Issue 202813005: Add DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION() macro (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Slight clean up Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/html/HTMLElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/HTMLElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698