| 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 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1755 { | 1755 { |
| 1756 return node && node->layoutObject() && node->layoutObject()->style()->textSe
curity() != TSNONE; | 1756 return node && node->layoutObject() && node->layoutObject()->style()->textSe
curity() != TSNONE; |
| 1757 } | 1757 } |
| 1758 | 1758 |
| 1759 DispatchEventResult dispatchBeforeInputInsertText(EventTarget* target, const Str
ing& data) | 1759 DispatchEventResult dispatchBeforeInputInsertText(EventTarget* target, const Str
ing& data) |
| 1760 { | 1760 { |
| 1761 if (!RuntimeEnabledFeatures::inputEventEnabled()) | 1761 if (!RuntimeEnabledFeatures::inputEventEnabled()) |
| 1762 return DispatchEventResult::NotCanceled; | 1762 return DispatchEventResult::NotCanceled; |
| 1763 if (!target) | 1763 if (!target) |
| 1764 return DispatchEventResult::NotCanceled; | 1764 return DispatchEventResult::NotCanceled; |
| 1765 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(InputEvent::Inp
utType::InsertText, data, InputEvent::EventCancelable::IsCancelable, InputEvent:
:EventIsComposing::NotComposing); | 1765 // TODO(chongz): Pass appreciate |ranges| after it's defined on spec. |
| 1766 // http://w3c.github.io/editing/input-events.html#dom-inputevent-inputtype |
| 1767 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(InputEvent::Inp
utType::InsertText, data, InputEvent::EventCancelable::IsCancelable, InputEvent:
:EventIsComposing::NotComposing, nullptr); |
| 1766 return target->dispatchEvent(beforeInputEvent); | 1768 return target->dispatchEvent(beforeInputEvent); |
| 1767 } | 1769 } |
| 1768 | 1770 |
| 1769 DispatchEventResult dispatchBeforeInputFromComposition(EventTarget* target, Inpu
tEvent::InputType inputType, const String& data, InputEvent::EventCancelable can
celable) | 1771 DispatchEventResult dispatchBeforeInputFromComposition(EventTarget* target, Inpu
tEvent::InputType inputType, const String& data, InputEvent::EventCancelable can
celable) |
| 1770 { | 1772 { |
| 1771 if (!RuntimeEnabledFeatures::inputEventEnabled()) | 1773 if (!RuntimeEnabledFeatures::inputEventEnabled()) |
| 1772 return DispatchEventResult::NotCanceled; | 1774 return DispatchEventResult::NotCanceled; |
| 1773 if (!target) | 1775 if (!target) |
| 1774 return DispatchEventResult::NotCanceled; | 1776 return DispatchEventResult::NotCanceled; |
| 1775 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data
, cancelable, InputEvent::EventIsComposing::IsComposing); | 1777 // TODO(chongz): Pass appreciate |ranges| after it's defined on spec. |
| 1778 // http://w3c.github.io/editing/input-events.html#dom-inputevent-inputtype |
| 1779 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data
, cancelable, InputEvent::EventIsComposing::IsComposing, nullptr); |
| 1776 return target->dispatchEvent(beforeInputEvent); | 1780 return target->dispatchEvent(beforeInputEvent); |
| 1777 } | 1781 } |
| 1778 | 1782 |
| 1779 DispatchEventResult dispatchBeforeInputEditorCommand(EventTarget* target, InputE
vent::InputType inputType, const String& data) | 1783 DispatchEventResult dispatchBeforeInputEditorCommand(EventTarget* target, InputE
vent::InputType inputType, const String& data, const RangeVector* ranges) |
| 1780 { | 1784 { |
| 1781 if (!RuntimeEnabledFeatures::inputEventEnabled()) | 1785 if (!RuntimeEnabledFeatures::inputEventEnabled()) |
| 1782 return DispatchEventResult::NotCanceled; | 1786 return DispatchEventResult::NotCanceled; |
| 1783 if (!target) | 1787 if (!target) |
| 1784 return DispatchEventResult::NotCanceled; | 1788 return DispatchEventResult::NotCanceled; |
| 1785 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data
, InputEvent::EventCancelable::IsCancelable, InputEvent::EventIsComposing::NotCo
mposing); | 1789 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data
, InputEvent::EventCancelable::IsCancelable, InputEvent::EventIsComposing::NotCo
mposing, ranges); |
| 1786 return target->dispatchEvent(beforeInputEvent); | 1790 return target->dispatchEvent(beforeInputEvent); |
| 1787 } | 1791 } |
| 1788 | 1792 |
| 1789 } // namespace blink | 1793 } // namespace blink |
| OLD | NEW |