| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 1849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1860 { | 1860 { |
| 1861 return node && node->layoutObject() && node->layoutObject()->style()->textSe
curity() != TSNONE; | 1861 return node && node->layoutObject() && node->layoutObject()->style()->textSe
curity() != TSNONE; |
| 1862 } | 1862 } |
| 1863 | 1863 |
| 1864 DispatchEventResult dispatchBeforeInputInsertText(EventTarget* target, const Str
ing& data) | 1864 DispatchEventResult dispatchBeforeInputInsertText(EventTarget* target, const Str
ing& data) |
| 1865 { | 1865 { |
| 1866 if (!RuntimeEnabledFeatures::inputEventEnabled()) | 1866 if (!RuntimeEnabledFeatures::inputEventEnabled()) |
| 1867 return DispatchEventResult::NotCanceled; | 1867 return DispatchEventResult::NotCanceled; |
| 1868 if (!target) | 1868 if (!target) |
| 1869 return DispatchEventResult::NotCanceled; | 1869 return DispatchEventResult::NotCanceled; |
| 1870 // TODO(chongz): Pass appreciate |ranges| after it's defined on spec. | |
| 1871 // http://w3c.github.io/editing/input-events.html#dom-inputevent-inputtype | |
| 1872 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(InputEvent::Inp
utType::InsertText, data, InputEvent::EventCancelable::IsCancelable, InputEvent:
:EventIsComposing::NotComposing, nullptr); | 1870 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(InputEvent::Inp
utType::InsertText, data, InputEvent::EventCancelable::IsCancelable, InputEvent:
:EventIsComposing::NotComposing, nullptr); |
| 1873 return target->dispatchEvent(beforeInputEvent); | 1871 return target->dispatchEvent(beforeInputEvent); |
| 1874 } | 1872 } |
| 1875 | 1873 |
| 1876 DispatchEventResult dispatchBeforeInputFromComposition(EventTarget* target, Inpu
tEvent::InputType inputType, const String& data, InputEvent::EventCancelable can
celable) | 1874 DispatchEventResult dispatchBeforeInputFromComposition(EventTarget* target, Inpu
tEvent::InputType inputType, const String& data, InputEvent::EventCancelable can
celable) |
| 1877 { | 1875 { |
| 1878 if (!RuntimeEnabledFeatures::inputEventEnabled()) | 1876 if (!RuntimeEnabledFeatures::inputEventEnabled()) |
| 1879 return DispatchEventResult::NotCanceled; | 1877 return DispatchEventResult::NotCanceled; |
| 1880 if (!target) | 1878 if (!target) |
| 1881 return DispatchEventResult::NotCanceled; | 1879 return DispatchEventResult::NotCanceled; |
| 1882 // TODO(chongz): Pass appreciate |ranges| after it's defined on spec. | 1880 // TODO(chongz): Pass appreciate |ranges| after it's defined on spec. e.g. F
or |DeleteComposedCharacterBackward|. |
| 1883 // http://w3c.github.io/editing/input-events.html#dom-inputevent-inputtype | 1881 // http://w3c.github.io/editing/input-events.html#dom-inputevent-inputtype |
| 1884 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data
, cancelable, InputEvent::EventIsComposing::IsComposing, nullptr); | 1882 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data
, cancelable, InputEvent::EventIsComposing::IsComposing, nullptr); |
| 1885 return target->dispatchEvent(beforeInputEvent); | 1883 return target->dispatchEvent(beforeInputEvent); |
| 1886 } | 1884 } |
| 1887 | 1885 |
| 1888 DispatchEventResult dispatchBeforeInputEditorCommand(EventTarget* target, InputE
vent::InputType inputType, const String& data, const RangeVector* ranges) | 1886 DispatchEventResult dispatchBeforeInputEditorCommand(EventTarget* target, InputE
vent::InputType inputType, const String& data, const RangeVector* ranges) |
| 1889 { | 1887 { |
| 1890 if (!RuntimeEnabledFeatures::inputEventEnabled()) | 1888 if (!RuntimeEnabledFeatures::inputEventEnabled()) |
| 1891 return DispatchEventResult::NotCanceled; | 1889 return DispatchEventResult::NotCanceled; |
| 1892 if (!target) | 1890 if (!target) |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1920 return InputType::DeleteWordBackward; | 1918 return InputType::DeleteWordBackward; |
| 1921 if (granularity == LineBoundary) | 1919 if (granularity == LineBoundary) |
| 1922 return InputType::DeleteLineBackward; | 1920 return InputType::DeleteLineBackward; |
| 1923 return InputType::DeleteContentBackward; | 1921 return InputType::DeleteContentBackward; |
| 1924 default: | 1922 default: |
| 1925 return InputType::None; | 1923 return InputType::None; |
| 1926 } | 1924 } |
| 1927 } | 1925 } |
| 1928 | 1926 |
| 1929 } // namespace blink | 1927 } // namespace blink |
| OLD | NEW |