Closed Bug 1891408 Opened 20 days ago Closed 10 days ago

Sort out `WSScanResult::Point`

Categories

(Core :: DOM: Editor, task)

task

Tracking

()

RESOLVED FIXED
127 Branch
Tracking Status
firefox127 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(3 files)

The method returns previous point (from scanning start point of view) rather than the point at reached content. This is really error-prone, and it's impossible to understand the meaning from the name.

They point the found character point if scanning forward. However, they point
the next character point if scanning backward. Therefore, I don't have any
good idea to name them. Therefore, I rename them to *_Deprecated() and the
callers should use better name method later.

Depends on D207684

When it's called, it just returns at the reached content node. However, this
does not make sense when it reached a character in the text node.

Depends on D207685

Point_Deprecated() is really error-prone since its result meaning is different
whether the scan direction is backward or forward. Therefore, if a caller wants
a point in a text node and the direction is only one of them, we can change it
to use WSScanResult::PointAtReachedContent() or
WSScanResult::PointAfterReachedContent().

Depends on D207686

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/d5989f64e5ea
part 1: Rename `WSScanResult::Offset()` and `WSScanResult::Point()` r=m_kato
https://hg.mozilla.org/integration/autoland/rev/7f2596d16f75
part 2: Make `WSScanResult::PointAtContent()` return a point in a text node r=m_kato
https://hg.mozilla.org/integration/autoland/rev/669dafe4d5a9
part 3: Make some callers of `WSScanResult::Point_Deprecated()` use new methods r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 10 days ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: