Closed Bug 1613378 Opened 6 years ago Closed 6 years ago

Reduce dependencies from `Selection::MaybeAddTableCellRange` to `mFrameSelection`

Categories

(Core :: DOM: Selection, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: mbrodesser, Assigned: mbrodesser)

References

(Blocks 1 open bug)

Details

Attachments

(10 files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

A preparatory step to decouple the code which keeps a Selection's styled ranges sorted and disjunct. As DocumentOrShadowRoot will keep a list of sorted disjunct ranges, the corresponding code will have to be factored out from Selection.

Pushed by mbrodesser@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5a1c680c8740 part 1) Decouple `Selection::GetTableSelectionType` from `Selection` class. r=smaug https://hg.mozilla.org/integration/autoland/rev/11d012aeef35 part 2) Remove unnecessary dependency from `nsFrameSelection::GetCellLayout` to `mPresShell` and declare it static. r=smaug https://hg.mozilla.org/integration/autoland/rev/743fb8cbcce4 part 3) Remove `Selection::GetTableCellLocationFromRange`'s dependency to `mFrameSelection` and declare it static. r=smaug

Removes duplicated code and reveals the dependency to frame selection.

Depends on D62039

Moreover, this is potentially more efficient because
GetRangesForIntervalArray doesn't have to be called when there's no
frame selection.

Pushed by apavel@mozilla.com: https://hg.mozilla.org/mozilla-central/rev/b49700eb1596 part 4) Declare some methods in `nsFrameSelection` static. r=smaug https://hg.mozilla.org/mozilla-central/rev/0ea74c8ad137 part 5) Decouple `UserSelectRangesToAdd` from `Selection` class. r=smaug
Pushed by mbrodesser@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f3baf3407cbe part 6) Remove copy&pasted `IsValidSelectionPoint` function. r=smaug https://hg.mozilla.org/integration/autoland/rev/6fe76439f1d3 part 7) Remove `Selection`'s default constructor. r=smaug https://hg.mozilla.org/integration/autoland/rev/e3a2ab6d7267 part 8) Add assertion to `nsAutoScrollTimer::Init`. r=smaug https://hg.mozilla.org/integration/autoland/rev/cee4bbabc4b5 part 9) Clarify dependency to `mFrameSelection` in `Selection` when adding/removing ranges. r=smaug https://hg.mozilla.org/integration/autoland/rev/f38b806ee78b part 10) Declare some table/Selection related method arguments const. r=smaug
Flags: needinfo?(mbrodesser)
Keywords: leave-open
Pushed by mbrodesser@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0d7ceea5ffb7 part 6) Remove copy&pasted `IsValidSelectionPoint` function. r=smaug https://hg.mozilla.org/integration/autoland/rev/d301a063f64f part 7) Remove `Selection`'s default constructor. r=smaug https://hg.mozilla.org/integration/autoland/rev/0f4ea01a8e97 part 8) Add assertion to `nsAutoScrollTimer::Init`. r=smaug
Pushed by mbrodesser@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/41809d86171c part 9) Clarify dependency to `mFrameSelection` in `Selection` when adding/removing ranges. r=smaug https://hg.mozilla.org/integration/autoland/rev/5177b7449ca5 part 10) Declare some table/Selection related method arguments const. r=smaug
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: