Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: third_party/WebKit/Source/core/editing/EditingUtilities.cpp

Issue 1965543002: [InputEvent] Support |sequence<Range> getRanges()| in 'beforeinput' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1724 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 { 1735 {
1736 return node && node->layoutObject() && node->layoutObject()->style()->textSe curity() != TSNONE; 1736 return node && node->layoutObject() && node->layoutObject()->style()->textSe curity() != TSNONE;
1737 } 1737 }
1738 1738
1739 DispatchEventResult dispatchBeforeInputInsertText(EventTarget* target, const Str ing& data) 1739 DispatchEventResult dispatchBeforeInputInsertText(EventTarget* target, const Str ing& data)
1740 { 1740 {
1741 if (!RuntimeEnabledFeatures::inputEventEnabled()) 1741 if (!RuntimeEnabledFeatures::inputEventEnabled())
1742 return DispatchEventResult::NotCanceled; 1742 return DispatchEventResult::NotCanceled;
1743 if (!target) 1743 if (!target)
1744 return DispatchEventResult::NotCanceled; 1744 return DispatchEventResult::NotCanceled;
1745 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(InputEvent::Inp utType::InsertText, data, InputEvent::EventCancelable::IsCancelable, InputEvent: :EventIsComposing::NotComposing); 1745 DEFINE_STATIC_LOCAL(HeapVector<Member<Range>>, emptyVector, (new HeapVector< Member<Range>>));
dtapuska 2016/05/12 02:00:09 I don't think it is worth worrying about a static
chongz 2016/05/12 20:53:49 Removed static local and instead passing pointers
1746 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(InputEvent::Inp utType::InsertText, data, InputEvent::EventCancelable::IsCancelable, InputEvent: :EventIsComposing::NotComposing, emptyVector);
1746 return target->dispatchEvent(beforeInputEvent); 1747 return target->dispatchEvent(beforeInputEvent);
1747 } 1748 }
1748 1749
1749 DispatchEventResult dispatchBeforeInputFromComposition(EventTarget* target, Inpu tEvent::InputType inputType, const String& data) 1750 DispatchEventResult dispatchBeforeInputFromComposition(EventTarget* target, Inpu tEvent::InputType inputType, const String& data)
1750 { 1751 {
1751 if (!RuntimeEnabledFeatures::inputEventEnabled()) 1752 if (!RuntimeEnabledFeatures::inputEventEnabled())
1752 return DispatchEventResult::NotCanceled; 1753 return DispatchEventResult::NotCanceled;
1753 if (!target) 1754 if (!target)
1754 return DispatchEventResult::NotCanceled; 1755 return DispatchEventResult::NotCanceled;
1755 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data , InputEvent::EventCancelable::NotCancelable, InputEvent::EventIsComposing::IsCo mposing); 1756 DEFINE_STATIC_LOCAL(HeapVector<Member<Range>>, emptyVector, (new HeapVector< Member<Range>>));
1757 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data , InputEvent::EventCancelable::NotCancelable, InputEvent::EventIsComposing::IsCo mposing, emptyVector);
1756 return target->dispatchEvent(beforeInputEvent); 1758 return target->dispatchEvent(beforeInputEvent);
1757 } 1759 }
1758 1760
1759 DispatchEventResult dispatchBeforeInputEditorCommand(EventTarget* target, InputE vent::InputType inputType, const String& data) 1761 DispatchEventResult dispatchBeforeInputEditorCommand(EventTarget* target, InputE vent::InputType inputType, const String& data, const HeapVector<Member<Range>>& ranges)
1760 { 1762 {
1761 if (!RuntimeEnabledFeatures::inputEventEnabled()) 1763 if (!RuntimeEnabledFeatures::inputEventEnabled())
1762 return DispatchEventResult::NotCanceled; 1764 return DispatchEventResult::NotCanceled;
1763 if (!target) 1765 if (!target)
1764 return DispatchEventResult::NotCanceled; 1766 return DispatchEventResult::NotCanceled;
1765 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data , InputEvent::EventCancelable::IsCancelable, InputEvent::EventIsComposing::NotCo mposing); 1767 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data , InputEvent::EventCancelable::IsCancelable, InputEvent::EventIsComposing::NotCo mposing, ranges);
1766 return target->dispatchEvent(beforeInputEvent); 1768 return target->dispatchEvent(beforeInputEvent);
1767 } 1769 }
1768 1770
1769 } // namespace blink 1771 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698