Closed Bug 1026431 Opened 11 years ago Closed 11 years ago

[Text Selection] Selection carets display as tilt mode when selectall.

Categories

(Core :: DOM: Selection, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: mtseng, Assigned: mtseng)

References

Details

Attachments

(1 file, 1 obsolete file)

When selectall, the range's StartParent and EndParent will be parent element node instead of text node. In this case, we switch our carets to tilt mode [1]. We should modify this condition to avoid this issue. [1] http://dxr.mozilla.org/mozilla-central/source/layout/base/SelectionCarets.cpp?from=SelectionCarets.cpp&case=true#460
Attached patch bug1026431 (obsolete) — Splinter Review
In this case <textarea>abc</textarea> and we select 'c' character, EndContent would be HTMLDivElement and mResultContent which get by calling startFrame->PeekOffset() with selecting next cluster would be TextNode. Although the position is same, nsContentUtils::ComparePoints still shows HTMLDivElement is after TextNode. So that we cannot use EndContent or StartContent to compare with result of PeekOffset(). So we compare between next charater of startFrame and previous character of endFrame.
Assignee: nobody → mtseng
Status: NEW → ASSIGNED
Attachment #8456621 - Flags: review?(roc)
Attached patch bug1026431 v2Splinter Review
Check mResultContent before calling ComparePoints
Attachment #8456621 - Attachment is obsolete: true
Attachment #8456621 - Flags: review?(roc)
Attachment #8456655 - Flags: review?(roc)
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: