From 73a9108de97e4d578c7fe89c846d68ff452cd499 Mon Sep 17 00:00:00 2001 From: Ting-Yu Lin Date: Fri, 20 Aug 2021 21:41:46 +0000 Subject: [PATCH] Bug 1715291 - Fix text in is clipped by inline-end padding. r=emilio The fix in Bug 1696885 is not correct when the width of the text in is shorter than the width of the , but is long enough to be covered by its inline-end padding. This patch's idea is similar to the old code [1] before applying bug 1696885, but only tweak the scrollable overflow area in the inline axis. [1] https://searchfox.org/mozilla-central/rev/c3ee9188d2f9020764db9daf8fa47a07fa3311c9/layout/generic/nsGfxScrollFrame.cpp#785-806 Differential Revision: https://phabricator.services.mozilla.com/D123244 --- layout/generic/nsGfxScrollFrame.cpp | 32 +++++++++---------- .../scrollable-overflow-input-001-ref.html | 19 +++++++++++ .../scrollable-overflow-input-001.html | 28 ++++++++++++++++ .../scrollable-overflow-input-002-ref.html | 20 ++++++++++++ .../scrollable-overflow-input-002.html | 29 +++++++++++++++++ 5 files changed, 111 insertions(+), 17 deletions(-) create mode 100644 testing/web-platform/tests/css/css-overflow/scrollable-overflow-input-001-ref.html create mode 100644 testing/web-platform/tests/css/css-overflow/scrollable-overflow-input-001.html create mode 100644 testing/web-platform/tests/css/css-overflow/scrollable-overflow-input-002-ref.html create mode 100644 testing/web-platform/tests/css/css-overflow/scrollable-overflow-input-002.html diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index de4ae78b4c7f..3bd84d698584 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -787,24 +787,22 @@ void nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowInput* aState, auto* disp = StyleDisplay(); if (MOZ_UNLIKELY(disp->mOverflowClipBoxInline == StyleOverflowClipBox::ContentBox)) { - // If the scrolled frame can be scrolled in the inline axis, inflate its - // scrollable overflow areas with its inline-end padding to prevent its - // content from being clipped at scroll container's inline-end padding - // edge. - // - // Note: Inflating scrolled frame's overflow areas is generally wrong if the - // scrolled frame's children themselves has any scrollable overflow areas. - // However, we can only be here in production for