Closed Bug 1152254 Opened 4 years ago Closed 4 years ago

when dragging selected text in vertical writing modes, text that is not a complete element is missing from the drag image


(Core :: Layout, defect)

Not set



Tracking Status
firefox40 --- fixed


(Reporter: jfkthame, Assigned: jfkthame)


(Blocks 2 open bugs)



(2 files)

See testcase. When some of the vertical text is selected, and then the user clicks-and-drags on the selected text to move/copy it, the drag image may not correctly show all the selected text.

Some examples:
(1) Select from "Et eam ullum" in the first paragraph to "Cu ornatus" in the last, thus including the entire vertical paragraph between. Drag the selected text. Result: OK.

(2) Select from "Et eam ullum" (1st para) to "Te eum nihil possim" within the vertical paragraph. Drag. Result: The drag-image text is truncated after the bold span.

(3) Select from "Et eam ullum" (1st para) to "Eius commodo" in the vertical paragraph. Drag. Result: None of the vertical text is rendered in the drag image.

(4) Select from "Dico prompta" to "cu qui" within the bold vertical text. Drag. Result: No drag image is rendered.

(5) Select from "Dico prompta" to "cu qui." within the bold vertical text by double-clicking the first word and then dragging to include the last word AND the following period. Drag. Result: OK.

(6) Select the same text, but by a SINGLE-click and drag from "Dico" to "qui.", so that selection is by character rather than by word. Drag. Result: No drag image.

Note that in all cases, the correct content is in fact being dragged, as can be verified by dropping into a target area/app that accepts dragged text.
This occurs because PresShell::ClipListToRange ends up returning a zero-width clipping area for the display list being rendered. So although we have the right display list for the fragment of text we want to render, we clip it all away.
With this patch I now get the expected drag images.
Attachment #8589573 - Flags: review?(smontagu)
Assignee: nobody → jfkthame
Comment on attachment 8589573 [details] [diff] [review]
Handle vertical text frames when clipping display list for drag image

Review of attachment 8589573 [details] [diff] [review]:

::: layout/base/nsPresShell.cpp
@@ +4988,5 @@
>            // the clip rectangle is determined by taking the the start and
>            // end points of the range, offset from the reference frame.
>            // Because of rtl, the end point may be to the left of the
>            // start point, so x is set to the lowest value

Please edit the comment to reflect the changes to the code.
Attachment #8589573 - Flags: review?(smontagu) → review+
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Product: Core → Core Graveyard
Component: Layout: Misc Code → Layout
Product: Core Graveyard → Core
You need to log in before you can comment on or make changes to this bug.