This patch implements nsCocoaUtils::GetEventTimeStamp() which hides how to get TimeStamp from timeStamp of NSEvent from other developers.
Different from Windows and GTK, we don't need to use SystemTimeConverter and implement CurrentTimeGetter class because the internal value of the macOS implementation of TimeStamp is based on mach_absolute_time(), which measures "ticks" since boot. Event timestamps are NSTimeIntervals (seconds) since boot. So the two time representations already have the same base; we only need to convert seconds into ticks.
MozReview-Commit-ID: LvioyJOM7S9
--HG--
extra : rebase_source : 0e497f675f9b7e1355155dc081945478f83019a8
This patch changes it from |NS_IMETHOD| to |virtual void| because every
implementation of these functions always returns |NS_OK|.
--HG--
extra : rebase_source : 07ee29c514bf35b97d7195c53bb5b9220d1ef961
This patch changes them from |NS_IMETHOD| to |virtual void| because every
implementation of these functions always returns |NS_OK|.
--HG--
extra : rebase_source : 6207df5a46aeb6b8aaa0f697447a51bc6a6dc366
This patch does the following.
- Removes the return value, because none of the call sites check it.
- Removes the empty implementations from the android nsIWidget instance,
because it can use the nsBaseWidget one.
--HG--
extra : rebase_source : 0791d3cb05907d6b41879549b52f3a33018abf45
This patch removes its return value, because none of the call sites check it
except for one non-vital assertion.
--HG--
extra : rebase_source : 3471c4e22394b8a05c6708d0f8469686ffad9814
Specifically: OnDefaultButtonLoaded, AttachNativeKeyEvent, BeginMoveDrag,
BeginResizeDrag, GetAttention. These are all fallible functions whose result is
always checked.
The patch also moves some trivial function definitions from nsBaseWidget.cpp to
nsBaseWidget.h, and removes the android BeginResizeDrag() because it can
use the nsBaseWidget one.
--HG--
extra : rebase_source : ef32a41b547bcbc21f7df0043f683307470b136e
Send the size from PMGetAdjustedPaperRect to the child to use as the page size.
Add an Mac implementation of GetEffectivePageSize that returns the adjusted dimensions.
Add an Mac implementation of SetPaperWidth and SetPaperHeight so that adjusted dimensions can be manually set for reftest-print.
MozReview-Commit-ID: GgTFgBzkxTy
--HG--
extra : rebase_source : 66d5b2f8216ebd28401aec9bbb78c5ad32dd666c
Currently, when InsertText() which is caused by a key press causes committing composition, it consumes keypress event. However, Korean 2-set IME calls InsertText() two times when there is composition and key press causes inserting another character next to the composition. In this case, current design ignores second InsertText() becuase keypress event is already consumed by the first InsertText() call.
For solving this issue safely, InsertText() should mark current key event as "dispatched composition event". Then, following InsertText() calls should cause composition events instead of keypress events since following event order is too odd:
1. keydown (currently not dispatched by TextEventDisaptcher)
2. compositionupdate
3. compositionend
4. keypress
5. keyup
with the new design this becomes:
1. keydown (currently not dispatched by TextEventDispatcher)
2. compositionupdate
3. compositionend
4. compositionstart
5. compositionupdate
6. compositionend
7. keyup
This is similar to Chromium, although, Chromium includes the second InsertText() call into the first composition, we need to fix it later due to risky.
MozReview-Commit-ID: GL42cU2WIL0
--HG--
extra : rebase_source : 2063c56166f6c9ccee25a74e1d29f94daa6b159c
Send the size from PMGetAdjustedPaperRect to the child to use as the page size.
Add an Mac implementation of GetEffectivePageSize that returns the adjusted dimensions.
MozReview-Commit-ID: GgTFgBzkxTy
--HG--
extra : rebase_source : 9b6e3200698a695d3ca03f3848060083b8fe4ae6
Adds serialization of native print settings values so
that correct page size, scaling, orientation are sent
to the child after the print dialog is displayed.
Changes the Mac print dialog code to load native
print settings from the "print.macosx.pagesetup-2"
pref and ignore what is passed in.
Overwrites the scaling percentage specified in
the print dialog when "Ignore Scaling and Shrink to
Fit Page Width" is checked.
Scaling on Nightly (remote printing) needs more work
to be done in a follow up bug.
MozReview-Commit-ID: B12ZeHuiYFJ
--HG--
extra : rebase_source : baa2a5865b29db8914fca1242af59674f9630c8e
Vietnamese Telex perhaps referes this result and change its behavior. When typying something, Telex starts composition on Chrome but may not behave so on Gecko.
Fortunately, Chromium just returns some attributes when validAttributesForMarkedText: of NSTextInputClient [1] but it doesn't return these styles when attributedSubstringForProposedRange: of NSTextInputClient is called (always returns non-styled plain text) [2]. Therefore, this patch does not touch IMEInputHandler::GetAttributedSubstringFromRange().
*1 <7d85f23cb0/content/browser/renderer_host/render_widget_host_view_mac.mm (2936)>
*2 <7d85f23cb0/content/browser/renderer_host/render_widget_host_view_mac.mm (3036)>
MozReview-Commit-ID: 1gPIiu4Qbud
--HG--
extra : rebase_source : 5336eea303ee157959941dcc4bda2a0931f1f532
Vietnamese Telex IME handles Backspace key immediately after inputting a word even when there is no marked text. At this time, it tries to replace the word with specific string. In such case, our editor shouldn't remove anything at handling the Backspace keypress event.
For avoiding this issue, InserText() should dispatch a set of composition for inserting the specified text into the range. Then, editor won't perform any action of the key.
Additionally, when a Backspace keydown tries to remove the last character of the word, Telex removes it with a composition. At this time, it creates dummy marked text "a" and make it empty later. So, in this case, InsertText() won't be called, therefore, we need to consume the Backspace keypress when SetMarkedText() is called for preventing removing the previous character of the word.
MozReview-Commit-ID: LfeEHDWn0cZ
--HG--
extra : rebase_source : 4753262ef16bc3875754ae38e966d8512947ad89
This is the first step in using these functions without having a
LayerManagerComposite at all.
MozReview-Commit-ID: 2zkuB7Ox4Ut
--HG--
extra : rebase_source : b23988275f5851a2fd30bd3e8a9931107a224c66
widget/cocoa/nsAppShell.mm:113:47 [-Wmismatched-parameter-types] conflicting parameter types in implementation of 'nextEventMatchingMask:untilDate:inMode:dequeue:': 'NSEventMask' (aka 'unsigned long long') vs 'NSUInteger' (aka 'unsigned long')
NSWindow's nextEventMatchingMask method expects a parameter of type NSEventMask, not NSUInteger, when building x86_64 with SDK 10.12:
https://developer.apple.com/reference/appkit/nswindow/1419304-nexteventmatchingmask
TextInputHandler::InsertText() dispatches a set of composition events when a key press causes 2 or more characters (Note that InsertText() is typically called only when IME is available because it's called via [NSResponder interpretKeyEvents]). However, this is different from the behavior of Windows. On Windows, NativeKey dispatches two ore more eKeyPress events in this case.
So, for consistency between platforms, TextInputHandler should dispatch eKeyPress events in such case.
MozReview-Commit-ID: EMvaL7sklKf
--HG--
extra : rebase_source : 0309d32d692a2394f53cd59216c6e774068e452b