Closed Bug 556432 Opened 15 years ago Closed 15 years ago

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

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b2

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

References

Details

(Keywords: testcase)

Attachments

(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(): http://mxr.mozilla.org/mozilla-central/source/layout/base/nsPresShell.cpp#5519 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 https://bugzilla.mozilla.org/show_bug.cgi?id=178513#c62 <quote> 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. </quote>
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+
Status: NEW → RESOLVED
Closed: 15 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.

Attachment

General

Created:
Updated:
Size: