/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
class nsImageControlFrame final : public nsImageFrame { public: explicit nsImageControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext);
~nsImageControlFrame() final;
// Don't do anything if the event has already been handled by someone if (nsEventStatus_eConsumeNoDefault == *aEventStatus) { return NS_OK;
}
if (IsContentDisabled()) { return nsIFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
}
*aEventStatus = nsEventStatus_eIgnore;
if (aEvent->mMessage == eMouseUp &&
aEvent->AsMouseEvent()->mButton == MouseButton::ePrimary) { // Store click point for HTMLInputElement::SubmitNamesValues // Do this on MouseUp because the specs don't say and that's what IE does auto* lastClickedPoint = static_cast<CSSIntPoint*>(
mContent->GetProperty(nsGkAtoms::imageClickedPoint)); if (lastClickedPoint) { // normally lastClickedPoint is not null, as it's allocated in Init()
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(
aEvent, RelativeTo{this});
*lastClickedPoint = TranslateEventCoords(pt);
}
} return nsImageFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.