| 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 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1856 { | 1856 { |
| 1857 return node && node->layoutObject() && node->layoutObject()->style()->textSe
curity() != TSNONE; | 1857 return node && node->layoutObject() && node->layoutObject()->style()->textSe
curity() != TSNONE; |
| 1858 } | 1858 } |
| 1859 | 1859 |
| 1860 DispatchEventResult dispatchBeforeInputInsertText(EventTarget* target, const Str
ing& data) | 1860 DispatchEventResult dispatchBeforeInputInsertText(EventTarget* target, const Str
ing& data) |
| 1861 { | 1861 { |
| 1862 if (!RuntimeEnabledFeatures::inputEventEnabled()) | 1862 if (!RuntimeEnabledFeatures::inputEventEnabled()) |
| 1863 return DispatchEventResult::NotCanceled; | 1863 return DispatchEventResult::NotCanceled; |
| 1864 if (!target) | 1864 if (!target) |
| 1865 return DispatchEventResult::NotCanceled; | 1865 return DispatchEventResult::NotCanceled; |
| 1866 // TODO(chongz): Pass appreciate |ranges| after it's defined on spec. | |
| 1867 // http://w3c.github.io/editing/input-events.html#dom-inputevent-inputtype | |
| 1868 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(InputEvent::Inp
utType::InsertText, data, InputEvent::EventCancelable::IsCancelable, InputEvent:
:EventIsComposing::NotComposing, nullptr); | 1866 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(InputEvent::Inp
utType::InsertText, data, InputEvent::EventCancelable::IsCancelable, InputEvent:
:EventIsComposing::NotComposing, nullptr); |
| 1869 return target->dispatchEvent(beforeInputEvent); | 1867 return target->dispatchEvent(beforeInputEvent); |
| 1870 } | 1868 } |
| 1871 | 1869 |
| 1872 DispatchEventResult dispatchBeforeInputFromComposition(EventTarget* target, Inpu
tEvent::InputType inputType, const String& data, InputEvent::EventCancelable can
celable) | 1870 DispatchEventResult dispatchBeforeInputFromComposition(EventTarget* target, Inpu
tEvent::InputType inputType, const String& data, InputEvent::EventCancelable can
celable) |
| 1873 { | 1871 { |
| 1874 if (!RuntimeEnabledFeatures::inputEventEnabled()) | 1872 if (!RuntimeEnabledFeatures::inputEventEnabled()) |
| 1875 return DispatchEventResult::NotCanceled; | 1873 return DispatchEventResult::NotCanceled; |
| 1876 if (!target) | 1874 if (!target) |
| 1877 return DispatchEventResult::NotCanceled; | 1875 return DispatchEventResult::NotCanceled; |
| 1878 // TODO(chongz): Pass appreciate |ranges| after it's defined on spec. | 1876 // TODO(chongz): Pass appreciate |ranges| after it's defined on spec. e.g. F
or |DeleteComposedCharacterBackward|. |
| 1879 // http://w3c.github.io/editing/input-events.html#dom-inputevent-inputtype | 1877 // http://w3c.github.io/editing/input-events.html#dom-inputevent-inputtype |
| 1880 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data
, cancelable, InputEvent::EventIsComposing::IsComposing, nullptr); | 1878 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data
, cancelable, InputEvent::EventIsComposing::IsComposing, nullptr); |
| 1881 return target->dispatchEvent(beforeInputEvent); | 1879 return target->dispatchEvent(beforeInputEvent); |
| 1882 } | 1880 } |
| 1883 | 1881 |
| 1884 DispatchEventResult dispatchBeforeInputEditorCommand(EventTarget* target, InputE
vent::InputType inputType, const String& data, const RangeVector* ranges) | 1882 DispatchEventResult dispatchBeforeInputEditorCommand(EventTarget* target, InputE
vent::InputType inputType, const String& data, const RangeVector* ranges) |
| 1885 { | 1883 { |
| 1886 if (!RuntimeEnabledFeatures::inputEventEnabled()) | 1884 if (!RuntimeEnabledFeatures::inputEventEnabled()) |
| 1887 return DispatchEventResult::NotCanceled; | 1885 return DispatchEventResult::NotCanceled; |
| 1888 if (!target) | 1886 if (!target) |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1916 return InputType::DeleteWordBackward; | 1914 return InputType::DeleteWordBackward; |
| 1917 if (granularity == LineBoundary) | 1915 if (granularity == LineBoundary) |
| 1918 return InputType::DeleteLineBackward; | 1916 return InputType::DeleteLineBackward; |
| 1919 return InputType::DeleteContentBackward; | 1917 return InputType::DeleteContentBackward; |
| 1920 default: | 1918 default: |
| 1921 return InputType::None; | 1919 return InputType::None; |
| 1922 } | 1920 } |
| 1923 } | 1921 } |
| 1924 | 1922 |
| 1925 } // namespace blink | 1923 } // namespace blink |
| OLD | NEW |