gecko-dev/dom/events
Masayuki Nakano 5a78a77b68 Bug 1375825 - part2: ContentEventHandler::ExpandToClusterBoundary() should check the return value of nsTextFrame::PeekOffsetCharacter() r=jfkthame
ContentEventHandler::ExpandToClusterBoundary() doesn't check the return value of nsTextFrame::PeekOffsetCharacter().  Therefore, it may set its result to reversed offset. (e.g., when aForward is true and offset is 6, the result may be 5.  When aForward is false and offset is 5, the result may be 6.)

For avoiding that, ContentEventHandler::ExpandToClusterBoundary() should check the result and only when it returns nsIFrame::FOUND, it should compute the proper offset.

On the other hand, it's too bad for ContentEventHandler that nsTextFrame::PeekOffsetCharacter() to return nsIFrame::CONTINUE_UNSELECTABLE when the user-select style is "all" because IME doesn't expect such cases.

Therefore, this patch adds additional argument to nsIFrame::PeekOffsetCharacter(), aOptions which is a struct containing bool members.  The reason why it's not a bit mask enum is, such struct doesn't cause simple mistake at checking the value and the code is shorter.  When mIgnoreUserStyleAll of it is true, this patch makes nsTextFrame not return nsIFrame::CONTINUE_UNSELECTABLE.

MozReview-Commit-ID: ACNNBTP92YZ

--HG--
extra : rebase_source : bd85da902e7fb59135d15514cb20a5599a4a640b
2017-06-29 10:58:16 +09:00
..
crashtests Bug 1334831 - script-generated patch to use .remove() instead of .parentNode.removeChild, r=jaws. 2017-01-30 08:10:22 +01:00
test Backed out changeset e744a3029de2 (bug 1375940) for failing dom/events/test/test_dblclick_kill_window.html. r=backout 2017-06-28 02:24:15 +02:00
AnimationEvent.cpp
AnimationEvent.h
AsyncEventDispatcher.cpp Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
AsyncEventDispatcher.h Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
BeforeUnloadEvent.cpp
BeforeUnloadEvent.h
ClipboardEvent.cpp Bug 1313943 - Legacy event initializers should all do nothing during dispatch; r=bkelly 2016-11-01 17:19:59 +02:00
ClipboardEvent.h
CommandEvent.cpp Bug 1313943 - Legacy event initializers should all do nothing during dispatch; r=bkelly 2016-11-01 17:19:59 +02:00
CommandEvent.h
CompositionEvent.cpp Bug 1333925 Make CompositionEvent::mRanges cycle collected r=smaug 2017-01-26 15:35:09 +09:00
CompositionEvent.h Bug 1333925 Make CompositionEvent::mRanges cycle collected r=smaug 2017-01-26 15:35:09 +09:00
ContentEventHandler.cpp Bug 1375825 - part2: ContentEventHandler::ExpandToClusterBoundary() should check the return value of nsTextFrame::PeekOffsetCharacter() r=jfkthame 2017-06-29 10:58:16 +09:00
ContentEventHandler.h Bug 1374580 (part 2) - Remove nsAFlat{,C}String typedefs. r=froydnj. 2017-06-20 19:19:05 +10:00
CustomEvent.cpp Bug 1313943 - Legacy event initializers should all do nothing during dispatch; r=bkelly 2016-11-01 17:19:59 +02:00
CustomEvent.h
DataTransfer.cpp Bug 1352281 - Include KIND_OTHER types in DataTransfer.types, r=baku 2017-04-17 14:57:25 -04:00
DataTransfer.h Bug 1327798 - Part 1. PasteNoFormatting shouldn't set text/html to clipboard event on paste. r=enndeakin 2017-02-22 18:34:45 +09:00
DataTransferItem.cpp Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
DataTransferItem.h Bug 1342057 - Part 1: Use correct MIME type for files as DataTransferItem.type, r=baku 2017-03-07 18:18:42 -05:00
DataTransferItemList.cpp Bug 1342057 - Part 1: Use correct MIME type for files as DataTransferItem.type, r=baku 2017-03-07 18:18:42 -05:00
DataTransferItemList.h Bug 1308287 part 1. Change [NeedsSubjectPrincipal] to only do the Maybe thing for interfaces that can be exposed to workers. r=baku 2016-10-10 21:07:48 -04:00
DeviceMotionEvent.cpp Bug 1261894 - Update InitDeviceMotionEvent to handle high-res timestamps. r=smaug 2017-02-28 16:50:15 -06:00
DeviceMotionEvent.h Bug 1287006 - Don't pass Nullable by value in various places, rather by const&. r=bz 2017-02-13 09:07:40 -08:00
DOMEventTargetHelper.cpp Bug 1362119 - part 1 - Moving dom/base/Script{Loader,Element}.* in dom/script, r=ehsan 2017-05-08 08:24:22 +02:00
DOMEventTargetHelper.h Bug 1354599 - Implement DOMEventTargetHelper::KeepAliveIfHasListenersFor, r=smaug 2017-04-18 13:51:27 +02:00
DragEvent.cpp Bug 1313943 - Legacy event initializers should all do nothing during dispatch; r=bkelly 2016-11-01 17:19:59 +02:00
DragEvent.h
Event.cpp Bug 1374580 (part 2) - Remove nsAFlat{,C}String typedefs. r=froydnj. 2017-06-20 19:19:05 +10:00
Event.h Bug 1217238 - Reduce time precision when privacy.resistFingerprinting is on. r=mystor 2017-06-06 11:45:14 +08:00
EventDispatcher.cpp Bug 1375392 - Tweak the PROFILER_LABEL* macros. r=mstange. 2017-06-22 17:08:53 +10:00
EventDispatcher.h Bug 1251198 - Remove various obsolete events from document.createEvent r=smaug 2017-04-20 15:45:37 +03:00
EventListenerManager.cpp Bug 1351783 part 8 - Gather whether there are key listeners on the focused element. r=kats,smaug 2017-06-05 19:22:16 -05:00
EventListenerManager.h Bug 1351783 part 8 - Gather whether there are key listeners on the focused element. r=kats,smaug 2017-06-05 19:22:16 -05:00
EventListenerService.cpp Bug 1372327 - Use LookupForAdd instead of Get+Put to avoid unnecessary hashtable lookups. r=froydnj 2017-06-14 17:27:25 +02:00
EventListenerService.h
EventNameList.h Bug 1373857 - Part 3: Optimize the PostHandleEvent() events that we dispatch for checkboxes and radiocontrols when they get toggled in order to make it use direct WidgetEvent dispatch; r=smaug 2017-06-20 13:59:52 -04:00
EventStateManager.cpp Bug 1351783 part 7 - Create FocusState and FocusTarget types. r=kats,botond 2017-06-05 19:12:22 -05:00
EventStateManager.h Bug 1360441 - Disable the IsHandlingUserInput timeout for execCommand(copy/cut) commands, r=ehsan 2017-05-18 16:51:48 -04:00
EventStates.h Bug 1373798 part 2. Introduce event state flags that track the state of an element's "dir" attribute. r=mystor 2017-06-19 23:24:59 -04:00
EventTarget.cpp Bug 1351783 part 8 - Gather whether there are key listeners on the focused element. r=kats,smaug 2017-06-05 19:22:16 -05:00
EventTarget.h Bug 1351783 part 8 - Gather whether there are key listeners on the focused element. r=kats,smaug 2017-06-05 19:22:16 -05:00
FocusEvent.cpp Bug 1323815, FocusEvent.relatedTarget should work consistently with MouseEvent.relatedTarget, r=masayuki 2016-12-19 13:36:48 +02:00
FocusEvent.h Bug 1323815, FocusEvent.relatedTarget should work consistently with MouseEvent.relatedTarget, r=masayuki 2016-12-19 13:36:48 +02:00
ImageCaptureError.cpp
ImageCaptureError.h
IMEContentObserver.cpp Bug 1374207 - part2: TextComposition, IMEContentObserver and IMEStateManager should use EditorBase instead of nsIEditor r=m_kato 2017-06-20 19:23:44 +09:00
IMEContentObserver.h Bug 1374207 - part2: TextComposition, IMEContentObserver and IMEStateManager should use EditorBase instead of nsIEditor r=m_kato 2017-06-20 19:23:44 +09:00
IMEStateManager.cpp Bug 1376424 - part0: Backout the patch for bug 1368554 r=m_kato 2017-06-27 22:02:07 +09:00
IMEStateManager.h Bug 1374207 - part2: TextComposition, IMEContentObserver and IMEStateManager should use EditorBase instead of nsIEditor r=m_kato 2017-06-20 19:23:44 +09:00
InputEvent.cpp
InputEvent.h
InternalMutationEvent.h
JSEventHandler.cpp Bug 1345996. Change event handler invocation to only do the "true return cancels" for onerror handlers handed ErrorEvents, and only on globals. r=smaug 2017-03-10 23:53:09 -05:00
JSEventHandler.h
KeyboardEvent.cpp Bug 1322736 part.2 Remove "after keydown" and "after keyup" events r=smaug 2016-12-16 16:01:51 +09:00
KeyboardEvent.h
KeyNameList.h Bug 1274503 part.0 Move "MediaFastForward" to "Media Keys" section for keeping same order with the spec r=smaug 2016-11-03 22:01:10 +09:00
MessageEvent.cpp Bug 1311324 P2 Replace usage of ServiceWorkerMessageEvent with MessageEvent. r=bz 2017-03-09 20:50:13 -05:00
MessageEvent.h Bug 1311324 P2 Replace usage of ServiceWorkerMessageEvent with MessageEvent. r=bz 2017-03-09 20:50:13 -05:00
MouseEvent.cpp Bug 1339758, click() and similar can return 0 from various coordinate properties, r=masayuki 2017-03-23 12:57:44 +02:00
MouseEvent.h Bug 1317759. Remove LegacyIsCallerChromeOrNativeCode use in Event::GetScreenCoords in favor or caller type checks at the entrypoints where we really care about pretending that our screen is client-area sized. r=smaug 2016-11-16 14:10:22 -05:00
MouseScrollEvent.cpp Bug 1313943 - Legacy event initializers should all do nothing during dispatch; r=bkelly 2016-11-01 17:19:59 +02:00
MouseScrollEvent.h
moz.build Bug 1251198 - Remove various obsolete events from document.createEvent r=smaug 2017-04-20 15:45:37 +03:00
MutationEvent.cpp Bug 1313943 - Legacy event initializers should all do nothing during dispatch; r=bkelly 2016-11-01 17:19:59 +02:00
MutationEvent.h
NotifyPaintEvent.cpp Bug 1302071 - Part 3: Remove flags parameter to NotifyInvalidation since it's unused. r=tnikkel 2017-02-17 11:50:58 +13:00
NotifyPaintEvent.h Bug 1302071 - Part 3: Remove flags parameter to NotifyInvalidation since it's unused. r=tnikkel 2017-02-17 11:50:58 +13:00
nsIEventListenerService.idl
PaintRequest.cpp Bug 1302071 - Part 3: Remove flags parameter to NotifyInvalidation since it's unused. r=tnikkel 2017-02-17 11:50:58 +13:00
PaintRequest.h Bug 1302071 - Part 3: Remove flags parameter to NotifyInvalidation since it's unused. r=tnikkel 2017-02-17 11:50:58 +13:00
PhysicalKeyCodeNameList.h
PointerEvent.cpp Bug 1292064 - [Pointer Event] Add digitizer/pen tangential (barrel) pressure and twist. r=smaug 2017-02-09 10:49:00 +08:00
PointerEvent.h Bug 1292064 - [Pointer Event] Add digitizer/pen tangential (barrel) pressure and twist. r=smaug 2017-02-09 10:49:00 +08:00
ScrollAreaEvent.cpp Bug 1333927 Make ScrollAreaEvent::mClientArea cycle collected r=smaug 2017-01-27 15:57:38 +09:00
ScrollAreaEvent.h Bug 1333927 Make ScrollAreaEvent::mClientArea cycle collected r=smaug 2017-01-27 15:57:38 +09:00
SimpleGestureEvent.cpp Bug 1313943 - Legacy event initializers should all do nothing during dispatch; r=bkelly 2016-11-01 17:19:59 +02:00
SimpleGestureEvent.h
SpeechRecognitionError.cpp
SpeechRecognitionError.h
StorageEvent.cpp Bug 1322550 - Rename DOMStorage to Storage, r=smaug 2017-01-04 14:53:01 +01:00
StorageEvent.h Bug 1285898 - [e10s-multi] Localstorage "storage" event is not fired with multiple content processes. r=asuth 2017-02-19 22:16:48 -05:00
TextClause.cpp
TextClause.h
TextComposition.cpp Bug 1376424 - part0: Backout the patch for bug 1368554 r=m_kato 2017-06-27 22:02:07 +09:00
TextComposition.h Bug 1376424 - part0: Backout the patch for bug 1368554 r=m_kato 2017-06-27 22:02:07 +09:00
Touch.cpp Bug 1324035 part 4. Change nsContentUtils::ResistFingerprinting to just take a dom::CallerType instead of having all its consumers check it. r=qdot 2016-12-17 00:25:52 -05:00
Touch.h Bug 1317759. Remove LegacyIsCallerChromeOrNativeCode use in Event::GetScreenCoords in favor or caller type checks at the entrypoints where we really care about pretending that our screen is client-area sized. r=smaug 2016-11-16 14:10:22 -05:00
TouchEvent.cpp Bug 1357872, nsPresContext is refcounted, so use it so, r=kats 2017-04-25 00:38:33 +03:00
TouchEvent.h
TransitionEvent.cpp
TransitionEvent.h
UIEvent.cpp Bug 1339758, click() and similar can return 0 from various coordinate properties, r=masayuki 2017-03-23 12:57:44 +02:00
UIEvent.h Bug 1347073 Get rid of UIEvent.isChar since it's not initialized properly on most platforms and the other browsers don't support this r=smaug 2017-03-14 18:29:39 +09:00
VirtualKeyCodeList.h
WheelEvent.cpp Bug 1313943 - Legacy event initializers should all do nothing during dispatch; r=bkelly 2016-11-01 17:19:59 +02:00
WheelEvent.h
WheelHandlingHelper.cpp Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
WheelHandlingHelper.h Bug 1358758 - Use CSSIntRect for nsIFrame::GetScreenRect. r=kats 2017-04-25 07:33:13 +09:00
XULCommandEvent.cpp Bug 1313943 - Legacy event initializers should all do nothing during dispatch; r=bkelly 2016-11-01 17:19:59 +02:00
XULCommandEvent.h