Commit Graph

304 Commits

Author SHA1 Message Date
Mirko Brodesser
e6e5c6c7ce Bug 1633448: part 7) Add StyledRanges::UnregisterSelection. r=hsivonen
One step closer towards privatizing `StyledRanges::mRanges`.

Depends on D73234

Differential Revision: https://phabricator.services.mozilla.com/D73430
2020-05-04 10:11:13 +00:00
Mirko Brodesser
18aaa242c9 Bug 1633448: part 6) Change IsUserSelectionNotCollapsed to IsUserSelectionCollapsed. r=hsivonen
Removes unnecessary double negations.

Differential Revision: https://phabricator.services.mozilla.com/D73234
2020-05-04 10:11:13 +00:00
Mirko Brodesser
fa59f55384 Bug 1633448: part 5) Rename AreUserSelectedRangesNonEmpty to IsUserSelectionNotCollapsed. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D73233
2020-05-04 10:11:12 +00:00
Mirko Brodesser
9b36b46be4 Bug 1633448: part 4) Annotate Selection::SetAnchorFocusToRange with MOZ_CAN_RUN_SCRIPT. r=smaug
Depends on D72803

Differential Revision: https://phabricator.services.mozilla.com/D72804
2020-04-28 16:15:52 +00:00
Mirko Brodesser
6d955c4792 Bug 1633448: part 2) Rename nsFrameSelection::GetTableCellSelection to IsInTableSelectionMode. r=smaug
Depends on D72688

Differential Revision: https://phabricator.services.mozilla.com/D72689
2020-04-27 19:34:53 +00:00
Mirko Brodesser
67f895532d Bug 1633448: part 1) Move Selection::SubtractRange to StyledRanges. r=smaug
`StyledRanges should have as few dependencies to `Selection` as
possible.

Differential Revision: https://phabricator.services.mozilla.com/D72688
2020-04-27 19:26:25 +00:00
Simon Giesecke
ea268054bd Bug 1628715 - Part 7: Add MOZ_NONNULL_RETURN to infallible nsTArray::AppendElements. r=xpcom-reviewers,necko-reviewers,nika,valentin
Differential Revision: https://phabricator.services.mozilla.com/D70831
2020-04-24 13:31:14 +00:00
Simon Giesecke
eecf28b6bc Bug 1628715 - Part 5: Add MOZ_NONNULL_RETURN to infallible nsTArray::InsertElementsAt. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D70403
2020-04-24 13:26:13 +00:00
Kristen Wright
2f69894345 Bug 1626388 - Convert dom.select_events.textcontrols.enabled to static pref r=njn
Converts dom.select_events.textcontrols.enabled to a static pref.

Differential Revision: https://phabricator.services.mozilla.com/D69614
2020-04-06 23:30:18 +00:00
Mirko Brodesser
4883ada17c Bug 1623858: part 26) Annotate MaybeAddRangeAndTruncateOverlaps with MOZ_CAN_RUN_SCRIPT. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D69179
2020-04-01 11:42:16 +00:00
Mirko Brodesser
774ebb0fa4 Bug 1623858: part 25) Factor AreUserSelectedRangesNonEmpty out. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D68962
2020-03-31 13:59:09 +00:00
Mirko Brodesser
855ba86f73 Bug 1623858: part 24) Use local doc variable. r=masayuki
Depends on D68960

Differential Revision: https://phabricator.services.mozilla.com/D68961
2020-03-31 12:24:36 +00:00
Mirko Brodesser
b27707f8c1 Bug 1623858: part 23) Factor dispatching selectstart event out. r=masayuki
Simplifies its caller.

Differential Revision: https://phabricator.services.mozilla.com/D68960
2020-03-31 12:22:05 +00:00
Mirko Brodesser
20e62ac6ce Bug 1623858: part 22) Move focusing common editing host to Selection::StyledRanges. r=masayuki
Simplifies understanding `Selection::NotifySelectionListeners`.

Differential Revision: https://phabricator.services.mozilla.com/D68809
2020-03-31 08:21:39 +00:00
Mirko Brodesser
df700a2abc Bug 1623858: part 19) Remove superfluous nsAutoScrollTimer::Init. r=hsivonen
Depends on D68578

Differential Revision: https://phabricator.services.mozilla.com/D68579
2020-03-30 08:41:52 +00:00
Mirko Brodesser
d1a20aff11 Bug 1623858: part 18) Assert Selection::StopAutoScrollTimer is only called for eNormal Selections. r=hsivonen
Depends on D68577

Differential Revision: https://phabricator.services.mozilla.com/D68578
2020-03-30 08:39:08 +00:00
Mirko Brodesser
a7cc359418 Bug 1623858: part 17) Assert accessible caret methods in Selection are only called for eNormal Selections. r=hsivonen
Depends on D68576

Differential Revision: https://phabricator.services.mozilla.com/D68577
2020-03-30 08:36:55 +00:00
Mirko Brodesser
7b4bef2edf Bug 1624633: part 9) Move FindRangeData. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D68225
2020-03-27 11:05:48 +00:00
Mirko Brodesser
4ca56926b2 Bug 1624633: part 8) Move GetCommonEditingHostForAllRanges. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D68224
2020-03-27 11:05:43 +00:00
Mirko Brodesser
ab81e8c7a3 Bug 1624633: part 7) Move MaybeAddRangeAndTruncateOverlaps. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D68223
2020-03-27 11:26:25 +00:00
Mirko Brodesser
cf4857243e Bug 1624633: part 6) Annotate nsRange::RegisterSelection with MOZ_CAN_RUN_SCRIPT. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D68222
2020-03-27 11:11:02 +00:00
Mirko Brodesser
40b881656a Bug 1624633: part 5) Move HasEqualRangeBoundariesAt. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D68221
2020-03-27 11:03:57 +00:00
Mirko Brodesser
6781b8ab98 Bug 1624633: part 4) Move GetIndicesForInterval. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D68220
2020-03-27 11:19:50 +00:00
Mirko Brodesser
6fd24e539e Bug 1624633: part 3) Move FindInsertionPoint. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D68219
2020-03-27 11:25:16 +00:00
Mirko Brodesser
143a1044d7 Bug 1624633: part 2) Move Selection::RemoveRangeInternal to StyledRanges::RemoveRangeAndUnregisterSelection. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D68218
2020-03-27 11:02:37 +00:00
Mirko Brodesser
7d343d9f19 Bug 1624633: part 1) Move Selection::mRanges to StyledRanges struct. r=hsivonen
This allows methods operating on the ranges to be moved to that struct.

To see where this leads to, consider the following reviews.

Differential Revision: https://phabricator.services.mozilla.com/D68217
2020-03-27 11:21:25 +00:00
Mirko Brodesser
3fa26147a9 Bug 1623858: part 14) Incorporate feedback of part 12. r=smaug
Forgot to update the review on Phabricator.

Differential Revision: https://phabricator.services.mozilla.com/D68333
2020-03-26 12:23:30 +00:00
Mirko Brodesser
7b4104ee33 Bug 1623858: part 12) Factor determining "selectstart" event target out. r=smaug
Depends on D68008

Differential Revision: https://phabricator.services.mozilla.com/D68009
2020-03-25 15:39:37 +00:00
Mirko Brodesser
d23dd7c8e6 Bug 1623858: part 11) Split Selection::AddRangesForSelectableNodes. r=smaug
Depends on D67848

Differential Revision: https://phabricator.services.mozilla.com/D68008
2020-03-25 15:36:54 +00:00
Mirko Brodesser
c0b7a5a8cb Bug 1623858: part 10) Simplify Selection::AddRangesForSelectableNodes's signature. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D67848
2020-03-25 14:28:40 +00:00
Mirko Brodesser
9544770963 Bug 1622752: annotate Selection::ScrollIntoView with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D67002
2020-03-16 21:04:46 +00:00
Mirko Brodesser
b96d857176 Bug 1623333: part 4) Assert Selection's type is eNormal in relevant methods accessing mFrameSelection. r=smaug
Helps to determine which methods of `nsFrameSelection` are intended to
be called only for the `eNormal` Selection.

Driven by the idea that state of `nsFrameSelection` relevant only for
the `eNormal` Selection should later move to a `NormalSelection` class.

Differential Revision: https://phabricator.services.mozilla.com/D67445
2020-03-19 11:08:58 +00:00
Mirko Brodesser
933c34a5bf Bug 1623333: part 2) Declare Selection::mSelectionType const. r=smaug
Simplifies reasoning about it.

Differential Revision: https://phabricator.services.mozilla.com/D67328
2020-03-19 09:25:02 +00:00
Mirko Brodesser
9adf280170 Bug 1623333: part 1) Throw error in Selection's webidl methods, when there's no nsFrameSelection instance. r=smaug
Alleviates the possibility to add calls which are unintentionally no-ops.

In practice, these errors should never be propagated to the web, and
signal to other callers (for copy&paste) that the calls are wrong.
Ideally, the other callers wouldn't see these methods, but that requires
a larger refactoring.

Differential Revision: https://phabricator.services.mozilla.com/D67327
2020-03-19 09:24:57 +00:00
Mirko Brodesser
cf8f076493 Bug 1623040: split nsRange::SetSelection into RegisterSelection and UnregisterSelection. r=smaug
The name "SetSelection" was misleading, because it did more than a
setter.

Differential Revision: https://phabricator.services.mozilla.com/D67126
2020-03-18 09:06:10 +00:00
Mirko Brodesser
43334fd5db Bug 1620952: part 9) Rename nsFrameSelection::GetBatching to IsBatching. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D66061
2020-03-11 09:18:18 +00:00
Mirko Brodesser
914fc6efb7 Bug 1620952: part 8) Rename nsFrameSelection::IsDirty. r=jfkthame
The new name is clearer.

Differential Revision: https://phabricator.services.mozilla.com/D66060
2020-03-11 09:18:10 +00:00
Boris Zbarsky
8b76288352 Bug 1535530. Fix can-run-script analysis to not mishandle on-stack refs to RefPtrs. r=andi,masayuki
The key here is to test the type of the variable declaration for being a
smartptr type, instead of testing the type of the variable _use_.

Differential Revision: https://phabricator.services.mozilla.com/D65581
2020-03-06 09:57:45 +00:00
Mirko Brodesser
b10c0dee5f Bug 1617141: part 2) Add MOZ_CAN_RUN_SCRIPT to Selection::MaybeAddTableCellRange. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D63645
2020-03-03 13:42:56 +00:00
Mirko Brodesser
b1ce2a956d Bug 1617141: part 1) Simplify code around Selection::MaybeAddTableCellRange. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D63644
2020-03-03 13:42:49 +00:00
Mirko Brodesser
ba22ad15cc Bug 1617165: part 2) Rename nsFrameSelection::PostReason and PopReason. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D63668
2020-03-02 13:48:24 +00:00
Kris Maglione
232ff37e9f Bug 1535617: Part 2 - Clear weak references for most cycle collected objects on unlink. r=mccr8
This covers most cycle collected objects which support weak references, but
not the ones which inherit from a cycle collected class and don't do any cycle
collection on their own.

Differential Revision: https://phabricator.services.mozilla.com/D63962
2020-02-25 19:44:39 +00:00
Mirko Brodesser
acfe8d2310 Bug 1616565: remove indirect calls to NotifySelectionListeners in Selection. r=smaug
Slightly clarfifies the relation of `Selection` and `nsFrameSelection`.

This requires undesirable 'kungFuDeathGrips'. However, they existed
already, only via an indirect call.

Differential Revision: https://phabricator.services.mozilla.com/D63479
2020-02-20 14:46:21 +00:00
Mirko Brodesser
ab464826d5 Bug 1615581: part 3) Rename mSelectingTableCellMode to mMode. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D62904
2020-02-18 12:28:59 +00:00
Mirko Brodesser
9d0d027729 Bug 1615581: part 2) Group table-cell-selection related members in common struct. r=jfkthame
Simplifies reasoning about table-cell related code, because it's less
coupled with `nsFrameSelection`.

Differential Revision: https://phabricator.services.mozilla.com/D62903
2020-02-18 12:28:52 +00:00
Mirko Brodesser
f878d8d407 Bug 1615581: part 1) Rename TableSelection to TableSelectionMode. r=jfkthame
See part 2) why this is necessary.

Differential Revision: https://phabricator.services.mozilla.com/D62902
2020-02-18 12:28:45 +00:00
Mirko Brodesser
fc0935aa80 Bug 1615581: part 0) Correct style around TableSelection usage. r=jfkthame
Preparatory step for the following parts.

Differential Revision: https://phabricator.services.mozilla.com/D63058
2020-02-18 12:28:32 +00:00
Mirko Brodesser
bbf6b5d7f3 Bug 1615304: part 1) Move nsFrameSelection::DeleteFromDocument to Selection. r=smaug
Helps to clarify the role of `nsFrameSelection`.

Differential Revision: https://phabricator.services.mozilla.com/D62879
2020-02-14 10:58:06 +00:00
Mirko Brodesser
660ce238cf Bug 1613378: part 10) Declare some table/Selection related method arguments const. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D62258
2020-02-12 12:27:39 +00:00
Mirko Brodesser
303b4cab8f Bug 1613378: part 9) Clarify dependency to mFrameSelection in Selection when adding/removing ranges. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D62198
2020-02-12 12:27:32 +00:00