Open Bug 1543196 Opened 6 years ago Updated 3 years ago

using disabled="true" enables document.oncontextmenu behavior

Categories

(Core :: DOM: Events, defect, P3)

66 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: m.phillips, Unassigned)

References

(Regression)

Details

(Keywords: regression)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0

Steps to reproduce:

I set document.oncontextmenu = function() {return false}.

<html>
<head/>
<body onload="document.oncontextmenu = function() {return false};">
<!-- Disabled context menu should be suppressed but is NOT -->
<input type="text" size="20" disabled="disabled" class="TxtFldDis_sun4">
<textarea rows="2" cols="20" disabled="disabled"></textarea>

<!-- Context menu suppressed correctly when disabled attribute not present -->
<input type="text" size="20" class="TxtFldDis_sun4">
<textarea rows="2" cols="20"></textarea>

</body>
</html>

Actual results:

The context menu appears with a right click on the elements with the attribute
disabled="disabled"

Expected results:

The context menu should not be appearing whether the disabled attribute is present or not.

Regression window:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=dec6aa71da64&tochange=d8be4bc4fba8

Suspect:
801ba75ac563 Olli Pettay — Bug 816340 - Propagate events to chrome even if there is a disabled form control in the event target chain, r=jst,gavin

Component: Untriaged → DOM: Events
Product: Firefox → Core
Regressed by: 816340

smaug, is this expected given bug 816340?

Flags: needinfo?(bugs)
Priority: -- → P3

Hmm, we should get the document level contextmenu.

But this stuff if being changed in bug 1540995

Depends on: 1540995
Flags: needinfo?(bugs)

I think this bug is somewhat invalid. Even when disabled, the default context menu should still be presented (as :smaug states) - but perhaps preventDefault() could be used to prevent it from showing.

Has Regression Range: --- → yes
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.