Closed
Bug 58704
Opened 24 years ago
Closed 22 years ago
cannot select anything smaller than lines in justified text
Categories
(Core :: DOM: Selection, defect, P1)
Core
DOM: Selection
Tracking
()
VERIFIED
FIXED
mozilla1.0
People
(Reporter: cks+mozilla, Assigned: bzbarsky)
References
Details
(Keywords: helpwanted, Whiteboard: [selection][correctness], EDITORBASE)
Attachments
(3 files)
1.03 KB,
text/html
|
Details | |
568 bytes,
text/html
|
Details | |
967 bytes,
patch
|
akkzilla
:
review+
kinmoz
:
superreview+
asa
:
approval+
|
Details | Diff | Splinter Review |
Build ID: a trunk CVS pull from today
Current Mozilla builds don't seem to be able to select in justified text
properly (or at least justified text in tables, which is what I have boiled
down a simplified test case to). It appears to work like this: in the first
line you can select normally. After that, you can only select line-by-line,
and if you double-click to select a word the first word of the line will be
selected, no matter where the cursor is.
I will attach a test case. An in-the-field case is at any site that uses
justified text content, such as the stories on http://www.theregister.co.uk/
This is a recent regression. I believe it appeared after the fix for a
corruption bug involving selection of justified text was put into the trunk,
within the past week or so. (Bug #56704)
Reporter | ||
Comment 1•24 years ago
|
||
Confirming on Linux build 2000103108.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 4•24 years ago
|
||
[Reproduced on build 2000112320, Mac OS 9.0 --> All/All.]
OS: Linux → All
Hardware: PC → All
Comment 5•24 years ago
|
||
using the build from 12/31 on win98 I am unable to reproduce this bug. I can
select a word or line based on clicks and can select any word in any line.
marking wfm
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → WORKSFORME
Reporter | ||
Comment 6•24 years ago
|
||
This bug remains present in a current Linux CVS build. Reopening.
The instructions in the attachment remain current for me.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Comment 7•24 years ago
|
||
reassign to akkana to check this out on linux, akkana if you can dup this one,
can you please update the bug and then hand it over to anthony -- he may need
some guidance as to the root of the issue since it seems to be linuz specific
Assignee: mjudge → akkana
Status: REOPENED → NEW
OS: All → Linux
Hardware: All → Other
Comment 8•24 years ago
|
||
Yes, it happens on linux exactly as described. Weird! Matthew said he saw it
on Mac as well, so it doesn't sound like it's linux only.
Assignee: akkana → anthonyd
Severity: normal → major
Status: NEW → ASSIGNED
Priority: P3 → P2
Target Milestone: --- → mozilla0.9
Comment 9•24 years ago
|
||
this is still an issue on mac using the build 2001011912 -- really weird
selection bug
Keywords: correctness,
nsbeta1
Whiteboard: [nsbeta1+]
Comment 11•23 years ago
|
||
move to mozilla0.9.2
I wonder if there is some pref setting that is different on Windows (from Mac and
Unix) and that is what causing the platform difference?
Keywords: helpwanted
OS: Linux → All
Hardware: Other → All
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Comment 13•23 years ago
|
||
*** Bug 89579 has been marked as a duplicate of this bug. ***
Comment 14•23 years ago
|
||
*** Bug 62490 has been marked as a duplicate of this bug. ***
Comment 15•23 years ago
|
||
An interesting note: if the justified block contains an inline element, then you
can begin or end a selection anywhere inside the inline element, as normal.
Comment 16•23 years ago
|
||
Yes, and another example weirdness: if the (second or later) justified line
contains a link (A HREF), double-clicking somewhere in the last after the </A>
chooses the last word in the link text (not the word under the mouse, and not
the first word of the line). Moreover it seems the word after the link sometimes
gets underlined! Very Weird.
BTW, the bug is still present in 0.9.3, Linux (redhat 7.1, RPM)
Comment 17•23 years ago
|
||
Comment 18•23 years ago
|
||
Also, if there is an italics text inside the justified paragraph, that
text can be selected normally. I have added a testcase showing it.
Assignee | ||
Comment 19•23 years ago
|
||
*** Bug 53334 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 20•23 years ago
|
||
*** Bug 95757 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 22•23 years ago
|
||
*** Bug 99516 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 23•23 years ago
|
||
*** Bug 112067 has been marked as a duplicate of this bug. ***
Comment 24•23 years ago
|
||
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1
(you can query for this string to delete spam or retrieve the list of bugs I've
moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
Comment 25•23 years ago
|
||
*** Bug 96281 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 26•23 years ago
|
||
*** Bug 114600 has been marked as a duplicate of this bug. ***
Comment 27•23 years ago
|
||
An interesting thing is: If I (Mozilla 0.9.7 on Debian Linux) try to select into
the last line of the second paragraph in the first example, it is possible to
select up to any letter by moving the mouse downward. If the mouse cursor is in
the pixel row below the last line, you can select just as it should be.
Keywords: mozilla1.0
Assignee | ||
Comment 28•23 years ago
|
||
*** Bug 124473 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 30•23 years ago
|
||
*** Bug 130517 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 31•22 years ago
|
||
*** Bug 137488 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 32•22 years ago
|
||
Nominating. This is the sort of behavior that end-users find incredibly
frustrating. User points at a word, clicks, drags right, nothing happens. User
points at a word, clicks, drags down, the entire line (before and after the
point where user clicked) is selected. User concludes that the program has
screwy selection behavior and never selects text in it again, since it seems to
be impossible to do it in a reasonable way.
As a note, this needs to be tested on a line that is _not_ the first line in the
paragraph (leading to yet more confusion).
Could someone point me to the code that would be involved in this, please?
mjudge? jfrancis? akkana?
Keywords: nsbeta1
Comment 33•22 years ago
|
||
I second the nomination -- this happened to me the other day and was indeed
extremely frustrating (one of those "What kind of brain-dead app is this?" moments).
Most text selection is done in nsTextFrame.cpp and nsFrame.cpp (or was, last
time I tried to look at selection bugs). It was never clear to me what
controlled what was in one file vs. the other -- for example, word delimiters
were handled in nsTextFrame but paragraph delimiters were in nsFrame.
Updated•22 years ago
|
Comment 34•22 years ago
|
||
nominating for EDITORBASE
Whiteboard: [selection][correctness] → [selection][correctness], EDITORBASE
Comment 35•22 years ago
|
||
editorbase triage: EDITORBASE-. The default for tables is align=left. This is
not common usage.
Whiteboard: [selection][correctness], EDITORBASE → [selection][correctness], EDITORBASE-
Comment 36•22 years ago
|
||
Please re-evaluate. There are 12 duplicate bugs for this bug; are we really
sure it's not common editor usage?
Whiteboard: [selection][correctness], EDITORBASE- → [selection][correctness], EDITORBASE
Comment 37•22 years ago
|
||
*** Bug 138261 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 38•22 years ago
|
||
As a note, this is the default for all blog entries and a number of news
sites... News sites in particular tend to go for a "newspaper-like" look, which
means align:justify.
Assignee | ||
Comment 39•22 years ago
|
||
OK... This is a bug on Mac and Linux, but not Windows because on Windows the
"browser.drag_out_of_frame_style" pref is not set to "1". This pref is checked
by nsTextFrame::GetPositionSlowly(), and if it's true we perform a check to see
whether the position is inside the frame bounds at all. Now the checking code
looks like this:
nsRect bounds(mRect);
bounds.MoveBy(origin.x, origin.y);
if (aPoint.y < bounds.y)//above rectangle
{
aOffset = mContentOffset;
outofstylehandled = PR_TRUE;
}
else if (aPoint.y > (bounds.y + bounds.height))
{
aOffset = mContentOffset + mContentLength;
outofstylehandled = PR_TRUE;
}
After this, if |outofstylehandled| is true we just use the aOffset value we
already have instead of calculating it.
Now testing on the testcases here, clicking on the _first_ line I get:
origin.y == 930
bounds.y (before adjustment) == 0
bounds.height == 238
On the _second_ line I get:
origin.y == 1168
bounds.y (before adjustment) == 238
bounds.height == 238
So the "238" height has been counted twice -- "origin" has moved and the origin
of mRect has moved (naturally). As a result, we hit the |aPoint.y < bounds.y|
case, set the offset to the smallest offset in the frame, and things break.
The attached patch changes this code to be just like the code in
nsTextFrame::GetPosition(). It fixes the bug for me and seems like the right
thing to do from a completely theoretical standpoint...
The only caveat is that the current (buggy, imo) code was put in place in
revision 1.270 of nsTextFrame.cpp to fix Mac bugs: bug 29570, bug 37393, bug
42794. It replaced other (buggy, obviously) code that used mRect.y where I use
origin.y in the patch. I'm 99% certain that using origin.y is the right thing
to do, but someone with a Mac should test the three bugs in question with the
patch. brade? Can you do it?
Comment 40•22 years ago
|
||
I played around with the patch for a while, and it seems to work well.
(One problem I noticed however, was that dragging text and dropping it at the
drag-location crashed Mozilla. However, this seems to happen even *without* the
patch applied...)
Comment 41•22 years ago
|
||
*** Bug 139446 has been marked as a duplicate of this bug. ***
Comment 42•22 years ago
|
||
mjudge, can you review bz's patch, or name another reviewer? We should get this
in for 1.0RC2. Thanks,
/be
Blocks: 138000
Keywords: mozilla1.0 → mozilla1.0+
Comment 43•22 years ago
|
||
Hakan--by some chance were you using Linux when you encountered the crasher you
mention in comment 40? There is a known issue (Linux-specific) with drag/drop.
I believe the bug now has a reviewed patch and may be checked in now (or maybe
not?). I'm pretty sure it's a topcrash. Sorry I don't have the bug # handy.
Comment 44•22 years ago
|
||
Yes, I was using Linux. (Can we please get some review action in this bug? It's
pretty major for all Linux users, I'd say.)
Comment 45•22 years ago
|
||
Hakan:
Thats bug 81779
Comment 46•22 years ago
|
||
bug 81779
I just got e-mail indicating it was just checked in
Comment 47•22 years ago
|
||
This is wanted by drivers for RC2, I tested the patch (it works fine) and we're
still not getting any review attention. I'm tempted to just stamp my r=, since
I tested it, but I won't. mjudge, can you please have a look at the patch?
Comment 48•22 years ago
|
||
Comment on attachment 80111 [details] [diff] [review]
Proposed patch v1.0 (special thanks to kin, hwaara and especially smontagu)
I'm going to go ahead and sr=kin@netscape.com this patch. I think that in the
original patch,
mjudge meant to use MoveTo() instead of MoveBy(), which would have made the
coordinates involved equivalent to the code in GetPosition() ... only it used 2
extra function calls to get the bounds and reset the origin of the resulting
bounds rect.
I don't think we have to worry about regressing any of the bugs the original
patch was intended to fix. aPoint is in the coordinate system of the view not
the frame, and the rect we are comparing this point with is also in the view
coordinate system (with bz's patch) so the intended comparison's should work
properly.
Attachment #80111 -
Flags: superreview+
Comment 49•22 years ago
|
||
Comment on attachment 80111 [details] [diff] [review]
Proposed patch v1.0 (special thanks to kin, hwaara and especially smontagu)
We don't seem to be hearing from Mike (though he said on Wed. and Thurs. that
he would look at it) so I'll give it my r=akkana. Everything I've tested with
the patch works as expected, no unwanted side effects noticed.
Attachment #80111 -
Flags: review+
Comment 50•22 years ago
|
||
got laptop back and i have been wrestling with the bulid system on it. If akkana
has reviewed it then thats cool with me.
Comment 51•22 years ago
|
||
Is this ready to go? Can it be landed today or tomorrow?
Assignee | ||
Comment 52•22 years ago
|
||
To me. Checked in on trunk, mailed drivers for branch approval.
Assignee: mjudge → bzbarsky
Priority: P2 → P1
Comment 53•22 years ago
|
||
Comment on attachment 80111 [details] [diff] [review]
Proposed patch v1.0 (special thanks to kin, hwaara and especially smontagu)
a=asa (on behalf of drivers) for checkin to the 1.0 branch
Attachment #80111 -
Flags: approval+
Assignee | ||
Comment 54•22 years ago
|
||
checked in on the branch.
Status: NEW → RESOLVED
Closed: 24 years ago → 22 years ago
Keywords: fixed1.0.0
Resolution: --- → FIXED
Comment 55•22 years ago
|
||
This is great! Finally, I'm able to properly select justified text!
Thanks Boris! :-)
Comment 56•22 years ago
|
||
is this checked in on trunk as well?
Assignee | ||
Comment 57•22 years ago
|
||
Yep. It is. See comment 52.
Comment 58•22 years ago
|
||
hmmm... when I double click on words in the testcases, what gets highlighted is
the beginning of the word to the end of the word + 1 space. In normally aligned
text, I just get from the beginning to the end of the word with no extra space
highlighted.
Is this is a bug in the patch that was commited?
Jake
Assignee | ||
Comment 59•22 years ago
|
||
hoju, what OS is this? I cannot reproduce that on Linux....
In any case, it's a separate bug from this one.
Comment 60•22 years ago
|
||
The space is selected deliberately on windows. Linux (and, I think, mac) don't
select the space. It's controlled by the prefs:
layout.word_select.eat_space_to_next_word and
layout.word_select.stop_at_punctuation.
Comment 61•22 years ago
|
||
Akkana,
Why the difference in behavior for different platforms? Why the difference in
selection between text with different alignments? And why would one want a
preference like this in the first place? Shouldn't it just behave the same?
BTW, Boris, I am on Win2k (sp2sr1).
Jake
Comment 62•22 years ago
|
||
People have different expectations on different platforms, because the native
apps have different behaviors. We try to mimic native app selection behavior as
much as possible.
For some of the history of the doubleclick behavior, see bug 98546. Note that
selecting the space was what all platforms did at first, because that was what
Windows users expected and the code was written by a windows person, but
eventually a mac person fixed it to allow for the unix/mac expectation. If you
disagree about the windows default, bug 98546 is the bug you want; but be ready
to back it up with a substantial list of popular windows apps that don't select
the space.
Comment 63•22 years ago
|
||
Tried selecting text on a few sites that used to suffer from this problem, they
all work flawlessly. Yay!
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•