зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1556556
- Remove many uses of IgnoreRootScrollFrame. r=mstange,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D68913
This commit is contained in:
Родитель
62da5ce412
Коммит
7cf10dca6d
|
@ -536,17 +536,7 @@ Accessible* Accessible::ChildAtPoint(int32_t aX, int32_t aY,
|
||||||
offset += presContext->PresShell()->GetVisualViewportOffset() -
|
offset += presContext->PresShell()->GetVisualViewportOffset() -
|
||||||
presContext->PresShell()->GetLayoutViewportOffset();
|
presContext->PresShell()->GetLayoutViewportOffset();
|
||||||
|
|
||||||
EnumSet<nsLayoutUtils::FrameForPointOption> options = {
|
nsIFrame* foundFrame = nsLayoutUtils::GetFrameForPoint(startFrame, offset);
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
// This is needed in Android to ignore the clipping of the scroll frame
|
|
||||||
// when zoomed in. May regress something on other platforms, so
|
|
||||||
// keeping it Android-exclusive for now.
|
|
||||||
nsLayoutUtils::FrameForPointOption::IgnoreRootScrollFrame
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
nsIFrame* foundFrame =
|
|
||||||
nsLayoutUtils::GetFrameForPoint(startFrame, offset, options);
|
|
||||||
|
|
||||||
nsIContent* content = nullptr;
|
nsIContent* content = nullptr;
|
||||||
if (!foundFrame || !(content = foundFrame->GetContent()))
|
if (!foundFrame || !(content = foundFrame->GetContent()))
|
||||||
|
|
|
@ -62,17 +62,6 @@ APZEventResult APZInputBridge::ReceiveInputEvent(WidgetInputEvent& aEvent) {
|
||||||
UpdateWheelTransaction(mouseEvent.mRefPoint, mouseEvent.mMessage);
|
UpdateWheelTransaction(mouseEvent.mRefPoint, mouseEvent.mMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If zooming is enabled, mark the mouse event as "ignore root
|
|
||||||
// scroll frame". This ensures that the main-thread hit test the
|
|
||||||
// mouse event undergoes (in PositionedEventTargeting.cpp) uses
|
|
||||||
// the IGNORE_ROOT_SCROLL_FRAME flag, which is needed for correct
|
|
||||||
// hit testing in a zoomed-in or zoomed-out state.
|
|
||||||
// FIXME: bug 1525793 -- this may need to handle zooming or not on a
|
|
||||||
// per-document basis.
|
|
||||||
if (StaticPrefs::apz_allow_zooming()) {
|
|
||||||
mouseEvent.mIgnoreRootScrollFrame = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (WillHandleMouseEvent(mouseEvent)) {
|
if (WillHandleMouseEvent(mouseEvent)) {
|
||||||
MouseInput input(mouseEvent);
|
MouseInput input(mouseEvent);
|
||||||
input.mOrigin =
|
input.mOrigin =
|
||||||
|
|
|
@ -475,7 +475,6 @@ nsEventStatus APZCCallbackHelper::DispatchSynthesizedMouseEvent(
|
||||||
if (aMsg == eMouseLongTap) {
|
if (aMsg == eMouseLongTap) {
|
||||||
event.mFlags.mOnlyChromeDispatch = true;
|
event.mFlags.mOnlyChromeDispatch = true;
|
||||||
}
|
}
|
||||||
event.mIgnoreRootScrollFrame = true;
|
|
||||||
if (aMsg != eMouseMove) {
|
if (aMsg != eMouseMove) {
|
||||||
event.mClickCount = aClickCount;
|
event.mClickCount = aClickCount;
|
||||||
}
|
}
|
||||||
|
@ -568,17 +567,7 @@ static bool PrepareForSetTargetAPZCNotification(
|
||||||
ScrollableLayerGuid guid(aLayersId, 0, ScrollableLayerGuid::NULL_SCROLL_ID);
|
ScrollableLayerGuid guid(aLayersId, 0, ScrollableLayerGuid::NULL_SCROLL_ID);
|
||||||
nsPoint point = nsLayoutUtils::GetEventCoordinatesRelativeTo(
|
nsPoint point = nsLayoutUtils::GetEventCoordinatesRelativeTo(
|
||||||
aWidget, aRefPoint, aRootFrame);
|
aWidget, aRefPoint, aRootFrame);
|
||||||
EnumSet<FrameForPointOption> options;
|
nsIFrame* target = nsLayoutUtils::GetFrameForPoint(aRootFrame, point);
|
||||||
if (nsLayoutUtils::AllowZoomingForDocument(
|
|
||||||
aRootFrame->PresShell()->GetDocument())) {
|
|
||||||
// If zooming is enabled, we need IgnoreRootScrollFrame for correct
|
|
||||||
// hit testing. Otherwise, don't use it because it interferes with
|
|
||||||
// hit testing for some purposes such as scrollbar dragging (this will
|
|
||||||
// need to be fixed before enabling zooming by default on desktop).
|
|
||||||
options += FrameForPointOption::IgnoreRootScrollFrame;
|
|
||||||
}
|
|
||||||
nsIFrame* target =
|
|
||||||
nsLayoutUtils::GetFrameForPoint(aRootFrame, point, options);
|
|
||||||
nsIScrollableFrame* scrollAncestor =
|
nsIScrollableFrame* scrollAncestor =
|
||||||
target ? nsLayoutUtils::GetAsyncScrollableAncestorFrame(target)
|
target ? nsLayoutUtils::GetAsyncScrollableAncestorFrame(target)
|
||||||
: aRootFrame->PresShell()->GetRootScrollFrameAsScrollable();
|
: aRootFrame->PresShell()->GetRootScrollFrameAsScrollable();
|
||||||
|
|
|
@ -42,8 +42,7 @@ static already_AddRefed<dom::Element> ElementFromPoint(
|
||||||
}
|
}
|
||||||
nsIFrame* frame = nsLayoutUtils::GetFrameForPoint(
|
nsIFrame* frame = nsLayoutUtils::GetFrameForPoint(
|
||||||
rootFrame, CSSPoint::ToAppUnits(aPoint),
|
rootFrame, CSSPoint::ToAppUnits(aPoint),
|
||||||
{FrameForPointOption::IgnorePaintSuppression,
|
{FrameForPointOption::IgnorePaintSuppression});
|
||||||
FrameForPointOption::IgnoreRootScrollFrame});
|
|
||||||
while (frame && (!frame->GetContent() ||
|
while (frame && (!frame->GetContent() ||
|
||||||
frame->GetContent()->IsInAnonymousSubtree())) {
|
frame->GetContent()->IsInAnonymousSubtree())) {
|
||||||
frame = nsLayoutUtils::GetParentOrPlaceholderFor(frame);
|
frame = nsLayoutUtils::GetParentOrPlaceholderFor(frame);
|
||||||
|
|
|
@ -57,9 +57,7 @@ TouchBehaviorFlags TouchActionHelper::GetAllowedTouchBehavior(
|
||||||
nsPoint relativePoint =
|
nsPoint relativePoint =
|
||||||
nsLayoutUtils::GetEventCoordinatesRelativeTo(aWidget, aPoint, aRootFrame);
|
nsLayoutUtils::GetEventCoordinatesRelativeTo(aWidget, aPoint, aRootFrame);
|
||||||
|
|
||||||
nsIFrame* target = nsLayoutUtils::GetFrameForPoint(
|
nsIFrame* target = nsLayoutUtils::GetFrameForPoint(aRootFrame, relativePoint);
|
||||||
aRootFrame, relativePoint,
|
|
||||||
nsLayoutUtils::FrameForPointOption::IgnoreRootScrollFrame);
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
return behavior;
|
return behavior;
|
||||||
}
|
}
|
||||||
|
|
|
@ -519,11 +519,6 @@ static EnumSet<nsLayoutUtils::FrameForPointOption> GetHitTestOptions() {
|
||||||
EnumSet<nsLayoutUtils::FrameForPointOption> options = {
|
EnumSet<nsLayoutUtils::FrameForPointOption> options = {
|
||||||
nsLayoutUtils::FrameForPointOption::IgnorePaintSuppression,
|
nsLayoutUtils::FrameForPointOption::IgnorePaintSuppression,
|
||||||
nsLayoutUtils::FrameForPointOption::IgnoreCrossDoc};
|
nsLayoutUtils::FrameForPointOption::IgnoreCrossDoc};
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
// On Android, we need IgnoreRootScrollFrame for correct hit testing when
|
|
||||||
// zoomed in or out.
|
|
||||||
options += nsLayoutUtils::FrameForPointOption::IgnoreRootScrollFrame;
|
|
||||||
#endif
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -110,15 +110,6 @@ nsIFrame* TouchManager::SetupTarget(WidgetTouchEvent* aEvent,
|
||||||
return aFrame;
|
return aFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t flags = 0;
|
|
||||||
// Setting this flag will skip the scrollbars on the root frame from
|
|
||||||
// participating in hit-testing, and we only want that to happen on
|
|
||||||
// zoomable platforms (for now).
|
|
||||||
dom::Document* doc = aFrame->PresContext()->Document();
|
|
||||||
if (nsLayoutUtils::AllowZoomingForDocument(doc)) {
|
|
||||||
flags |= INPUT_IGNORE_ROOT_SCROLL_FRAME;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsIFrame* target = aFrame;
|
nsIFrame* target = aFrame;
|
||||||
for (int32_t i = aEvent->mTouches.Length(); i;) {
|
for (int32_t i = aEvent->mTouches.Length(); i;) {
|
||||||
--i;
|
--i;
|
||||||
|
@ -129,7 +120,7 @@ nsIFrame* TouchManager::SetupTarget(WidgetTouchEvent* aEvent,
|
||||||
// find the target for this touch
|
// find the target for this touch
|
||||||
nsPoint eventPoint = nsLayoutUtils::GetEventCoordinatesRelativeTo(
|
nsPoint eventPoint = nsLayoutUtils::GetEventCoordinatesRelativeTo(
|
||||||
aEvent, touch->mRefPoint, aFrame);
|
aEvent, touch->mRefPoint, aFrame);
|
||||||
target = FindFrameTargetedByInputEvent(aEvent, aFrame, eventPoint, flags);
|
target = FindFrameTargetedByInputEvent(aEvent, aFrame, eventPoint);
|
||||||
if (target) {
|
if (target) {
|
||||||
nsCOMPtr<nsIContent> targetContent;
|
nsCOMPtr<nsIContent> targetContent;
|
||||||
target->GetContentForEvent(aEvent, getter_AddRefs(targetContent));
|
target->GetContentForEvent(aEvent, getter_AddRefs(targetContent));
|
||||||
|
|
|
@ -394,7 +394,6 @@ void nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
nsRect visible;
|
nsRect visible;
|
||||||
nsRect dirty;
|
nsRect dirty;
|
||||||
bool ignoreViewportScrolling = false;
|
bool ignoreViewportScrolling = false;
|
||||||
nsIFrame* savedIgnoreScrollFrame = nullptr;
|
|
||||||
if (subdocRootFrame) {
|
if (subdocRootFrame) {
|
||||||
// get the dirty rect relative to the root frame of the subdoc
|
// get the dirty rect relative to the root frame of the subdoc
|
||||||
visible = aBuilder->GetVisibleRect() + GetOffsetToCrossDoc(subdocRootFrame);
|
visible = aBuilder->GetVisibleRect() + GetOffsetToCrossDoc(subdocRootFrame);
|
||||||
|
@ -403,10 +402,8 @@ void nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
visible = visible.ScaleToOtherAppUnitsRoundOut(parentAPD, subdocAPD);
|
visible = visible.ScaleToOtherAppUnitsRoundOut(parentAPD, subdocAPD);
|
||||||
dirty = dirty.ScaleToOtherAppUnitsRoundOut(parentAPD, subdocAPD);
|
dirty = dirty.ScaleToOtherAppUnitsRoundOut(parentAPD, subdocAPD);
|
||||||
|
|
||||||
if (nsIFrame* rootScrollFrame = presShell->GetRootScrollFrame()) {
|
if (nsIScrollableFrame* rootScrollableFrame =
|
||||||
nsIScrollableFrame* rootScrollableFrame =
|
presShell->GetRootScrollFrameAsScrollable()) {
|
||||||
presShell->GetRootScrollFrameAsScrollable();
|
|
||||||
MOZ_ASSERT(rootScrollableFrame);
|
|
||||||
// Use a copy, so the rects don't get modified.
|
// Use a copy, so the rects don't get modified.
|
||||||
nsRect copyOfDirty = dirty;
|
nsRect copyOfDirty = dirty;
|
||||||
nsRect copyOfVisible = visible;
|
nsRect copyOfVisible = visible;
|
||||||
|
@ -416,10 +413,6 @@ void nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
/* aSetBase = */ true);
|
/* aSetBase = */ true);
|
||||||
|
|
||||||
ignoreViewportScrolling = presShell->IgnoringViewportScrolling();
|
ignoreViewportScrolling = presShell->IgnoringViewportScrolling();
|
||||||
if (ignoreViewportScrolling) {
|
|
||||||
savedIgnoreScrollFrame = aBuilder->GetIgnoreScrollFrame();
|
|
||||||
aBuilder->SetIgnoreScrollFrame(rootScrollFrame);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
aBuilder->EnterPresShell(subdocRootFrame, pointerEventsNone);
|
aBuilder->EnterPresShell(subdocRootFrame, pointerEventsNone);
|
||||||
|
@ -514,10 +507,6 @@ void nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
|
|
||||||
if (subdocRootFrame) {
|
if (subdocRootFrame) {
|
||||||
aBuilder->LeavePresShell(subdocRootFrame, &childItems);
|
aBuilder->LeavePresShell(subdocRootFrame, &childItems);
|
||||||
|
|
||||||
if (ignoreViewportScrolling) {
|
|
||||||
aBuilder->SetIgnoreScrollFrame(savedIgnoreScrollFrame);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate a resolution and/or zoom item if needed. If one or both of those
|
// Generate a resolution and/or zoom item if needed. If one or both of those
|
||||||
|
|
|
@ -421,7 +421,6 @@ WidgetMouseEvent MouseInput::ToWidgetMouseEvent(nsIWidget* aWidget) const {
|
||||||
PixelCastJustification::LayoutDeviceIsScreenForUntransformedEvent));
|
PixelCastJustification::LayoutDeviceIsScreenForUntransformedEvent));
|
||||||
event.mClickCount = clickCount;
|
event.mClickCount = clickCount;
|
||||||
event.mInputSource = mInputSource;
|
event.mInputSource = mInputSource;
|
||||||
event.mIgnoreRootScrollFrame = true;
|
|
||||||
event.mFocusSequenceNumber = mFocusSequenceNumber;
|
event.mFocusSequenceNumber = mFocusSequenceNumber;
|
||||||
|
|
||||||
return event;
|
return event;
|
||||||
|
|
|
@ -2097,7 +2097,6 @@ void nsWindow::DispatchHitTest(const WidgetTouchEvent& aEvent) {
|
||||||
WidgetMouseEvent hittest(true, eMouseHitTest, this,
|
WidgetMouseEvent hittest(true, eMouseHitTest, this,
|
||||||
WidgetMouseEvent::eReal);
|
WidgetMouseEvent::eReal);
|
||||||
hittest.mRefPoint = aEvent.mTouches[0]->mRefPoint;
|
hittest.mRefPoint = aEvent.mTouches[0]->mRefPoint;
|
||||||
hittest.mIgnoreRootScrollFrame = true;
|
|
||||||
hittest.mInputSource = MouseEvent_Binding::MOZ_SOURCE_TOUCH;
|
hittest.mInputSource = MouseEvent_Binding::MOZ_SOURCE_TOUCH;
|
||||||
nsEventStatus status;
|
nsEventStatus status;
|
||||||
DispatchEvent(&hittest, status);
|
DispatchEvent(&hittest, status);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче