Bug 1405087: Don't use -moz-user-input: disabled to decide event handling stuff. r=smaug

We only set it on disabled form controls anyway, so use the content state
directly.

MozReview-Commit-ID: 7jJ75dvszyC
This commit is contained in:
Emilio Cobos Álvarez
2018-02-10 19:34:10 +01:00
parent 28c2666aa0
commit d6211e6535
10 changed files with 40 additions and 44 deletions

View File

@@ -46,15 +46,14 @@ HTMLOptGroupElement::GetEventTargetParent(EventChainPreVisitor& aVisitor)
aVisitor.mCanHandle = false;
// Do not process any DOM events if the element is disabled
// XXXsmaug This is not the right thing to do. But what is?
if (HasAttr(kNameSpaceID_None, nsGkAtoms::disabled)) {
if (IsDisabled()) {
return NS_OK;
}
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
const nsStyleUserInterface* uiStyle = frame->StyleUserInterface();
if (uiStyle->mUserInput == StyleUserInput::None ||
uiStyle->mUserInput == StyleUserInput::Disabled) {
if (nsIFrame* frame = GetPrimaryFrame()) {
// FIXME(emilio): This poking at the style of the frame is broken unless we
// flush before every event handling, which we don't really want to.
if (frame->StyleUserInterface()->mUserInput == StyleUserInput::None) {
return NS_OK;
}
}