diff --git a/devtools/client/inspector/markup/test/head.js b/devtools/client/inspector/markup/test/head.js index fb2153d5dc80..ddd04516082a 100644 --- a/devtools/client/inspector/markup/test/head.js +++ b/devtools/client/inspector/markup/test/head.js @@ -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; diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 18c7d7c422e5..a39c0b88ff3a 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -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; diff --git a/testing/web-platform/meta/focus/focus-large-element-in-overflow-hidden-container.html.ini b/testing/web-platform/meta/focus/focus-large-element-in-overflow-hidden-container.html.ini deleted file mode 100644 index 703dfe13847c..000000000000 --- a/testing/web-platform/meta/focus/focus-large-element-in-overflow-hidden-container.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[focus-large-element-in-overflow-hidden-container.html] - expected: FAIL diff --git a/testing/web-platform/meta/focus/focus-visible-element-in-overflow-hidden-container.html.ini b/testing/web-platform/meta/focus/focus-visible-element-in-overflow-hidden-container.html.ini deleted file mode 100644 index e3e234c8f16f..000000000000 --- a/testing/web-platform/meta/focus/focus-visible-element-in-overflow-hidden-container.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[focus-visible-element-in-overflow-hidden-container.html] - expected: FAIL