gecko-dev/layout/forms
Hiroyuki Ikezoe 7b600a0531 Bug 1534070 - Factor scroll-padding into the position calculation where nsIPresShell::ScrollContentIntoView() is going to scroll if necessary. r=botond
In the case where scroll-snap-type is specified for the scroll container, the
scroll-padding is also factored into in ScrollFrameHelper::ComputeScrollSnapInfo
which is called via ScrollFrameHelper::ScrollToWithOrigin.  It doesn't double
the scroll-padding value, but it's actually redundant, we should avoid it.
We could separate the functionality of ScrollToWithOrigin, one is to scroll
to a given element, the other is to scroll to a given position.  The former will
be used for Element.scrollIntoElement and relevant stuff, the latter will be
used for Element.scrollTo and relevant stuff.  That's being said, as of now, we
have still the old scroll snap implementation, so the separation will introduce
complexity, the separation should be done once after the old implementation
removed.

There are 9 call sites of nsIPresShell::ScrollContentIntoView:
  nsIPresShell::GoToAnchor
  nsIPresShell::ScrollToAnchor
  Element::ScrollIntoView
   We definitely needs scroll-padding and scroll-margin for these functions.

  nsCoreUtils::ScrollTo
   This is used for Accesible::ScrollTo which scrolls to a given accesible node,
   probably we should behave as what Element::ScrollIntoView does.

  Accessible::DispatchClickEvent
   Similar to the above, similated various mouse events on a given target node.

  PresShell::EventHandler::PrepareToUseCaretPosition
  PresShell::EventHandler::GetCurrentItemAndPositionForElement
   Both are for context menu, we shouldn't consider scroll-padding and
   scroll-margin.

  nsFormFillController::SetPopupOpen
   This is used for autocompletion popup, we shouldn't consider scroll-padding
   and scroll-margin.

  nsFocusManager::ScrollIntoView
   This is bit unfortunate, we should use scroll-padding and scroll-margin
   depending on call site of this function. Bug 1535232 is for this case.

cssom-view/scrollIntoView-scrollPadding.html which has some tests that is
actually testing scroll-padding with scrollIntoView passes with this change.

The reftest in this change is a test case that the browser navigates to an
element with specifying the anchor to the element.

Differential Revision: https://phabricator.services.mozilla.com/D23084

--HG--
extra : moz-landing-system : lando
2019-04-11 06:22:14 +00:00
..
crashtests Bug 893331 - Add crashtest to verify assertion doesn't unexpectedly fire. r=TYLin 2018-11-02 21:31:37 +00:00
test Bug 505355 - Simplify focus handling for file inputs. r=smaug 2019-04-10 22:52:03 +02:00
moz.build Bug 326944, remove nsIComboboxControlFrame interface, r=mats 2018-09-26 10:41:12 -04:00
nsButtonFrameRenderer.cpp Bug 1539673 - Support fallible display item construction. r=miko 2019-04-01 16:53:11 +00:00
nsButtonFrameRenderer.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
nsCheckboxRadioFrame.cpp Bug 1523969 part 14 - Move method definition inline comments to new line in 'layout/'. r=dholbert 2019-02-25 16:09:24 -06:00
nsCheckboxRadioFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsColorControlFrame.cpp Bug 1525955 - Include anon boxes in CSSPseudoElementType, to remove ComputedStyle::mPseudoTag. r=heycam 2019-02-19 13:44:33 +00:00
nsColorControlFrame.h Bug 1525955 - Include anon boxes in CSSPseudoElementType, to remove ComputedStyle::mPseudoTag. r=heycam 2019-02-19 13:44:33 +00:00
nsComboboxControlFrame.cpp Bug 1542407 - Make nsIFrame use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-06 06:02:28 +00:00
nsComboboxControlFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsDateTimeControlFrame.cpp Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsDateTimeControlFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsFieldSetFrame.cpp Bug 1539673 - Support fallible display item construction. r=miko 2019-04-01 16:53:11 +00:00
nsFieldSetFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsFileControlFrame.cpp Bug 505355 - Simplify focus handling for file inputs. r=smaug 2019-04-10 22:52:03 +02:00
nsFileControlFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsGfxButtonControlFrame.cpp Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsGfxButtonControlFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsHTMLButtonControlFrame.cpp Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan 2019-03-13 10:19:06 +01:00
nsHTMLButtonControlFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsIFormControlFrame.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
nsImageControlFrame.cpp Bug 1534914 - Improve blocked cursor behavior to fall back to next image. r=smaug 2019-03-13 18:38:09 +00:00
nsISelectControlFrame.h Bug 1521853 - Remove Throws annotation from some infallible HTMLOptionsCollection/HTMLSelectElement properties. r=qdot 2019-01-22 19:03:07 +00:00
nsITextControlFrame.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
nsLegendFrame.cpp Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsLegendFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsListControlFrame.cpp Bug 1534070 - Factor scroll-padding into the position calculation where nsIPresShell::ScrollContentIntoView() is going to scroll if necessary. r=botond 2019-04-11 06:22:14 +00:00
nsListControlFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsMeterFrame.cpp Bug 1542407 - Make nsIFrame use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-06 06:02:28 +00:00
nsMeterFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsNumberControlFrame.cpp Bug 1523969 part 14 - Move method definition inline comments to new line in 'layout/'. r=dholbert 2019-02-25 16:09:24 -06:00
nsNumberControlFrame.h Bug 1525955 - Include anon boxes in CSSPseudoElementType, to remove ComputedStyle::mPseudoTag. r=heycam 2019-02-19 13:44:33 +00:00
nsProgressFrame.cpp Bug 1542407 - Make nsIFrame use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-06 06:02:28 +00:00
nsProgressFrame.h Bug 1525955 - Include anon boxes in CSSPseudoElementType, to remove ComputedStyle::mPseudoTag. r=heycam 2019-02-19 13:44:33 +00:00
nsRangeFrame.cpp Bug 1542407 - Make nsIFrame use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-06 06:02:28 +00:00
nsRangeFrame.h Bug 1525955 - Include anon boxes in CSSPseudoElementType, to remove ComputedStyle::mPseudoTag. r=heycam 2019-02-19 13:44:33 +00:00
nsSelectsAreaFrame.cpp Bug 1539673 - Support fallible display item construction. r=miko 2019-04-01 16:53:11 +00:00
nsSelectsAreaFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsTextControlFrame.cpp Bug 1540930 - Make nsPresContext use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-03 12:40:26 +00:00
nsTextControlFrame.h Bug 1525955 - Include anon boxes in CSSPseudoElementType, to remove ComputedStyle::mPseudoTag. r=heycam 2019-02-19 13:44:33 +00:00