Commit graph

68 commits

Author SHA1 Message Date
Gerald Squelart
2416d881e2 Bug 1691589 - Reduce reliance on GeckoProfiler.h when only labels (and maybe markers) are needed - r=necko-reviewers,geckoview-reviewers,sg,agi,florian
There are no code changes, only #include changes.
It was a fairly mechanical process: Search for all "AUTO_PROFILER_LABEL", and in each file, if only labels are used, convert "GeckoProfiler.h" into "ProfilerLabels.h" (or just add that last one where needed).
In some files, there were also some marker calls but no other profiler-related calls, in these cases "GeckoProfiler.h" was replaced with both "ProfilerLabels.h" and "ProfilerMarkers.h", which still helps in reducing the use of the all-encompassing "GeckoProfiler.h".

Differential Revision: https://phabricator.services.mozilla.com/D104588
2021-02-16 04:44:19 +00:00
Barret Rennie
2db5a81fea Bug 1663963 - Remove expired scroll anchor adjustment telemetry r=rhunt
Differential Revision: https://phabricator.services.mozilla.com/D89650
2020-09-10 00:52:39 +00:00
Razvan Maries
90b7948378 Backed out 2 changesets (bug 1663963, bug 1657188) for perma failures on browser_Telemetry_loadTimePreload.js. CLOSED TREE
Backed out changeset 643f16da7b99 (bug 1657188)
Backed out changeset 0c9661a5c8f9 (bug 1663963)
2020-09-10 03:48:48 +03:00
Barret Rennie
0bec7c3a9c Bug 1663963 - Remove expired scroll anchor adjustment telemetry r=rhunt
Differential Revision: https://phabricator.services.mozilla.com/D89650
2020-09-09 21:44:48 +00:00
Emilio Cobos Álvarez
f08a5f293b Bug 1650502 - Plumb whether an async APZ animation is in progress via RepaintRequest. r=botond
And store that information in the scroll frame for the purposes of
avoiding scroll anchoring and scroll restoration.

Differential Revision: https://phabricator.services.mozilla.com/D85157
2020-08-02 16:58:29 +00:00
Cosmin Sabou
8aa0a2fcff Backed out 2 changesets (bug 1650502) for mochitest failures on test_frame_reconstruction.html. CLOSED TREE
Backed out changeset 1a4ce811fcab (bug 1650502)
Backed out changeset b21e76dcb485 (bug 1650502)
2020-08-02 19:50:05 +03:00
Emilio Cobos Álvarez
964bac7f10 Bug 1650502 - Plumb whether an async APZ animation is in progress via RepaintRequest. r=botond
And store that information in the scroll frame for the purposes of
avoiding scroll anchoring and scroll restoration.

Differential Revision: https://phabricator.services.mozilla.com/D85157
2020-08-02 15:20:55 +00:00
Andreea Pavel
cae88d4491 Backed out 2 changesets (bug 1650502) for failing android at test_frame_reconstruction.html on a CLOSED TREE
Backed out changeset 9b300d20df23 (bug 1650502)
Backed out changeset 1e87d4186672 (bug 1650502)
2020-08-01 02:54:36 +03:00
Emilio Cobos Álvarez
1ade3ecd63 Bug 1650502 - Plumb whether an async APZ animation is in progress via RepaintRequest. r=botond
And store that information in the scroll frame for the purposes of
avoiding scroll anchoring and scroll restoration.

Differential Revision: https://phabricator.services.mozilla.com/D85157
2020-07-31 20:33:01 +00:00
Ting-Yu Lin
fdc00547f6 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
Simon Giesecke
cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Kartikaya Gupta
5606d64a06 Bug 1645764 - Turn ANCHOR_LOG into a MOZ_LOG. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D79658
2020-06-15 12:38:27 +00:00
Kartikaya Gupta
7ac36807b1 Bug 1643042 - Turn the scroll origin parameter into a strongly-typed enum. r=tnikkel
This patch is a fairly mechanical conversion. The old `nullptr` gets converted
to ScrollOrigin::NotSpecified, and all the other possible values get corresponding
values in the new ScrollOrigin enum. A few switch statements are introduced to
clean up big if statements, but other than that, additional cleanups will happen
in later patches.

Differential Revision: https://phabricator.services.mozilla.com/D78438
2020-06-05 09:37:51 +00:00
Daniel Holbert
7d4f598530 Bug 1639381: Add period and newline at the end of scroll-anchor logging statement. r=emilio
This change is for consistency with other similar logging, and to avoid getting
unrelated lines of logging concatenated together.

Calling this "DONTBUILD" because this is just a small tweak to an (opt-in)
debug logging string which probably doesn't get printed on TreeHerder, so
there's virtually no chance this could have an impact on any TreeHerder jobs.

Differential Revision: https://phabricator.services.mozilla.com/D76061
2020-05-19 23:15:10 +00:00
Emilio Cobos Álvarez
aa9d2c20c6 Bug 1538537 - When suppressing anchoring on an scrollframe, forward to the frame that actually maintains the anchor as needed. r=dholbert
The test-case is position-change-heuristic.html but with body and #space
having overflow: hidden, which makes it fail on Nightly.

Differential Revision: https://phabricator.services.mozilla.com/D75825
2020-05-19 23:57:23 +00:00
Ting-Yu Lin
162c8d3a67 Bug 1638928 Part 2 - Rename nsIFrame's GetChildLists() to ChildLists(). r=mats
This patch is generated by using my editor's rename functionality.

In the next patch, `nsIFrame::` prefix is going to be removed manually
from all the ChildLists() calls.

Differential Revision: https://phabricator.services.mozilla.com/D75893
2020-05-19 12:37:37 +00:00
Ting-Yu Lin
07b47bf217 Bug 1635319 Part 1 - Add nsIFrame::GetChildLists(), and use range-based for loops instead of ChildListIterator in layout/generic/. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D75652
2020-05-18 01:09:34 +00:00
Emilio Cobos Álvarez
072ca409e3 Bug 1630385 - Don't descend into scroll frames with a pre-existing anchor. r=dholbert
We can modify the scroll position without invalidating the anchor (that's kind
of the point, actually).

So it's possible (and ok) to end up with a frame which is already maintaining
an anchor but for which CanMaintainAnchor now returns false.

So if you have a scrollframe with a non-zero scroll position and select an
anchor for that scrollframe, and then try to select an anchor for an ancestor,
you don't want to dig into there.

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

--HG--
extra : moz-landing-system : lando
2020-04-15 23:13:00 +00:00
Emilio Cobos Álvarez
202a1619ad Bug 1520581 - Allow to select scroll anchors inside nested scroll frames. r=dholbert
As long as the nested scrollframe doesn't maintain an anchor itself.

This is important for pages which use overflow: hidden to contain large
parts of their scrollable content, see bug 1629237 for an example.

When calling InvalidateAnchor(), we may invalidate an ancestor anchor
itself, if we're not maintaining an anchor and our scrolled frame is
part of the anchor chain. This is important to maintain our state
properly.

I was going to add some assertion to this effect but it can fail when
fragmenting inlines already, so for now I've commented it out and filed
bug 1629280 for that. It's not great, but it cannot lead to a security
issue so we probably can fix it with time.

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

--HG--
extra : moz-landing-system : lando
2020-04-13 20:58:14 +00:00
Simon Giesecke
8aa47bcfb7 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in layout. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D66016

--HG--
extra : moz-landing-system : lando
2020-03-17 09:38:32 +00:00
Emilio Cobos Álvarez
e4106f7b64 Bug 1615955 - Suppress scroll anchoring when scroll offset is zero. r=dholbert
As per https://github.com/w3c/csswg-drafts/pull/4679.

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

--HG--
extra : moz-landing-system : lando
2020-02-22 20:08:22 +00:00
Emilio Cobos Álvarez
d13e046349 Bug 1584035 - Don't apply scroll anchoring adjustments if we have an ongoing APZ smooth scroll. r=dholbert
Same case as the other smooth-scrolling thingies, scroll anchoring is less
prioritary (and is disturbing) in that case.

Also fix the logging code (`WritingMode::DebugString` is no longer a thing).

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

--HG--
extra : moz-landing-system : lando
2020-02-12 18:56:43 +00:00
Emilio Cobos Álvarez
672ef887fb Bug 1592474 - Report a console warning when we disable scroll anchoring on a scroller. r=dholbert,flod
Depends on D51024

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

--HG--
extra : moz-landing-system : lando
2019-10-31 09:19:21 +00:00
Emilio Cobos Álvarez
f70cc8c005 Bug 1592474 - Add some heuristics to disable scroll anchoring in pathological cases. r=dholbert
The idea of these are not to penalize legit uses of scroll anchoring, and
catching pathological cases fast.

The current algorithm I thought of is just whether the average of all the
consecutive scroll anchoring adjustments is less than a given threshold.

If the average adjustment is close to zero and the user is not scrolling, it
means that we're not making much progress.

It is important that zero adjustments don't get counted, since those are common
during window resizes and don't have side-effects anyway.

Exact number may need tuning, let me know if you want it
nightly-and-early-beta-only for now or something.

Depends on D51038

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

--HG--
extra : moz-landing-system : lando
2019-10-31 09:25:08 +00:00
Emilio Cobos Álvarez
4510f3e34a Bug 1592474 - Share code between ScrollAnchorContainer::{Destroy,InvalidateAnchor}. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D51038

--HG--
extra : moz-landing-system : lando
2019-10-31 09:23:35 +00:00
Emilio Cobos Álvarez
5e0abce31f Bug 1588748 - Make an scroll anchoring assertion a release assert. r=dholbert
This should prevent this being exploitable, should this fire.

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

--HG--
extra : moz-landing-system : lando
2019-10-15 18:46:42 +00:00
Emilio Cobos Álvarez
bb4daeb401 Bug 1586909 - Process anchor suppressions even when ignoring adjustments. r=dholbert
Otherwise we may keep the scroll anchor around and we may try to anchor to it
later even though we should've really suppressed it completely.

Maybe we should just call InvalidateAnchor() unconditionally from that code
path, even if there are no suppressions pending...

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

--HG--
extra : moz-landing-system : lando
2019-10-07 22:47:15 +00:00
Sylvestre Ledru
f12b9fa5c3 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-10-06 18:29:55 +00:00
Emilio Cobos Álvarez
5906f23d74 Bug 1540203 - Tweak scroll anchor selection to allow to select everything but inline-fragmentable, non-text boxes. r=dholbert
Per the discussion in https://github.com/w3c/csswg-drafts/issues/4247.

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

--HG--
extra : moz-landing-system : lando
2019-09-13 22:26:48 +00:00
Emilio Cobos Álvarez
31c8224bf5 Bug 1561450 - Suppress scroll anchoring adjustments from scroll event listeners. r=dholbert
See https://github.com/w3c/csswg-drafts/issues/4239

This fixes what is in my opinion one of the biggest issues of scroll anchoring
as specified / currently implemented.

It's trivial to flush layout on a scroll handler and create scroll adjustments,
which in turn would trigger other scroll events to be fired. This situation,
which is what has happened in most of the scroll anchoring regressions I've
fixed, at best gets pages to get stuck in an infinite CPU loop. At worst, it
causes scrolling to be unusable because the page keeps reacting to scroll
events.

An alternative, slightly more elegant but not clear to me if 100% implementable
approach would be bug 1529702.

This should enormously reduce the need for scroll anchoring suppression
triggers[1], I'd think, which in turn would allow me to investigate removing
some of that complexity.

https://drafts.csswg.org/css-scroll-anchoring/#suppression-triggers

The setup to set / unset the boolean is a bit awkward but I couldn't come up
with anything better.

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

--HG--
extra : moz-landing-system : lando
2019-08-23 22:29:49 +00:00
Nicholas Nethercote
18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

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

--HG--
extra : moz-landing-system : lando
2019-07-26 01:10:23 +00:00
Emilio Cobos Álvarez
937b1f9834 Bug 1566783 - Don't prevent PresShell::ScrollToAnchor() from working due to scroll anchoring adjustments that happen without the user scrolling. r=dholbert
We were bailing out because scroll anchoring adjustments can make this check
fail:

  * https://searchfox.org/mozilla-central/rev/22b330ecb3edba1536a54887060cbdd09db21c59/layout/base/PresShell.cpp#3194

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

--HG--
extra : moz-landing-system : lando
2019-07-20 15:02:35 +00:00
Emilio Cobos Álvarez
24c8f44f2d No bug - Fix -Werror multiline-comment warning in previous scroll anchoring log tweak. sigh
CLOSED TREE
2019-07-18 00:21:17 +02:00
Emilio Cobos Álvarez
77fcf48fbf No bug - tweak scroll anchoring logs. r=npotb 2019-07-18 00:03:47 +02:00
Emilio Cobos Álvarez
6ef01a0d95 Bug 1554572 - Don't apply scroll anchor adjustments if we're processing an async scroll animation. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D38077

--HG--
extra : moz-landing-system : lando
2019-07-15 17:48:16 +00:00
Emilio Cobos Álvarez
1a121e2e21 Bug 1546027 - Don't apply scroll anchor adjustments if we're restoring our scroll position. r=dholbert
Since scroll position restoration is absolute, and we'll lose it as soon as we
apply any adjustment or do any other sort of scrolling.

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

--HG--
extra : moz-landing-system : lando
2019-07-15 17:46:11 +00:00
Emilio Cobos Álvarez
11ea945833 Bug 1546697 - Use a consistent style for enum classes in layout. r=dholbert
Per the discussion in:

  https://groups.google.com/d/msg/mozilla.dev.platform/P79pwa9z5m8/iPYPAWPHCAAJ

They should be CamelCase, and that's what most of them already do. This converts
the rest, which are a few.

For the ones that already used `e` or `k` prefixes, I've mostly done:

 for file in $(rg Type::e layout | cut -d : -f 1 | sort | uniq); do sed -i 's#Type::e#Type::#g' $file; done

For the ones that used uppercase, I've removed the prefix if it was already in
the type name, and turn them into CamelCase.

Depends on D28680

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

--HG--
extra : moz-landing-system : lando
2019-04-25 23:03:04 +00:00
Masayuki Nakano
e8446480e1 Bug 1542407 - Make nsIFrame use mozilla::PresShell directly rather than via nsIPresShell r=emilio
Except retrieving from weak reference, `nsIFrame` should treat
`mozilla::PresShell` directly rather than via `nsIPresShell`.

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

--HG--
extra : moz-landing-system : lando
2019-04-06 06:02:28 +00:00
Daniel Holbert
b0da9aaf64 Bug 1541137: Add missing includes/namespaces/decls to fix non-unified build bustage in layout/generic. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D25823

--HG--
extra : moz-landing-system : lando
2019-04-02 20:06:52 +00:00
Botond Ballo
573a6eaafa Bug 1538511 - Move nsIScrollableFrame::ScrollMode into a separate file. r=kats
This allows this enumeration to be used from nsIPresShell.h without introducing
a circular dependency.

Its new home in layout/base/ScrollTypes.h, included as mozilla/ScrollTypes.h.
Others similar enums can be added to that file if desired.

This patch also makes ScrollMode an enum class (as it's no longer nested
inside a class) and switches its enumerators to the |eName| naming convention.

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

--HG--
extra : moz-landing-system : lando
2019-03-25 23:17:20 +00:00
Sylvestre Ledru
41d1d79094 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-02-15 08:15:57 +00:00
Ryan Hunt
fc7e92ad83 Bug 1520363 - Rename nsIScrollableFrame::GetAnchor() to Anchor(). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D19872

--HG--
extra : moz-landing-system : lando
2019-02-15 01:25:55 +00:00
Ryan Hunt
6bdc12be01 Bug 1519553 - Don't round scroll anchor adjustments to device pixels. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D19107

--HG--
extra : source : 7f29bb7519563e3aaafa2e484a356409ce05aab7
extra : histedit_source : 3f1c287cc5984bf896ed43cccd7533d39cda40c9
2019-02-07 20:39:49 -06:00
Ryan Hunt
585289697d Bug 1521579 - Only transform one bounding rect for text nodes when computing scroll anchoring bounding rect. r=dholbert
When visiting a text frame with many continuations, traversing ancestors to compute the
transform to the ancestor scroll frame can become very hot. This commit changes the
algorithm to translate all the text continuations to an ancestor that can then be
transformed just once.

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

--HG--
extra : moz-landing-system : lando
2019-01-30 14:42:58 +00:00
Ryan Hunt
092461a72f Bug 1521579 - Skip text frames that are continuations. r=dholbert
A continuation text frame's rect will be considered when visiting the primary
frame via 'FindScrollAnchoringBoundingRect', so we have no reason to compute
the same rect again if for some reason we have excluded the primary text frame.

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

--HG--
extra : moz-landing-system : lando
2019-01-30 14:42:28 +00:00
Ryan Hunt
3e87663a7f Bug 1518640 - Use the visual viewport for anchor node selection. r=botond
--HG--
extra : rebase_source : 0f7038a4bf6b7d2a7958177b883c7fbb4130d288
extra : intermediate-source : 97681055c88c7af478467d6c76e227d0cb916aad
extra : source : 27bbb318ecb4f44c315f87584bdeb1b239d80cef
2019-01-22 13:37:16 -06:00
Csoregi Natalia
54be80a8cf Backed out 2 changesets (bug 1518640) for reftest failures on gfx/layers/apz/test/reftest/frame-reconstruction-scroll-clamping.html. CLOSED TREE
Backed out changeset 27bbb318ecb4 (bug 1518640)
Backed out changeset 3b192e4631cc (bug 1518640)
2019-01-22 22:37:00 +02:00
Ryan Hunt
04f720e12c Bug 1518640 - Use the visual viewport for anchor node selection. r=botond
--HG--
extra : histedit_source : 44a540ddceb42939c124e51486c18856584de39a
2019-01-22 13:37:16 -06:00
Ryan Hunt
89cf3d0af8 Bug 1521278 - Allow ScrollAnchorContainer to detach anchor frame even if pref is disabled. r=dholbert
The important piece is just that we don't queue a selection for later. This code runs
for each scroll, so we'd be wasting a lot of effort to do that.

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

--HG--
extra : moz-landing-system : lando
2019-01-20 07:21:55 +00:00
Ryan Hunt
a3916a4e4e Bug 1520344 - Store last scroll anchor position in writing-mode relative coordinates. r=dholbert
This commit changes ScrollAnchorContainer to store the offset between the scroll anchoring
bounding rect start edge and the scroll-port start edge in the block axis of the scroll frame.

The logic to clamp the negative portions of scroll anchor bounding rect is also amended
to only clamp the portion that is beyond the border start edge in the block axis of the
scroll frame.

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

--HG--
extra : rebase_source : 43b5bc4ece7f90cb38e3a7186a764d9cddac90f9
extra : source : f26d953d76fcfb02a5fa46cb62e389f852592fe9
2019-01-16 15:13:12 -06:00