Commit Graph

2663 Commits

Author SHA1 Message Date
Kartikaya Gupta
e048c386fc Bug 1661897 - Acknowledge pending visual scroll updates for any RSF. r=botond
We set pending visual scroll updates even for RSFs that are on subdocuments,
so we should ensure they get acknowledged and cleared on paints. Otherwise
the pending visual scroll update can get "stuck" and it affects things that
depend on it, such as the drag-selection code.

Differential Revision: https://phabricator.services.mozilla.com/D88893
2020-09-01 18:18:01 +00:00
Narcis Beleuzu
c37170eccf Backed out 2 changesets (bug 1661897) for mochitest failures on test_group_mouseevents.html . CLOSED TREE
Backed out changeset 34ee0403ab1e (bug 1661897)
Backed out changeset f83db4b41bf6 (bug 1661897)
2020-09-01 07:47:59 +03:00
Kartikaya Gupta
d836558a54 Bug 1661897 - Acknowledge pending visual scroll updates for any RSF. r=botond
We set pending visual scroll updates even for RSFs that are on subdocuments,
so we should ensure they get acknowledged and cleared on paints. Otherwise
the pending visual scroll update can get "stuck" and it affects things that
depend on it, such as the drag-selection code.

Differential Revision: https://phabricator.services.mozilla.com/D88893
2020-08-31 20:34:34 +00:00
Botond Ballo
e223d799a9 Bug 1661356 - Change nsLayoutUtils::ComputeScrollMetadata() to take a scrollport size instead of a scrollport rect. r=kats
No one meaningfully uses the scrollport rect's origin, so there's no
point in having callers compute it.

Differential Revision: https://phabricator.services.mozilla.com/D88337
2020-08-27 01:40:19 +00:00
Stephen A Pohl
0a7b9948c9 Bug 1656264: Adjust default font size for non-native theming. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D85415
2020-08-24 14:42:46 +00:00
Botond Ballo
526b2d55e0 Bug 1659973 - Bring back FrameMetrics::mVisualViewportOffset (but call it mVisualDestination). r=kats
Differential Revision: https://phabricator.services.mozilla.com/D87941
2020-08-22 22:59:47 +00:00
Botond Ballo
8a1932458c Bug 1659642 - Split out a new file APZPublicUtils.h from APZUtils.h. r=kats
By moving the few things that need to be exposed to other components
to APZPublicUtils.h, APZUtils.h becomes much less widely included
(and thus changing it triggers a quicker recompile) while retaining
most of its utilities.

Differential Revision: https://phabricator.services.mozilla.com/D87404
2020-08-19 00:51:46 +00:00
Botond Ballo
46cb4b771c Bug 1519285 - Remove FrameMetrics::mVisualViewportOffset. r=kats
It is now redundant with mScrollOffset which always stores the
visual scroll offset.

Differential Revision: https://phabricator.services.mozilla.com/D87162
2020-08-18 05:12:37 +00:00
Botond Ballo
f027a116ab Bug 1519285 - Populate the (main thread's view of the) visual scroll offset in ComputeScrollMetadata(). r=kats
Differential Revision: https://phabricator.services.mozilla.com/D87160
2020-08-18 04:13:01 +00:00
Botond Ballo
b2cef81a9b Bug 1519285 - Replace most calls to FrameMetrics::{Get,Set}ScrollOffset() with calls to the more specific visual or layout accessors. r=kats
Likewise for RepaintRequest, and direct usages of mScrollOffset
inside FrameMetrics.

The general idea is:

 * APZ's copy of the FrameMetrics stores the visual scroll offset,
   so calls to GetScrollOffset() on it are replaced with
   GetVisualScrollOffset()

 * The layer tree's copy of the frame metrics (and copies derived
   from that like mLastContentPaintMetrics) currently stores the
   layout scroll offset, so calls to GetScrollOffset() on those
   are replaced with GetLayoutScrollOffset().

The latter changes are particularly important, as they enable us
to modify the layer tree's copy to store (a main thread snapshot
of) the visual offset in mScrollOffset in a future patch.

This patch intends no functional changes. In the cases where we
change GetScrollOffset() to GetLayoutScrollOffset(), mScrollOffset
and mLayoutViewport.TopLeft() should already be storing the same
thing.

The patch identifies a few usages as suspicious but leaves them
functionally unchanged for now.

A few problematic usages of GetScrollOffset() remain, which will
require other fixes to remove.

Differential Revision: https://phabricator.services.mozilla.com/D87159
2020-08-18 05:11:23 +00:00
Botond Ballo
10922a343b Bug 1519285 - Populate both scroll offsets in CalculateBasicFrameMetrics(). r=kats
Take advantage of them in CalculateRectToZoomTo(), where we also fix
a previously-incorrect usage.

Differential Revision: https://phabricator.services.mozilla.com/D87156
2020-08-18 04:55:46 +00:00
Timothy Nikkel
6c39597e2d Bug 1656802. Make visual viewport only layout scrollbars affect the composition bounds/visual viewport. r=emilio,kats
AFAICT the spec says that these layout scrollbars that take up no layout space that scroll the visual viewport do affect the size of the visual viewport. (Double check this)

Most other users don't care about the size of these special scrollbars.

I left nsIDOMWindowUtils::getScrollbarSize unchanged (NB different from nsIDOMWindowUtils::getScrollbarSizes which is modified by this patch) because I'm less sure. I will file a followup about it.

Differential Revision: https://phabricator.services.mozilla.com/D85708
2020-08-07 11:40:52 +00:00
Ting-Yu Lin
0041e19cd2 Bug 1042151 Part 4 - Consider flexbox's main & cross axis when getting scrolled rect. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D86078
2020-08-07 19:11:38 +00:00
Ting-Yu Lin
4f4bda78d0 Bug 1042151 Part 2 - Refactor the conditions that decide which edge to clamp when getting scrolled rect. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D86076
2020-08-07 02:20:44 +00:00
Ting-Yu Lin
08217997a3 Bug 1042151 Part 1 - Sort the #include statements in nsLayoutUtils.cpp. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D86075
2020-08-07 02:20:42 +00:00
Bogdan Tara
12f0274f43 Backed out 11 changesets (bug 1656802) for async-scrolling reftests failures CLOSED TREE
Backed out changeset 941ee8aa9735 (bug 1656802)
Backed out changeset c5b1b38d1d35 (bug 1656802)
Backed out changeset fe2dd5de83ef (bug 1656802)
Backed out changeset 8e217fc1c6d4 (bug 1656802)
Backed out changeset 21f574f6acb4 (bug 1656802)
Backed out changeset 753f93dffe07 (bug 1656802)
Backed out changeset 386554110008 (bug 1656802)
Backed out changeset 2d3576ace2f1 (bug 1656802)
Backed out changeset 06a47c35c531 (bug 1656802)
Backed out changeset 57fa48542435 (bug 1656802)
Backed out changeset b1517bc33eff (bug 1656802)
2020-08-07 14:36:21 +03:00
Timothy Nikkel
0ed32af9ec Bug 1656802. Make visual viewport only layout scrollbars affect the composition bounds/visual viewport. r=emilio,kats
AFAICT the spec says that these layout scrollbars that take up no layout space that scroll the visual viewport do affect the size of the visual viewport. (Double check this)

Most other users don't care about the size of these special scrollbars.

I left nsIDOMWindowUtils::getScrollbarSize unchanged (NB different from nsIDOMWindowUtils::getScrollbarSizes which is modified by this patch) because I'm less sure. I will file a followup about it.

Differential Revision: https://phabricator.services.mozilla.com/D85708
2020-08-07 10:05:10 +00:00
Brindusan Cristian
418a1be912 Backed out 5 changesets (bug 1042151) for causing wpt failures in negative-overflow.html. CLOSED TREE
Backed out changeset a9a3507991fa (bug 1042151)
Backed out changeset 14e34cd9dfd8 (bug 1042151)
Backed out changeset bf4991db4445 (bug 1042151)
Backed out changeset ad498cd179b9 (bug 1042151)
Backed out changeset 1eac44fb3f6f (bug 1042151)
2020-08-07 05:16:01 +03:00
Ting-Yu Lin
80d5e1982b Bug 1042151 Part 4 - Consider flexbox's main & cross axis when getting scrolled rect. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D86078
2020-08-06 22:38:11 +00:00
Ting-Yu Lin
ad11b787b8 Bug 1042151 Part 2 - Refactor the conditions that decide which edge to clamp when getting scrolled rect. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D86076
2020-08-06 22:38:00 +00:00
Ting-Yu Lin
8d22bf4a0a Bug 1042151 Part 1 - Sort the #include statements in nsLayoutUtils.cpp. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D86075
2020-08-06 22:37:53 +00:00
Emilio Cobos Álvarez
69eae3bcd8 Bug 1436758 - Make color-adjust: exact not darken foreground colors. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D85660
2020-08-02 08:45:29 +00:00
Noemi Erli
cf5e7541d4 Backed out changeset 4fbc6775e743 (bug 1640195) for causing multiple failures CLOSED TREE 2020-07-30 02:58:03 +03:00
Stephen A Pohl
9ff3f2f4e4 Bug 1640195: Address UX feedback for non-native widget styling. r=geckoview-reviewers,emilio,agi
Differential Revision: https://phabricator.services.mozilla.com/D76509
2020-07-29 22:16:06 +00:00
Cameron McCormack
156ec1630b Bug 1654925 - Make FindNearestCommonAncestorFrameWithinBlock handle bad frame trees without crashing. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D84768
2020-07-24 22:43:36 +00:00
Nicolas Silva
1af0c45273 Bug 1653615 - Ensure displayport snapping doesn't move by more than the margin. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D84552
2020-07-24 07:09:47 +00:00
Philipp Zech
187d7f4637 Bug 1648938 - Convert writing-modes #defines to an enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D84016
2020-07-23 21:31:23 +00:00
Timothy Nikkel
7b4e15a398 Bug 1651332. Use purely relative scroll offset updates for many scrollbar initiated scrolls. r=kats
This patch basically attempts to make clicking in the scrollbar track outside of the scrollthumb "work". Clicking in the scrollbar track usually does a page scroll via nsSliderFrame::PageScroll. This eventually ends up in ScrollFrameHelper::ScrollBy where we turn the request from a relative one ("scroll by a page") into an absolute one ("scroll to this position").

This page scroll is typically a smooth scroll and is currently done on the main thread/layout side. Once we start scrolling the visual viewport offset with the scrollbars we can no longer do this purely on the layout side, we at least need the help of the compositor side. I think the simplest way to do this is to hand the scroll request off to the compositor and have it handle the whole thing.

Now we need to consider the following situation: user clicks scrollbar track to page scroll, smooth scroll gets partway complete on the compositor, user clicks again on scrollbar track for a further page scroll. The main thread can't send an absolute scroll offset update request to the compositor at this point because it has outdated information (it needs a 'starting position' to add the page scroll offset amount) so it'll end up scrolling to the wrong place. It has to send a relative scroll offset update.

We already have a mechanism to send relative scroll offset updates. It is implemented by sending a base scroll offset and the desired scroll offset, and then on the compositor send the difference between those two is computed and then added to the scroll offset.

This patch creates a new mechanism (so called "pure relative") that just sends a relative offset update without any absolute scroll positions. The reason I did this is because the existing relative scroll offset update mechanism is not aware of visual viewport offsets, but rather only layout scroll position. For example, here

https://searchfox.org/mozilla-central/rev/8d55e18875b89cdf2a22a7cba60dc40999c18356/layout/generic/nsGfxScrollFrame.h#446

the value we use for the base scroll offset (mApzScrollPos) is set to the layout scroll position. It may be entirely reasonable to make this existing mechanism vv offset aware, but I wanted to implement something to get it working with a smaller chance of regressions to things that already exist and work. Ideally these two mechanims would be merged.

Differential Revision: https://phabricator.services.mozilla.com/D82688
2020-07-19 14:56:24 +00:00
Emilio Cobos Álvarez
8ea590abaa Bug 1650719 - Don't lose the rect offset from the composition bounds. r=kats
This offset was reset in one of the two codepaths of D80723, but turns
out it's important for same-origin documents that are also
root-content-documents, like about: pages in the parent process, which
happened to hit the codepath that did _not_ reset it. :(

Differential Revision: https://phabricator.services.mozilla.com/D84584
2020-07-22 22:02:35 +00:00
Hiroyuki Ikezoe
e1cc862d00 Bug 1652190 - Don't expand the composition size including the dynamic toolbar height if the root content is not scrollable. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D83601
2020-07-21 02:53:09 +00:00
Ting-Yu Lin
ede6f9503a Bug 1637130 - Rename visual overflow to ink overflow. r=dbaron
This patch is generated by:

```
# Rename the nsOverflowType enum.
rg -l "eVisualOverflow" layout/ gfx/ | xargs sed -i "s/eVisualOverflow/eInkOverflow/g"

# Rename and drop the "Get" prefix from various functions.
rg -l "GetVisualOverflowRect" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowRect/InkOverflowRect/g"
rg -l "GetPreEffectsVisualOverflowRect" layout/ gfx/ | xargs sed -i "s/GetPreEffectsVisualOverflowRect/PreEffectsInkOverflowRect/g"
rg -l "GetVisualOverflowFromDeltas" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowFromDeltas/InkOverflowFromDeltas/g"
rg -l "GetScrollableOverflowRect" layout/ gfx/ | xargs sed -i "s/GetScrollableOverflowRect/ScrollableOverflowRect/g"

# Rename, drop the "Get" prefix, and change the suffix "Area" to "Rect"
# (because they return nsRect) for the two methods in nsLineBox.
rg -l "GetVisualOverflowArea" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowArea/InkOverflowRect/g"
rg -l "GetScrollableOverflowArea" layout/ gfx/ | xargs sed -i "s/GetScrollableOverflowArea/ScrollableOverflowRect/g"

# Rename rest of the functions and variables.
rg -l "VisualOverflow" layout/ gfx/ | xargs sed -i "s/VisualOverflow/InkOverflow/g"
rg -l "visual overflow" layout/ gfx/ | xargs sed -i "s/visual overflow/ink overflow/g"
rg -l "visualOverflow" layout/ gfx/ | xargs sed -i "s/visualOverflow/inkOverflow/g"
rg -l "visOverflow" layout/ gfx/ | xargs sed -i "s/visOverflow/inkOverflow/g"
rg -l "vis-overflow" layout/ gfx/ python/ | xargs sed -i "s/vis-overflow/ink-overflow/g"

./mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D84231
2020-07-20 20:17:36 +00:00
Cameron McCormack
97cb78739e Bug 1620467 - Part 3: Defer to -moz-default-appearance when appearance is auto. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D83429
2020-07-16 22:04:12 +00:00
longsonr
d0980a7f6e Bug 1652254 - Remove svg from some moz.build local includes r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D83247
2020-07-12 16:38:26 +00:00
longsonr
ba1943ecf8 Bug 1259861 - Move everything else into the mozilla namespace in layout/svg r=dholbert
Also: adjust include paths to be consistent for usages of various SVG headers,
and remove unused SVG includes (mostly for "utils" classes),
and drop stray "ns" from already-renamed SVG classes in various code comments.

Differential Revision: https://phabricator.services.mozilla.com/D83140
2020-07-11 02:20:20 +00:00
Kartikaya Gupta
494cf8f784 Bug 1651050 - Add a logging module for code that sets displayports. r=tnikkel
This is useful for debugging purposes.

Depends on D82778

Differential Revision: https://phabricator.services.mozilla.com/D82779
2020-07-09 10:10:28 +00:00
Hiroyuki Ikezoe
7e3d79cf55 Bug 1525561 - Rename nsPresContext::GetToplevelContentDocumentPresContext to GetInProcessRootContentDocumentPresContext. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D82812
2020-07-09 01:58:59 +00:00
Kagami Sascha Rosylight
93741338a8 Bug 1630704 - Part 27: Remove nsFrame from inheritance chain r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81864
2020-07-06 22:29:42 +00:00
Hiroyuki Ikezoe
4c553c009e Bug 1324591 - Add nsLayoutUtils::IsInPositionFixedSubtree. r=TYLin
Depends on D75729

Differential Revision: https://phabricator.services.mozilla.com/D81480
2020-07-05 11:43:20 +00:00
Brindusan Cristian
5bbac659d5 Backed out 9 changesets (bug 1324591) for linux build bustages on central on nsDisplayList.h.
Backed out changeset 75966ee1fe65 (bug 1324591)
Backed out changeset d6a01c6bc40e (bug 1324591)
Backed out changeset fef36ff2ea3d (bug 1324591)
Backed out changeset 4a4ae4bd95d1 (bug 1324591)
Backed out changeset 732804c83add (bug 1324591)
Backed out changeset 84657a3522fb (bug 1324591)
Backed out changeset e6c74ba41007 (bug 1324591)
Backed out changeset 8e6d4e9f5aa0 (bug 1324591)
Backed out changeset 6bc284863aff (bug 1324591)
2020-07-05 13:45:35 +03:00
Hiroyuki Ikezoe
64799ce47f Bug 1324591 - Add nsLayoutUtils::IsInPositionFixedSubtree. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D81480
2020-07-05 02:19:25 +00:00
Nicolas Silva
a22164416c Bug 1647156 - Improve the displayport snapping logic. r=kats
Aligning the displayport position in large increments can cause issues when the displayport is small enough to be smaller than the alignment itself. The risk is higher for small frames with no displayport margin as the alignment might have previously be rounded up to 512. Luckily not having margins is an indication that we aren't trying hard to benefit from APZ and a large alignment isn't benefiting us. This patch takes that into consideration and defaults to small alignements when there is no margins. The alignment is also rounded to a multiple of 256 instead of 512 to further reduce the likelihood of running into issues with small displayports.

Differential Revision: https://phabricator.services.mozilla.com/D80614
2020-07-02 16:14:51 +00:00
Kagami Sascha Rosylight
0a3a447bbb Bug 1647525 - Use HasAnyStateBits() in remaining layout files r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81230
2020-06-28 01:00:19 +00:00
Kagami Sascha Rosylight
a6c432362c Bug 1647525 - Use HasAnyStateBits() in nsLayoutUtils r=emilio
Depends on D81095

Differential Revision: https://phabricator.services.mozilla.com/D81096
2020-06-25 14:27:15 +00:00
Emilio Cobos Álvarez
02ced5ba08 Bug 1647871 - Simplify content viewer composition size code. r=kats,hiro
This should be equivalent because:

 * Content viewer size and widget size should eventually be the same always
   (modulo mid-resize, see bug 1645954).

 * Only the root content document has a widget on android (the puppet widget).

 * Only the root content document has a dynamic toolbar.

 * We were only calling this on the root document, which has no parent pres
   context (at least with e10s). Without e10s we could have a chrome
   prescontext (not sure it that ends up being a parent in the pres context
   chain), but we should never change the resolution of that one, so I think
   aScaleContentViewerSize is just useless.

This avoids having two sources of truth by always checking the content viewer
size without subtracting the dynamic toolbar max size.

Differential Revision: https://phabricator.services.mozilla.com/D80723
2020-06-24 14:46:40 +00:00
longsonr
a9ef2f170b Bug 1647101 - Move SVGTextFrame SVGViewFrame SVGFEContainerFrame SVGFEImageFrame SVGFELeafFrame SVGFEUnstyledLeafFrame into the mozilla namespace r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D80383
2020-06-23 22:59:34 +00:00
Andrew Osmond
5d64a94391 Bug 1550710 - Make vector images enable high quality scaling for embedded raster images. r=tnikkel
We did not pass FLAG_HIGH_QUALITY_SCALING down to the document used to
rasterize the SVG to a surface, resulting in embedded raster images to
not use high quality downscaling.

Differential Revision: https://phabricator.services.mozilla.com/D56422
2020-06-23 12:43:21 +00:00
Emilio Cobos Álvarez
1c8cab8731 Bug 1646224 - Fix a typo in windows-only code.
MANUAL PUSH: a11y orange

CLOSED TREE
2020-06-22 13:13:27 +02:00
Emilio Cobos Álvarez
6c9ff73ac1 Bug 1646224 - Use mozilla::Length rather than nscoord to store font sizes. r=heycam,jfkthame
This avoids arbitrary precision loss when computing REM units and so on,
which is particularly important if we ever change the base of our app
units (but useful regardless).

Differential Revision: https://phabricator.services.mozilla.com/D79928
2020-06-22 09:45:40 +00:00
Kartikaya Gupta
b2bbdf0796 Bug 1646385 - Move SetVisualViewport goop from nsLayoutUtils to PresShell. r=tnikkel
There's no need to put this in nsLayoutUtils since it's so closely bound
to presShell anyway. So we move it from being a static nsLayoutUtils function
that takes a PresShell pointer, to being a method on the PresShell itself.

Two functional changes here:
1. Don't run the MaybeReflowForInflationScreenSizeChange code unless the
   visual viewport actually changes
2. Run the MaybeReflowForInflationScreenSizeChange if the visual viewport
   is reset.

These functional changes can be logically thought of as "group the font-
inflation reflow stuff together with the other visual-viewport-triggered
reflow stuff".

Depends on D80040

Differential Revision: https://phabricator.services.mozilla.com/D80041
2020-06-18 11:54:01 +00:00
Timothy Nikkel
c6658de71b Bug 1645954. Don't use a stale value of mScrollPort during scrollframe reflow while still determining the new value of mScrollPort. r=tnikkel
Also, adjust for scrollbars and resolution correctly.

Differential Revision: https://phabricator.services.mozilla.com/D79778
2020-06-18 09:25:02 +00:00