Fast find (find bar) finds text hidden in the overflow of "overflow:hidden" elements but does not show it (scroll to it)

NEW
Unassigned

Status

()

defect
P5
normal
12 years ago
9 months ago

People

(Reporter: sciguyryan, Unassigned)

Tracking

(4 keywords)

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Reporter)

Description

12 years ago
Recently I noticed this but I guess it has always been this way.

Reading E-mails with Google Mail I was searching for text (if you have a Bugzilla E-mail and its description is larger than the page width you can see this yourself by searching for "comments to this bug at"). Sometimes it finds content that is completely invisible to the user, I believe its overflowed in this case, and this could potentially cause some confusion as the find bar is claiming to have found something but nothing is shown.

I'm not sure what can actually be done here, maybe set the find bar an intermediate between the not found and found for when the content isn't actually visible too the user?
(Reporter)

Comment 2

12 years ago
I'm not sure that its the same bug because that bug doesn't seem to mention overflow which is what I believe is happening here.
Depends on to track might be a good idea, then.
Depends on: 305381
Posted file testcase
I don't think this would be fixed by bug 407817.
Apparently, overflow: hidden can't be scrolled anymore within the find code. This used to be possible in Mozilla1.7. I think dbaron disabled it in some bug.

It seems to me that Mozilla should be able to scroll the found word into view for overflow: hidden nodes. That's also possible in IE. (Opera and Safari both show the same behavior as current Mozilla).
(In reply to comment #4)
>  I think dbaron disabled it in some bug.

Ah, found it, bug 259615.
So this is probably a regression from that bug, at least, if the desired behavior is to scroll the found word into view (instead of not finding anything).
Ah, indeed.
No longer depends on: 305381
Keywords: testcase
Summary: Fast find sometimes "finds" unseen content and could cause confusion → Fast find (find bar) finds text hidden in the overflow of "overflow:hidden" elements
(Assignee)

Updated

11 years ago
Product: Firefox → Toolkit

Updated

9 years ago
Duplicate of this bug: 375030

Comment 8

8 years ago
The ability to scroll when overflow: hidden made it in since this bug was last visited, it just needed to be connected.

Not sure the best way to test this, or where a test should be added since typeaheadfind doesn't seem to have its own tests?  

The SCROLL_OVERFLOW_HIDDEN flag gets added to the nsISelectionController and nsSelection.cpp to allow translating to the nsIPresShell::SCROLL_OVERFLOW_HIDDEN (simply reusing it would have caused a conflict between that and nsISelectionController::SCROLL_FIRST_ANCESTOR_ONLY, which are both 0x02).  

The changes in nsPresShell.cpp are to avoid ambiguity between nsISelectionController::SCROLL_OVERFLOW_HIDDEN and nsIPresShell:SCROLL_OVERFLOW_HIDDEN.  A few extraneous changes there were line-ending changes.

Comment 9

8 years ago
Will you request a review or is it not finished yet?
Summary: Fast find (find bar) finds text hidden in the overflow of "overflow:hidden" elements → Fast find (find bar) finds text hidden in the overflow of "overflow:hidden" elements but does not show it (scroll to it)

Updated

8 years ago
Duplicate of this bug: 691323

Updated

8 years ago
Attachment #566620 - Flags: review?(dietrich)
Comment on attachment 566620 [details] [diff] [review]
Passes SCROLL_OVERFLOW_HIDDEN along in flags so that scrolling occurs; cleans up enumerations/flags to avoid conflict.

I'm not the right reviewer here, haven't ever looked at any of this code.

Can someone suggest reviewers for the respective content, layout and browser changes in this patch?
Attachment #566620 - Flags: review?(dietrich)

Comment 12

8 years ago
https://wiki.mozilla.org/Modules/Toolkit
It seems Gavin (comment 6) is in the list for "Find toolbar".
Attachment #566620 - Flags: review?(dbaron)
Attachment #566620 - Flags: review?(Olli.Pettay)
Attachment #566620 - Flags: review?(gavin.sharp)
Assigned reviewers from the 3 different areas of code in the patch.
Comment on attachment 566620 [details] [diff] [review]
Passes SCROLL_OVERFLOW_HIDDEN along in flags so that scrolling occurs; cleans up enumerations/flags to avoid conflict.

The toolkit/ change is trivially correct, assuming the rest of the patch is OK. r=me on that.
Attachment #566620 - Flags: review?(gavin.sharp) → review+
OS: Windows XP → All
Hardware: x86 → All
Whiteboard: [parity-webkit][parity-opera][parity-ie]
I really think the browser should *never* scroll elements that are overflow:hidden; that should be done only by the page, if it wants to.  We have some bugs where sometimes user actions can cause such elements to scroll, but I consider those to be bugs.
I mostly agree about not scrolling areas that the user can't scroll themselves, so here is an alternative patch that will prevent finding it and confusing them.

Basically:
1. Get the rectangle for the range.
2. Escalate up the chain of frames to find the top frame that is a parent of one with overflows due to styling.  If none is found, then it's visible.
3. Check if the visible rectangle of that frame intersects the range's rectangle.
4. If not, then it's not visible.

"Select all" will still select the hidden text, so it can be copied.  Not sure if there's a bug filed for that (a brief search didn't turn one up).
Comment on attachment 566620 [details] [diff] [review]
Passes SCROLL_OVERFLOW_HIDDEN along in flags so that scrolling occurs; cleans up enumerations/flags to avoid conflict.

I agree with dbaron. overflow:hidden should not be scrollable.

Though, this bug should get some input from ux.
Attachment #566620 - Flags: review?(Olli.Pettay) → review-
Attachment #566620 - Flags: review?(dbaron) → review-
Comment on attachment 570125 [details] [diff] [review]
Alternate patch: don't find hidden text in overflow:hidden areas.

While this seems like perhaps a reasonable approach (though I'm actually pretty skeptical that it's worth the code complexity needed to implement it), this patch doesn't really do it right -- it's more complicated than this.  For example, if you have an overflow:scroll div inside an overflow:hidden div, and there's text that you need to scroll the overflow:scroll div in order to show, this will determine that it's hidden because the overflow:hidden div clips it at the overflow:scroll div's *current* scroll position.  And, looking more closely, I think there are a number of other serious bugs in the logic -- for example, considering only the outermost scroll frame that has overflow and not any inside it.

That said, I tend to think this bug should be WONTFIX rather than trying to improve this patch.
Attachment #570125 - Flags: review-
If you try the https://bugzilla.mozilla.org/attachment.cgi?id=292660 case in IE, Chrome, Opera, and WebKit, you'll notice they all scroll the overflow:hidden area on that page during a find for "mozilla".

Given that, as smaug suggested in comment 17, it seems like maybe this bug should get some input from the ux team.

Comment 20

5 years ago
Another example:
http://www.tomshardware.co.uk/answers/id-2006267/debugging-crash.html

Searching for
> FAILURE_ID_HASH_STRING

Firefox scrolls down to the bottom of the page, where the phrase would show up, if the first posting was fully visible, which it isn't. But currently it's scrolling to an area where the search-result is nowhere to be found.

On that page, the phrase can be found twice.
Because of that Firefox jumps between those two results when clicking "Next", but the user can't actually see them. Very confusing.

IE 11 and Chrome 34 scroll the part of the page into view: http://i.imgur.com/XOyBE6Z.jpg

Comment 21

5 years ago
Are moz-devs not annoyed by this, or why is there no attention to this bug, which is hiding search-results from the user?
More and more sites are using overflow (my latest encounter: text of longer Facebook-postings hidden behind "See more"), and it's not fun looking for Find-results, which are not visible to the user.

Chrome, IE, even the late Opera 12 shows them.

The worst part about this is that there is no visual indication that a search-result is hidden. The user doesn't even know where to look for it.
Flags: needinfo?(dbaron)
Flags: needinfo?(bugs)
If there's text that's reachable only by scrolling something that's overflow:hidden (which the user can't scroll), the fact that find behaves oddly doesn't seem like the biggest problem -- how many users will actually use find in order to read the text that they can't scroll to?  The far more serious problem seems to be that the author has designed a page with some of the contents hidden.

If they're hidden in a way that's not common across all browsers, it seems worth filing bugs on that.


I still think it's a bad idea to scroll overflow:hidden elements for find when nothing else scrolls them, especially if authors are sometimes using it to hide things that they want to stay hidden (which would mean scrolling to them would hide the contents that the author wanted visible).
Flags: needinfo?(dbaron)
Flags: needinfo?(bugs)
Duplicate of this bug: 557097

Updated

4 years ago
Duplicate of this bug: 565651

Updated

4 years ago
Duplicate of this bug: 1126765

Comment 26

4 years ago
Another example would be just about any Wikipedia article, for instance
https://en.wikipedia.org/wiki/Permutation

Looking for the word “jump” there currently shows 47 matches, none of which are visible. The first one has overflow:hidden; height:0px. Confusingly, you can scroll to this one with Next/Previous, although it's completely invisible. The remaining 46 have overflow:hidden; height:1px; width:1px; position: absolute; top: -99999px; and you can't scroll to any of them.


As a workaround, users can add the following style either to the Stylish add-on [1] or the userContent.css file [2].

@-moz-document domain("wikipedia.org") {
#jump-to-nav, .cite-accessibility-label { display: none !important; }
}

[1] https://addons.mozilla.org/firefox/addon/stylish/
[2] http://kb.mozillazine.org/UserContent.css

Comment 27

4 years ago
Totally agree with MichaelSmith: page find in areas hidden by overflow:hidden works in ALL major browsers EXCEPT Firefox.  It should definitely be considered a BUG and be fixed.

Another consideration is that very popular jquery/javascript scrolltools (nicescroll etc.) regularly hide content with overflow:hidden, but allow the user to scroll to the sections afterwards through the script.  In this case, user expectation would be completely broken.

Nicescroll works nicely in IE, Safari, Chrome, Opera, but not in Firefox!  Needs fixing.

Comment 28

4 years ago
I didn't mean to suggest that it should be fixed because Nicescroll isn't working in the last sentence of my previous comment, BTW, I was merely suggesting that users coming from or also using other browsers would be confused by Firefox's behaviour.  Thanks!

Updated

3 years ago
Duplicate of this bug: 1228814
Priority: -- → P5
I just encountered this bug, with a overflow: hidden for a list.
I wanted to highlight all occurrences of a word and then scroll the list to check the boxes corresponding to the lines where this word was found.
I was first surprised that there were highlights everywhere, but figured it was because it was hidden. OK for me.
Then I scrolled (user voluntary action) and the highlight boxes stayed in place and the text scrolled underneath. Being totally useless. And that's not OK for me.

I wish it would just scroll with the text. Hope that it can be fixed somehow.

Comment 31

3 years ago
(In reply to Flore Allemandou [:flore] from comment #30)
> Then I scrolled (user voluntary action) and the highlight boxes stayed in place and the text
> scrolled underneath. Being totally useless. And that's not OK for me.
Just to be clear, this bug is about scrolling found string into view when findbar highlights it

> I wish it would just scroll with the text. Hope that it can be fixed somehow.
If you scrolled via mouse wheel / scrollbar, then the bug you're describing is most likely one of connected bugs in bug 384458 (a new ugly findbar that is under development)
See Also: → 1318657
Mass bug change to replace various 'parity' whiteboard flags with the new canonical keywords. (See bug 1443764 comment 13.)
Whiteboard: [parity-webkit][parity-opera][parity-ie]
You need to log in before you can comment on or make changes to this bug.