Closed Bug 1623333 Opened 5 years ago Closed 5 years ago

Clarify relation of `Selection`'s methods to `nsFrameSelection`.

Categories

(Core :: DOM: Selection, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: mbrodesser, Assigned: mbrodesser)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

No description provided.

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.

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.

Depends on D67444

Pushed by mbrodesser@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d05172dd2297 part 1) Throw error in Selection's webidl methods, when there's no `nsFrameSelection` instance. r=smaug https://hg.mozilla.org/integration/autoland/rev/9317b00ee13f part 2) Declare `Selection::mSelectionType` `const`. r=smaug https://hg.mozilla.org/integration/autoland/rev/083722af5b6e part 3) Assert `EditorBase::SelectionRefPtr` has type `eNormal`. r=masayuki
Pushed by mbrodesser@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/12f6c8914207 part 4) Assert Selection's type is `eNormal` in relevant methods accessing `mFrameSelection`. r=smaug
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: