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

7 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano e28c807e5a Bug 1533989 - Make InputEvent.data and InputEvent.dataTransfer not expose clipboard data if user disables clipboard events r=smaug
If user disables clipboard events, it means that they don't want to expose
clipboard data to web apps even if web apps cannot handle "paste" operation.
Therefore, they must not want to leak clipboard data with `InputEvent.data`
and `InputEvent.dataTransfer`.

This patch makes `InputEvent::GetData()` and `InputEvent::GetDataTransfer()`
returns empty string or new `DataTransfer` object which has only empty string
if:
- They are called by content JS.
- The event is a trusted event.
- `inputType` value is `insertFromPaste` or `insertFromPasteAsQuotation`.

The reason why we don't return null for both is, Input Events spec declares
`data` or `dataTransfer` shouldn't be null in the `inputType` values.  And
the reason why we don't return empty `DataTransfer` is, web apps may expect
at least one data is stored in non-null `dataTransfer` value.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 16:08:11 +00:00
Masayuki Nakano 6eadee9e6c Bug 998941 - part 2-1: Implement InputEvent.dataTransfer declared by Input Events r=smaug
InputEvent.dataTransfer is declared by Input Events Level 1 and Level 2 (i.e.,
not UI Events).  It's necessary for "beforeinput" event on contenteditable
elements because of with some InputEvent.inputType values on contenteditable,
InputEvent.dataTransfer is used instead of InputEvent.data.

According to the Chrome's behavior, if InputEvent.dataTransfer is created by
web apps, the DataTransfer object is mutable.  Otherwise, i.e., the event
represents user input, the DataTransfer object is read only.  We should follow
this behavior.

This is enabled by default.

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

--HG--
extra : moz-landing-system : lando
2019-02-19 06:32:11 +00:00
Masayuki Nakano 0f145fc8e5 Bug 998941 - part 1-1: Implement InputEvent.data of UI Events r=smaug
InputEvent.data notifies web apps of inserting/inserted text with "beforeinput"
and "input" events.  So, this is important especially for "beforeinput" event
listeners.  That's the reason why we need to support this before implementing
"beforeinput" event.

This patch adds it into InputEvent and make it enabled by default.

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

--HG--
extra : moz-landing-system : lando
2019-02-19 06:27:41 +00:00
Masayuki Nakano ed2040ac16 Bug 1447239 - Implement InputEvent.inputType r=smaug
This patch implements InputType.inputType which is declared by Input Events.
The attribute has already been implemented by Chrome and Safari.  Chrome
implements Input Events Level 1, but Safari implements Input Events Level 2.
 Difference between them is only whether it supports "insertFromComposition",
"deleteByComposition" and "deleteCompositionText".  This patch makes the
level switchable with pref and takes Level 1 by default because Level 2 is
still unstable around event order with composition events.

For reducing string copy cost at dispatching "input" event, this patch
makes EditorInternalInputEvent store valid input-type as enum class,
EditorInputType and resolves it to string value when
dom::InputEvent::GetInputType() is called.  Note that the reason why
this patch names the enum class as EditorInputType is, there is InputType
enum class already for avoiding conflict the name, this appends "Editor"
prefix because "input" and "beforeinput" events are fired only when an
editor has focus.

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

--HG--
extra : moz-landing-system : lando
2019-01-07 10:10:57 +00:00
Cosmin Sabou 679b5e2db1 Backed out 5 changesets (bug 1485040) for causing build bustages on test_mozwebidlcodegen. CLOSED TREE
Backed out changeset b417c2d937e8 (bug 1485040)
Backed out changeset c567c4c7438f (bug 1485040)
Backed out changeset 806c36cb2c4c (bug 1485040)
Backed out changeset 0fbb490ffc7f (bug 1485040)
Backed out changeset a9622e7761eb (bug 1485040)
2018-09-13 23:04:55 +03:00
Andrew McCreight 93b3b0138c Bug 1485040, part 5 - Automatically fix mode lines in WebIDL files r=qdot
This patch was generated by my modeline.py script.

MozReview-Commit-ID: EbVjPLwiUAT

Depends on D4159

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

--HG--
extra : moz-landing-system : lando
2018-09-13 19:30:51 +00:00
Masayuki Nakano ecab2beca9 Bug 993253 Implement DOM InputEvent interface with isComposing attribute r=smaug+ehsan 2014-04-10 16:11:37 +09:00