| 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 27 matching lines...) Expand all Loading... |
| 38 #include "core/editing/state_machines/BackwardCodePointStateMachine.h" | 38 #include "core/editing/state_machines/BackwardCodePointStateMachine.h" |
| 39 #include "core/editing/state_machines/ForwardCodePointStateMachine.h" | 39 #include "core/editing/state_machines/ForwardCodePointStateMachine.h" |
| 40 #include "core/events/CompositionEvent.h" | 40 #include "core/events/CompositionEvent.h" |
| 41 #include "core/frame/LocalFrame.h" | 41 #include "core/frame/LocalFrame.h" |
| 42 #include "core/html/HTMLInputElement.h" | 42 #include "core/html/HTMLInputElement.h" |
| 43 #include "core/html/HTMLTextAreaElement.h" | 43 #include "core/html/HTMLTextAreaElement.h" |
| 44 #include "core/input/EventHandler.h" | 44 #include "core/input/EventHandler.h" |
| 45 #include "core/layout/LayoutObject.h" | 45 #include "core/layout/LayoutObject.h" |
| 46 #include "core/layout/LayoutTheme.h" | 46 #include "core/layout/LayoutTheme.h" |
| 47 #include "core/page/ChromeClient.h" | 47 #include "core/page/ChromeClient.h" |
| 48 #include "core/page/FocusController.h" |
| 49 #include "core/page/Page.h" |
| 48 | 50 |
| 49 namespace blink { | 51 namespace blink { |
| 50 | 52 |
| 51 namespace { | 53 namespace { |
| 52 | 54 |
| 53 void DispatchCompositionUpdateEvent(LocalFrame& frame, const String& text) { | 55 void DispatchCompositionUpdateEvent(LocalFrame& frame, const String& text) { |
| 54 Element* target = frame.GetDocument()->FocusedElement(); | 56 Element* target = frame.GetDocument()->FocusedElement(); |
| 55 if (!target) | 57 if (!target) |
| 56 return; | 58 return; |
| 57 | 59 |
| (...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 flags |= kWebTextInputFlagAutocapitalizeCharacters; | 1129 flags |= kWebTextInputFlagAutocapitalizeCharacters; |
| 1128 else if (autocapitalize == words) | 1130 else if (autocapitalize == words) |
| 1129 flags |= kWebTextInputFlagAutocapitalizeWords; | 1131 flags |= kWebTextInputFlagAutocapitalizeWords; |
| 1130 else if (autocapitalize == sentences) | 1132 else if (autocapitalize == sentences) |
| 1131 flags |= kWebTextInputFlagAutocapitalizeSentences; | 1133 flags |= kWebTextInputFlagAutocapitalizeSentences; |
| 1132 else | 1134 else |
| 1133 NOTREACHED(); | 1135 NOTREACHED(); |
| 1134 } | 1136 } |
| 1135 } | 1137 } |
| 1136 | 1138 |
| 1139 if (GetDocument().GetPage()->GetFocusController().NextFocusableElementInForm( |
| 1140 element, kWebFocusTypeForward)) |
| 1141 flags |= kWebTextInputFlagHaveNextFocusableElement; |
| 1142 |
| 1143 if (GetDocument().GetPage()->GetFocusController().NextFocusableElementInForm( |
| 1144 element, kWebFocusTypeBackward)) |
| 1145 flags |= kWebTextInputFlagHavePreviousFocusableElement; |
| 1146 |
| 1137 return flags; | 1147 return flags; |
| 1138 } | 1148 } |
| 1139 | 1149 |
| 1140 WebTextInputMode InputMethodController::InputModeOfFocusedElement() const { | 1150 WebTextInputMode InputMethodController::InputModeOfFocusedElement() const { |
| 1141 if (!RuntimeEnabledFeatures::InputModeAttributeEnabled()) | 1151 if (!RuntimeEnabledFeatures::InputModeAttributeEnabled()) |
| 1142 return kWebTextInputModeDefault; | 1152 return kWebTextInputModeDefault; |
| 1143 | 1153 |
| 1144 AtomicString mode = GetInputModeAttribute(GetDocument().FocusedElement()); | 1154 AtomicString mode = GetInputModeAttribute(GetDocument().FocusedElement()); |
| 1145 | 1155 |
| 1146 if (mode.IsEmpty()) | 1156 if (mode.IsEmpty()) |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 FinishComposingText(kKeepSelection); | 1248 FinishComposingText(kKeepSelection); |
| 1239 } | 1249 } |
| 1240 | 1250 |
| 1241 DEFINE_TRACE(InputMethodController) { | 1251 DEFINE_TRACE(InputMethodController) { |
| 1242 visitor->Trace(frame_); | 1252 visitor->Trace(frame_); |
| 1243 visitor->Trace(composition_range_); | 1253 visitor->Trace(composition_range_); |
| 1244 SynchronousMutationObserver::Trace(visitor); | 1254 SynchronousMutationObserver::Trace(visitor); |
| 1245 } | 1255 } |
| 1246 | 1256 |
| 1247 } // namespace blink | 1257 } // namespace blink |
| OLD | NEW |