Closed
Bug 391584
Opened 17 years ago
Closed 17 years ago
double-clicking a word followed by link selects the first word of the link text
Categories
(Core :: DOM: Selection, defect, P2)
Tracking
()
VERIFIED
FIXED
mozilla1.9beta2
People
(Reporter: info, Assigned: roc)
References
Details
(Whiteboard: [dbaron-1.9:RuCt])
Attachments
(5 files, 3 obsolete files)
66 bytes,
text/html
|
Details | |
10.18 KB,
patch
|
smontagu
:
review+
|
Details | Diff | Splinter Review |
11.53 KB,
patch
|
Details | Diff | Splinter Review | |
9.20 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
5.36 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a8pre) Gecko/2007080910 Minefield/3.0a8pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a8pre) Gecko/2007080910 Minefield/3.0a8pre ID:2007080910
(See summary.)
Reproducible: Always
Steps to Reproduce:
1. Double-click a word that is followed by a hyperlink.
For example, clickthisword comment 0.
Actual Results:
The selection extends to the first word of the hyperlink.
Expected Results:
Selection should only be the word and trailing whitespace.
This over-selection is a bit like bug 206141, so I put it in component Selection instead of GFX:Thebes.
Comment 1•17 years ago
|
||
I bet this has the same cause as bug 391464, so adding a dependency there and confirming. I can reproduce this using Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9a8pre) Gecko/2007080815 Minefield/3.0a8pre
Comment 3•17 years ago
|
||
This bug as described only occurs when layout.word_select.eat_space_to_next_word=true (i.e, by default on Windows). But the same occurs when clicking a word following a link (e.g. bug 391584 clickthisword), even if layout.word_select.eat_space_to_next_word is false.
Flags: blocking1.9?
Comment 4•17 years ago
|
||
(In reply to comment #3)
> (e.g. bug 391584 clickthisword)
Sorry, this example doesn't actually show the bug. But try clicking your user name after the "Log out" on the top of this page, and the word "out" is selected.
No longer blocks: 391783
Flags: blocking1.9? → blocking1.9+
Assignee | ||
Updated•17 years ago
|
Assignee: nobody → roc
Assignee | ||
Comment 5•17 years ago
|
||
Double-clicking on 'roc' selects 'out' as well.
Comment 6•17 years ago
|
||
Assignee | ||
Comment 7•17 years ago
|
||
Attachment #281396 -
Attachment is obsolete: true
Assignee | ||
Comment 8•17 years ago
|
||
Okay, this fixes it. The problem is when whitespace is collapsing; if the word break opportunity is associated with a space that collapses away, then we don't notice it. The solution is to remember when we pass over a collapsed space with a word-break opportunity.
This also fixes another bug in that testcase --- putting the caret in "out" and then doing a word-right advanes to the start of "roc" instead of stopping at the end of "out". This is because of the XXX-commented problem that we never have a word-break at the start of a frame. A simple way to improve this is to note a word break opportunity at the start of the frame when the frame starts with white-space.
Attachment #281407 -
Flags: superreview?(smontagu)
Attachment #281407 -
Flags: review?(smontagu)
Assignee | ||
Updated•17 years ago
|
Attachment #281407 -
Flags: superreview?(smontagu)
Assignee | ||
Comment 9•17 years ago
|
||
Okay, here's an update of the patch, this time with a mochitest.
While I was writing the test I realized we should also record a word break opportunity at the end of a frame when there's white-space there. This is still a bit of a hack ... a genuine fix would provide all possible context from adjacent frames when we call nsIWordBreaker.
Attachment #281407 -
Attachment is obsolete: true
Attachment #281601 -
Flags: review?(smontagu)
Attachment #281407 -
Flags: review?(smontagu)
Updated•17 years ago
|
Attachment #281601 -
Flags: review?(smontagu) → review+
Assignee | ||
Comment 10•17 years ago
|
||
checked in
Status: NEW → RESOLVED
Closed: 17 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Assignee | ||
Comment 11•17 years ago
|
||
I backed this out because the tests don't pass on Linux or Windows.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 12•17 years ago
|
||
Same patch, but this time it sets the layout.word_select.eat_space_to_next_word pref to false while running the tests. I'll try relanding this.
Assignee | ||
Comment 13•17 years ago
|
||
I relanded this a while ago.
Status: REOPENED → RESOLVED
Closed: 17 years ago → 17 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 14•17 years ago
|
||
(In reply to comment #4)
> try clicking your user
> name after the "Log out" on the top of this page, and the word "out" is
> selected.
Incorrectly selecting the hyperlink before is fixed in Minefield, for at least a few days. However, incorrectly selecting the hyperlink after still happens in build 2007101704. I think the bug should be reopened, or maybe the most-excellent Mr. O'Callahan has fixed a branch?
Assignee | ||
Comment 15•17 years ago
|
||
File a new bug with a testcase and make sure it isn't a duplicate of bug 391464.
Reporter | ||
Comment 16•17 years ago
|
||
The exact behavior I describe at the top of this bug is still present in Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a9pre) Gecko/2007102105 Minefield/3.0a9pre ID:2007102105
Double-click any word in the comments that's followed by a link, the first word of the link text is selected as well.
Why file the same text in a new bug? I'm reopening this. Sorry if I missed something obvious.
This seems different from bug 391464; Uri Bernstein thinks bug 391783 is the same. I just re-confirmed all three in my build.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 17•17 years ago
|
||
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a9pre) Gecko/2007102205 Minefield/3.0a9pre
I confirm that this bug (steps-to-reproduce from comment 0) is this present in the latest trunk hourly.
Assignee | ||
Comment 18•17 years ago
|
||
Indeed, it's not fixed when eat_space_next_to_word is false. Sorry about that.
Assignee | ||
Comment 19•17 years ago
|
||
I mean, it's not fixed when eat_space_next_to_word is *true*.
Assignee | ||
Comment 20•17 years ago
|
||
This patch makes us pass around the contents of earlier text frames as context for making word-breaking decisions. This way we can correctly identify a word-break opportunity at the edge of a frame, fixing this bug.
Attachment #285835 -
Flags: review?(smontagu)
Assignee | ||
Updated•17 years ago
|
Whiteboard: [needs review]
Comment 21•17 years ago
|
||
Comment on attachment 285835 [details] [diff] [review]
further fix
>+ PRInt32 textStart;
>+ if (aDirection > 0) {
>+ if (aContext.IsEmpty()) {
>+ // No left context, so it must be the start of a line or text run
>+ mWordBreaks[0] = PR_TRUE;
>+ }
>+ textStart = aContext.Length();
>+ mFrag->AppendTo(aContext, textOffset, textLen);
>+ } else {
>+ if (aContext.IsEmpty()) {
>+ // No right context, so it must be the start of a line or text run
>+ mWordBreaks[textLen] = PR_TRUE;
s/start/end/ in the second comment, and please use "previous" and "subsequent" or something, not "right" and "left".
Attachment #285835 -
Flags: review?(smontagu) → review+
Assignee | ||
Updated•17 years ago
|
Whiteboard: [needs review] → [needs landing]
Whiteboard: [needs landing] → [needs landing][dbaron-1.9:RuCt]
Assignee | ||
Comment 22•17 years ago
|
||
Attachment #285835 -
Attachment is obsolete: true
Attachment #287633 -
Flags: review+
Assignee | ||
Updated•17 years ago
|
Priority: -- → P2
Comment 23•17 years ago
|
||
Checking in layout/generic/nsFrame.cpp;
/cvsroot/mozilla/layout/generic/nsFrame.cpp,v <-- nsFrame.cpp
new revision: 3.765; previous revision: 3.764
done
Checking in layout/generic/nsIFrame.h;
/cvsroot/mozilla/layout/generic/nsIFrame.h,v <-- nsIFrame.h
new revision: 3.381; previous revision: 3.380
done
Checking in layout/generic/nsTextFrameThebes.cpp;
/cvsroot/mozilla/layout/generic/nsTextFrameThebes.cpp,v <-- nsTextFrameThebes.cpp
new revision: 3.121; previous revision: 3.120
done
Status: REOPENED → RESOLVED
Closed: 17 years ago → 17 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing][dbaron-1.9:RuCt] → [dbaron-1.9:RuCt]
Target Milestone: --- → mozilla1.9 M10
Assignee | ||
Comment 24•17 years ago
|
||
I'll check these in when I get a chance
Assignee | ||
Comment 25•17 years ago
|
||
Test checked in
Comment 26•17 years ago
|
||
Verified in Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9pre) Gecko/2008050704 Minefield/3.0pre and Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9pre) Gecko/2008050706 Minefield/3.0pre.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•