Closed Bug 292581 Opened 20 years ago Closed 19 years ago

funky selection behaviour 3

Categories

(Core :: DOM: Selection, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME
mozilla1.8beta4

People

(Reporter: bugs.caleb, Assigned: sharparrow1)

References

()

Details

Attachments

(5 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050501 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050501 Firefox/1.0+

This one is hopefully the last selection bug i stumble onto.

The behaviour is kinda similar to bug 289792, but a bit less extreme.

Reproduction:

1. Open the specified URL
2. Look at the first post by 'ratboy2000'
3. Start selecting his post text from the bottom (starting from the 'Guess I'll
wait.' line) and upwards.

When your mouse pointer reaches a few milimeters above the first line of his
post the selection kinda inverts/jumps back. You can also try moving your mouse
when that happens and notice that the selection moves in a place different than
the one the mouse is pointing to.

I tried making a testcase, without any success, any help would be appreciated!

Reproducible: Always

Steps to Reproduce:
didn't search for duplicates yet, but I can confirm this bug on FF 20050502.
Attaching an ultimately (hoping not too ultimately :) ) reduced  testcase. It
seems that the combination of the <H2> tag and the <div style="float:left;"> for
the main text triggers this bug.

To reproduce :
1. open the attached testcase
2. reduce browser window height (in order for the verical scrollbar to appear)
3. Try to select the entirety of the main 
text from an arbitrary line. E.g. starting from the first line and moving
downwards until you hit the status area.

Result: When the cursor hits the status area of the browser window, it starts
scrolling (as expected) BUT the selected text changes to something on the left
or top of the initial selection starting point.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached file reduced testcase
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050419
Firefox/1.0.4

Happens here, I scroll down and the selection flips and then back and flips
again, rather odd, just like described.

Adding clean-report based on what Dimitrios said.  Also, I wouldn't know what to
dupe this too, so not even gonna try.
Keywords: clean-report
Attached file original testcase ?
table in a float:left div, reduced, but not minimized.
Requesting blocking since this bug makes it difficult to select text in some
circumstances.
Flags: blocking1.8b3?
Flags: blocking-aviary1.1?
I'm not 100% this is related, but here's another page that has really poor
selection behaviour:

http://www.allmusic.com/cg/amg.dll?p=amg&searchlink=FOUR|FRESHMEN&uid=MIW060505271437&sql=11:7x6fmpb39f5o~T2

Try to select "The Four Freshmen" while dragging the mouse from right to left
and moving it across the center of the letters.. the selection will suddenly
move to the "wrong person? more matches HERE" link. Although if you hold your
mouse really high (practicly above the text) the selection won't screw up.

I'll try to get a minimized testcase sometime soon, but this makes selecting
very annoying.
Whiteboard: DUPEME
Flags: blocking1.8b3? → blocking1.8b4?
Flags: blocking-aviary1.1?
Attached file Very simplified testcase (obsolete) —
This is definitely a regression from Firefox 1.0, although I have no idea when
it regressed.
Eli, can you look through the builds at archive.mozilla.org and try to determine
when this regressed? that would help us a lot.
This regressed between the April 14 and April 15 builds.  Looking at Bonsai, it
seems most likely this was regressed by Bug 289792 (how ironic).
Attached patch Patch v1Splinter Review
I edited this patch because I have other changes in my tree, so it might not
apply cleanly.
Attachment #190089 - Flags: review?(bzbarsky)
So why does that patch work?
The problem was that event coordinates were not being translated at the right
time.  The previous code was passing coordinates relative to the frame's view
instead of relative to the frame's parent view.  Therefore, the frame was
misinterpreting the coordinates it recieved.

This is all really wacky, and I think I'm going to make this use frame
coordinates sometime in the 1.9 cycle.
Attachment #189853 - Attachment is obsolete: true
Comment on attachment 190089 [details] [diff] [review]
Patch v1

r+sr=bzbarsky.	I hate GetOffsetFromView...
Attachment #190089 - Flags: superreview+
Attachment #190089 - Flags: review?(bzbarsky)
Attachment #190089 - Flags: review+
Attachment #190089 - Flags: approval1.8b4?
Attachment #190089 - Flags: approval1.8b4? → approval1.8b4+
Assignee: selection → sharparrow1
Whiteboard: DUPEME → [checkin needed]
I've tested this patch, it works well (thank Eli!).
Checking in nsFrame.cpp;
/cvsroot/mozilla/layout/generic/nsFrame.cpp,v  <--  nsFrame.cpp
new revision: 3.570; previous revision: 3.569
done
Status: NEW → RESOLVED
Closed: 19 years ago
Flags: blocking1.8b4?
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Target Milestone: --- → mozilla1.8beta4
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Could someone back out this patch?
I can back it out... but why? Care to explain?
Ah, nevermind, someone on stephend was kind enough to point out bug 302804. I
backed it out.

Checking in nsFrame.cpp;
/cvsroot/mozilla/layout/generic/nsFrame.cpp,v  <--  nsFrame.cpp
new revision: 3.574; previous revision: 3.573
done
This was fixed by bug 296036.
Status: REOPENED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → WORKSFORME
QA Contact: selection
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: