Commit graph

261 commits

Author SHA1 Message Date
Greg Tatum
ee2694c97d Bug 1719546 - Replace nsBidi with mozilla::intl::Bidi; r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D128793
2021-10-20 14:01:21 +00:00
Butkovits Atila
01c5e2aed8 Backed out 3 changesets (bug 1719546) for causing SM bustages at Bidi.h. CLOSED TREE
Backed out changeset c4d6ffc7e445 (bug 1719546)
Backed out changeset a1f7ed6c4251 (bug 1719546)
Backed out changeset e69fc596f2c3 (bug 1719546)
2021-10-19 21:09:47 +03:00
Greg Tatum
f250d90114 Bug 1719546 - Replace nsBidi with mozilla::intl::Bidi; r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D128793
2021-10-19 16:55:36 +00:00
Masayuki Nakano
347bc5719a Bug 1714914 - Make editor classes treat offset in parent node as uint32_t r=m_kato
It should be treated as `uint32_t` since DOM API does so.  However, there are
some exceptions:

* Result of `nsINode::ComputeIndexOf()`
* Result of `nsAString` methods

They return `-1` as not found, and anyway, they cannot treat large integer
than `INT32_MAX`.  Therefore, this patch does not touch around them.

Differential Revision: https://phabricator.services.mozilla.com/D118933
2021-06-30 07:07:28 +00:00
Kagami Sascha Rosylight
66ab2e605c Bug 1717552 - Remove dom.select_events.enabled r=masayuki,smaug
Differential Revision: https://phabricator.services.mozilla.com/D118639
2021-06-24 12:30:35 +00:00
Kagami Sascha Rosylight
5bce02c01c Bug 1717435 - Enable selectionchange listener without dom.select_events.textcontrols.enabled r=masayuki
`select` event is now fired from selectionchange listener and thus the listener should be enabled regardless of the flag.

Differential Revision: https://phabricator.services.mozilla.com/D118400
2021-06-22 00:08:56 +00:00
Kagami Sascha Rosylight
55dbc99e55 Bug 1713491 - Return std::pair from nsIFrame::GetOffsets r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D117520
2021-06-11 23:54:06 +00:00
Butkovits Atila
53cb932555 Backed out changeset aa6c7477c4d2 (bug 1713491) for causing build bustages on nsIFrame.cpp. CLOSED TREE 2021-06-12 00:12:06 +03:00
Kagami Sascha Rosylight
9d0b659349 Bug 1713491 - Return std::pair from nsIFrame::GetOffsets r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D117520
2021-06-11 18:53:28 +00:00
Dorel Luca
e1f4d9bb38 Backed out changeset 17e7b969b830 (bug 1713491) for Linux build bustage in gecko/dom/events/ContentEventHandler.cpp. CLOSED TREE 2021-06-11 17:52:10 +03:00
Kagami Sascha Rosylight
74760a9a0e Bug 1713491 - Return std::pair from nsIFrame::GetOffsets r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D117520
2021-06-11 11:37:11 +00:00
Kagami Sascha Rosylight
9a794d46fa Bug 1715882 - Return void from Selection::Clear and ::NotifySelectionListeners r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D117469
2021-06-11 09:10:35 +00:00
Kagami Sascha Rosylight
41fc1feef9 Bug 1714640 - Add AdjustFrameForLineStart call in Selection::ScrollIntoView r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D117009
2021-06-08 16:21:36 +00:00
Kartikaya Gupta
0cd36f6974 Bug 1694847 - Remove the expired SCROLL_INPUT_METHODS telemetry probe. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D116320
2021-05-31 21:36:35 +00:00
Kagami Sascha Rosylight
717d5d2aa5 Bug 1671768 - Part 4: Use MOZ_CAN_RUN_SCRIPT for Selection::RemoveAllRanges r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D103780
2021-02-03 21:52:48 +00:00
Kagami Sascha Rosylight
e0304db4c3 Bug 1671768 - Part 2: Use MOZ_CAN_RUN_SCRIPT for Selection::Extend r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D103778
2021-02-03 21:52:15 +00:00
Mirko Brodesser
1ea34c359f Bug 1688832: part 9) Change argument of nsFrameSelection::TakeFocus from pointer to reference. r=smaug
Simplification.

Differential Revision: https://phabricator.services.mozilla.com/D103772
2021-02-02 16:16:22 +00:00
Mirko Brodesser
4b75da3596 Bug 1688832: part 8) Declare nsFrameSelection::TakeFocus [[nodiscard]]. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D103616
2021-02-03 08:56:53 +00:00
nirmay
55420bffb0 Bug 1677643 - Replace nsIScrollableFrame::{HORIZONTAL, VERTICAL} with ScrollDirections. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D102087
2021-01-21 17:45:19 +00:00
Mirko Brodesser
af17c6956b Bug 1685303: part 16) Slightly simplify code in nsFrameSelection::TakeFocus and add logging. r=smaug
Depends on D101931

Differential Revision: https://phabricator.services.mozilla.com/D101932
2021-01-15 16:00:20 +00:00
Mirko Brodesser
0710c52ceb Bug 1685303: part 15) Move documentation of some methods of nsFrameSelection to the header. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101931
2021-01-15 15:53:55 +00:00
Mirko Brodesser
c0d32bffc5 Bug 1685303: part 10) Annotate nsFrameSelection::HandleClick with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101598
2021-01-14 13:24:36 +00:00
Mirko Brodesser
2f7cef4d64 Bug 1685303: part 5) Extend logging in nsFrameSelection::HandleClick. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101355
2021-01-11 15:05:25 +00:00
Mirko Brodesser
20f8199ab3 Bug 1685303: part 3) Add debug logging to nsFrameSelection::HandleClick. r=smaug
Depends on D100985

Differential Revision: https://phabricator.services.mozilla.com/D100988
2021-01-08 08:52:17 +00:00
Emilio Cobos Álvarez
a0c580e9a2 Bug 1676785 - Simplify XUL special code-path for <input> value setter. r=masayuki
This allows us to remove nsISelectionController.selectAll() and related
code too, and should not change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D97011
2020-12-02 12:48:41 +00:00
Mihai Alexandru Michis
89a2d40ee0 Backed out changeset 93cf5f317f98 (bug 1676785) for causing mochitest failures in test_input_value_set_preserve_undo.xhtml
CLOSED TREE
2020-12-02 14:05:18 +02:00
Emilio Cobos Álvarez
2b6c54e6c1 Bug 1676785 - Simplify XUL special code-path for <input> value setter. r=masayuki
This allows us to remove nsISelectionController.selectAll() and related
code too, and should not change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D97011
2020-12-02 10:44:25 +00:00
Kagami Sascha Rosylight
756976ae2b Bug 1615296 - Part 3: Fix remaining MOZ_CAN_RUN_SCRIPT warnings r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D93600
2020-10-15 19:12:47 +00:00
Kartikaya Gupta
264e82488a Bug 1670003 - Add back the scroll input methods telemetry. r=botond
This is mostly a revert of the patch in bug 1425686 that removed the old
probe, but rebased to new code locations and clang-formatted. The histogram
entry is also updated with new bug numbers and fields.

The next patch will refine some of these telemetry recording points; the patch
is split into two for easier reviewing as this part is basically what landed
originally.

Differential Revision: https://phabricator.services.mozilla.com/D92995
2020-10-10 17:41:47 +00:00
Masayuki Nakano
2fde14a338 Bug 1623918 - part 2: Mark nsINode::GetSelectionRootContent() and its root callers as MOZ_CAN_RUN_SCRIPT as far as possible r=smaug
This patch tries to mark root callers of `nsINode::GetSelectionRootContent()`
which calls `nsINode::GetAnonymousRootElementOfTextEditor()` as far as possible
(and reasonable).

It's used by `ContentEventHandler` so that a lot of methods of
`EventStateManager`, `ContentEventHandler`, `IMEContentObserver` which are main
users of it are also marked as `MOZ_CAN_RUN_SCRIPT`.  I think that this is
reasonable.

On the other hand, it might not be reasonable to mark `IMEStateManager` methods
as `MOZ_CAN_RUN_SCRIPT` for initializing `IMEContentObserver` because
`IMEStateManager` may be able to initialize `IMEContentObserver` asynchronously
and its root callers are in XUL layout code.  Therefore, this patch uses
`MOZ_CAN_RUN_SCRIPT_BOUNDARY` for `IMEStateManager` at least for now.

Differential Revision: https://phabricator.services.mozilla.com/D92730
2020-10-09 02:37:47 +00:00
Narcis Beleuzu
c163b394ef Backed out 2 changesets (bug 1623918) for crashtest failure on 1623918.html CLOSED TREE
Backed out changeset 519ca1b069e5 (bug 1623918)
Backed out changeset d8a09a5fea47 (bug 1623918)
2020-10-08 12:06:58 +03:00
Masayuki Nakano
da386ef224 Bug 1623918 - part 2: Mark nsINode::GetSelectionRootContent() and its root callers as MOZ_CAN_RUN_SCRIPT as far as possible r=smaug
This patch tries to mark root callers of `nsINode::GetSelectionRootContent()`
which calls `nsINode::GetAnonymousRootElementOfTextEditor()` as far as possible
(and reasonable).

It's used by `ContentEventHandler` so that a lot of methods of
`EventStateManager`, `ContentEventHandler`, `IMEContentObserver` which are main
users of it are also marked as `MOZ_CAN_RUN_SCRIPT`.  I think that this is
reasonable.

On the other hand, it might not be reasonable to mark `IMEStateManager` methods
as `MOZ_CAN_RUN_SCRIPT` for initializing `IMEContentObserver` because
`IMEStateManager` may be able to initialize `IMEContentObserver` asynchronously
and its root callers are in XUL layout code.  Therefore, this patch uses
`MOZ_CAN_RUN_SCRIPT_BOUNDARY` for `IMEStateManager` at least for now.

Differential Revision: https://phabricator.services.mozilla.com/D92730
2020-10-08 03:56:51 +00:00
Kagami Sascha Rosylight
11ef0ef23e Bug 1623413 - Part 2: Rename Collapse() to CollapseInLimiter() r=masayuki
Depends on D88702

Differential Revision: https://phabricator.services.mozilla.com/D88920
2020-09-03 03:45:26 +00:00
Mihai Alexandru Michis
0600dacd03 Backed out 3 changesets (bug 1623413) for causing failures in Selection_collapse.html
CLOSED TREE

Backed out changeset d3d67293f115 (bug 1623413)
Backed out changeset 75ed1b8a5c67 (bug 1623413)
Backed out changeset 0eef32d6a454 (bug 1623413)
2020-09-03 05:37:49 +03:00
Kagami Sascha Rosylight
010d7de462 Bug 1623413 - Part 2: Rename Collapse() to CollapseInLimiter() r=masayuki
Depends on D88702

Differential Revision: https://phabricator.services.mozilla.com/D88920
2020-09-02 23:42:27 +00:00
Kagami Sascha Rosylight
b6115988e8 Bug 1656041 - Part 2: Return a struct from GetFrameFromDirection r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D85317
2020-08-04 15:23:47 +00:00
Nathan Froyd
e3ebda1914 Bug 1223932 - delete guard object uses from the tree; r=jwalden
CLOSED TREE

We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Mihai Alexandru Michis
a911a108d0 Backed out changeset ac9c811bc427 (bug 1223932) for causing spidermonkey rust failures.
CLOSED TREE
2020-07-30 18:23:21 +03:00
Nathan Froyd
bec9f9b93a Bug 1223932 - delete guard object uses from the tree; r=jwalden
We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Kagami Sascha Rosylight
1afcf4d621 Bug 1630704 - Part 27: Remove nsFrame from inheritance chain r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81864
2020-07-06 22:29:42 +00:00
Kagami Sascha Rosylight
f92968ee05 Bug 1649931 - Part 3: Add nsIFrameEnumerator::Traverse() r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81954
2020-07-03 00:48:59 +00:00
Kagami Sascha Rosylight
f7e99ea037 Bug 1645879 - Detect reversed direction frame when collapsing selection r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D79739
2020-06-16 11:52:49 +00:00
Kagami Sascha Rosylight
ea53f4857d Bug 1644868 - Return pointer from GetPrimaryFrameFor* r=jfkthame
Those methods have two sources to check after call: the return value and the pointer. This can be confusing as a caller may think they should check both when they don't need to. Since the two always behaves together (a valid pointer + NS_OK, or nullptr + NS_ERROR_FAILURE), this replaces the return value with the pointer.

Differential Revision: https://phabricator.services.mozilla.com/D79196
2020-06-11 10:56:11 +00:00
Kagami Sascha Rosylight
5becfc7c3d Bug 1644511 - Part 2: Make selection collapsing follow bidi.edit.caret_movement_style r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D79005
2020-06-10 21:17:51 +00:00
Jonathan Kew
501e5caa97 Bug 1642223 - Fix behavior of AdjustNormalSelection when moving back into the maintained range from before it, to avoid collapsing to the end of the range. r=mbrodesser
Differential Revision: https://phabricator.services.mozilla.com/D78545
2020-06-10 08:31:39 +00:00
Kagami Sascha Rosylight
0046c51bb0 Bug 1644511 - Part 1: Make bidi.edit.caret_movement_style a static pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D79004
2020-06-10 00:33:51 +00:00
Mirko Brodesser
76dbaf2f21 Bug 1635709: part 29) Factor finding first and last cell of row or column out. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D77825
2020-06-04 09:04:39 +00:00
Mirko Brodesser
ab2db129d7 Bug 1635709: part 28) Declare some function arguments in nsFrameSelection const. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D77460
2020-06-04 09:03:47 +00:00
Mirko Brodesser
9dccdae144 Bug 1635709: part 27) clang-format previous changes in nsFrameSelection.cpp. r=masayuki
Simple application of `./mach clang-format -p
layout/generic/nsFrameSelection.cpp`. Separating this from previous
changes simplified reviewing and decreases the probability for mistakes.

Differential Revision: https://phabricator.services.mozilla.com/D77459
2020-06-02 08:43:04 +00:00
Mirko Brodesser
3b9ea20cb4 Bug 1635709: part 26) Remove some code duplication in HandleDragSelecting. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D77424
2020-06-02 09:08:34 +00:00