Closed Bug 556432 Opened 10 years ago Closed 10 years ago

Dragging a content selection shows non-selectable text in the drag feedback


(Core :: Layout, defect)

Not set





(Reporter: mats, Assigned: mats)



(Keywords: testcase)


(3 files)

From bug 39098 comment 74:

Bug 4: the drag feedback is wrong (the copied text is correct though) -
I've tracked this down to "info->mBuilder.SetPaintAllFrames();"
in PresShell::CreateRangePaintInfo():
If I remove that line I get the correct drag feedback, but I'm 
assuming it's there for a reason.

It was also noted in bug 166235 comment 3.
Attached file Testcase
The origin of SetPaintAllFrames appears to be
There is a problem here --- out of flow frames won't get painted when the
selection contains the placeholder but the containing block for the out of flow
frames is not part of the selection. E.g. if you select some inline text that
contains a float. I'll attach a patch that provides a SetPaintAllFrames method
on the nsDisplayListBuilder (completely untested!) that should fix this.
Keywords: testcase
Attached patch Patch rev. 1Splinter Review
Rename the mPaintAllFrames bit to mSelectedFramesOnly.
Set the bit when we're building display items for PresShell::RenderSelection.
Only include frames with NS_FRAME_SELECTED_CONTENT when the bit is set.

It passed TryServer unit tests, fwiw (I suspect poor test coverage here).
Assignee: nobody → matspal
Attachment #451159 - Flags: review?(roc)
Comment on attachment 451159 [details] [diff] [review]
Patch rev. 1

+  if (aForPrimarySelection)
+    info->mBuilder.SetSelectedFramesOnly();


-  if (aBuilder->GetPaintAllFrames()) {
+  else if (aBuilder->GetSelectedFramesOnly() &&

} else if {
Attachment #451159 - Flags: review?(roc) → review+
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3b2
Depends on: 614417
You need to log in before you can comment on or make changes to this bug.