Commit Graph
98 Commits
Author SHA1 Message Date
Emilio Cobos Álvarez 41c7d6492e Bug 1905426 - Refine zero-scroll-offset scroll anchoring heuristic to match blink. r=hiro
See link in the comment. We were checking both offsets, but blink only
checks one.

In this case, the page has a table with `overflow-x: auto` and
`overflow-y: hidden`. They implement a custom virtual scrolling on the
vertical axis, and scroll-anchoring interacts poorly with it.

Adapt zero-scroll-offset.html to test for this.

Differential Revision: https://phabricator.services.mozilla.com/D217201
2024-07-22 22:45:49 +00:00
Ting-Yu Lin a9397b0f0a Bug 1896516 Part 12 - Tidy up ScrollContainerFrame's interface. r=layout-reviewers,emilio
The motivation of this patch is that we've now switched all the callers from
`nsIScrollableFrame` to `ScrollContainerFrame`, and it is better to audit the
access control of `ScrollContainerFrame`'s interface, and I notice almost all
the member variables are public!

This patch shuffle the interface so that there are only one public, protected,
and private section, and all the member variables are moved to the private
section.

`AutoMinimumScaleSizeChangeDetector` and `RemoveDisplayPortCallback` need to
access member variables, so by declaring them under `ScrollContainerFrame`, they
have the privilege to do so.

Ideally, the caller only need to access what are already in
`nsIScrollableFrame`, so currently we might expose more methods than necessary.
We can audit that in a later part.

Differential Revision: https://phabricator.services.mozilla.com/D211499
2024-05-30 06:32:22 +00:00
Ting-Yu Lin 5cdee429ce Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211498
2024-05-30 06:32:22 +00:00
Ting-Yu Lin 76523f97b1 Bug 1896516 Part 6 - Remove nsIScrollableFrame usages in nsLayoutUtils. r=layout-reviewers,emilio
Convert `nsIScrollableFrame` to `ScrollContainerFrame` for all the APIs in
nsLayoutUtils, and then adapt other callers until everything compiles.

In `nsLayoutUtils::CalculateBasicFrameMetrics()`'s documentation,
s/ComputeFrameMetrics/ComputeScrollMetadata/ because the method was renamed in
https://hg.mozilla.org/mozilla-central/rev/cb2023f50288

Differential Revision: https://phabricator.services.mozilla.com/D211493
2024-05-30 06:32:20 +00:00
Sebastian Hengst bf4dfe53f8 Backed out 15 changesets (bug 1896516) for causing scrolling crashes on macOS. a=backout
Backed out changeset fd6904338812 (bug 1896516)
Backed out changeset 2977ff81a23e (bug 1896516)
Backed out changeset c8a6b0e526d6 (bug 1896516)
Backed out changeset 3c06f22da72b (bug 1896516)
Backed out changeset f63b0c4335fe (bug 1896516)
Backed out changeset 6f7ab8adfa6e (bug 1896516)
Backed out changeset 997c9249dbed (bug 1896516)
Backed out changeset c964fccd5180 (bug 1896516)
Backed out changeset 7b481b747b7a (bug 1896516)
Backed out changeset 42e1bbe0ecb6 (bug 1896516)
Backed out changeset 717dac08b607 (bug 1896516)
Backed out changeset 2f0817331dbe (bug 1896516)
Backed out changeset b765169a7a8f (bug 1896516)
Backed out changeset a2d37b98273c (bug 1896516)
Backed out changeset ea9ecb543e66 (bug 1896516)
2024-05-29 11:22:52 +02:00
Ting-Yu Lin d0eed162ec Bug 1896516 Part 12 - Tidy up ScrollContainerFrame's interface. r=layout-reviewers,emilio
The motivation of this patch is that we've now switched all the callers from
`nsIScrollableFrame` to `ScrollContainerFrame`, and it is better to audit the
access control of `ScrollContainerFrame`'s interface, and I notice almost all
the member variables are public!

This patch shuffle the interface so that there are only one public, protected,
and private section, and all the member variables are moved to the private
section.

`AutoMinimumScaleSizeChangeDetector` and `RemoveDisplayPortCallback` need to
access member variables, so by declaring them under `ScrollContainerFrame`, they
have the privilege to do so.

Ideally, the caller only need to access what are already in
`nsIScrollableFrame`, so currently we might expose more methods than necessary.
We can audit that in a later part.

Differential Revision: https://phabricator.services.mozilla.com/D211499
2024-05-28 04:46:21 +00:00
Ting-Yu Lin 37e9b779f9 Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211498
2024-05-28 04:46:20 +00:00
Ting-Yu Lin 16b24f6c41 Bug 1896516 Part 6 - Remove nsIScrollableFrame usages in nsLayoutUtils. r=layout-reviewers,emilio
Convert `nsIScrollableFrame` to `ScrollContainerFrame` for all the APIs in
nsLayoutUtils, and then adapt other callers until everything compiles.

In `nsLayoutUtils::CalculateBasicFrameMetrics()`'s documentation,
s/ComputeFrameMetrics/ComputeScrollMetadata/ because the method was renamed in
https://hg.mozilla.org/mozilla-central/rev/cb2023f50288

Differential Revision: https://phabricator.services.mozilla.com/D211493
2024-05-28 04:46:18 +00:00
Ting-Yu Lin 27bb908f13 Bug 1824877 Part 2 - Rename nsHTMLScrollFrame to mozilla::ScrollContainerFrame. r=dholbert
Also, change the ScrollContainerFrame::GetFrameName() to return
"ScrollContainer" instead of "HTMLScroll".

Differential Revision: https://phabricator.services.mozilla.com/D210233
2024-05-15 17:50:48 +00:00
Ting-Yu Lin 53837706d6 Bug 1824877 Part 1 - Rename nsGfxScrollFrame.{h,cpp} to ScrollContainerFrame.{h,cpp}. r=dholbert
Remove the #include from `nsFrameState.cpp` because it is not used.

Differential Revision: https://phabricator.services.mozilla.com/D210232
2024-05-15 17:50:48 +00:00
Ting-Yu Lin cf7be78eb0 Bug 1892778 Part 2 - Convert InlineDir and BlockDir to enum classes. r=dholbert
Also, rewrite GetInlineDir() and GetBlockDir() to remove bit operations for
computing the InlineDir and BlockDir enum variants.

Differential Revision: https://phabricator.services.mozilla.com/D208176
2024-04-23 03:56:42 +00:00
Hiroyuki Ikezoe 37ea7649a1 Bug 1871760 - Revert bug 1856088. r=botond
Two test cases attached in bug 1856088 now work with the previous commit and
work without `MergeableAbsolute`.

Differential Revision: https://phabricator.services.mozilla.com/D199841
2024-02-26 21:06:31 +00:00
Norisz Fay 909bfd0144 Backed out 2 changesets (bug 1871760) for causing Wr failures on window-scrollBy-display-change.html CLOSED TREE
Backed out changeset 0824e173f725 (bug 1871760)
Backed out changeset 4075109d54d0 (bug 1871760)
2024-02-09 14:46:05 +02:00
Hiroyuki Ikezoe 33fa42df0e Bug 1871760 - Revert bug 1856088. r=botond
Two test cases attached in bug 1856088 now work with the previous commit and
work without `MergeableAbsolute`.

Differential Revision: https://phabricator.services.mozilla.com/D199841
2024-02-09 08:44:41 +00:00
Ting-Yu Lin e9151ca0ee Bug 1875600 - Use nsIFrame::PresShell() to simply some callers. r=layout-reviewers,emilio
Those callers who using the pointer immediately after getting from
`GetPresShell()` can be replaced with `PresShell()`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D199164
2024-01-23 00:30:53 +00:00
Emilio Cobos Álvarez c27730d3df Bug 1364813 - Remove IsFrameOfType, use non-virtual checks. r=jwatt
Extend the per-frame-class bit we have to devirtualize IsLeaf to also
devirtualize IsFrameOfType. That is, move this data to FrameClasses.py.

This was done by going through all the frame classes, trying to preserve
behavior.

The only quirky thing is that I had to add two more trivial frame
classes, `nsAudioFrame` for audio elements, and
`nsFloatingFirstLetterFrame`. That's because these frame classes were
returning different answers at runtime, but they do this only on
conditions that trigger frame reconstruction (floating, and being an
audio element, respectively).

Differential Revision: https://phabricator.services.mozilla.com/D194703
2023-11-26 22:17:28 +00:00
Hiroyuki Ikezoe 38e00cc500 Bug 1856088 - Handle scroll anchor adjustments as an absolute scroll position updates behind a pref. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D190888
2023-10-25 05:55:26 +00:00
Hiroyuki Ikezoe 39ec308558 Bug 1833758 - Add a pref not to reset max consecutive adjustment count during running APZ async scroll. r=emilio
With this pref we can avoid bug 1561450 without disabling any scroll adjustments
in scroll event handlers because in the specific case of the bug the scroll
adjustment in question is zero length such as

```
  element.style.display = "block";
  element.offsetTop // flush layout
  element.style.display = "none";
```

so it can be caught by our existing consecutive adjustment heuristic. Thus with
the default layout.css.scroll-anchoring.max-consecutive-adjustments value, as of
now it's 10, the case of bug 1561450 will stop firing scroll events after
5 (= 10/2) additional scroll event observations.

Differential Revision: https://phabricator.services.mozilla.com/D178898
2023-05-29 22:40:16 +00:00
Emilio Cobos Álvarez 7305ac60c4 Bug 1823455 - Merge ScrollFrameHelper and nsHTMLScrollFrame. r=layout-reviewers,TYLin
Now that we've removed nsXULScrollFrame, ScrollFrameHelper can be
subsumed under nsHTMLScrollFrame.

I want to do this before making scrollbars non-XUL.

Renaming to mozilla::ScrollFrame is left for a follow-up bug.

Differential Revision: https://phabricator.services.mozilla.com/D173063
2023-03-22 13:06:40 +00:00
Emilio Cobos Álvarez 251720095b Bug 1808077 - Shrink back ScrollFrameHelper. r=hiro
I was feeling back for adding the extra TimeStamp member and realized
that we don't really need mScrollFrame. Use the container_of hack to
avoid storing the extra pointer.

Depends on D166972

Differential Revision: https://phabricator.services.mozilla.com/D166973
2023-01-17 02:06:53 +00:00
Emilio Cobos Álvarez 91a682e2e1 Bug 1808077 - Tweak scroll anchoring heuristics. r=hiro
This patch tweaks our scroll-anchoring-disabling heuristic in two interesting
ways:

 * First, it introduces a time factor. What we want to detect is
   back-and-forth caused by a bogus page. Those are usually very fast to catch,
   so add a 500ms timeout to detect the adjustments.
   If we experimentally find out it's too low we can raise it.

 * Second, tweak the average distance to 2px rather than 3px. That makes it
   much harder to hit for legit pages (while it should still catch the cases
   we're interested in).

Factor the code into a helper struct since it getting a bit more complicated.

Differential Revision: https://phabricator.services.mozilla.com/D166972
2023-01-17 02:06:53 +00:00
Ting-Yu Lin ef6d896662 Bug 1799732 Part 3 - Convert FrameChildListID to enum class. r=emilio
This patch is first generated by the following script under gecko root folder.

```
#!/bin/bash

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "kPrincipalList" "FrameChildListID::Principal"
rename "kPopupList" "FrameChildListID::Popup"
rename "kCaptionList" "FrameChildListID::Caption"
rename "kColGroupList" "FrameChildListID::ColGroup"
rename "kAbsoluteList" "FrameChildListID::Absolute"
rename "kFixedList" "FrameChildListID::Fixed"
rename "kOverflowList" "FrameChildListID::Overflow"
rename "kOverflowContainersList" "FrameChildListID::OverflowContainers"
rename "kExcessOverflowContainersList" "FrameChildListID::ExcessOverflowContainers"
rename "kOverflowOutOfFlowList" "FrameChildListID::OverflowOutOfFlow"
rename "kFloatList" "FrameChildListID::Float"
rename "kBulletList" "FrameChildListID::Bullet"
rename "kPushedFloatsList" "FrameChildListID::PushedFloats"
rename "kBackdropList" "FrameChildListID::Backdrop"
rename "kNoReflowPrincipalList" "FrameChildListID::NoReflowPrincipal"
```

And then:
1. Manually fix `FrameChildListID` definition in nsFrameList.h.
2. Apply clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D161864
2022-11-12 04:38:53 +00:00
Ting-Yu Lin 6c9e155611 Bug 1799732 Part 2 - Flatten the namespace for FrameChildList and co. by removing namespace layout. r=emilio
After moving FrameChildListID into mozilla namespace, `kPrincipalList` etc. are
also exposed in the mozilla namespace. In the next part, I'll convert
FrameChildListID enum into an enum class, so the naming pollution shouldn't be
an issue.

This patch has a nice side effect that it is now easier to remove all the
aliases of FrameChildListID (`kPrincipalList` etc.) defined in multiple places
since it is confusion to have the same thing written in different ways, e.g.
`nsIFrame::kPrincipalList`, `mozilla::layout::kPrincipalList`,
`FrameChildListID::kPrincipalList`, `kPrincipalList`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D161863
2022-11-12 04:38:53 +00:00
Noemi Erli a66dba1527 Backed out 3 changesets (bug 1799732) for causing build bustages in nsIFrame.cpp CLOSED TREE
Backed out changeset e559f9dbc76f (bug 1799732)
Backed out changeset c40fda7a8b0b (bug 1799732)
Backed out changeset 1f84bfb41ab8 (bug 1799732)
2022-11-12 02:16:45 +02:00
Ting-Yu Lin 60a57a352d Bug 1799732 Part 3 - Convert FrameChildListID to enum class. r=emilio
This patch is first generated by the following script under gecko root folder.

```
#!/bin/bash

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "kPrincipalList" "FrameChildListID::Principal"
rename "kPopupList" "FrameChildListID::Popup"
rename "kCaptionList" "FrameChildListID::Caption"
rename "kColGroupList" "FrameChildListID::ColGroup"
rename "kAbsoluteList" "FrameChildListID::Absolute"
rename "kFixedList" "FrameChildListID::Fixed"
rename "kOverflowList" "FrameChildListID::Overflow"
rename "kOverflowContainersList" "FrameChildListID::OverflowContainers"
rename "kExcessOverflowContainersList" "FrameChildListID::ExcessOverflowContainers"
rename "kOverflowOutOfFlowList" "FrameChildListID::OverflowOutOfFlow"
rename "kFloatList" "FrameChildListID::Float"
rename "kBulletList" "FrameChildListID::Bullet"
rename "kPushedFloatsList" "FrameChildListID::PushedFloats"
rename "kBackdropList" "FrameChildListID::Backdrop"
rename "kNoReflowPrincipalList" "FrameChildListID::NoReflowPrincipal"
```

And then:
1. Manually fix `FrameChildListID` definition in nsFrameList.h.
2. Apply clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D161864
2022-11-11 23:44:17 +00:00
Ting-Yu Lin da1dd7fade Bug 1799732 Part 2 - Flatten the namespace for FrameChildList and co. by removing namespace layout. r=emilio
After moving FrameChildListID into mozilla namespace, `kPrincipalList` etc. are
also exposed in the mozilla namespace. In the next part, I'll convert
FrameChildListID enum into an enum class, so the naming pollution shouldn't be
an issue.

This patch has a nice side effect that it is now easier to remove all the
aliases of FrameChildListID (`kPrincipalList` etc.) defined in multiple places
since it is confusion to have the same thing written in different ways, e.g.
`nsIFrame::kPrincipalList`, `mozilla::layout::kPrincipalList`,
`FrameChildListID::kPrincipalList`, `kPrincipalList`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D161863
2022-11-11 23:44:16 +00:00
Hiroyuki Ikezoe 105dbd9f06 Bug 1789930 - Allow scroll anchoring during async scrolling animation triggered by user is in progress. r=emilio,botond
Scroll anchoring updates the scroll positions with ScrollOrigin::Relative, thus
it's properly merged into the in-progress animation.

Differential Revision: https://phabricator.services.mozilla.com/D156932
2022-09-12 04:59:38 +00:00
Timothy Nikkel 4e8cfb04f4 Bug 1761239. Use an EnumSet for nsIScrollableFrame::IsScrollAnimating. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D141960
2022-03-26 02:22:57 +00:00
Emilio Cobos Álvarez e03cb7ea34 Bug 1738781 - Invalidate anchor after layout if we can find a better one. r=dholbert
This is _very_ similar to code Blink has dealing with
content-visibility: auto:

  https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/layout/scroll_anchor.cc;l=658-659;drc=fd8802b593110ea18a97ef044f8a40dd24a622ec

They don't have this problem on the original test-case because they
incorrectly invalidate the anchor when focus changes regardless of
whether the focus is a "priority element" per spec.

So I think this is a better, more consistent behavior over all.

Differential Revision: https://phabricator.services.mozilla.com/D130130
2021-11-02 10:59:50 +00:00
Mike Hommey 39d506b0e3 Bug 1733034 - Fix unused*-variable warnings due to missing ifdefs. r=andi
dom/base/EventSource.cpp:59:22: error: unused variable 'gEventSourceLog' [-Werror,-Wunused-variable]
static LazyLogModule gEventSourceLog("EventSource");
                     ^
dom/xul/nsXULCommandDispatcher.cpp:35:22: error: unused variable 'gCommandLog' [-Werror,-Wunused-variable]
static LazyLogModule gCommandLog("nsXULCommandDispatcher");
                     ^
layout/generic/ScrollAnchorContainer.cpp:23:31: error: unused variable 'sAnchorLog' [-Werror,-Wunused-variable]
static mozilla::LazyLogModule sAnchorLog("scrollanchor");
                              ^
memory/replace/phc/PHC.cpp:308:15: error: unused variable 'kAllocJunk' [-Werror,-Wunused-const-variable]
const uint8_t kAllocJunk = 0xe4;
              ^

Differential Revision: https://phabricator.services.mozilla.com/D126866
2021-09-29 21:44:49 +00:00
Gerald Squelart f25e1c0093 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 7a2e181cd8 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 b64d7c61d5 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 1219744b77 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 8064adca7a 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 e7d6d32200 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 3f35bf8c9e 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 8e0366be75 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 949c53bf42 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 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
Simon Giesecke a69d79b6db 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 a5682e0673 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 ca520b1c17 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 ac42115821 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 80cfcac64f 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 1bcc656a6a 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 8732dad5c0 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 657dcca360 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
2020-04-15 23:13:00 +00:00
Emilio Cobos Álvarez 7497c00d73 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
2020-04-13 20:58:14 +00:00
Simon Giesecke e613597e90 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in layout. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D66016
2020-03-17 09:38:32 +00:00