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

62 Коммитов

Автор SHA1 Сообщение Дата
Boris Zbarsky 25aa42d9a4 Bug 1455674 part 16. Remove most use of nsIDOMElement in dom. r=qdot 2018-04-26 23:37:34 -04:00
Boris Zbarsky ffa08d7425 Bug 1455674 part 9. Remove nsIDOMElement use from nsIFocusManager. r=qdot 2018-04-26 23:35:19 -04:00
Gijs Kruitbosch 7affe98785 Bug 1455379 - ignore key elements without a key attribute, r=bz,gandalf
MozReview-Commit-ID: 4vv4CKp5v9V

--HG--
extra : rebase_source : 52d50c1e41808b59b8787c8087e2774f3d2f4394
2018-04-20 12:48:20 +01:00
Boris Zbarsky 09bd9b6dd3 Bug 1455055 part 5. Clean up HandleEvent implementations in dom/xbl. r=masayuki
MozReview-Commit-ID: 1DOlnGP4Sri
2018-04-20 00:49:29 -04:00
Boris Zbarsky 2b6097ae6d Bug 1455055 part 1. Convert nsIDOMEventListener to taking an Event, not an nsIDOMEvent. r=masayuki
This does no cleanup other than what's needed to compile.  Cleanup coming up in
later patches.

MozReview-Commit-ID: 3sOnkj71n09
2018-04-20 00:49:29 -04:00
Masayuki Nakano b02ccefaa0 Bug 1438097 - nsXBLWindowKeyHandler::HandleEventOnCaptureInSystemEventGroup() should mark keyboard events which won't be fired on content in the default event group as "wait reply from remote process" r=smaug
BaseEventFlags::mOnlySystemGroupDispatchInContent was used only when the
key combination is reserved by chrome, and used for preventing to fire
in web content on non-e10s window (bug 1203059).

However, now, this is also used for preventing to fire keypress event for
non-printable key combinations on web contents in the default event group
(bug 1433101).  Therefore, now, we need to send events whose
mFlags.mOnlySystemGroupDispatchInContent is true because some event listeners
in the system event group in remote process may want to handle specific
keyboard events before nsXBLWindowKeyHandler.

This patch makes nsXBLWindowKeyHandler::HandleEventOnCaptureInSystemEventGroup()
treat KeyboardEvent whose mFlags.mOnlySystemGroupDispatchInContent is true
but which will be sent to remote process as usual event.

MozReview-Commit-ID: 4x0co9X2QV7

--HG--
extra : rebase_source : 260f05145bc3b80a90fa5114d982ebb5fec8f0fc
2018-02-14 15:21:15 +09:00
Boris Zbarsky 696520edca Bug 1436508 part 5. Switch xbl from nsIDOMKeyEvent to KeyboardEvent. r=masayuki
MozReview-Commit-ID: COqUWh5xjfH
2018-02-09 11:17:09 -05:00
Masayuki Nakano cb5853d299 Bug 1435530 - part 2: Make nsXBLWindowKeyHandler treat eAccessKeyNotFound as eKeyPress event r=enndeakin+6102
Modifiers of shortcut keys may be same as modifier of content access keys.

When focus is in the main process, such eKeyPress event is sent to remote
content first.  Then, and if it's not handled in the remote content,
eAccessKeyNotFound is dispatched into the DOM tree in the main process.
However, nsXBLWindowKeyHandler doesn't handle it as eKeyPress event.  So,
it causes that shortcut keys whose modifier conflicts with content access key
won't be handled.

This patch just makes nsXBLWindowKeyHandler treat eAccessKeyNotFound as
eKeyPress event even though other shortcut keys which are handled by JS
won't be executed.  Perhaps, we should stop using eAccessKeyNotFound but
it's too risky change for now.

MozReview-Commit-ID: IJltg5gwBc5

--HG--
extra : rebase_source : f456eade18cd4fefd2eab6e06f5b00156ac8ad59
2018-02-05 18:27:30 +09:00
Emilio Cobos Álvarez c8eb630ebe Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W
2017-12-25 17:50:10 +01:00
Emilio Cobos Álvarez ffdf5d2cb5 Backout changeset e43f568b3e9a (bug 1423990) because some OSX-only code still doesn't build. r=me 2017-12-25 12:55:45 +01:00
Emilio Cobos Álvarez c0959b2955 Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W

--HG--
extra : rebase_source : 09b82acb4f3d69e8a4345457ab217443bc28d6e2
2017-12-07 19:13:50 +01:00
Neil Deakin 695749c30c Bug 380637, move reserved key checking into ContentUtils so that it can be shared with menu accesskey checks , r=felipe 2017-11-09 18:42:39 -05:00
Neil Deakin ee8929c13f Bug 380637, add site-specific permissions to prevent pages from overriding keyboard shortcuts. This is done by preventing the key combination from being sent to the content page, r=felipe
Users can block the overriding of shortcuts using the permissions tab of the page info dialog, as with other permissions. Site permissions also allows the use of permissions.default.shortcuts to block overriding shortcuts for all sites.
2017-11-09 18:42:39 -05:00
Neil Deakin 9bd9459ef2 Bug 380637, add a general preference to prevent pages from overriding keyboard shortcuts. If a key doesn't specify the reserved attribute, this preference will be used, r=felipe 2017-11-09 18:42:39 -05:00
Nicholas Nethercote d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Nicholas Nethercote dfd3b7e7aa Bug 1400459 (part 2) - Devirtualize nsIAtom. r=heycam.
This patch merges nsAtom into nsIAtom. For the moment, both names can be used
interchangeably due to a typedef. The patch also devirtualizes nsIAtom, by
making it not inherit from nsISupports, removing NS_DECL_NSIATOM, and dropping
the use of NS_IMETHOD_. It also removes nsIAtom's IIDs.

These changes trigger knock-on changes throughout the codebase, changing the
types of lots of things as follows.

- nsCOMPtr<nsIAtom> --> RefPtr<nsIAtom>

- nsCOMArray<nsIAtom> --> nsTArray<RefPtr<nsIAtom>>
  - Count() --> Length()
  - ObjectAt() --> ElementAt()
  - AppendObject() --> AppendElement()
  - RemoveObjectAt() --> RemoveElementAt()

- ns*Hashtable<nsISupportsHashKey, ...> -->
  ns*Hashtable<nsRefPtrHashKey<nsIAtom>, ...>

- nsInterfaceHashtable<T, nsIAtom> --> nsRefPtrHashtable<T, nsIAtom>
  - This requires adding a Get() method to nsRefPtrHashtable that it lacks but
    nsInterfaceHashtable has.

- nsCOMPtr<nsIMutableArray> --> nsTArray<RefPtr<nsIAtom>>
  - nsArrayBase::Create() --> nsTArray()
  - GetLength() --> Length()
  - do_QueryElementAt() --> operator[]

The patch also has some changes to Rust code that manipulates nsIAtom.

MozReview-Commit-ID: DykOl8aEnUJ

--HG--
extra : rebase_source : 254404e318e94b4c93ec8d4081ff0f0fda8aa7d1
2017-09-26 08:33:21 +10:00
Masayuki Nakano 71cc15557e Bug 1387406 - part5: nsXBLWindowKeyHandler should treat editor as HTMLEditor r=smaug
Editor treated in nsXBLWindowKeyHandler is always HTMLEditor.  So, it should treat the editor as is.

MozReview-Commit-ID: 7uE2p8t5cNW

--HG--
extra : rebase_source : 66b2f42d9d0281f4a244f9cd1ceb077e32ac3515
2017-08-07 15:08:02 +09:00
Ryan Hunt ccfa40939c Bug 1385071 - Don't do the default action for key inputs that are handled by APZ. r=masayuki
Before if a key input was handled with APZ we wouldn't dispatch it to content,
because it was guaranteed there wouldn't be any key listeners. Now we are
allowing passive key listeners behind a pref, and so we will sometimes handle
a key input in APZ and dispatch it to content. When this happens, XBL shouldn't
do the default action, otherwise we would double scroll.

MozReview-Commit-ID: 2zfszQ3itkp

--HG--
extra : rebase_source : 724b110fd55c5935df589f1cbcc0b3380028a1ed
2017-07-30 13:08:17 -04:00
Masayuki Nakano 0ebdc75b7b Bug 1333459 - part2-3: Make nsMenuBarListener::KeyPress() wait reply from remote process if the eKeyPress event will be sent to a remote process later r=smaug
nsMenuBarListener::KeyPress() is eKeyEvent listener in the system event group.  If the target is a remote process, it shouldn't handle accesskey immediately because preceding eKeyDown event may be consumed in the remote process or eKeyPress event itself may be consumed in the remote process.

This patch makes nsMenuBarListener::KeyPress() mark eKeyPress event as "waiting reply from remote process" only when the event matches with a menu item's accesskey and it will be send to a remote process later.  Then, reply event should be handled in this method if it's available.

MozReview-Commit-ID: KOpCVgElnca

--HG--
extra : rebase_source : 881ec01f5c8e21c790bf9a8c3167d6c3f932524a
2017-07-19 18:39:34 +09:00
Masayuki Nakano 57f359b0de Bug 1377653 - part2: Add helper methods to WidgetEvent and BaseEventFlags to manage propagation state between parent process and remote process r=smaug
Currently, we have 2 bool flags (and optional 2 bool flags with related purpose) for managing propagation state between parent process and remote process.  However, it's really complicated.  Actually, setting these flags and referring the flags is usually follow explanation.

So, for making simpler, WidgetEvent and BaseEventFlags should have some utility methods for making them as self documented code.

This patch moves WidgetKeyboardEvent::mIsReserved to BaseEventFlags::mIsReservedByChrome.  That allows us to manage the cross process event propagation state in same place.

MozReview-Commit-ID: IXEDQJ4GpAZ

--HG--
extra : rebase_source : 5b63ac4f1d15e40e8bfc88423e336de28caa8ab6
2017-07-05 13:58:41 +09:00
Ryan Hunt 341325dac4 Bug 1376549 - Prevent APZ handling of keyboard shortcuts hardcoded in ESM. r=kats
MozReview-Commit-ID: 1IolnCXGPjQ

--HG--
extra : rebase_source : 748ed1700383f255d4c32f82d7e5f1455ede8d50
2017-06-28 16:06:47 -04:00
Ryan Hunt fb04e72bad Bug 1351783 part 19 - Rename Keyboard.h to KeyboardMap.h. r=masayuki
This is a better name for the header that matches its main class.

MozReview-Commit-ID: KSt9LVT3yRR

--HG--
rename : gfx/layers/apz/src/Keyboard.cpp => gfx/layers/apz/src/KeyboardMap.cpp
rename : gfx/layers/apz/src/Keyboard.h => gfx/layers/apz/src/KeyboardMap.h
extra : rebase_source : ec4c9ec5afa8479dc4cd3e987fc3293f047beb9e
extra : histedit_source : caa3a11043fc1ccdff3d7853eda69a0a3dfff99e
2017-06-15 18:06:00 -04:00
Ryan Hunt 18867b218f Bug 1351783 part 5 - Add a KeyboardMap type. r=kats,masayuki
The XBL bindings used for scrolling are managed by a nsXBLWindowKeyHandler. This
class loads the handlers and has logic for searching through them to match a
keyboard event. This commit adds a KeyboardMap class for storing KeyboardShortcuts
and for mirroring the search logic of nsXBLWindowKeyHandler.

MozReview-Commit-ID: 5BmFBilKTJy

--HG--
extra : rebase_source : 96cd0f5808ba6c4926e9da368ab3780b1d9d1449
2017-06-05 18:29:04 -05:00
Ting-Yu Lin 2b96e807e3 Bug 1367286 - Remove loading user html binding via "dom.userHTMLBindings.uri". r=bz
MozReview-Commit-ID: 175udoeRUmT

--HG--
extra : rebase_source : fd1b3cbc546d972bba184223426e5d4761b714b9
2017-05-24 13:10:12 -04:00
Ting-Yu Lin 200de4b5fa Bug 1363640 Part 3 - Strip whitespaces for files under dom/xbl. r=heycam
MozReview-Commit-ID: 3WBsFIgFZU9

--HG--
extra : rebase_source : 63699a4f10a418171cf9fa3205761c7b53129360
2017-05-09 20:45:11 -07:00
Neil Deakin 61da00566d Bug 1297342, reserved attribute should be on key element not on the command, r=felipe 2017-01-19 13:57:11 -05:00
Nicholas Nethercote 34dcc7b852 Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm.
This change avoids lots of false positives for Coverity's CHECKED_RETURN
warning, caused by NS_WARN_IF's current use in both statement-style and
expression-style.

In the case where the code within the NS_WARN_IF has side-effects, I made the
following change.

> NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));
> -->
> Unused << NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));

In the case where the code within the NS_WARN_IF lacks side-effects, I made the
following change.

> NS_WARN_IF(!condWithoutSideEffects);
> -->
> NS_WARNING_ASSERTION(condWithoutSideEffects, "msg");

This has two improvements.
- The condition is not evaluated in non-debug builds.
- The sense of the condition is inverted to the familiar "this condition should
  be true" sense used in assertions.

A common variation on the side-effect-free case is the following.

> nsresult rv = Fn();
> NS_WARN_IF_(NS_FAILED(rv));
> -->
> DebugOnly<nsresult rv> = Fn();
> NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Fn failed");

--HG--
extra : rebase_source : 58788245021096efa8372a9dc1d597a611d45611
2016-09-02 17:12:24 +10:00
Makoto Kato fbbac87fd2 Bug 1253284 - Allow reserved attribute without command attribute r=masayuki
MozReview-Commit-ID: A2aEOgTx5Jz

--HG--
extra : rebase_source : f0ecefde7d39b63caf1b69cb88e3ed49b1bef084
2016-05-06 18:38:44 +09:00
Masayuki Nakano 8f62c5aa3c Bug 1257759 part.8 nsXBLWindowKeyHandler should handle eKeyDownOnPlugin and eKeyUpOnPlugin events only with reserved shortcut key handlers r=smaug
eKeyDownOnPlugin (mozkeydownonplugin) and eKeyUpOnPlugin (mozkeyuponplugin) should execute if the key combination is reserved by the linked <command> element.

Note that there is no eKeyPressOnPlugin.  Therefore, eKeyDownOnPlugin may execute shortcut key handler which is registered as a keypress event handler.

MozReview-Commit-ID: CpjsFW02y26

--HG--
extra : rebase_source : 361be61bc6ff0213e3386427878d2f81321ca0df
2016-04-23 02:12:54 +09: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 9170348baf Bug 1259656 part.7 Rename WidgetEvent::originalTarget to WidgetEvent::mOriginalTarget r=smaug
MozReview-Commit-ID: G1WVCWkS0Lt

--HG--
extra : rebase_source : e4790266f4efa33269c073bca1d98f9e8e6c90d7
2016-04-19 01:33:23 +09:00
Jonathan Watt 9480920b04 Bug 1263785 - Kill off the deprecated nsINode::GetCurrentDoc. r=baku 2016-03-31 12:46:32 +01:00
Jonathan Watt fb7bb15e68 Bug 1263782 - Kill off the deprecated nsINode::IsInDoc(). r=baku 2016-03-31 11:58:25 +01:00
Nicholas Nethercote d376f9f82e Bug 1260871 - Remove do_GetAtom() and rename NS_NewAtom() as NS_Atomize(). r=erahm.
do_GetAtom() is currently just a synonym for NS_NewAtom().

--HG--
extra : rebase_source : f4409784f931616cbc300591e6b843d30805c273
2016-03-29 10:09:43 +11:00
Masayuki Nakano 2748ab1e88 Bug 1256589 part.3 Move the implementation of StopCrossProcessForwarding() from dom::Event to WidgetEvent r=smaug
MozReview-Commit-ID: KXeVxCJ05Mo

--HG--
extra : rebase_source : 2f8d49412e32eec4a0a8f599984d057637f491a1
extra : source : a68c4bb4878612d61425d87a47b4eca78f271240
2016-03-22 16:01:46 +09:00
Masayuki Nakano 3af2033805 Bug 1154183 part.7 Don't dispatch preceding keydown events of reserved keypress events on content in the default event group r=smaug
MozReview-Commit-ID: 5zdkdfNxbxb
2016-03-22 15:05:25 +09:00
Masayuki Nakano ac1b2491bc Bug 1154183 part.6 Add nsXBLWindowKeyHandler::IsExecuteableElement() r=smaug
MozReview-Commit-ID: 8FyDzkfHihH
2016-03-19 23:16:21 +09:00
Masayuki Nakano 5b0e7ecdae Bug 1154183 part.5 Make nsXBLWindowKeyHandler::GetElementForHandler() use early return style r=smaug
MozReview-Commit-ID: CezO0rZBOEl
2016-03-19 23:12:39 +09:00
Masayuki Nakano d62ef1ba67 Bug 1154183 part.4 Implement nsXBLWindowKeyHandler::GetElementForHandler() r=smaug
MozReview-Commit-ID: 9qsOLU3QCnr
2016-03-18 11:25:22 +09:00
Masayuki Nakano 77166dd790 Bug 1154183 part.3 Clean up some variable names in nsXBLWindowKeyHandler::WalkHandlersAndExecute() r=smaug
MozReview-Commit-ID: 17fCUBwFf92
2016-03-18 11:25:08 +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
Masayuki Nakano 10086a4e8d Bug 1203059 part.3 Installing and removing keyboard event listeners of nsXBLWindowKeyHandler should be done by the class itself r=smaug 2016-03-16 10:58:28 +09:00
Masayuki Nakano 86ac26d06f Bug 1203059 part.1 nsXBLWincowKeyHandler mark WidgetEvent::mFlags if it's reserved by chrome before the event is dispatched into the content r=smaug 2016-03-16 10:58:28 +09:00
Aidin Gharibnavaz 6863090c8a Bug 1235830 - Renaming GetInternalNSEvent to WidgetEvent, in nsIDOMEvent r=smaug
MozReview-Commit-ID: Hm8Owq17KXn

--HG--
extra : transplant_source : 2%82%D5%89%19%94%7C%E7%CA1%99%B5%24%1F5%E1%C0%1F%DE%07
2016-02-12 19:10:07 +03:30
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
Kyle Huey 91efc5a86c Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
Aidin Gharibnavaz e6606278c0 Bug 1230216 - Changing nsIDOM*Event interfaces so that they don't inherit nsIDOMEvent. r=smaug
All the event interfaces changed except for nsIDOMUIEvent and its inheritors.

--HG--
extra : transplant_source : %A5U%3F%80%2B%DD%01%F4%D8%21%F2%E9z%C1%D6%AA%CC%D4%EC%F8
2016-01-12 07:49:08 +03:30
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