void PopupBoxObject::MoveTo(int32_t aLeft, int32_t aTop) { nsMenuPopupFrame *menuPopupFrame = mContent ? do_QueryFrame(mContent->GetPrimaryFrame()) : nullptr; if (menuPopupFrame) { menuPopupFrame->MoveTo(CSSIntPoint(aLeft, aTop), true); } }
/* void scrollTo (long x, long y); */ void ScrollBoxObject::ScrollTo(int32_t x, int32_t y, ErrorResult& aRv) { nsIScrollableFrame* sf = GetScrollFrame(); if (!sf) { aRv.Throw(NS_ERROR_FAILURE); return; } sf->ScrollToCSSPixels(CSSIntPoint(x, y)); }
Touch::Touch(int32_t aIdentifier, LayoutDeviceIntPoint aPoint, LayoutDeviceIntPoint aRadius, float aRotationAngle, float aForce) { mIdentifier = aIdentifier; mPagePoint = CSSIntPoint(0, 0); mScreenPoint = CSSIntPoint(0, 0); mClientPoint = CSSIntPoint(0, 0); mRefPoint = aPoint; mPointsInitialized = false; mRadius = aRadius; mRotationAngle = aRotationAngle; mForce = aForce; mChanged = false; mMessage = 0; nsJSContext::LikelyShortLivingObjectCreated(); }
CSSIntPoint HTMLImageElement::GetXY() { nsIFrame* frame = GetPrimaryFrame(Flush_Layout); if (!frame) { return CSSIntPoint(0, 0); } nsIFrame* layer = nsLayoutUtils::GetClosestLayer(frame->GetParent()); return CSSIntPoint::FromAppUnitsRounded(frame->GetOffsetTo(layer)); }
int32_t MouseEvent::ScreenY(CallerType aCallerType) { if (aCallerType != CallerType::System && nsContentUtils::ResistFingerprinting()) { // Sanitize to something sort of like client cooords, but not quite // (defaulting to (0,0) instead of our pre-specified client coords). return Event::GetClientCoords(mPresContext, mEvent, mEvent->mRefPoint, CSSIntPoint(0, 0)).y; } return Event::GetScreenCoords(mPresContext, mEvent, mEvent->mRefPoint).y; }