Commit Graph

271 Commits

Author SHA1 Message Date
Simon Giesecke
a69d79b6db Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Kagami Sascha Rosylight
b31045dcce 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
fbef1cfbce 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
Emilio Cobos Álvarez
30cc71cb06 Bug 312971 - Unprefix -moz-read-write / -moz-read-only. r=edgar
And remove some duplicated tests from WPT.

Differential Revision: https://phabricator.services.mozilla.com/D75231
2020-05-14 16:46:08 +00:00
Mirko Brodesser
3bbda64677 Bug 1635709: part 18) Correct assignment to aDidAddRange in Selection::MaybeAddTableCellRange. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D75100
2020-05-14 10:08:55 +00:00
Mirko Brodesser
327d7f3108 Bug 1635709: part 16) Replace GetTableCellLocationFromRange with GetTableSelectionMode. r=masayuki
The location wasn't used from the caller of
`GetTableCellLocationFromRange`.

However, `GetTableCellLocationFromRange`
included flushing frames, this is now done in
`HTMLEditor::CellIndexes::Update`.

Differential Revision: https://phabricator.services.mozilla.com/D75098
2020-05-14 10:08:32 +00:00
Mirko Brodesser
a26ab9c5f8 Bug 1635709: part 15) Rename GetTableSelectionType to GetTableSelectionMode. r=masayuki
Depends on D75058

Differential Revision: https://phabricator.services.mozilla.com/D75059
2020-05-13 11:11:31 +00:00
Mirko Brodesser
845234fb65 Bug 1635709: part 14) Change nsRange argument from const pointer to const reference around table selection. r=masayuki
Helps to get rid of unnecessary `nsresult`s later.

Depends on D75057

Differential Revision: https://phabricator.services.mozilla.com/D75058
2020-05-13 11:11:08 +00:00
Mirko Brodesser
aeab706da5 Bug 1635709: part 6) Rename nsFrameSelection::*DesiredPos to *DesiredCaretPos. r=masayuki
`nsFrameSelection` has (too) many responsibilites, this adds some
clarification.

Differential Revision: https://phabricator.services.mozilla.com/D74615
2020-05-12 09:42:01 +00:00
Mirko Brodesser
8e89c90fd7 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
452167f1cb 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
e53a3d2700 Bug 1635709: part 1) Rename nsFrameSelection::SetCaretBidiLevel to SetCaretBidiLevelAndMaybeSchedulePaint. r=hsivonen
The old name was misleading.

Differential Revision: https://phabricator.services.mozilla.com/D74051
2020-05-06 15:26:07 +00:00
Simon Giesecke
5ab46b5ad0 Bug 1626570 - Improve handling of copying arrays in dom/base/. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D73625
2020-05-05 10:08:02 +00:00
Mirko Brodesser
b4fd978a9d Bug 1633448: part 11) Add const-correctness to Selection::CollapseToStart and CollapseToEnd. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D73434
2020-05-04 10:11:14 +00:00
Mirko Brodesser
b64246284b 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
65811d5374 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
246d5bac87 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
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