gecko-dev/layout/xul
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 1519956, remove box object related crashtests that will no longer be applicable with no box objects, r=bzbarsky 2019-03-07 17:57:12 -05:00
grid Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
reftest Bug 1539026 - Skia m74 fuzzing. r=rhunt 2019-03-26 14:52:45 -04:00
test Bug 1519953, replace calls to retrieve boxobject position and size with getBoundingClientRect, r=gijs 2019-03-01 12:26:45 -05:00
tree Bug 760345 - Remove the last usage of lossy currentcolor. r=heycam 2019-04-06 17:47:58 +00:00
BoxObject.cpp Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio 2019-03-29 15:12:47 +00:00
BoxObject.h Bug 1511854 - Part 1: Fix some formatting oddities in layout/ after the clang-format. r=TYLin 2018-12-05 18:44:03 +00:00
moz.build Bug 1504576 - Remove XUL nsProgressMeterFrame. r=dholbert 2018-11-08 22:15:38 +01:00
nsBox.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
nsBox.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsBoxFrame.cpp Bug 1542407 - Make nsIFrame use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-06 06:02:28 +00:00
nsBoxFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsBoxLayout.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
nsBoxLayout.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
nsBoxLayoutState.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
nsBoxLayoutState.h Bug 1540930 - Make nsPresContext use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-03 12:40:26 +00:00
nsButtonBoxFrame.cpp Bug 1540930 - Make nsPresContext use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-03 12:40:26 +00:00
nsButtonBoxFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsDeckFrame.cpp Bug 1540930 - Make nsPresContext use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-03 12:40:26 +00:00
nsDeckFrame.h Bug 1354913: Fix nsDeckFrame, nsImageBoxFrame and nsImageFrame so that nsDeckFrame does not tick the refresh driver when its child images are animated and hidden. r=aosmond 2019-03-25 19:11:22 +00:00
nsDocElementBoxFrame.cpp Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsGroupBoxFrame.cpp Bug 1539673 - Support fallible display item construction. r=miko 2019-04-01 16:53:11 +00:00
nsIBoxObject.idl Bug 1489617 - Get rid of XUL box related component registrations. r=Ehsan 2018-09-09 15:05:18 +00:00
nsImageBoxFrame.cpp Bug 1542407 - Make nsIFrame use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-06 06:02:28 +00:00
nsImageBoxFrame.h Bug 1354913: Fix nsDeckFrame, nsImageBoxFrame and nsImageFrame so that nsDeckFrame does not tick the refresh driver when its child images are animated and hidden. r=aosmond 2019-03-25 19:11:22 +00:00
nsIPopupContainer.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
nsIScrollbarMediator.h Bug 1373835 - Enable scroll snap for programatic scrolls. r=botond 2019-04-11 06:20:04 +00:00
nsLeafBoxFrame.cpp Bug 1539673 - Support fallible display item construction. r=miko 2019-04-01 16:53:11 +00:00
nsLeafBoxFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsMenuBarFrame.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
nsMenuBarFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsMenuBarListener.cpp Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00
nsMenuBarListener.h Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00
nsMenuFrame.cpp Bug 1542407 - Make nsIFrame use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-06 06:02:28 +00:00
nsMenuFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsMenuParent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
nsMenuPopupFrame.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
nsMenuPopupFrame.h Bug 1530594, generate frames before setting the active child in a menulist, so that menulists with sizetopopup='none' will still allow keyboard navigation when the menulist has not yet been opened, updated to get popup type earlier to avoid possible crash, r=tnikkel 2019-03-05 04:32:40 -05:00
nsPIBoxObject.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
nsPopupSetFrame.cpp Bug 1540930 - Make nsPresContext use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-03 12:40:26 +00:00
nsPopupSetFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsRepeatService.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
nsRepeatService.h Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00
nsResizerFrame.cpp Bug 1540930 - Make nsPresContext use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-03 12:40:26 +00:00
nsResizerFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsRootBoxFrame.cpp Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsScrollbarButtonFrame.cpp Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsScrollbarButtonFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsScrollbarFrame.cpp Bug 1542407 - Make nsIFrame use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-06 06:02:28 +00:00
nsScrollbarFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsSliderFrame.cpp Bug 1542407 - Make nsIFrame use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-06 06:02:28 +00:00
nsSliderFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsSplitterFrame.cpp Bug 1540930 - Make nsPresContext use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-03 12:40:26 +00:00
nsSplitterFrame.h Bug 1534914 - Improve blocked cursor behavior to fall back to next image. r=smaug 2019-03-13 18:38:09 +00:00
nsSprocketLayout.cpp Bug 1540990 - Get rid of unnecessary nsIPresShell.h inclusions r=emilio 2019-04-04 00:19:48 +00:00
nsSprocketLayout.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
nsStackFrame.cpp Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsStackFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsStackLayout.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
nsStackLayout.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
nsTextBoxFrame.cpp Bug 760345 - Remove the last usage of lossy currentcolor. r=heycam 2019-04-06 17:47:58 +00:00
nsTextBoxFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsTitleBarFrame.cpp Bug 1540930 - Make nsPresContext use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-03 12:40:26 +00:00
nsTitleBarFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsXULLabelFrame.cpp Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsXULLabelFrame.h Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt 2019-02-07 11:15:36 +01:00
nsXULPopupManager.cpp Bug 1540930 - Make nsPresContext use mozilla::PresShell directly rather than via nsIPresShell r=emilio 2019-04-03 12:40:26 +00:00
nsXULPopupManager.h Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00
nsXULTooltipListener.cpp Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio 2019-03-29 15:12:47 +00:00
nsXULTooltipListener.h Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00