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

36 Коммитов

Автор SHA1 Сообщение Дата
Simon Giesecke 61be6c6c35 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/events. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D63164

--HG--
extra : moz-landing-system : lando
2020-02-20 15:56:28 +00:00
Boris Zbarsky 14c30e58d6 Bug 1578173 part 4. Switch event subclasses to constructor operations. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D45391

--HG--
extra : moz-landing-system : lando
2019-09-11 14:35:28 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Masayuki Nakano 2d19d947df Bug 1502795 - Set keyCode or charCode of keypress event whose value is zero to the other's non-zero value by default again unless dispatched on known broken web apps r=smaug
This patch re-enables the new behavior of bug 1479964, to set keyCode or
charCode of keypress event whose value is zero to the other's non-zero value.

However, some web apps are still broken with the new behavior.  Therefore,
this patch adds a blacklist to keep using our legacy behavior in some specific
web apps.

Note that Google Docs, Gmail and Remember The Milk are reported as broken.
However, I don't see any broken shortcut with Gmail.  Therefore, this patch
adds only Google Docs and Remeber The Milk into the blacklist.

Differential Revision: https://phabricator.services.mozilla.com/D10322

--HG--
extra : moz-landing-system : lando
2018-11-07 06:39:10 +00:00
Tim Huang 0a30f56cd5 Bug 1363508 - Part 1: Spoofing pen/touch pointer events into mouse pointer events when fingerprinting resistance is on r=arthuredelstein,masayuki,smaug
The pointerType field in the pointer event will reveal the details of
users' hardware; this is a fingerprinting vector. So, we would spoof all
types of pointer events into mouse type pointer events for protecting
users from browser fingerprinting when fingerprinting resistance is on.

In this patch, we would spoof the pointerType as well as other fields
that mouse pointer events don't support, like pressure, tiltX/Y and so
on when fingerprinting resistance is on.

Differential Revision: https://phabricator.services.mozilla.com/D6003

--HG--
extra : moz-landing-system : lando
2018-10-09 11:55:43 +00:00
Masayuki Nakano 06267cb849 Bug 1479964 - Set KeyboardEvent.keyCode and KeyboardEvent.charCode to same value if the event is "keypress" event r=smaug
Chrome sets both KeyboardEvent.keyCode and KeyboardEvent.charCode of "keypress"
event to same value.  On the other hand, our traditional behavior is, sets
one of them to 0.

Therefore, we need to set keyCode value to charCode value if the keypress
event is caused by a non-function key, i.e., it may be a printable key with
specific modifier state and/or different keyboard layout for compatibility
with Chrome.  Similarly, we need to set charCode value to keyCode value if
the keypress event is caused by a function key which is not mapped to producing
a character.

Note that this hack is for compatibility with Chrome.  So, for now, it's enough
to change the behavior only for "keypress" event handlers in web content.  If
we completely change the behavior, we need to fix a lot of default handlers
and mochitests too.  However, it's really difficult because default handlers
check whether keypress events are printable or not with following code:

> if (event.charCode &&
>     !event.altKey && !event.ctrlKey && !event.metaKey) {

or

> if (!event.keyCode &&
>     !event.altKey && !event.ctrlKey && !event.metaKey) {

So, until we stop dispatching "keypress" events for non-printable keys,
we need complicated check in each of them.

And also note that this patch changes the behavior of KeyboardEvent::KeyCode()
when spoofing is enabled and the instance is initialized by initKeyEvent() or
initKeyboardEvent().  That was changed by bug 1222285 unexpectedly and keeping
the behavior makes patched code really ugly.  Therefore, this takes back the
old behavior even if spoofing is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D7974

--HG--
extra : moz-landing-system : lando
2018-10-09 04:43:37 +00:00
Jeff Gilbert 5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Arthur Edelstein 67294b1767 Bug 1438795 - Spoof KeyboardEvent.which for privacy.resistFingerprinting. r=masayuki, r=smaug 2018-02-20 16:51:00 -05:00
Boris Zbarsky 25715415a1 Bug 1436902 part 2. Use NS_INLINE_DECL_REFCOUNTING_INHERITED for some classes that have otherwise-empty QI impls. r=mccr8
MozReview-Commit-ID: 95xACATqz7p
2018-02-12 15:43:55 -05:00
Boris Zbarsky 034e47c66b Bug 1436508 part 12. Remove nsIDOMKeyEvent. r=masayuki
MozReview-Commit-ID: 8giqG5iHiIf
2018-02-09 11:17:10 -05:00
Boris Zbarsky 29c1a6e2e2 Bug 1436508 part 8. Remove unused nsIDOMKeyEvent members. r=masayuki
MozReview-Commit-ID: 57xpY8vNfW2
2018-02-09 11:17:09 -05:00
Boris Zbarsky d6140ab21c Bug 1436508 part 7. Remove nsIDOMKeyEvent usage from formfill and spellcheck. r=masayuki
The various event header changes are to avoid forcing random places to include nsGlobalWindowInner.h

MozReview-Commit-ID: 4THIjj6kIXv
2018-02-09 11:17:09 -05: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
Tim Huang 8933d9d799 Bug 1222285 - Part 1: Spoofing the keyboard event to mimc a certain keyboard layout according to the content-language of the document when 'privacy.resistFingerprinting' is true. r=arthuredelstein,masayuki,smaug
This patch makes Firefox to spoof keyboardEvent.code, keyboardEvent.keycode and
modifier states, for 'Shift', 'Alt', 'Control' and 'AltGraph', when 'privacy.resistFingerprinting'
is true. Firefox will spoof keyboard events as a certain keyboard layout according
to the content language of the document, for example, we use US English keyboard for
English content. Right now, it only supports English contents, we will add more
support for more languages later. The spoofing only affects content, chrome
can still see real keyboard events.

MozReview-Commit-ID: 40JPvwLmMMB

--HG--
extra : rebase_source : 870224ba4f87b3e336c5b061ac6859dd1c48c4f2
2017-08-29 11:33:27 +08:00
Nika Layzell c223b9ff2d Bug 1414974 - Part 6: Change WebIDL bindings to refer to nsGlobalWindowInner rather than nsGlobalWindow, r=bz
MozReview-Commit-ID: KbCpDFoWyTe
2017-11-09 10:44:49 -05:00
Aryeh Gregor 2df3e475b4 Bug 1387828 - Reinstate support for initKeyboardEvent; r=smaug
https://github.com/w3c/uievents/issues/112

This is supported by all other UAs.  In the past we had compatibility
problems when trying to add support, but it seems these might be fixed
if we make all arguments optional beyond the first.

The interface chosen for the method is from the spec, which has been
updated to match Chrome.  This is also very similar to WebKit, but the
final four arguments are different from IE.

MozReview-Commit-ID: 36AeX1JwJTt

--HG--
extra : rebase_source : 28b298d370f0f9a5ab4090a71a2aae91f1d90025
2017-08-06 16:52:39 +03:00
chunminchang c2b718ebb8 Bug 1110030 - part5 - Expose KeyboardEventInit dictionary. r=masayuki, r=smaug 2016-03-15 13:46:29 +08:00
Kyle Huey 91efc5a86c Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
Aryeh Gregor 5aeef0231d Bug 874842 - Return Event instead of nsIDOMEvent 2015-08-12 14:39:31 +03:00
Andrew McCreight 9e8f4b219e Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Ehsan Akhgari 883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Boris Zbarsky dc24477d79 Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp.  The
rest of this diff was generated by running the following commands:

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 10:13:33 -04:00
Gina Yeh 1d9d1f4c1f Bug 989198, Patch 2: Implementation of BeforeAfterKeyboardEvent, sr=smaug, r=masayuki. 2014-11-03 15:05:32 +08:00
Olli Pettay 3b8be5cd0d Bug 1084421 - Only Events with a wrapper should trigger GC more likely, r=mccr8
--HG--
extra : rebase_source : 398e18dfc3d103ee139cc3c5d49710855c925e82
2014-10-18 02:16:58 +03:00
Ryan VanderMeulen f00e2738a4 Backed out 6 changesets (bug 989198, bug 1082963) for causing bug 1083231.
Backed out changeset a7c972407578 (bug 1082963)
Backed out changeset 94d1b30bde00 (bug 989198)
Backed out changeset 01e064ceb505 (bug 989198)
Backed out changeset f5a538109e36 (bug 989198)
Backed out changeset 3ff227d79d74 (bug 989198)
Backed out changeset 186743fc6f6d (bug 989198)

CLOSED TREE
2014-10-16 12:57:18 -04:00
Gina Yeh 303bfb5736 Bug 989198, Patch 2: Implementation of BeforeAfterKeyboardEvent, sr=smaug, r=masayuki.
---
 dom/events/BeforeAfterKeyboardEvent.cpp          |   92 ++++++++++++++++++++++
 dom/events/BeforeAfterKeyboardEvent.h            |   45 +++++++++++
 dom/events/EventDispatcher.cpp                   |    3 +
 dom/events/KeyboardEvent.cpp                     |   60 ++++++++------
 dom/events/KeyboardEvent.h                       |    8 +-
 dom/events/moz.build                             |    2 +
 dom/events/test/test_all_synthetic_events.html   |    4 +
 dom/interfaces/events/nsIDOMEvent.idl            |    7 ++
 dom/tests/mochitest/general/test_interfaces.html |   48 ++++++-----
 dom/webidl/BeforeAfterKeyboardEvent.webidl       |   24 ++++++
 dom/webidl/moz.build                             |    1 +
 11 files changed, 250 insertions(+), 44 deletions(-)
 create mode 100644 dom/events/BeforeAfterKeyboardEvent.cpp
 create mode 100644 dom/events/BeforeAfterKeyboardEvent.h
 create mode 100644 dom/webidl/BeforeAfterKeyboardEvent.webidl
2014-10-14 15:09:20 +08:00
Benoit Jacob 9f1b7a6188 Bug 1035394 - Fix dangerous public destructors in dom/events - r=smaug 2014-07-08 17:23:17 -04:00
Masayuki Nakano aa909719cd Bug 865649 part.1 Implement KeyboardEvent.code r=smaug 2014-05-25 11:08:58 +09:00
Masayuki Nakano 5e612fc7b4 Bug 999645 Cancel implementing KeyboardEvent.initKeyboardEvent() because it completely breaks feature detection in web apps r=smaug 2014-04-25 13:16:20 +09:00
Masayuki Nakano 02d157a1ed Bug 930893 part.2 Implement KeyboardEvent.initKeyboardEvent() r=smaug 2014-04-14 15:37:48 +09:00
Masayuki Nakano d930f4e3f8 Bug 930893 part.1 Implement constructor of KeyboardEvent r=smaug 2014-04-14 15:37:47 +09:00
Masayuki Nakano 7cede8a035 Bug 993234 part.1 Implement KeyboardEvent.isComposing r=smaug 2014-04-10 16:11:36 +09:00
Boris Zbarsky 79dab91ff6 Bug 991742 part 8. Remove the "aScope" argument of WebIDL/nsWrapperCache WrapObject() methods. r=bholley
This patch was mostly generated with the following command:

find . -name "*.h" -o -name "*.cpp" | xargs sed -e '/WrapObject(JSContext/ {; N; s/\(WrapObject(JSContext *\* *a\{0,1\}[Cc]x\),\n\{0,1\} *JS::Handle<JSObject\*> a\{0,1\}[sS]cope/\1/ ; }' -i ""

and then reverting the changes that made to
dom/bindings/BindingUtils.h, since those WrapObject methods are not
the ones we're trying to change here, plus a bunch of manual fixups
for cases that this command did not catch (including all the callsites
of WrapObject()).
2014-04-08 18:27:18 -04:00
Boris Zbarsky d4bd64ee2c Bug 991742 part 6. Remove the "aScope" argument of binding Wrap() methods. r=bholley
This patch was mostly generated with this command:

find . -name "*.h" -o -name "*.cpp" | xargs sed -e 's/Binding::Wrap(aCx, aScope, this/Binding::Wrap(aCx, this/' -e 's/Binding_workers::Wrap(aCx, aScope, this/Binding_workers::Wrap(aCx, this/' -e 's/Binding::Wrap(cx, scope, this/Binding::Wrap(cx, this/' -i ""

plus a few manual fixes to dom/bindings/Codegen.py, js/xpconnect/src/event_impl_gen.py, and a few C++ files that were not caught in the search-and-replace above.
2014-04-08 18:27:17 -04:00
Masayuki Nakano e4686896dc Bug 975688 part.26 Rename nsDOMUIEvent to mozilla::dom::UIEvent r=smaug
--HG--
rename : dom/events/nsDOMUIEvent.cpp => dom/events/UIEvent.cpp
rename : dom/events/nsDOMUIEvent.h => dom/events/UIEvent.h
2014-02-28 23:58:43 +09:00
Masayuki Nakano 995c887975 Bug 975688 part.11 Rename nsDOMKeyboardEvent to mozilla::dom::KeyboardEvent r=smaug
--HG--
rename : dom/events/nsDOMKeyboardEvent.cpp => dom/events/KeyboardEvent.cpp
rename : dom/events/nsDOMKeyboardEvent.h => dom/events/KeyboardEvent.h
2014-02-27 19:51:13 +09:00