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 23 matching lines...) Expand all Loading... |
34 #include "core/dom/shadow/ShadowRoot.h" | 34 #include "core/dom/shadow/ShadowRoot.h" |
35 #include "core/editing/EditingStrategy.h" | 35 #include "core/editing/EditingStrategy.h" |
36 #include "core/editing/Editor.h" | 36 #include "core/editing/Editor.h" |
37 #include "core/editing/PlainTextRange.h" | 37 #include "core/editing/PlainTextRange.h" |
38 #include "core/editing/PositionIterator.h" | 38 #include "core/editing/PositionIterator.h" |
39 #include "core/editing/VisiblePosition.h" | 39 #include "core/editing/VisiblePosition.h" |
40 #include "core/editing/VisibleSelection.h" | 40 #include "core/editing/VisibleSelection.h" |
41 #include "core/editing/VisibleUnits.h" | 41 #include "core/editing/VisibleUnits.h" |
42 #include "core/editing/iterators/TextIterator.h" | 42 #include "core/editing/iterators/TextIterator.h" |
43 #include "core/editing/serializers/HTMLInterchange.h" | 43 #include "core/editing/serializers/HTMLInterchange.h" |
| 44 #include "core/events/InputEvent.h" |
44 #include "core/frame/LocalFrame.h" | 45 #include "core/frame/LocalFrame.h" |
45 #include "core/frame/UseCounter.h" | 46 #include "core/frame/UseCounter.h" |
46 #include "core/html/HTMLBRElement.h" | 47 #include "core/html/HTMLBRElement.h" |
47 #include "core/html/HTMLDivElement.h" | 48 #include "core/html/HTMLDivElement.h" |
48 #include "core/html/HTMLLIElement.h" | 49 #include "core/html/HTMLLIElement.h" |
49 #include "core/html/HTMLParagraphElement.h" | 50 #include "core/html/HTMLParagraphElement.h" |
50 #include "core/html/HTMLSpanElement.h" | 51 #include "core/html/HTMLSpanElement.h" |
51 #include "core/html/HTMLTableCellElement.h" | 52 #include "core/html/HTMLTableCellElement.h" |
52 #include "core/html/HTMLUListElement.h" | 53 #include "core/html/HTMLUListElement.h" |
53 #include "core/layout/LayoutObject.h" | 54 #include "core/layout/LayoutObject.h" |
(...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1645 // otherwise, make sure to be at the start of the first selected node, | 1646 // otherwise, make sure to be at the start of the first selected node, |
1646 // instead of possibly at the end of the last node before the selection | 1647 // instead of possibly at the end of the last node before the selection |
1647 return mostForwardCaretPosition(visiblePosition.deepEquivalent()); | 1648 return mostForwardCaretPosition(visiblePosition.deepEquivalent()); |
1648 } | 1649 } |
1649 | 1650 |
1650 bool isTextSecurityNode(const Node* node) | 1651 bool isTextSecurityNode(const Node* node) |
1651 { | 1652 { |
1652 return node && node->layoutObject() && node->layoutObject()->style()->textSe
curity() != TSNONE; | 1653 return node && node->layoutObject() && node->layoutObject()->style()->textSe
curity() != TSNONE; |
1653 } | 1654 } |
1654 | 1655 |
| 1656 DispatchEventResult dispatchBeforeInputInsertText(EventTarget* target, const Str
ing& data) |
| 1657 { |
| 1658 if (RuntimeEnabledFeatures::inputEventEnabled()) { |
| 1659 if (target) { |
| 1660 RefPtrWillBeRawPtr<InputEvent> beforeInputEvent = InputEvent::create
BeforeInputTyping(InputEvent::InputType::InsertText, data); |
| 1661 return target->dispatchEvent(beforeInputEvent); |
| 1662 } |
| 1663 } |
| 1664 return DispatchEventResult::NotCanceled; |
| 1665 } |
| 1666 |
| 1667 DispatchEventResult dispatchBeforeInputCompositionUpdate(EventTarget* target, co
nst String& data) |
| 1668 { |
| 1669 if (RuntimeEnabledFeatures::inputEventEnabled()) { |
| 1670 if (target) { |
| 1671 RefPtrWillBeRawPtr<InputEvent> beforeInputEvent = InputEvent::create
BeforeInputCompositionUpdate(InputEvent::InputType::ReplaceText, data); |
| 1672 return target->dispatchEvent(beforeInputEvent); |
| 1673 } |
| 1674 } |
| 1675 return DispatchEventResult::NotCanceled; |
| 1676 } |
| 1677 |
| 1678 DispatchEventResult dispatchBeforeInputEditorCommand(EventTarget* target, const
char* commandName, const String& data) |
| 1679 { |
| 1680 if (RuntimeEnabledFeatures::inputEventEnabled()) { |
| 1681 if (target) { |
| 1682 RefPtrWillBeRawPtr<InputEvent> beforeInputEvent = InputEvent::create
BeforeInputEditorCommand(commandName, data); |
| 1683 return target->dispatchEvent(beforeInputEvent); |
| 1684 } |
| 1685 } |
| 1686 return DispatchEventResult::NotCanceled; |
| 1687 } |
| 1688 |
1655 } // namespace blink | 1689 } // namespace blink |
OLD | NEW |