Commit Graph

161 Commits

Author SHA1 Message Date
Kagami Sascha Rosylight
02e4819dbc Bug 1645003 - Return pointer from GetPrimaryOrCaretFrameForNodeOffset and its deps r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D80063
2020-06-18 10:26:47 +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
Mirko Brodesser
194a3b964e Bug 1635709: part 5) Annotate Selection::ReplaceAnchorFocusRange with MOZ_CAN_RUN_SCRIPT. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D74383
2020-05-11 09:39:33 +00:00
Mirko Brodesser
6ddb867610 Bug 1635709: part 4) Transform Selection::DoAutoScroll to AutoScroller::DoAutoScroll. r=masayuki
Allows defriending `AutoScroller` from `Selection` and removes the
direct dependency of `AutoScroller` to `Selection`.

Differential Revision: https://phabricator.services.mozilla.com/D74382
2020-05-11 09:38:00 +00:00
Mirko Brodesser
6092b43712 Bug 1635709: part 3) Add unit to Selection::StartAutoScrollTimer's delay argument. r=hsivonen
Depends on D74052

Differential Revision: https://phabricator.services.mozilla.com/D74053
2020-05-06 15:24:59 +00:00
Mirko Brodesser
2d12323c40 Bug 1633448: part 10) Add StyledRanges::Clear. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D73433
2020-05-04 10:11:13 +00:00
Mirko Brodesser
d0cba89c40 Bug 1633448: part 9) Add StyledRanges::Length. r=hsivonen
Another step towards privatizing `StyledRanges::mRanges`.

Differential Revision: https://phabricator.services.mozilla.com/D73432
2020-05-04 10:11:13 +00:00
Mirko Brodesser
36148ce9a8 Bug 1633448: part 8) Add StyledRanges::RemoveCollapsedRanges. r=hsivonen
Another step towards privatizing `StyledRanges::mRanges`.

Depends on D73430

Differential Revision: https://phabricator.services.mozilla.com/D73431
2020-05-04 10:11:13 +00:00
Mirko Brodesser
c4ed6f536e 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
c6b90540b1 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
6aabdca219 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
3ecc9f7fd9 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
c3cb9d2c3f Bug 1633448: part 3) Annotate Selection::AddRangesForUserSelectableNodes with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D72803
2020-04-28 16:15:31 +00:00
Mirko Brodesser
b94b69e3a4 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
Mirko Brodesser
80129345c6 Bug 1623858: part 26) Annotate MaybeAddRangeAndTruncateOverlaps with MOZ_CAN_RUN_SCRIPT. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D69179

--HG--
extra : moz-landing-system : lando
2020-04-01 11:42:16 +00:00
Mirko Brodesser
90fce8e090 Bug 1623858: part 25) Factor AreUserSelectedRangesNonEmpty out. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D68962

--HG--
extra : moz-landing-system : lando
2020-03-31 13:59:09 +00:00
Mirko Brodesser
a6873f12af 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

--HG--
extra : moz-landing-system : lando
2020-03-31 08:21:39 +00:00
Mirko Brodesser
4412b5b8cf Bug 1623858: part 20) Assert Selection::NotifyAutoCopy is only called for eNormal Selections. r=hsivonen
Depends on D68579

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

--HG--
extra : moz-landing-system : lando
2020-03-30 08:48:16 +00:00
Mirko Brodesser
8429b643fd Bug 1624633: part 9) Move FindRangeData. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D68225

--HG--
extra : moz-landing-system : lando
2020-03-27 11:05:48 +00:00
Mirko Brodesser
d9c76a1049 Bug 1624633: part 8) Move GetCommonEditingHostForAllRanges. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D68224

--HG--
extra : moz-landing-system : lando
2020-03-27 11:05:43 +00:00
Mirko Brodesser
fc0da7632c Bug 1624633: part 7) Move MaybeAddRangeAndTruncateOverlaps. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D68223

--HG--
extra : moz-landing-system : lando
2020-03-27 11:26:25 +00:00
Mirko Brodesser
d3d7707457 Bug 1624633: part 6) Annotate nsRange::RegisterSelection with MOZ_CAN_RUN_SCRIPT. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D68222

--HG--
extra : moz-landing-system : lando
2020-03-27 11:11:02 +00:00
Mirko Brodesser
85ed1dee2a Bug 1624633: part 5) Move HasEqualRangeBoundariesAt. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D68221

--HG--
extra : moz-landing-system : lando
2020-03-27 11:03:57 +00:00
Mirko Brodesser
c49f43f86f Bug 1624633: part 4) Move GetIndicesForInterval. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D68220

--HG--
extra : moz-landing-system : lando
2020-03-27 11:19:50 +00:00
Mirko Brodesser
f3da4b161b Bug 1624633: part 3) Move FindInsertionPoint. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D68219

--HG--
extra : moz-landing-system : lando
2020-03-27 11:25:16 +00:00
Mirko Brodesser
0cfb1530f5 Bug 1624633: part 2) Move Selection::RemoveRangeInternal to StyledRanges::RemoveRangeAndUnregisterSelection. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D68218

--HG--
extra : moz-landing-system : lando
2020-03-27 11:02:37 +00:00
Mirko Brodesser
803698911f 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

--HG--
extra : moz-landing-system : lando
2020-03-27 11:21:25 +00:00
Mirko Brodesser
5b963b4881 Bug 1623858: part 11) Split Selection::AddRangesForSelectableNodes. r=smaug
Depends on D67848

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

--HG--
extra : moz-landing-system : lando
2020-03-25 15:36:54 +00:00
Mirko Brodesser
ec7cb2f8d3 Bug 1623858: part 10) Simplify Selection::AddRangesForSelectableNodes's signature. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D67848

--HG--
extra : moz-landing-system : lando
2020-03-25 14:28:40 +00:00
Mirko Brodesser
ad4d7454de Bug 1622752: annotate Selection::ScrollIntoView with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D67002

--HG--
extra : moz-landing-system : lando
2020-03-16 21:04:46 +00:00
Mirko Brodesser
e2af57ec37 Bug 1621620: part 3) Annotate nsFrameSelection::MoveCaret with MOZ_CAN_RUN_SCRIPT. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D66396

--HG--
extra : moz-landing-system : lando
2020-03-19 13:58:33 +00:00
Mirko Brodesser
d252ed1175 Bug 1623333: part 2) Declare Selection::mSelectionType const. r=smaug
Simplifies reasoning about it.

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

--HG--
extra : moz-landing-system : lando
2020-03-19 09:25:02 +00:00
Mirko Brodesser
ec9cb4d8ef Bug 1622199: annotate Selection::AddRangeAndSelectFramesAndNotifyListeners with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D66759

--HG--
extra : moz-landing-system : lando
2020-03-13 15:46:13 +00:00
Mirko Brodesser
4be580237d Bug 1619617: part 1) Annotate RemoveRangeAndUnselectFramesAndNotifyListeners with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D65511

--HG--
extra : moz-landing-system : lando
2020-03-06 12:03:23 +00:00
Mirko Brodesser
939aa616ca Bug 1617141: part 2) Add MOZ_CAN_RUN_SCRIPT to Selection::MaybeAddTableCellRange. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D63645

--HG--
extra : moz-landing-system : lando
2020-03-03 13:42:56 +00:00
Mirko Brodesser
f1f584f689 Bug 1617141: part 1) Simplify code around Selection::MaybeAddTableCellRange. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D63644

--HG--
extra : moz-landing-system : lando
2020-03-03 13:42:49 +00:00
Mirko Brodesser
f170973369 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

--HG--
extra : moz-landing-system : lando
2020-02-18 12:28:45 +00:00
Mirko Brodesser
3d79d25cdf 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

--HG--
extra : moz-landing-system : lando
2020-02-14 10:58:06 +00:00
Mirko Brodesser
b257e520ee Bug 1613378: part 10) Declare some table/Selection related method arguments const. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D62258

--HG--
extra : moz-landing-system : lando
2020-02-12 12:27:39 +00:00
Mirko Brodesser
36437a9d2d Bug 1613378: part 9) Clarify dependency to mFrameSelection in Selection when adding/removing ranges. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D62198

--HG--
extra : moz-landing-system : lando
2020-02-12 12:27:32 +00:00
Mirko Brodesser
e7ed18f679 Bug 1613378: part 7) Remove Selection's default constructor. r=smaug
Removes duplicated code and reveals the dependency to frame selection.

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

--HG--
extra : moz-landing-system : lando
2020-02-11 10:50:54 +00:00
Brindusan Cristian
a68356b907 Backed out 5 changesets (bug 1613378) for mochitest failures at test_general.html. CLOSED TREE
Backed out changeset f38b806ee78b (bug 1613378)
Backed out changeset cee4bbabc4b5 (bug 1613378)
Backed out changeset e3a2ab6d7267 (bug 1613378)
Backed out changeset 6fe76439f1d3 (bug 1613378)
Backed out changeset f3baf3407cbe (bug 1613378)
2020-02-11 12:27:49 +02:00
Mirko Brodesser
b5693e486b Bug 1613378: part 10) Declare some table/Selection related method arguments const. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D62258

--HG--
extra : moz-landing-system : lando
2020-02-11 09:25:27 +00:00
Mirko Brodesser
931ef1e3fa Bug 1613378: part 7) Remove Selection's default constructor. r=smaug
Removes duplicated code and reveals the dependency to frame selection.

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

--HG--
extra : moz-landing-system : lando
2020-02-11 09:26:07 +00:00
Emilio Cobos Álvarez
49abab29a5 Bug 1614208 - Remove nsStyleConsts usage from TextRange.h. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D62172

--HG--
extra : moz-landing-system : lando
2020-02-11 01:23:12 +00:00
Emilio Cobos Álvarez
6615ff9fad Bug 1614208 - Stop including AccessibleCaretEventHub and PresShell.h from Selection.h. r=TYLin
And fix a bunch of fallout as we now don't include nsDocShell.h everywhere.

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

--HG--
extra : moz-landing-system : lando
2020-02-11 01:22:29 +00:00
Mirko Brodesser
067c1b95c6 Bug 1613378: part 5) Decouple UserSelectRangesToAdd from Selection class. r=smaug
Depends on D62037

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

--HG--
extra : moz-landing-system : lando
2020-02-07 16:16:36 +00:00
Mirko Brodesser
cc5ff82f69 Bug 1613378: part 3) Remove Selection::GetTableCellLocationFromRange's dependency to mFrameSelection and declare it static. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D61693

--HG--
extra : moz-landing-system : lando
2020-02-07 09:24:53 +00:00
Mirko Brodesser
f3af81d6e9 Bug 1613378: part 1) Decouple Selection::GetTableSelectionType from Selection class. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D61691

--HG--
extra : moz-landing-system : lando
2020-02-07 09:24:34 +00:00
Mirko Brodesser
09e3040bc2 Bug 1612828: part 3) Remove nsresult return type from Selection::FindInsertionPoint. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D61533

--HG--
extra : moz-landing-system : lando
2020-02-05 12:22:08 +00:00