Open Bug 520573 Opened 15 years ago Updated 2 years ago

Snopes.com's anti-selection script can break focus/keyboard control

Categories

(Firefox :: Keyboard Navigation, defect)

x86
Windows 7
defect

Tracking

()

People

(Reporter: netrolller.3d, Unassigned)

References

()

Details

Normally, if a text field (e.g. the Location bar or the Search bar - doesn't matter if it is in chrome or content) is focused, clicking an empty zone in the content area causes the text field to lose focus, as expected. However, Snopes.com's disable-selection script seems to break this behavior, with focus remaining stuck in the selected text field, until another text field is clicked (you can't "click out" of text fields), potentially breaking keyboard-based scrolling. (This is clearly not the purpose of the script - it is a bug triggered by the script.)

Another bug that shows up is that right-clicking a link causes a permanent focus rectangle to appear around the link, which doesn't disappear when something else is clicked.

One more bug is described in the reproduction steps.

Steps to reproduce (1):
1. Load URL.
2. Click the location bar. (Location bar gains focus.)
3. Click anywhere on the page. (BUG: Nothing happens; location bar stays focused.)
4. Try scrolling using the keyboard arrow keys. (BUG: Arrows move caret inside location bar, instead of scrolling.)
5. (not applicable on Linux) Press backspace. (BUG: Nothing happens - possibly no way to go back in History without using the mouse at this point!)

Steps to reproduce (2):
1. Load URL.
2. Right-click the "opera singer" link. (Context menu pops up.)
3. Click on an empty area in the page. (BUG: Context menu closes, but focus rectangle persists!)
4. On keyboard, press Tab, then Shift+Down. (BUG: Some text gets selected, even though selection is supposedly disabled!)
5. Click on an empty area in the page. (BUG: Selection is stuck, with no way to make it disappear. Boo!)
Note that the URL is completely invalid HTML, with the offending script outside the <HTML> root element(!). Not sure if this is necessary for the bug to appear.
Further investigation shows that the bug boils down to this line of JS:
javascript:void(window.onmousedown=new Function ("return false"))

Running this script on this page causes all the above bugs to appear here.
Setting branch to Unspecified. This is still an issue in 4.0.1.
Version: 3.5 Branch → unspecified
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.