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