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