gecko-dev/layout/base
Jan-Niklas Jaeschke 5ce2766d95 Bug 1906134 - Text Fragments: Ensure to scroll the first text directive on a page into the center of the view. r=emilio
Before this patch, it could happen that `PresShell::GoToAnchor()` was called while loading a document.
This method did not know about text fragments before,
and would scroll the anchor (ie., the first text directive) to the top of the view.
This was noticeable for pages that took longer to load, where the text directive was scrolled to the center first, and then to the top.

This patch saves the desired vertical scroll position as a member in `PresShell` and makes `GoToAnchor()` scroll to the center as well.

Additionally, this patch updates the test file target document to make it more mobile-friendly.

Differential Revision: https://phabricator.services.mozilla.com/D216039
2024-07-16 09:16:48 +00:00
..
crashtests Bug 1905351 - Ensure the new pref value is set for affected crashtests that no longer assert. r=layout-reviewers,TYLin 2024-07-01 09:31:14 +00:00
gtest
tests Bug 1893119: Part 20 - Move EndDragSession from nsIDragService to nsIDragSession r=gstoll,rkraesig,win-reviewers,geckoview-reviewers,m_kato 2024-07-04 07:48:11 +00:00
AccessibleCaret.cpp Bug 1824886 - Rewrite AnonymousContent to use a shadow tree. r=smaug,TYLin,sfoster,devtools-reviewers,nchevobbe 2023-07-09 11:34:05 +00:00
AccessibleCaret.h Bug 1824886 - Rewrite AnonymousContent to use a shadow tree. r=smaug,TYLin,sfoster,devtools-reviewers,nchevobbe 2023-07-09 11:34:05 +00:00
AccessibleCaretEventHub.cpp Bug 1675847 - part 3: Make `ePointerClick` event dispatchers and handlers use `WidgetPointerEvent` r=smaug,search-reviewers,devtools-reviewers,nchevobbe,jteow 2024-06-14 00:18:47 +00:00
AccessibleCaretEventHub.h
AccessibleCaretLogger.h
AccessibleCaretManager.cpp Bug 1896516 Part 6 - Remove nsIScrollableFrame usages in nsLayoutUtils. r=layout-reviewers,emilio 2024-05-30 06:32:20 +00:00
AccessibleCaretManager.h Bug 1824886 - Rewrite AnonymousContent to use a shadow tree. r=smaug,TYLin,sfoster,devtools-reviewers,nchevobbe 2023-07-09 11:34:05 +00:00
ArenaObjectID.h
AutoProfilerStyleMarker.h Bug 1843534 - Avoid taking unnecessary timestamps when thread is not being profiled for markers. r=julienw 2023-08-09 10:28:37 +00:00
Baseline.cpp Bug 1874242 - Use correct writing-mode to initialize zeroed margin. 2024-01-12 00:49:19 +01:00
Baseline.h Bug 1874242 - Centralize border/padding/content box baseline calculations. r=dshin 2024-01-11 22:25:18 +00:00
CaretAssociationHint.h Bug 1816581 - part 1: Make `CaretAssociationHint` an enum class r=emilio 2023-12-27 04:42:09 +00:00
ContainStyleScopeManager.cpp Bug 1897361 - Share counter-style / list-style-type representation between Servo and Gecko. r=jwatt 2024-05-19 21:24:16 +00:00
ContainStyleScopeManager.h Bug 1849204 - Add generic atom hash keys that use the better distributed atom hash, and use it across the tree. r=mstange,xpcom-reviewers,credential-management-reviewers,sgalich,nika 2023-08-18 18:43:27 +00:00
DepthOrderedFrameList.cpp
DepthOrderedFrameList.h
DisplayPortUtils.cpp Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio 2024-05-30 06:32:22 +00:00
DisplayPortUtils.h Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio 2024-05-30 06:32:22 +00:00
FrameProperties.h Bug 1848714 - Use unsafe methods in hot code paths to access and remove elements from nsTArray when it is guaranteed to be safe, r=emilio 2023-08-15 14:24:19 +00:00
GeckoMVMContext.cpp Bug 1896516 Part 6 - Remove nsIScrollableFrame usages in nsLayoutUtils. r=layout-reviewers,emilio 2024-05-30 06:32:20 +00:00
GeckoMVMContext.h Bug 1862140 - Update mVisualViewportSizeUpdatedByDynamicToolbar whenever the visual viewport size is changed. r=botond 2024-01-11 00:39:16 +00:00
GeometryUtils.cpp Bug 1896711 part 3: Use MakeRefPtr/MakeAndAddRef to reduce boilerplate, in layout/base. r=TYLin 2024-05-15 07:29:20 +00:00
GeometryUtils.h
LayoutConstants.h Bug 1870572 - Use constexpr variables instead of macro to define layout constants. r=layout-reviewers,emilio 2023-12-18 18:18:28 +00:00
LayoutLogging.cpp
LayoutLogging.h
LayoutTelemetryTools.cpp Bug 1897752 - Really fix base toolchains build. 2024-05-20 20:03:47 +02:00
LayoutTelemetryTools.h Bug 1897752 - Clean up layout telemetry. r=smaug 2024-05-20 14:30:08 +00:00
MVMContext.h Bug 1862140 - Update mVisualViewportSizeUpdatedByDynamicToolbar whenever the visual viewport size is changed. r=botond 2024-01-11 00:39:16 +00:00
MediaEmulationData.h
MobileViewportManager.cpp Bug 1862140 - Update mVisualViewportSizeUpdatedByDynamicToolbar whenever the visual viewport size is changed. r=botond 2024-01-11 00:39:16 +00:00
MobileViewportManager.h
MotionPathUtils.cpp Bug 1884425 - Introduce PathOrShapeFunciton for path() and shape(). r=firefox-style-system-reviewers,zrhoffman 2024-03-28 19:42:13 +00:00
MotionPathUtils.h Bug 1598158 - Add IsClosedLoop() for SVGGeometryElement. r=emilio 2023-08-07 22:04:02 +00:00
OverflowChangedTracker.h
PositionedEventTargeting.cpp Bug 1733509 - Use TryInferEnclosingResolution for event retargeting. r=botond 2024-04-17 18:47:01 +00:00
PositionedEventTargeting.h
PresShell.cpp Bug 1906134 - Text Fragments: Ensure to scroll the first text directive on a page into the center of the view. r=emilio 2024-07-16 09:16:48 +00:00
PresShell.h Bug 1906134 - Text Fragments: Ensure to scroll the first text directive on a page into the center of the view. r=emilio 2024-07-16 09:16:48 +00:00
PresShellForwards.h Bug 1835864 - Make printing / paged mode deal with multiple canvas backgrounds properly. r=dholbert 2023-08-10 12:59:00 +00:00
PresShellInlines.h Bug 1897752 - Clean up layout telemetry. r=smaug 2024-05-20 14:30:08 +00:00
PresState.ipdlh
RelativeTo.h
RestyleManager.cpp Bug 1904183 - Add a profiler label frame for the element state changed code path r=emilio 2024-06-24 10:22:10 +00:00
RestyleManager.h Bug 1903671 - Check for namespace properly when looking for class / id attributes for invalidation. r=zrhoffman,dshin,firefox-style-system-reviewers 2024-06-21 22:29:51 +00:00
ScrollStyles.cpp
ScrollStyles.h
ScrollTypes.h Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio 2024-05-30 06:32:22 +00:00
ShapeUtils.cpp Bug 1823475 - Drop DefaultPosition and omit "at <position>" if it is not specified. r=devtools-reviewers,emilio 2023-09-26 21:05:20 +00:00
ShapeUtils.h Bug 1842277 - Compute <basic-shape-rect> to the equivalent inset() function. r=devtools-reviewers,emilio 2023-07-12 20:16:47 +00:00
StackArena.cpp
StackArena.h
StaticPresData.cpp Bug 1853392 - Simplify font-size-adjust: from-font handling. r=jfkthame 2023-09-15 22:17:25 +00:00
StaticPresData.h
SurfaceFromElementResult.h Bug 1781527: apply code formatting via Lando 2023-07-10 00:29:39 +00:00
TouchManager.cpp Bug 1891304 - Make `APZEventState` manage whether the `pointerdown` was consumed by content or not r=smaug,hiro 2024-05-14 01:07:49 +00:00
TouchManager.h Bug 1891304 - Make `APZEventState` manage whether the `pointerdown` was consumed by content or not r=smaug,hiro 2024-05-14 01:07:49 +00:00
UnitTransforms.h Bug 1876941 - Add a Matrix4x4Typed::Cast function. r=botond 2024-01-31 22:40:21 +00:00
Units.h
ViewportUtils.cpp Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio 2024-05-30 06:32:22 +00:00
ViewportUtils.h
WordMovementType.h
ZoomConstraintsClient.cpp Bug 1896516 Part 7 - Remove PresShell::GetRootScrollFrameAsScrollable(). r=layout-reviewers,emilio 2024-05-30 06:32:20 +00:00
ZoomConstraintsClient.h
metrics.yaml Bug 1892660 - Add a metric for async stylesheet load time. r=jesup 2024-05-02 22:40:56 +00:00
moz.build Bug 1836727 - [marionette] Fix MARIONETTE_MANIFESTS usage in moz.build files. r=webdriver-reviewers,necko-reviewers,application-update-reviewers,search-reviewers,sessionstore-reviewers,places-reviewers,dom-storage-reviewers,Standard8,jesup,jdescottes,nalexander,sclements,janv 2024-01-11 10:34:29 +00:00
nsAutoLayoutPhase.cpp
nsAutoLayoutPhase.h
nsBidiPresUtils.cpp Bug 1883935 - Fix typo'd character code in ReplaceSeparators. r=layout-reviewers,emilio 2024-03-07 10:25:40 +00:00
nsBidiPresUtils.h Bug 1882790 - Cleanup and optimize BidiLineData handling. r=layout-reviewers,emilio 2024-03-05 11:40:27 +00:00
nsCSSColorUtils.cpp
nsCSSColorUtils.h
nsCSSFrameConstructor.cpp Bug 1902540 - Don't remove first rbc child if still needed. r=dholbert 2024-06-21 22:25:27 +00:00
nsCSSFrameConstructor.h Bug 1897135 Part 3 - Change two APIs to ensure root frame is a ViewportFrame. r=dholbert 2024-05-17 21:37:02 +00:00
nsCaret.cpp Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio 2024-05-30 06:32:22 +00:00
nsCaret.h Bug 1887552 - Simplify caret visibility code. r=sefeng,geckoview-reviewers 2024-03-26 10:53:17 +00:00
nsChangeHint.h Bug 1874826 - Avoid reconstruction due to change to block formatting context. r=layout-reviewers,emilio 2024-01-23 10:09:57 +00:00
nsCompatibility.h
nsCounterManager.cpp Bug 1897361 - Share counter-style / list-style-type representation between Servo and Gecko. r=jwatt 2024-05-19 21:24:16 +00:00
nsCounterManager.h Bug 1897361 - Share counter-style / list-style-type representation between Servo and Gecko. r=jwatt 2024-05-19 21:24:16 +00:00
nsDocumentViewer.cpp Bug 1898321 - Text Fragments: Correctly find text fragments if there are DOM changes during page load. r=farre,dom-core 2024-06-19 17:16:39 +00:00
nsFrameManager.cpp Bug 1897135 Part 3 - Change two APIs to ensure root frame is a ViewportFrame. r=dholbert 2024-05-17 21:37:02 +00:00
nsFrameManager.h Bug 1897135 Part 3 - Change two APIs to ensure root frame is a ViewportFrame. r=dholbert 2024-05-17 21:37:02 +00:00
nsFrameTraversal.cpp Bug 1824877 Part 3 - Change ScrollContainerFrame's type from Scroll to ScrollContainer. r=dholbert 2024-05-15 17:50:49 +00:00
nsFrameTraversal.h Bug 779684 - part 3: Make `nsFrameIterator` non-refcountable r=emilio 2023-12-24 06:01:19 +00:00
nsGenConList.cpp Bug 1281158 - Parse alternative text for the content property. r=dshin 2024-05-08 16:06:47 +00:00
nsGenConList.h
nsIDocumentViewerPrint.h
nsILayoutHistoryState.idl
nsIPercentBSizeObserver.h
nsIPreloadedStyleSheet.idl
nsIReflowCallback.h
nsIStyleSheetService.idl
nsLayoutDebugger.cpp Bug 1878545. Allow debug dump of display item without having a display list builder pointer. r=layout-reviewers,emilio 2024-02-04 11:01:37 +00:00
nsLayoutHistoryState.cpp Bug 1896711 part 3: Use MakeRefPtr/MakeAndAddRef to reduce boilerplate, in layout/base. r=TYLin 2024-05-15 07:29:20 +00:00
nsLayoutUtils.cpp Bug 1150182 - Use strong-typed CSSIntSize instead of nsIntSize for canvas sizes. r=gfx-reviewers,layout-reviewers,emilio,nical 2024-07-15 15:20:11 +00:00
nsLayoutUtils.h Bug 1900737 - Remove nsLayoutUtils::GPUImageScalingEnabled r=dholbert 2024-06-05 06:06:46 +00:00
nsPresArena.cpp Bug 1848714 - Use unsafe methods in hot code paths to access and remove elements from nsTArray when it is guaranteed to be safe, r=emilio 2023-08-15 14:24:19 +00:00
nsPresArena.h
nsPresArenaObjectList.h
nsPresContext.cpp Bug 1896711 part 3: Use MakeRefPtr/MakeAndAddRef to reduce boilerplate, in layout/base. r=TYLin 2024-05-15 07:29:20 +00:00
nsPresContext.h Bug 1895870 - Simplify refresh driver observer set-up. r=smaug 2024-05-14 08:12:03 +00:00
nsPresContextInlines.h Bug 1844755 - Consider to not create ServoStyleSet for data documents, r=emilio 2023-10-23 16:10:41 +00:00
nsQuoteList.cpp
nsQuoteList.h
nsRefreshDriver.cpp Bug 1897752 - Clean up layout telemetry. r=smaug 2024-05-20 14:30:08 +00:00
nsRefreshDriver.h Bug 1896762 - Make animation timing match the spec. r=smaug,firefox-animation-reviewers,boris 2024-05-17 16:33:06 +00:00
nsRefreshObservers.cpp Bug 1868456: Improve ManagedPostRefreshObserver invariants. r=emilio 2023-12-06 02:09:29 +00:00
nsRefreshObservers.h Bug 1896762 - Make animation timing match the spec. r=smaug,firefox-animation-reviewers,boris 2024-05-17 16:33:06 +00:00
nsStyleChangeList.cpp
nsStyleChangeList.h
nsStyleSheetService.cpp Bug 1896711 part 3: Use MakeRefPtr/MakeAndAddRef to reduce boilerplate, in layout/base. r=TYLin 2024-05-15 07:29:20 +00:00
nsStyleSheetService.h Bug 1520118 - Remove support for style sheets loaded from the category manager. r=layout-reviewers,emilio 2023-11-10 13:48:12 +00:00