Bug 1858984 - Fix ComputeNeedToScroll with large line sizes. r=emilio,devtools-reviewers,ochameau
When the line scroll amount is larger than that of the rectangle to scroll into view, do not use the line size to determine if we should scroll. Depends on D192869 Differential Revision: https://phabricator.services.mozilla.com/D192870
This commit is contained in:
@@ -478,6 +478,7 @@ async function simulateNodeDrag(
|
||||
typeof selector === "string"
|
||||
? await getContainerForSelector(selector, inspector)
|
||||
: selector;
|
||||
container.elt.scrollIntoView(true);
|
||||
const rect = container.tagLine.getBoundingClientRect();
|
||||
const scrollX = inspector.markup.doc.documentElement.scrollLeft;
|
||||
const scrollY = inspector.markup.doc.documentElement.scrollTop;
|
||||
|
||||
@@ -3326,6 +3326,13 @@ static bool ComputeNeedToScroll(WhenToScroll aWhenToScroll, nscoord aLineSize,
|
||||
// The caller wants the frame as visible as possible
|
||||
return true;
|
||||
case WhenToScroll::IfNotVisible:
|
||||
if (aLineSize > (aRectMax - aRectMin)) {
|
||||
// If the line size is greater than the size of the rect
|
||||
// to scroll into view, do not use the line size to determine
|
||||
// if we need to scroll.
|
||||
aLineSize = 0;
|
||||
}
|
||||
|
||||
// Scroll only if no part of the frame is visible in this view.
|
||||
return aRectMax - aLineSize <= aViewMin ||
|
||||
aRectMin + aLineSize >= aViewMax;
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
[focus-large-element-in-overflow-hidden-container.html]
|
||||
expected: FAIL
|
||||
@@ -1,2 +0,0 @@
|
||||
[focus-visible-element-in-overflow-hidden-container.html]
|
||||
expected: FAIL
|
||||
Reference in New Issue
Block a user