Closed Bug 623432 Opened 9 years ago Closed 4 years ago

Drag selection fails in browser/viewSource/viewPartialSource window when maximized. Unable to horizontal scroll by selecting text by mouse dragging

Categories

(Core :: DOM: Selection, defect)

x86
All
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox44 --- wontfix
firefox45 --- wontfix
firefox46 --- wontfix
firefox47 --- affected
firefox49 --- fixed
firefox-esr38 --- affected
firefox-esr45 --- ?

People

(Reporter: alice0775, Assigned: mats)

References

(Depends on 2 open bugs)

Details

(Keywords: regression, Whiteboard: regressed in Firefox 4)

Attachments

(7 files)

Build Identifier:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b9pre) Gecko/20110105 Firefox/4.0b9pre ID:20110105030550

Drag seection fails in viewSource/viewPartialSource window when miximized.Unable to horizontal scroll by selecting text.


Reproducible: Always

Steps to Reproduce:
1. Start Minefield with new profile
2. Open ( https://bugzilla.mozilla.org/ )
3. View Source (Ctrl + U) and Maximized
4. Scroll down to the middle of page
3. try to select the comment line "<p style="padding: 5px; margin: 0px; color: red; text-align: center;">Bugzilla will b......" by mouse move horizontally.

Actual Results:
 Drag seection fails.
 Unable to horizontal scroll by selecting text by mouse dragging.

Expected Results:
 Selection should be expand with horizontal scrolling.
Attached image example screen shot
Hmm.  Is this a regression from 3.6?
(In reply to comment #2)
> Hmm.  Is this a regression from 3.6?
Yes,

Wotks:
Mozilla/5.0 (Windows; U; Windows NT 6.1; ja-JP; rv:1.9.1.17pre) Gecko/20110105 Firefox/3.5.17pre ID:20110105030302
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.14pre) Gecko/20110103 Firefox/3.6.14pre ID:20110103033208

Fails:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b9pre) Gecko/20110105 Firefox/4.0b9pre ID:20110105030550

There are 3 regressions:
Works:
http://hg.mozilla.org/mozilla-central/rev/bf0fdec8f43b
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a1pre) Gecko/20090913 Minefield/3.7a1pre ID:20090913050738
Fails(selection expanded from top, jump to top)
http://hg.mozilla.org/mozilla-central/rev/912c6ae3b70c
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a1pre) Gecko/20090914 Minefield/3.7a1pre ID:20090914045953
*pushlog1(selection expanded from top, jump to top):
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=bf0fdec8f43b&tochange=912c6ae3b70c

Fails(selection expanded from top, jump to top)
http://hg.mozilla.org/mozilla-central/rev/3079370d6597
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a1pre) Gecko/20090917 Minefield/3.7a1pre ID:20090917041912
Fails(selection expanded from top)
http://hg.mozilla.org/mozilla-central/rev/41dd493c42c9
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a1pre) Gecko/20090918 Minefield/3.7a1pre ID:20090918042213
*pushlog2(selection expanded from top):
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=3079370d6597&tochange=41dd493c42c9

Fails(selection expanded from top)
http://hg.mozilla.org/mozilla-central/rev/e915fafc9ba5
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a1pre) Gecko/20090928 Minefield/3.7a1pre ID:20090928044637
Fails(not expand)
http://hg.mozilla.org/mozilla-central/rev/fbea0edb9622
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a1pre) Gecko/20090929 Minefield/3.7a1pre ID:20090929042924
*pushlog3(not expand any more):
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=e915fafc9ba5&tochange=fbea0edb9622
Attached file sample
This happens not only in viewSource but also in tabbrowser.
is this duplication of Bug 55924 ?
Hmm.  Seems like it might be, but not sure why the behavior changed here...
Depends on: 55924
Summary: Drag seection fails in viewSource/viewPartialSource window when miximized.Unable to horizontal scroll by selecting text by mouse dragging → Drag selection fails in viewSource/viewPartialSource window when maximized. Unable to horizontal scroll by selecting text by mouse dragging
There is also bug 383391
OS: Windows 7 → All
#1 regression is caused by Bug 503943,
#2 regression is caused by Bug 516991,
#3 regression is caused by Bug 516615.
Now, css writing-mode:vertical* is implemented, horizontal scrolling becomes important in this case.
Summary: Drag selection fails in viewSource/viewPartialSource window when maximized. Unable to horizontal scroll by selecting text by mouse dragging → Drag selection fails in browser/viewSource/viewPartialSource window when maximized. Unable to horizontal scroll by selecting text by mouse dragging
Flags: needinfo?(enndeakin)
css writing-mode:vertical*  testcase : attachment 8606769 [details]
Any update here enndeakin?
Flags: needinfo?(benjamin)
Whiteboard: regressed in Firefox 4
Neil and I talked about this; he feels like it's changed a lot since he worked on that and Mats might have better insight than him.

Mats, if this is just noise (or you're otherwise unable to look at this), let me know.
Flags: needinfo?(mats)
Flags: needinfo?(enndeakin)
Flags: needinfo?(benjamin)
(In reply to Mats Palmgren (:mats) from comment #13)
> Please test the builds here:
> https://archive.mozilla.org/pub/firefox/try-builds/mpalmgren@mozilla.com-
> 0d912edd0808f191de6f6cf9f063e7ba7dc235a2/

The try build works as expected with testcase of comment#10 :)
However, it does not work with view source case of comment#0 and comment#4.

https://hg.mozilla.org/try/rev/0d912edd0808f191de6f6cf9f063e7ba7dc235a2
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0 ID:20160422181414
I think there are two separate problems here.  The first is that drag-selecting
content that is adjacent to the screen edge is impossible since the mouse cursor
is actually located exactly at the selection edge so we decide that scrolling
isn't necessary.  The second problem occurs when the mouse moves over a scrollbar
(which isn't selectable), then the selection code simply stops receiving events.

Alice, can you confirm that the builds above solves the first problem?
(i.e. horizontal selection over the screen edge *without* a vertical
scrollbar on that side)

I'll see if I can come up with a fix for the second problem too...
Note that the second problem above also occurs when the window edge isn't anywhere
near the screen edge.  E.g. load the attached "sample" test and drag-select to
the right, then stop moving the mouse when it's 1px into the vertical scrollbar.
The selection simply doesn't work as long as the mouse is over the scrollbar.
(In reply to Mats Palmgren (:mats) from comment #17)
> I think these builds (when ready) should fix also the second problem:
> https://archive.mozilla.org/pub/firefox/try-builds/mpalmgren@mozilla.com-
> 2667aa1345b4745eae04b2e0da46e9574107a55a/

This try build fixes the problem(with/without scrollbar and vertical text as well) :)

https://hg.mozilla.org/try/rev/2667aa1345b4745eae04b2e0da46e9574107a55a
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0 ID:20160423130544
Great, thanks.
This is mostly just an optimization, but I think it also makes sense
logically to test that we're indeed drag-selecting upfront since
the rest of the method is only for drag-selection.
Assignee: nobody → mats
Attachment #8744661 - Flags: review?(tnikkel)
BTW, see comment 15 for problem description.
Comment on attachment 8744659 [details] [diff] [review]
part 1 - When the target scroll point is at the screen edge and no scrolling occured, then try to scroll 10px in that direction anyway

>+  if (didScroll && mAutoScrollTimer) {
>     nsPoint presContextPoint = globalPoint -
>-      presContext->PresShell()->FrameManager()->GetRootFrame()->GetOffsetToCrossDoc(rootmostFrame);
>+      shell->FrameManager()->GetRootFrame()->GetOffsetToCrossDoc(rootmostFrame);

If shell can go away and needs a refptr, then presumably the root frame can get destroyed. So I guess you need to check root frame.
Attachment #8744659 - Flags: review?(tnikkel) → review+
(In reply to Timothy Nikkel (:tnikkel) from comment #25)
> If shell can go away and needs a refptr, then presumably the root frame can
> get destroyed. So I guess you need to check root frame.

Nevermind, we have a weakframe check on aFrame, if its alive then the root frame is too.
Comment on attachment 8744660 [details] [diff] [review]
part 2 - Ignore scrollbars while drag-selecting content

Seems reasonable, although I don't really know this code.
Attachment #8744660 - Flags: review?(tnikkel) → review+
Attachment #8744661 - Flags: review?(tnikkel) → review+
Depends on: 1268751
You need to log in before you can comment on or make changes to this bug.