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

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: Ojan's review Created 4 years, 6 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 // TODO(chongz): Pass appreciate |ranges| after it's defined on spec.
1746 // http://w3c.github.io/editing/input-events.html#dom-inputevent-inputtype
1747 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(InputEvent::Inp utType::InsertText, data, InputEvent::EventCancelable::IsCancelable, InputEvent: :EventIsComposing::NotComposing, nullptr);
1746 return target->dispatchEvent(beforeInputEvent); 1748 return target->dispatchEvent(beforeInputEvent);
1747 } 1749 }
1748 1750
1749 DispatchEventResult dispatchBeforeInputFromComposition(EventTarget* target, Inpu tEvent::InputType inputType, const String& data, InputEvent::EventCancelable can celable) 1751 DispatchEventResult dispatchBeforeInputFromComposition(EventTarget* target, Inpu tEvent::InputType inputType, const String& data, InputEvent::EventCancelable can celable)
1750 { 1752 {
1751 if (!RuntimeEnabledFeatures::inputEventEnabled()) 1753 if (!RuntimeEnabledFeatures::inputEventEnabled())
1752 return DispatchEventResult::NotCanceled; 1754 return DispatchEventResult::NotCanceled;
1753 if (!target) 1755 if (!target)
1754 return DispatchEventResult::NotCanceled; 1756 return DispatchEventResult::NotCanceled;
1755 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data , cancelable, InputEvent::EventIsComposing::IsComposing); 1757 // TODO(chongz): Pass appreciate |ranges| after it's defined on spec.
1758 // http://w3c.github.io/editing/input-events.html#dom-inputevent-inputtype
1759 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data , cancelable, InputEvent::EventIsComposing::IsComposing, nullptr);
1756 return target->dispatchEvent(beforeInputEvent); 1760 return target->dispatchEvent(beforeInputEvent);
1757 } 1761 }
1758 1762
1759 DispatchEventResult dispatchBeforeInputEditorCommand(EventTarget* target, InputE vent::InputType inputType, const String& data) 1763 DispatchEventResult dispatchBeforeInputEditorCommand(EventTarget* target, InputE vent::InputType inputType, const String& data, const RangeVector* ranges)
1760 { 1764 {
1761 if (!RuntimeEnabledFeatures::inputEventEnabled()) 1765 if (!RuntimeEnabledFeatures::inputEventEnabled())
1762 return DispatchEventResult::NotCanceled; 1766 return DispatchEventResult::NotCanceled;
1763 if (!target) 1767 if (!target)
1764 return DispatchEventResult::NotCanceled; 1768 return DispatchEventResult::NotCanceled;
1765 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data , InputEvent::EventCancelable::IsCancelable, InputEvent::EventIsComposing::NotCo mposing); 1769 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data , InputEvent::EventCancelable::IsCancelable, InputEvent::EventIsComposing::NotCo mposing, ranges);
1766 return target->dispatchEvent(beforeInputEvent); 1770 return target->dispatchEvent(beforeInputEvent);
1767 } 1771 }
1768 1772
1769 } // namespace blink 1773 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698