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 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 // otherwise, make sure to be at the start of the first selected node, | 1725 // otherwise, make sure to be at the start of the first selected node, |
1726 // instead of possibly at the end of the last node before the selection | 1726 // instead of possibly at the end of the last node before the selection |
1727 return mostForwardCaretPosition(visiblePosition.deepEquivalent()); | 1727 return mostForwardCaretPosition(visiblePosition.deepEquivalent()); |
1728 } | 1728 } |
1729 | 1729 |
1730 bool isTextSecurityNode(const Node* node) | 1730 bool isTextSecurityNode(const Node* node) |
1731 { | 1731 { |
1732 return node && node->layoutObject() && node->layoutObject()->style()->textSe
curity() != TSNONE; | 1732 return node && node->layoutObject() && node->layoutObject()->style()->textSe
curity() != TSNONE; |
1733 } | 1733 } |
1734 | 1734 |
| 1735 DispatchEventResult dispatchBeforeInputInsertText(EventTarget* target, const Str
ing& data) |
| 1736 { |
| 1737 if (!RuntimeEnabledFeatures::inputEventEnabled()) |
| 1738 return DispatchEventResult::NotCanceled; |
| 1739 if (!target) |
| 1740 return DispatchEventResult::NotCanceled; |
| 1741 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(InputEvent::Inp
utType::InsertText, data, InputEvent::EventCancelable::IsCancelable); |
| 1742 return target->dispatchEvent(beforeInputEvent); |
| 1743 } |
| 1744 |
| 1745 DispatchEventResult dispatchBeforeInputFromComposition(EventTarget* target, Inpu
tEvent::InputType inputType, const String& data) |
| 1746 { |
| 1747 if (!RuntimeEnabledFeatures::inputEventEnabled()) |
| 1748 return DispatchEventResult::NotCanceled; |
| 1749 if (!target) |
| 1750 return DispatchEventResult::NotCanceled; |
| 1751 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data
, InputEvent::EventCancelable::NotCancelable); |
| 1752 return target->dispatchEvent(beforeInputEvent); |
| 1753 } |
| 1754 |
| 1755 DispatchEventResult dispatchBeforeInputEditorCommand(EventTarget* target, InputE
vent::InputType inputType, const String& data) |
| 1756 { |
| 1757 if (!RuntimeEnabledFeatures::inputEventEnabled()) |
| 1758 return DispatchEventResult::NotCanceled; |
| 1759 if (!target) |
| 1760 return DispatchEventResult::NotCanceled; |
| 1761 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data
, InputEvent::EventCancelable::IsCancelable); |
| 1762 return target->dispatchEvent(beforeInputEvent); |
| 1763 } |
| 1764 |
1735 } // namespace blink | 1765 } // namespace blink |
OLD | NEW |