Граф коммитов

134 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 85a1d561a2 Bug 1339543 part 6 PBrowser::RequestNativeKeyBindings() should retrieves edit commands only for specified type r=smaug
PBrowser::RequestNativeKeyBindings() is used only when somebody tries to
execute native key bindings for synthesized keyboard events.  Therefore, it
doesn't need to retrieve edit commands for all editor types.  Instead, it
should take the editor type and just return the edit commands for it.

MozReview-Commit-ID: HF4Gz99SBQP

--HG--
extra : rebase_source : e332d2ef5ae36949a9a362d8f95c5d427c9812e7
2017-05-19 18:46:02 +09:00
Masayuki Nakano 872f694c63 Bug 1339543 part 4 Change nsIWidget::ExecuteNativeKeyBinding() to nsIWidget::GetEditCommands() which just retrieves edit commands for the type r=smaug
Now, nsIWidget::ExecuteNativeKeyBinding() isn't used by anybody for executing
edit commands.  Instead, they need array of edit commands for the key
combination.  So, the method should be renamed to GetEditCommands() and just
return edit commands as an array.

MozReview-Commit-ID: 4G0B1lJ8Lbe

--HG--
extra : rebase_source : 4a5829281d59677c773950c34d91a1cd8074d243
2017-05-19 17:49:41 +09:00
Masayuki Nakano 730193bdb6 Bug 1339543 part 2 eKeyPress event should have edit commands for all editor types when it's dispatched to a remote process r=smaug
When eKeyPress event is dispatched from TabParent to a remote process, it
should store edit command for all editor types.  Then, copied
WidgetKeyboardEvent in the remote process doesn't need to request the edit
commands when its ExecuteEditCommands() is called.

Note that this patch also changes a automated test, browser_bug1316330.js,
that uses nsIDOMWindowUtils.dispatchDOMEventViaPresShell() to dispatch
repeated keyboard events in the tab.  However, it should use synthesizeKey()
to emulate everything of native keyboard events and the API can dispatch
repeated keyboard events too.  (And the test has a bug.  It tries to wait 0.5
sec when every keydown or keypress event.  However, it fails since startTime
is never initialized.  This patch fixes this bug too.)

MozReview-Commit-ID: IYhyxqH3Ch8

--HG--
extra : rebase_source : 0db911e8e6ea7fc537bda76f4cc0f8952cc13dd2
2017-05-19 17:24:20 +09:00
Masayuki Nakano 6d8d004613 Bug 1339543 part 1 Wrap nsIWidget::ExecuteNativeKeyBinding() with a WidgetKeyboardEvent method and users of the method should use it r=smaug
Currently, edit commands for native key bindings are stored in widget.  This is
stateful and really complicated in content process because it needs to cache
them.

We can make this simpler if we make WidgetKeyboardEvent store edit commands for
the key combination.  Then, child process can handle it even if it's delayed
event or it's a nested event.

This patch adds arrays to WidgetKeyboardEvent to store edit commands which are
initialized with nsIWidget::ExecuteNativeKeyBinding() and adds
WidgetKeyboardEvent::ExecuteEditCommands() to execute stored edit commands as
same as nsIWidget::ExecutenativeKeyBinding().

MozReview-Commit-ID: BGRvBrLz5lp

--HG--
extra : rebase_source : b7ecd704d9c331ca1e0aedc66f230114015b853b
2017-05-19 16:50:30 +09:00
Stephen A Pohl 99336e02ef Bug 429824: Properly forward native OSX events to the native menu bar if they haven't been handled by the child process in e10s. r=mstange,masayuki 2017-05-15 22:59:35 -04:00
Masayuki Nakano 87d8470a52 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
UIEvent.isChar is not supported by the other browsers and the value isn't initialized any platforms except on macOS. So, the value isn't useful and we have no reason to keep it.

MozReview-Commit-ID: 4BLpo88gSZj

--HG--
extra : rebase_source : ca950f8cb618a0cadc99ba4c80b5a8df94a20f27
2017-03-14 18:29:39 +09:00
Masayuki Nakano 5442d350f3 Bug 1337739 Create an enum eKeyLocation* for avoiding to use nsIDOMKeyEvent::DOM_KEY_LOCATION_* r=smaug
Currently, we use alias NS_VK_* for WidgetKeyboardEvent::mKeyCode.  Similarly, we should create alias enum for nsIDOMKeyEvent::DOM_KEY_LOCATION_*.  Then, we can reduce the length and avoid to include nsIDOMKeyEvent in some cpp files.

MozReview-Commit-ID: 5cs4zQ061Lc

--HG--
extra : rebase_source : e6a6edd27718b9e3d4a40b07902d029791876999
2017-02-08 21:04:22 +09:00
Masayuki Nakano e0dcff15d2 Bug 1322736 part.3 Remove dom::BeforeAfterKeyboardEvent and InternalBeforeAfterKeyboardEvent r=smaug
MozReview-Commit-ID: Eyz2HjIdQEW

--HG--
extra : rebase_source : 182f4f8236dcfb83f8725a9c66cc46dedbb14f2c
2016-12-16 16:25:22 +09:00
Masayuki Nakano d48cef4255 Bug 1322736 part.2 Remove "after keydown" and "after keyup" events r=smaug
MozReview-Commit-ID: ICFPyDhgfh7

--HG--
extra : rebase_source : 6d3a9d227ac99710ac2daa036e1e169d31ae9e6a
2016-12-16 16:01:51 +09:00
Masayuki Nakano abc299239b Bug 1322736 part.1 Remove "before keydown" and "before keyup" events r=smaug
MozReview-Commit-ID: 3umPBwTowLc

--HG--
extra : rebase_source : c77a7f4b9334f261623d655edb3bf50377d1804d
2016-12-16 15:59:25 +09:00
Masayuki Nakano 06d6d7a752 Bug 1304620 part.2 ContentCacheInParent should manage if there is pending composition in the remote process r=m_kato
If the remote process is busy or user restarts composition too quickly, there could be 2 or more compositions in ContentCache.  For managing such case, ContentCacheInParent should manage the pending composition count which is increased at dispatching eCompositionStart event to the remote process and decreased at receiving eCompositionCommit(AsIs) event from the remote process.

MozReview-Commit-ID: KbTsK20NEZD

--HG--
extra : rebase_source : 428b14646ccde190b446b5c820e0e84866a855f2
2016-10-12 17:09:02 +09:00
Masayuki Nakano 97735168f1 Bug 1297013 part.2 Implement some helper methods to log constants related to event handling r=smaug
This patch implements some helper methods to log constants related to event handling.

ToString(KeyNameIndex) and ToString(CodeNameIndex) converts the enum itmes to human readable string.  They use WidgetKeyboardEvent's helper class which returns Unicode text.  Therefore, this need to convert from UTF16 to UTF8.  That's the reason why these methods don't return |const char*|.

GetDOMKeyCodeName(uint32_t) returns DOM keycode name if it's defined.  Otherwise, returns hexadecimal value.  For generating switch-case statement, VirtualKeyCodeList.h shouldn't include ",".  Therefore, this patch removes "," from VirtualKeyCodeList.h and append it at defining NS_DEFINE_VK.  Additionally, the last item of enum and array should not end with ",".  Therefore, this adds dummy last item at each of them.  Finally, some of the keyCode values are shared between 2 keys.  Therefore, it needs to support NS_DISALLOW_SAME_KEYCODE for switch-case generator.  See the comment in the file for more detail.

GetModifiersName(Modifiers) returns all modifier names included in the given value.

MozReview-Commit-ID: 9i2ftFOTpDn

--HG--
extra : rebase_source : 458a4d28624dc10dd4454f2e7708d746d1fcb045
2016-09-15 00:48:47 +09:00
Masayuki Nakano d170e03f6c Bug 1286464 part.6 ContentEventHandler::OnQueryCaretRect() should use eQueryTextRect event when it needs to guess the caret rect r=smaug
ContentEventHandler::OnQueryTextRect() is now too complicated. So, we shouldn't duplicate similar code in OnQueryCaretRect(). When it needs to guess a caret rect from a character rect, we shouldn't compute character rect by itself.

MozReview-Commit-ID: 5G4MzQJzmoV

--HG--
extra : rebase_source : 31f2ec578eeb2af82b8af2d938448eb42afd50ea
2016-07-29 00:37:09 +09:00
isangelawu 5362a0f92e Bug 1275473 - Implement CompositionEvent.ranges. r=masayuki, r=smaug 2016-07-26 12:09:07 +02:00
Makoto Kato 689ca97c17 Bug 1203871 - Part 2. Implement eQueryTextRectArray. r=masayuki
It will use on ContentCache.  Also, SetRangeFromFlatTextOffset issue will hanle on another bug.

MozReview-Commit-ID: 9Yu8bLlcZS5

--HG--
extra : rebase_source : c8eba70bdedf303b0fa649c1a609fe6120983e65
extra : histedit_source : 4189807b57ede13c1546e95052fcc298c8581d06
2016-06-23 10:40:04 +01:00
Masayuki Nakano 60bb642e47 Bug 1275528 part.1 Support a way to query content relative to insertion point r=smaug
Native IME handler may want to query content relative to start of selection (or composition if there is it). Additionally, in e10s mode, insertion point in actual content may be different from the cache in parent.  Therefore, in some cases, it does make sense to query content with offset relative to start of selection or composition.

This patch implements it simply and only in non-e10s mode.

Additionally, this fixes a bug of nsQueryContentEventResult::GetOffset() which hasn't been accepted its calls even if the event message is valid (eQueryTextContent, eQueryTextRect and eQueryCaretRect).

MozReview-Commit-ID: 34I7vyTUAgO

--HG--
extra : rebase_source : d79ba0dc3e002f7691495ee1ff8bdb3854d8f6fe
2016-06-16 14:10:49 +09:00
Masayuki Nakano 4e5c167f73 Bug 1275914 part.5 Support special selections at handling eQuerySelectedText r=smaug
TextComposition needs to query first IME selection.  Therefore, we need to add support to query special selection range with eQuerySelectedText.

First, WidgetQueryContentEvent::mInput should have mSelectionType which should be initialized with InitForQuerySelectedText() but unfortunately, there is no method for eQuerySelectedText.  Therefore, this patch initializes WidgetQueryContentEvent::mInit::mSelectionType with SelectionType::eNormal in its constructor.

Next, ContentEventHandler needs to support to handle eQuerySelectedText with special selection types.  However, we need to create 2 paths in some cases, one is for normal selection and the other is for special selections because there are no selection ranges may be usual case for special selections but not so for normal selection.  Therefore, ContentEventHandler::InitCommon() becomes a little bit more complicated.  ContentEventHandler::mSelection and ContentEventHandler::mFirstSelectedRange is initialized with the specified selection type but normal selection type is also necessary to compute the selection root since the selection root is computed from the first selected range which may not be anywhere if its selection type is not normal.

Finally, ContentEventHandler::OnQuerySelectedText() returns "there are no selections" as succeeded case in special selection type cases.

MozReview-Commit-ID: 9WzUx8b5piw

--HG--
extra : rebase_source : fb07b40748b594d36315f1fc21c0a02ff9f668bb
2016-06-21 13:13:11 +09:00
Masayuki Nakano 0e98199ee6 Bug 1254755 part.6 Reorder the members of WidgetKeyboardEvent for reducing its instance size r=smaug
For reducing the instance size of WidgetKeyboardEvent, this patch also explicitly defines the type of KeyNameIndex and CodeNameIndex.

MozReview-Commit-ID: 8Iw2e8ZFOpe

--HG--
extra : rebase_source : 8123d19c30cf525643e7f442013c506de8b67543
2016-05-12 19:18:36 +09:00
Masayuki Nakano 1252a7bf75 Bug 1254755 part.5 Rename WidgetKeyboardEvent::isChar to WidgetKeyboardEvent::mIsChar r=smaug
MozReview-Commit-ID: 58mri5IP3dV

--HG--
extra : rebase_source : fadfc0eb40c2ea9a3a60ba54b0ae7c5cae94f96e
2016-05-12 18:31:05 +09:00
Masayuki Nakano e2fb1c839c Bug 1254755 part.4 Rename WidgetKeyboardEvent::location to WidgetKeyboardEvent::mLocation r=smaug
MozReview-Commit-ID: CjT7izri6Vq

--HG--
extra : rebase_source : 1e82d581b8bf1cce3d3154402f3bb435f7a004f6
2016-05-12 18:17:22 +09:00
Masayuki Nakano 7bfa8a21fa Bug 1254755 part.3 Rename WidgetKeyboardEvent::alternativeCharCodes to WidgetKeyboardEvent::mAlternativeCharCodes r=smaug
MozReview-Commit-ID: 26K8ZxzavfB

--HG--
extra : rebase_source : 5f74e58a784bae2ed626c0c9f7c992228dcff1be
2016-05-12 17:57:21 +09:00
Masayuki Nakano 8a70a17c6a Bug 1254755 part.2 Rename WidgetKeyboardEvent::charCode to WidgetKeyboardEvent::mCharCode r=smaug
And mCharCode shouldn't be compared with NS_VK_*, nsIDOMKeyEvent::DOM_VK_*. Additionally, when it's compared with a character constant, cast isn't necessary.

MozReview-Commit-ID: JMT614copjG

--HG--
extra : rebase_source : 69ee3c589e5a71c814ec9a40ac3aab39c789c11d
2016-05-13 16:06:18 +09:00
Masayuki Nakano 3359bad586 Bug 1254755 part.1 Rename WidgetKeyboardEvent::keyCode to WidgetKeyboardEvent::mKeyCode r=smaug
And also WidgetKeyboardEvent::mKeyCode should be compared with NS_VK_* rather than nsIDOMKeyEvent::DOM_VK_*.

MozReview-Commit-ID: IKjQ1nr8XYe

--HG--
extra : rebase_source : 83125cd2523f6b70759f621470aad23b00aae8ae
2016-05-12 17:13:49 +09:00
Neil Deakin 405358d4b3 Bug 1101975, handle access keys in content process before menus, r=masayuki 2016-05-11 08:56:42 -04:00
Stone Shih 547b61eae3 Bug 386743 - Set default event bubbling/cancelable flags in the WidgetEvent constructor. r=smaug 2016-04-13 14:16:42 +08:00
Masayuki Nakano eb041d2df7 Bug 1257759 part.7 Add new internal events which represent key events on plugin r=smaug
If a plugin process posts native key events to the widget, it needs to check if the key combination is reserved by chrome because if it's reserved by chrome, the reserved shortcut key handler should be executed and the event shouldn't be handled by the focused plugin.

This patches add eKeyDownOnPlugin and eKeyUpOnPlugin.  nsXBLWindowKeyHandler will listen to them and handle them as normal keydown and keypress or keyup event.  Note that these events won't be fired on content in the default event group and won't be sent to the remote process.

MozReview-Commit-ID: H5OKPLtVdr6

--HG--
extra : rebase_source : c6852423e47c40e9953b72061262730f7cce35d7
2016-04-23 01:22:49 +09:00
Masayuki Nakano cbe8f5268a Bug 1259656 part.1 Rename WidgetEvent::refPoint to WidgetEvent::mRefPoint r=smaug
MozReview-Commit-ID: ESWM5ZyBpSR

--HG--
extra : rebase_source : c5e1e3f60bcdde2a7f6c399e72430b29a3e552cd
2016-04-18 23:09:02 +09:00
chunminchang 55f5e1cc1b Bug 1110030 - part1 - add flags:IsSynthesizedByTIP and InputMethodAppState in WidgetKeyboardEvent. r=masayuki 2016-03-15 13:50:16 +08:00
Masayuki Nakano 7bcaf602d0 Bug 1154183 part.2 eKeyDown event should have charCode value of following keypress event r=smaug
MozReview-Commit-ID: 9duzKfCFPro
2016-03-19 20:57:11 +09:00
Masayuki Nakano 963976b46d Bug 1154183 part.1 Move shortcut/access key candidate list creators from nsContentUtils to WidgetKeyboardEvent r=smaug
MozReview-Commit-ID: Ied6qEUc2Kz
2016-03-18 11:22:37 +09:00
Nicholas Nethercote f5787d55ab Bug 1255655 - Const-ify kKeyNames and kCodeNames. r=karlt.
--HG--
extra : rebase_source : f8bbaa32b9fe7f13ad5998718921f96e3021b43d
2016-03-11 13:18:39 +11:00
Birunthan Mohanathas d7371d07d0 Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-02-02 17:36:30 +02:00
Phil Ringnalda d381b4bca6 Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray
CLOSED TREE

Backed out changeset d66c3f19a210 (bug 1235261)
Backed out changeset 467d945426bb (bug 1235261)
Backed out changeset 32b61df13142 (bug 1235261)
Backed out changeset c50bb8ed4196 (bug 1235261)
Backed out changeset 0ff0fa6fe81f (bug 1235261)
Backed out changeset df70e89669da (bug 1235261)
Backed out changeset 064969357fc9 (bug 1235261)
2016-01-31 10:10:57 -08:00
Birunthan Mohanathas 373593275e Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-01-31 17:12:12 +02:00
Andrea Marchesini caa2f9b456 Bug 1231378 - part 4 - Fix uninitialized members of classes in netwerk/widget/storage/uriloader/memory/tools, r=smaug 2016-01-12 18:16:59 +00:00
Carsten "Tomcat" Book 3589aeeb8a Backed out changeset d6b0ffe1a7b3 (bug 1231378) 2016-01-12 15:48:54 +01:00
Andrea Marchesini 2609a149da Bug 1231378 - part 4 - Fix uninitialized members of classes in netwerk/widget/storage/uriloader/memory/tools, r=smaug 2016-01-12 13:57:37 +00:00
Masayuki Nakano da7a2f4f8d Bug 1179632 part.2 WidgetCompositionEvent should store NativeIMEContext which caused the event and PuppetWidget should store it for GetNativeIMEContext() r=smaug, sr=smaug 2015-12-11 15:15:57 +09:00
Mark Capella e7b070ed41 Bug 1215959 - (GeckoCaret2) Upgrade Core and AccessibleCaret, r=smaug 2015-12-01 15:25:06 -05:00
Chris Peterson 44d581458a Bug 1223258 - Fix -Wunreachable-code warnings in widget. r=masayuki
widget/tests/TestAppShellSteadyState.cpp:397:5: warning: code will never be executed [-Wunreachable-code]
widget\widgetutils.cpp(95) : warning C4702: unreachable code
widget\mouseevents.h(97) : warning C4702: unreachable code
widget\textevents.h(492) : warning C4702: unreachable code
2015-11-08 22:46:00 -08:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Masayuki Nakano f961371a5e Bug 1109410 Resolve CSS transform in ContentEventHandler::ConvertToRootViewRelativeOffset() r=roc 2015-10-05 14:46:39 +09:00
Masayuki Nakano 888b2103ea Bug 895274 part.194 Rename NS_COMPOSITION_COMMIT to eCompositionCommit r=smaug 2015-09-11 21:21:27 +09:00
Masayuki Nakano ed4dac1ca6 Bug 895274 part.193 Rename NS_COMPOSITION_CHANGE to eCompositionChange r=smaug 2015-09-11 21:21:27 +09:00
Masayuki Nakano ebdc7bd69b Bug 895274 part.191 Rename NS_COMPOSITION_END to eCompositionEnd r=smaug 2015-09-11 21:21:27 +09:00
Masayuki Nakano 966f685af3 Bug 895274 part.188 Rename NS_COMPOSITION_COMMIT_AS_IS to eCompositionCommitAsIs r=smaug 2015-09-11 21:21:26 +09:00
Masayuki Nakano 1d6a202900 Bug 895274 part.187 Rename NS_QUERY_TEXT_RECT to eQueryTextRect r=smaug 2015-09-11 21:21:26 +09:00
Masayuki Nakano 09e1247ff7 Bug 895274 part.158 Rename NS_QUERY_DOM_WIDGET_HITTEST to eQueryDOMWidgetHittest r=smaug 2015-09-10 10:40:06 +09:00
Masayuki Nakano 26489b9f11 Bug 895274 part.157 Rename NS_QUERY_CHARACTER_AT_POINT to eQueryCharacterAtPoint r=smaug 2015-09-10 10:40:06 +09:00
Masayuki Nakano 4a34ce078a Bug 895274 part.154 Rename NS_QUERY_CARET_RECT to eQueryCaretRect r=smaug 2015-09-10 10:40:06 +09:00