Closed Bug 93188 Opened 20 years ago Closed 17 years ago

In positioned content, only 1 line can be selected and selection jumps

Categories

(Core :: DOM: Selection, defect, P3)

x86
All
defect

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: benm, Unassigned)

References

()

Details

(Keywords: testcase, Whiteboard: [select])

Attachments

(5 files, 1 obsolete file)

attempting to select the block of php code on
http://www.zend.com/zend/trick/trick-optimizing-php.php (or any similar blocks
of code on this site) causes selection of a couple of browser heights worth of text.

steps
1. go to above page
2. attempt to select block of php code starting with cursor just to left opening
<?php
3. a whole heap of stuff is instantly selected.

i had a look the html and all i could work out is that if you save page local
the problem is fixed, but if you link the page back to style sheet being used it
comes back again?
we have a component called Selection. Browser-General is for bugs that don't fit
into any other component
Assignee: asa → mjudge
Component: Browser-General → Selection
QA Contact: doronr → tpreston
I have constructed a reduce test case, which could probably be reduced even
more, but I wanted to ensure the problem could be easily reproduced.

In teh attached test case, select from the right of teh last line and drag to
the left, when the selection is dragged over the ?>, the entire content is
selected. If I remove the table, this does not happen. 
Severity: normal → minor
Priority: -- → P3
Whiteboard: [select]
Target Milestone: --- → mozilla0.9.5
Attached file reduced test case
Attached file new test case
the behaviour in beppe's test case as far as i am aware is normal, if you select
a block of text starting at the bottom and moving right to left once you move
over the left edge to the block it will select everthing else above in the
block. this is the normal behaviour in ie as well.

i created a new test case
if you click just to the left of the opening <?php tag attempting to select the
php code, you will automaticaly select all the php and the next 2 paragraphs.
clicking on the six links at the top  of the page (and thus starting at a
different possition down the page) will give you different results. from the
last 3 links you can select part of the php code before the page suddenly jumps
down to far.

yes, I see your point, and removing the table code from your testcase does not
alter the odd selection behavior. I will try and get that one reduced even further
If this is important to someone for 0.9.5, tell me now so I can find another
owner for it. mjudge won't be back until 0.9.6.
Marking NEW.
Status: UNCONFIRMED → NEW
Ever confirmed: true
-> 0.9.6
Target Milestone: mozilla0.9.5 → mozilla0.9.6
0.9.6 is gone -> 0.9.7 
Target Milestone: mozilla0.9.6 → mozilla0.9.7
0.9.7 is long long gone time to -> ?
removing myself from the cc list
shouldn't this bug be retargeted?
Target Milestone: mozilla0.9.7 → ---
Summary: selecting text block in <code></code> tags causes unwanted selection. → In relatively positioned content, only 1 line can be selected and selection jumps
*** Bug 156394 has been marked as a duplicate of this bug. ***
*** Bug 181041 has been marked as a duplicate of this bug. ***
*** Bug 212790 has been marked as a duplicate of this bug. ***
Keywords: testcase
Summary: In relatively positioned content, only 1 line can be selected and selection jumps → In positioned content, only 1 line can be selected and selection jumps
I've attached a testcase depicting another problem related to
position:relative.

I had previously filed a duplicate to this bug in which I reported the problem
about being able to only select one line.  However, I also discovered that it
only occurs in certain tags, while other tags encounter different problems.


Here's a summary of what I had in the other bug report:

Problem #1 (most common):
To sum up, this is the issue already mentioned about being able to only select
one line. 
This bug applies to the following tags:
<span>
<a>
<font>
<layer>


Problem #2:
If you define some tags as having a position of relative, and then try to
select
the text inside of those tags, the selection will flicker or jump around as you

try and select multiple lines.	The tags this bug applies to are:
<div>
<p>
I can verify the underlying bug, best described in comment 18, problem #2. This 
behavior is seen in Firebird 0.7 and later builds. Oddly enough, this same bug 
exists in IE6. Nevertheless, it's quite annoying and should be targeted.
There is no reasonable way to fix this that I see.  Feel free to come up with
one (and take the bug if you do, please).
Target Milestone: --- → Future
*** Bug 235543 has been marked as a duplicate of this bug. ***
I was going to submit this as a new bug, but then I found this bug report. 
This testcase is similar to the second, but completely reduced to the
essentials.  It's just a series of normal paragraphs with one paragraph with
style="position:relative" thrown in the middle.  If you start selecting
(highlighting) text above or below this paragraph, and then move the mouse over
this paragraph, the focus of the browser window jumps down a lot.

Two important observations:

(1) The amount of space the window jumps down depends on how fast you move the
mouse.	Start with the window at the very top of the page.  When selecting the
text, if you move the mouse really fast, the window won't jump at all.	If you
move the mouse at an average pace, the window jumps down to show "21" on the
bottom.  If you move the mouse REALLY slowly, the window will jump all the way
down to the bottom of the page.

(2) Try editing the source to move the paragraph with position:relative to
different places in the page.  If this paragraph is below the number N, then
the window (if you move the mouse at an average pace) will jump down to the
number 2*N-1. For example, if the position:relative paragraph is between the 9
and 10, then the window will jump down to the 17; if it is between the 16 and
17, the window will jump down to 31, etc.
Comment on attachment 127927 [details]
Testcase: Selection flickers or can only select one line.

<html>
<head>

</head>

<body>
<span style="position:relative"><br><br>SPAN__________In order to test this
bug, here's what you do:<br>Place your cursor anywhere inside of the text and
try to select mutiple rows of text. You will notice that you can only select
one row of text.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that you can only select one row of text.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that you can only select one row of text.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that you can only select one row of text.
<br>NOTICE!<br>
NOTICE!<br>
If you place your cursor in an area outside of the text (so that the cursor
changes from a crosshair to a regular cusor), then you can select multiple
lines. This works on all four sides: top, bottom, left, and right; and it even
works in the center.
If you place your cursor in an area outside of the text (so that the cursor
changes from a crosshair to a regular cusor), then you can select multiple
lines. This works on all four sides: top, bottom, left, and right; and it even
works in the center.
If you place your cursor in an area outside of the text (so that the cursor
changes from a crosshair to a regular cusor), then you can select multiple
lines. This works on all four sides: top, bottom, left, and right; and it even
works in the center.
</span>
<a style="position:relative"><br><br>A______________In order to test this bug,
here's what you do:<br>Place your cursor anywhere inside of the text and try to
select mutiple rows of text. You will notice that you can only select one row
of text.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that you can only select one row of text.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that you can only select one row of text.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that you can only select one row of text.
<br>NOTICE!<br>

NOTICE!<br>
If you place your cursor in an area outside of the text (so that the cursor
changes from a crosshair to a regular cusor), then you can select multiple
lines. This works on all four sides: top, bottom, left, and right; and it even
works in the center.
If you place your cursor in an area outside of the text (so that the cursor
changes from a crosshair to a regular cusor), then you can select multiple
lines. This works on all four sides: top, bottom, left, and right; and it even
works in the center.
If you place your cursor in an area outside of the text (so that the cursor
changes from a crosshair to a regular cusor), then you can select multiple
lines. This works on all four sides: top, bottom, left, and right; and it even
works in the center.
</a>
<font style="position:relative"><br><br>FONT______________In order to test this
bug, here's what you do:<br>Place your cursor anywhere inside of the text and
try to select mutiple rows of text. You will notice that you can only select
one row of text.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that you can only select one row of text.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that you can only select one row of text.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that you can only select one row of text.
<br>NOTICE!<br>
NOTICE!<br>
If you place your cursor in an area outside of the text (so that the cursor
changes from a crosshair to a regular cusor), then you can select multiple
lines. This works on all four sides: top, bottom, left, and right; and it even
works in the center.
If you place your cursor in an area outside of the text (so that the cursor
changes from a crosshair to a regular cusor), then you can select multiple
lines. This works on all four sides: top, bottom, left, and right; and it even
works in the center.
If you place your cursor in an area outside of the text (so that the cursor
changes from a crosshair to a regular cusor), then you can select multiple
lines. This works on all four sides: top, bottom, left, and right; and it even
works in the center.
</font>
<layer style="position:relative"><br><br>LAYER______________In order to test
this bug, here's what you do:<br>Place your cursor anywhere inside of the text
and try to select mutiple rows of text. You will notice that you can only
select one row of text.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that you can only select one row of text.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that you can only select one row of text.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that you can only select one row of text.
<br>NOTICE!<br>
NOTICE!<br>

If you place your cursor in an area outside of the text (so that the cursor
changes from a crosshair to a regular cusor), then you can select multiple
lines. This works on all four sides: top, bottom, left, and right; and it even
works in the center.
If you place your cursor in an area outside of the text (so that the cursor
changes from a crosshair to a regular cusor), then you can select multiple
lines. This works on all four sides: top, bottom, left, and right; and it even
works in the center.
If you place your cursor in an area outside of the text (so that the cursor
changes from a crosshair to a regular cusor), then you can select multiple
lines. This works on all four sides: top, bottom, left, and right; and it even
works in the center.
</layer>
<p style="position:relative"><br><br>P______________In order to test this bug,
here's what you do:<br>Place your cursor anywhere inside of the text and try to
select mutiple rows of text. You will notice that that the selection flickers
and/or jumps around.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that that the selection flickers and/or jumps around.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that that the selection flickers and/or jumps around.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that that the selection flickers and/or jumps around.
<br>NOTICE!<br>
NOTICE!<br>
This problem occurs even if you start your selection by placing your cursor
outside of the text.
This problem occurs even if you start your selection by placing your cursor
outside of the text.
This problem occurs even if you start your selection by placing your cursor
outside of the text.
</p>
<div style="position:relative"><br><br>DIV______________In order to test this
bug, here's what you do:<br>Place your cursor anywhere inside of the text and
try to select mutiple rows of text. You will notice that that the selection
flickers and/or jumps around.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that that the selection flickers and/or jumps around.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that that the selection flickers and/or jumps around.
Place your cursor anywhere inside of the text and try to select mutiple rows of
text. You will notice that that the selection flickers and/or jumps around.
<br>NOTICE!<br>
NOTICE!<br>
This problem occurs even if you start your selection by placing your cursor
outside of the text.
This problem occurs even if you start your selection by placing your cursor
outside of the text.
This problem occurs even if you start your selection by placing your cursor
outside of the text.

</div>
</body>

</html>
Attachment #127927 - Attachment description: Testcase: Selection jumps and flickers → Testcase: Selection flickers or can only select one line.
Sorry about the above comment.	I was trying to edit one of the attachments,
but I must have submitted it as a comment instead.

I have changed the example I uploaded previously because I noticed that parts
of it were missing.
Attachment #127927 - Attachment is obsolete: true
I can reproduce this with Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a)
Gecko/20040429 Firefox/0.8.0+ (Steffen). -> OS = All.
Reassigning to default owner.
Assignee: mjudge → selection
OS: Windows 2000 → All
QA Contact: tpreston
Depends on: 53966
This also happens when viewing the Mozilla 1.7 release notes, mostly when
starting a select to the right of the headers (Mail, Under The Hood, Chatzilla,
etc.). Quite confusing and complicates the selection of text.

http://www.mozilla.org/releases/mozilla1.7/README.html
Looks like the fix for bug 53966 has fixed this bug, too. :-) Tested with a five
hour old Linux trunk build.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
The following bugs are still present:
Selection jumps/flickers.
Certain selections cause the page to scroll (haven't been able to find a way to
reproduce).
Here's a testcase of the remaining two issues.
Reopened Bug 212790 to track the remaining issues.
You need to log in before you can comment on or make changes to this bug.