Commit Graph

2663 Commits

Author SHA1 Message Date
Cosmin Sabou
376723ec78 Backed out changeset 299e19193e11 (bug 1646224) for causing font related failures. CLOSED TREE 2020-06-18 18:26:51 +03:00
Emilio Cobos Álvarez
901a6be6f6 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-18 13:55:03 +00:00
Cameron McCormack
3107a7b3a8 Bug 1645713 - Do less work when finding common ancestor for text run creation. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D79625
2020-06-16 23:40:37 +00:00
Nicolas Silva
c0d27ed94e Bug 1635472 - Move the displayport in larger increments with WebRender. r=kats
With this change the displayport moves by screen (or a scroll-frame) up to a quarter of the displayport size instead of every 128 pixels when WebRender is enabled.
Also separate the alignment of the position and size to allow moving the displayport in much larger increments without increasing the displayport size which regresses tscrollx and generally increases webrender's CPU load.

Differential Revision: https://phabricator.services.mozilla.com/D77870
2020-06-16 17:41:56 +00:00
Botond Ballo
7dd8a56b66 Bug 1638594 - Handle layout coordinates relative to the RCD viewport frame correctly in the GetECRT slow-path. r=tnikkel
Asking for layout coordinates relative to the RCD viewport frame
is a special case because the RCD viewport frame is outside the
zoom boundary, and so should technically always use visual
coordinates.

Nonetheless, we need to use layout coordinates relative to the
RCD viewport frame in several places, as we don't have a frame
that's inside the zoom boundary and sized to the initial
containing block (bug 1641279 may introduce such a frame in the
future).

This means GetEventCoordinatesRelativeTo needs special handling
to apply the visual-to-layout transform when converting from
visual coordinates relative to the root document's viewport
frame, to layout coordinates relative to the RCD viewport frame.

If the RCD is the root document, we take the fast-path which
handled this with an explicit check, but if the RCD is not the
root document, we take the slow-path which does not handle this.
This patch refactors GetECRT so it always checks for this
special case at the end.

Depends on D79589

Differential Revision: https://phabricator.services.mozilla.com/D79590
2020-06-13 05:29:24 +00:00
Noemi Erli
c0544bcd9f Backed out changeset ab8da9fe39fe (bug 1635472) for causing reftest failures in dynamic-toolbar-sticky-4b.html CLOSED TREE 2020-06-12 13:00:07 +03:00
Nicolas Silva
66d22dfc29 Bug 1635472 - Move the displayport in largerer increments with WebRender. r=kats
Also separate the alignment of the position and size to allow moving the displayport in much larger increments without increasing the displayport size which regresses tscrollx and generally increases webrender's CPU load.

Differential Revision: https://phabricator.services.mozilla.com/D77870
2020-06-12 08:24:16 +00:00
Emilio Cobos Álvarez
1dfa7ecc27 Bug 1640623 - Use an enum class for LookAndFeel::FontID. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D76696
2020-06-11 11:27:58 +00:00
Emilio Cobos Álvarez
f998ecc386 Bug 1640623 - Use enum classes for LookAndFeel int and float IDs. r=jmathies,geckoview-reviewers,esawin
Differential Revision: https://phabricator.services.mozilla.com/D76694
2020-06-11 11:27:43 +00:00
Kartikaya Gupta
d72396b729 Bug 1644512 - Reduce headers included in nsLayoutUtils.h. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D78954
2020-06-09 19:34:36 +00:00
Hiroyuki Ikezoe
c74d576f3e Bug 1619169 - Duplicate ExpandHeightForViewportUnits to ExpandHeightForDynamicToolbar. r=botond
And use the duplicated one at the places where we need the expanded size for
interactions with the dynamic toolbar on the compositor. The new function will
be modified in the next commit.

Note that the only one remaining call site of ExpandHeightForViewportUnits is
for window.inner{Width,Height}. For window.inner{Width,Height} we don't yet
return the layout viewport (which might be expanded by the minimum-scale), it's
going to be fixed in bug 1598487 [1], but it's not ready to fix because there
also need fixes in comm-central (see dependencies in the bug).  So for now, we
should keep the current behavior for window.inner{Width,Height}.

Also note that it's not yet clear whether we will eventually replace the last
call site of ExpandHeightForViewportUnits with ExpandHeightForDynamicToolbar
since the value corresponding to the dynamic toolbar might _NOT_ be affected by
the minimum-scale in some cases.  See bug 1641166 for details.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1598487
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1641166

Differential Revision: https://phabricator.services.mozilla.com/D78440
2020-06-06 04:44:54 +00:00
Kartikaya Gupta
25f5d53bf1 Bug 1643042 - Switch mLastSmoothScrollOrigin to using None as well. r=tnikkel
This uses "None" instead of "NotSpecified" as the value for
mLastSmoothScrollOrigin when there is no smooth scroll in progress.

Depends on D78439

Differential Revision: https://phabricator.services.mozilla.com/D78469
2020-06-05 09:41:07 +00:00
Kartikaya Gupta
b304eb7479 Bug 1643042 - Introduce an None scroll origin. r=tnikkel
This adds a new scroll origin, None, which is used as the initial value for
mLastScrollOrigin. Unlike Other, this scroll origin can be clobbered by any
other scroll origin, including notably Relative. This means that on a
brand-new scrollframe, if the first scroll call comes in with an origin of
Relative, it will be preserved as a relative scroll instead of getting
converted to a non-relative scroll.

This in turn fixes a latent bug in the code that was exposed by the
test_relative_update.html APZ mochitest when run with apz.allow_zooming=true.

Note also that we should never be passing eNone to functions like ScrollToImpl;
for those scenarios we continue using Unknown if we don't have a more specific
scroll origin to use. In other words, None is a sort of sentinel value to be
used for class fields, and is not to be used for actual scrollto-type calls.

Differential Revision: https://phabricator.services.mozilla.com/D78439
2020-06-05 09:44:10 +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
Timothy Nikkel
5d8b4e5b2f Bug 1640783. Should only call ClearPendingVisualScrollUpdate if we painted to the widget. r=botond
If we called PaintFrame for drawWindow or something other than painting to the widget the visual scroll update won't make it to the compositor, so don't clear it.

This doesn't fix anything specifically, just noticed it while reading code.

Differential Revision: https://phabricator.services.mozilla.com/D76781
2020-06-03 07:50:16 +00:00
Micah Tigley
b5cc00ad13 Bug 1621781 - Add an "IsRDMTouchSimulationActive" field to ScrollMetadata. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D77395
2020-05-30 03:15:22 +00:00
Dorel Luca
901c8af40d Backed out 2 changesets (bug 1621781) for Mochitest failures in gfx/layers/apz/test/mochitest/test_group_mouseevents.html
Backed out changeset a5fe71693070 (bug 1621781)
Backed out changeset 58a9b7f50a4b (bug 1621781)
2020-05-30 06:12:01 +03:00
Micah Tigley
e96ffd7eae Bug 1621781 - Add an "IsRDMTouchSimulationActive" field to ScrollMetadata. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D77395
2020-05-29 21:03:06 +00:00
Timothy Nikkel
5448ce6eee Bug 1636071. No longer stop at out of flow frames in nsLayoutUtils::GetTransformToAncestor when using the STOP_AT_STACKING_CONTEXT_AND_DISPLAY_PORT flag. r=miko
It is no longer needed.

Differential Revision: https://phabricator.services.mozilla.com/D74221
2020-05-21 19:34:46 +00:00
Kartikaya Gupta
ebabf0ce45 Bug 1639825 - Some minor code reorganization. r=tnikkel
This makes it more obvious that we are using the same scrollDelta for adjusting
the displayport as we are for populating the callback transform. Instead of
computing the same value inside a helper, we just provide the helper with the
already-computed delta that is used for the callback transform too.

Differential Revision: https://phabricator.services.mozilla.com/D76297
2020-05-22 14:37:06 +00:00
Shishir Jaiswal
9d326df010 Bug 1634911 - Simplify loops over lines in block layout to use ranged for. r=emilio
- Fixed wrong 'line' comparison
- Fixed clang-tidy warning
- Addressed the final review comments.
- Fixed the build failures happening in DEBUG mode. Had to revert the range based for loop usage at one place.

Differential Revision: https://phabricator.services.mozilla.com/D75673
2020-05-20 10:38:40 +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
Dorel Luca
ac1c2045e3 Backed out changeset 39dff7adfc30 (bug 1634911) for build bustage in layout/generic/nsBlockFrame.cpp. CLOSED TREE 2020-05-19 20:10:12 +03:00
Shishir Jaiswal
34bc8520ca Bug 1634911 - Simplify loops over lines in block layout to use ranged for. r=emilio
- Fixed clang-tidy warning
- Addressed the final review comments.
- Fixed the build failures happening in DEBUG mode. Had to revert the range based for loop usage at one place.

Differential Revision: https://phabricator.services.mozilla.com/D75673
2020-05-19 16:54:02 +00:00
Ting-Yu Lin
fa348f911f Bug 1635319 Part 4 - Have GetCrossDocChildLists() return an array of ChildList, and use it in range-based for loops instead of FrameChildListArrayIterator. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D75655
2020-05-18 01:06:58 +00:00
Ting-Yu Lin
59cb4b8a77 Bug 1635319 Part 2 - Use range-based for loops and array iterators instead of ChildListIterator in layout/generic/. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D75653
2020-05-18 01:17:15 +00:00
longsonr
2a15970acc Bug 1636119 - Don't snap SVG content during animation r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D74505
2020-05-14 10:43:11 +00:00
Nicolas Silva
794ebc767d Bug 1636841 - Revert snapping the displayport by 512 increments with WR. r=kats
The original change causes a large  tscrollx linux64-shippable-qr regression, we'll have to revisit this after we better understand the regression.

Differential Revision: https://phabricator.services.mozilla.com/D75045
2020-05-13 10:55:32 +00:00
Hiroyuki Ikezoe
dfcb8e297c Bug 1634616 - Calculate a perfect square based on the viewport size and rotate it to adjust the partial prerender area for rotation transforms. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D74521
2020-05-12 21:24:40 +00:00
Hiroyuki Ikezoe
afeee51c5f Bug 1634616 - Unscale pre-render area for transform animations too. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D74520
2020-05-12 20:58:09 +00:00
Hiroyuki Ikezoe
bd351593a3 Bug 1637149 - Use a ctor of nsDisplayTransform which doesn't require a boolean argument for |allowAsyncAnimation| in nsLayoutUtils::GetLayerTransformForFrame. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D74803
2020-05-12 12:24:37 +00:00
Coroiu Cristina
a9cc814af1 Backed out 3 changesets (bug 1634616) for reftest failures at layout/reftests/transform/partial-prerender-expansion-rotate.html on a CLOSED TREE
Backed out changeset 53da1ae188f4 (bug 1634616)
Backed out changeset 60271de42eb8 (bug 1634616)
Backed out changeset 4279b1647e47 (bug 1634616)
2020-05-12 13:47:25 +03:00
Hiroyuki Ikezoe
ec23a82f08 Bug 1634616 - Calculate a perfect square based on the viewport size and rotate it to adjust the partial prerender area for rotation transforms. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D74521
2020-05-12 08:32:45 +00:00
Hiroyuki Ikezoe
9d21d30221 Bug 1634616 - Unscale pre-render area for transform animations too. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D74520
2020-05-12 08:32:15 +00:00
Nicolas Silva
a777561d0d Bug 1635472 - Move the displayport by 512 increments with WebRender. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D73914
2020-05-07 10:29:23 +00:00
Narcis Beleuzu
758119cf89 Backed out changeset e9afce8fbf79 (bug 1635472) for mochitest failures on test_group_zoom.html . CLOSED TREE 2020-05-06 13:38:53 +03:00
Nicolas Silva
53e62e8839 Bug 1635472 - Move the displayport by 512 increments with WebRender. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D73914
2020-05-05 23:09:32 +00:00
Botond Ballo
6748fc1cb3 Bug 1631568 - Have nsLayoutUtils::GetFrameForPoint() and GetFramesForArea() take a RelativeTo parameter. r=tnikkel
This removes the need for FrameForPointOptions::IsRelativeToLayoutViewport,
and makes sure each call site of these functions indicates whether the
input point/rect is in visual or layout coordinates.

Several call sites were passing in layout coordinates without setting the
IsRelativeToLayoutViewport flag, which this patch corrects.

Differential Revision: https://phabricator.services.mozilla.com/D71705
2020-05-05 15:24:12 +00:00
Botond Ballo
9703b5367d Bug 1556556 - Miscellaneous fixes related to event coordinate transformations. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D69639
2020-05-05 19:28:15 +00:00
Botond Ballo
5a09afe62e Bug 1556556 - Handle visual/layout coordinate conversions correctly in GetEventCoordinatesRelativeTo(). r=kats,mattwoodrow
The idea here is:

  * The incoming point comes from WidgetEvent::mRefPoint which is in
    visual coordinates.

  * Depending on the value of the target RelativeTo parameter, we
    may need to convert this to layout coordinates.

  * In the fast-path, we do a direct check on the viewport type
    and apply the visual-to-layout transform if appropriate.

  * In the slow path, we rely on TransformRootPointToFrame() (which
    calls GetTransformToAncestor()) to include the visual-to-layout
    transform if appropriate, by correctly passing in
    ViewportType::Visual as the starting point.

     * To make sure we get into TransformRootPointToFrame(), we
       set transformFound if we'll be crossing a zoomed content root.

Differential Revision: https://phabricator.services.mozilla.com/D68921
2020-05-05 19:27:50 +00:00
Botond Ballo
3a89751d73 Bug 1556556 - Include the layout-to-visual transform for a zoomed content root in GetTransformMatrix(). r=kats,mattwoodrow
This is the "core" change of the patch series, which causes most
existing layout codepaths to correctly factor in the visual to
layout transform (or its inverse), as long as the callers correctly
propagate it in the correct ViewportType.

Differential Revision: https://phabricator.services.mozilla.com/D68920
2020-05-05 19:27:47 +00:00
Botond Ballo
731c9522be Bug 1556556 - Propagate RelativeTo far and wide. r=kats,mattwoodrow
This "upgrades" various nsLayoutUtils functions which take as inputs
a set of coordinates and a frame that the coordinates are relative to,
to accept a RelativeTo object instead of a frame.

Most of the patch is just dumb propagation, but the few places where
we use an explicit ViewportType::Visual are important. There are
probably a few other places I've overlooked, but this seems to cover
the important ones that come up commonly.

There are undoubtedly other functions into which we can propagate
RelativeTo, in this patch I've propagated it as far as necessary
for my needs in this bug (mainly GetTransformToAncestor() and
GetEventCoordinatesRelativeTo()).

Differential Revision: https://phabricator.services.mozilla.com/D68919
2020-05-05 19:26:38 +00:00
Botond Ballo
f66e578e97 Bug 1556556 - Add a "relative to layout viewport" option for display list building. r=mstange,mattwoodrow
Use it in document.elementFromPoint().

Differential Revision: https://phabricator.services.mozilla.com/D68914
2020-05-05 19:24:08 +00:00
Botond Ballo
7cd506ba3d Bug 1556556 - Remove some cruft related to handling the resolution in non-e10s setups. r=tnikkel
Prior to this bug, it was necessary to handle non-e10s specially, because the
resolution was being unapplied at the process boundary, and in non-e10s there
was no process boundary.

The remaining patches in this bug move the resolution unapplication away from
the process boundary in all cases, making special handling for non-e10s
unnecessary.

Differential Revision: https://phabricator.services.mozilla.com/D68273
2020-05-05 19:20:00 +00:00
Mats Palmgren
e7f922b1e5 Bug 1633045 - Don't use the Print Preview viewport scroll frame as a scroll container for 'position:sticky' content. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D72529
2020-04-27 19:19:38 +00:00
Csoregi Natalia
bdf8849001 Backed out 30 changesets (bug 1556556, bug 1631568) for multiple mochitest failures. CLOSED TREE
Backed out changeset edd529f7a9c5 (bug 1631568)
Backed out changeset 1cc0881e244b (bug 1631568)
Backed out changeset ed3c1e85d5e3 (bug 1556556)
Backed out changeset 38ffc6215bbf (bug 1556556)
Backed out changeset 03c2c25d8023 (bug 1556556)
Backed out changeset 9c717eb067b8 (bug 1556556)
Backed out changeset 98e26bc98b85 (bug 1556556)
Backed out changeset 05a6a581e755 (bug 1556556)
Backed out changeset 867946cf05bb (bug 1556556)
Backed out changeset 20d72a334530 (bug 1556556)
Backed out changeset 2c62e61d9054 (bug 1556556)
Backed out changeset 62a223d057d2 (bug 1556556)
Backed out changeset 2c5d55a1f0b1 (bug 1556556)
Backed out changeset 700447945b4e (bug 1556556)
Backed out changeset 93190ae4f5ff (bug 1556556)
Backed out changeset a7bd34d961bb (bug 1556556)
Backed out changeset fccd1d3c7189 (bug 1556556)
Backed out changeset 24056e47183d (bug 1556556)
Backed out changeset 204881474cc1 (bug 1556556)
Backed out changeset 387320881876 (bug 1556556)
Backed out changeset be8f5eb58460 (bug 1556556)
Backed out changeset 629c58a9166b (bug 1556556)
Backed out changeset 4312b2b5dda8 (bug 1556556)
Backed out changeset d11dbf6403a5 (bug 1556556)
Backed out changeset 95c54c023779 (bug 1556556)
Backed out changeset 80fcb7e71188 (bug 1556556)
Backed out changeset d75a4ecb0d47 (bug 1556556)
Backed out changeset 903c4de34e7a (bug 1556556)
Backed out changeset f15334a3e803 (bug 1556556)
Backed out changeset 9553e99137ea (bug 1556556)
2020-04-28 12:43:11 +03:00
Botond Ballo
953fb069fa Bug 1631568 - Have nsLayoutUtils::GetFrameForPoint() and GetFramesForArea() take a RelativeTo parameter. r=tnikkel
This removes the need for FrameForPointOptions::IsRelativeToLayoutViewport,
and makes sure each call site of these functions indicates whether the
input point/rect is in visual or layout coordinates.

Several call sites were passing in layout coordinates without setting the
IsRelativeToLayoutViewport flag, which this patch corrects.

Differential Revision: https://phabricator.services.mozilla.com/D71705
2020-04-28 01:44:43 +00:00
Botond Ballo
6ae11be824 Bug 1556556 - Miscellaneous fixes related to event coordinate transformations. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D69639
2020-04-28 01:42:26 +00:00
Botond Ballo
8304e4699b Bug 1556556 - Handle visual/layout coordinate conversions correctly in GetEventCoordinatesRelativeTo(). r=kats,mattwoodrow
The idea here is:

  * The incoming point comes from WidgetEvent::mRefPoint which is in
    visual coordinates.

  * Depending on the value of the target RelativeTo parameter, we
    may need to convert this to layout coordinates.

  * In the fast-path, we do a direct check on the viewport type
    and apply the visual-to-layout transform if appropriate.

  * In the slow path, we rely on TransformRootPointToFrame() (which
    calls GetTransformToAncestor()) to include the visual-to-layout
    transform if appropriate, by correctly passing in
    ViewportType::Visual as the starting point.

     * To make sure we get into TransformRootPointToFrame(), we
       set transformFound if we'll be crossing a zoomed content root.

Differential Revision: https://phabricator.services.mozilla.com/D68921
2020-04-28 01:42:17 +00:00
Botond Ballo
8e84771610 Bug 1556556 - Include the layout-to-visual transform for a zoomed content root in GetTransformMatrix(). r=kats,mattwoodrow
This is the "core" change of the patch series, which causes most
existing layout codepaths to correctly factor in the visual to
layout transform (or its inverse), as long as the callers correctly
propagate it in the correct ViewportType.

Differential Revision: https://phabricator.services.mozilla.com/D68920
2020-04-28 01:42:14 +00:00