Commit Graph

21106 Commits

Author SHA1 Message Date
Noemi Erli
22ac309175 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
4887b1d8b2 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
Kartikaya Gupta
81ee3e23f8 Bug 1644271 - Add an early-exit to temporarily disable an MVM codepath. r=tnikkel
This is a short-term step to ensure all tests pass with the mvm pref
turned on. It disables the visual viewport setting codepath for visual-only
MVM instances, unless the APZ zooming pref is also set (because other APZ
zooming code relies on this).

Differential Revision: https://phabricator.services.mozilla.com/D79229
2020-06-12 01:15:05 +00:00
Kartikaya Gupta
938b9b6fcf Bug 1644271 - Add some more MVM_LOG statements. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D79227
2020-06-12 01:15:48 +00:00
Kartikaya Gupta
f2ad64a769 Bug 1644271 - Don't let the MVM do reflows or change the resolution unless we're using mobile viewport sizing. r=tnikkel
If there's no meta-viewport handling, the MVM shouldn't need to do reflows
because it shouldn't be changing the layout viewport. Also there should be
no need for the MVM to adjust the resolution on the presShell since the
user will be driving those changes via user input. The MVM now just updates
the visual viewport sizing in response to changes.

It may turn out that some these conditions need to be tweaked later, but for
now this seems like a reasonable starting point.

Differential Revision: https://phabricator.services.mozilla.com/D79226
2020-06-12 01:15:46 +00:00
Kartikaya Gupta
2c71f100fb Bug 1644271 - Don't let the MVM control reflow dimensions unless we're using mobile viewport sizing. r=tnikkel
Allowing the MVM to control the reflow means that the requested reflow size
is ignored, and instead the existing CSS/layout viewport is used. This is
undesirable for calls to SizeToContent(), where the intent is to do a reflow
to figure out the smallest amount of space the content fits in.

In general though unless we are using mobile viewport sizing we shouldn't be
needing the MVM to drive reflows.

Differential Revision: https://phabricator.services.mozilla.com/D79225
2020-06-12 01:15:44 +00:00
Kartikaya Gupta
ba088f5b71 Bug 1644271 - Add a ManagerType field to the MVM, to allow conditional behaviour. r=tnikkel
The MVM is needed for both handling of meta-viewport tags and APZ zooming.
However, the set of functionality needed in the two modes are not the same.
This patch adds a mechanism to create an MVM with a flag that lets it know
which mode it is operating in. Eventually we may want to split this into two
or more classes but for now this seems like a reasonable way forward.

The flag is currently set on the MVM on creation based on whether or not the
meta-viewport support is needed. There's no code that meaningfully *uses* the
flag yet, so this patch should have no functional change. The bulk of the
patch is ensuring that we appropriately destroy and re-create the MVM if the
flag required changes.

Differential Revision: https://phabricator.services.mozilla.com/D79224
2020-06-12 01:15:42 +00:00
Kartikaya Gupta
f89c7c3302 Bug 1644271 - Add a pref to enable the MobileViewportManager. r=tnikkel
Currently false by default, so no functional change in the default
configuration.

Differential Revision: https://phabricator.services.mozilla.com/D79223
2020-06-12 01:15:40 +00:00
Kartikaya Gupta
65e2a40d98 Bug 1531971 - Make the test wait for the second page to actually paint before attempting to restore the first page from bfcache. r=smaug
The first page's content viewer is only saved in the bfcache when the second
page is painted. This can happen after the load event is fired, and in that
scenario, attempting to go back to the first page will reload it rather than
restore it from the bfcache. So for the test to work properly it needs to
wait until the second page is actually painted before it attempts go back.

Differential Revision: https://phabricator.services.mozilla.com/D79347
2020-06-11 21:19:10 +00:00
Emilio Cobos Álvarez
4cb5da08a2 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
ef3d21048d 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
Kagami Sascha Rosylight
ea53f4857d Bug 1644868 - Return pointer from GetPrimaryFrameFor* r=jfkthame
Those methods have two sources to check after call: the return value and the pointer. This can be confusing as a caller may think they should check both when they don't need to. Since the two always behaves together (a valid pointer + NS_OK, or nullptr + NS_ERROR_FAILURE), this replaces the return value with the pointer.

Differential Revision: https://phabricator.services.mozilla.com/D79196
2020-06-11 10:56:11 +00:00
Emilio Cobos Álvarez
416e50d907 Bug 1640191 - Simplify system colors change notification. r=jmathies
The current notification enumerates all windows and calls
SysColorChanged on them.

The current implementation of SysColorChanged is not quite sound, as it
really needs most if not all of what ThemeChanged does: SVGs can use
system colors, so we need to also invalidate the image cache for
example.

It's also not clear it deals correctly with propagating system color
changes to other documents.

In some cases we were even firing both theme changes and system color
changes at the same time. Unify this code paths.

Differential Revision: https://phabricator.services.mozilla.com/D76487
2020-06-10 15:18:25 +00:00
Simon Giesecke
82dc9b2271 Bug 1642949 - Replace uses of RemoveElementAt by RemoveLastElement/PopLastElement where possible. r=necko-reviewers,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78027
2020-06-10 10:46:14 +00:00
Butkovits Atila
e3dce68834 Backed out 3 changesets (bug 1643289, bug 1642949) for causing failure at test_headless_screenshot.html. CLOSED TREE
Backed out changeset 98c420f73380 (bug 1643289)
Backed out changeset 9447ea8910aa (bug 1643289)
Backed out changeset 0c827da9d847 (bug 1642949)
2020-06-10 10:07:23 +03:00
Simon Giesecke
d419f0ff08 Bug 1642949 - Replace uses of RemoveElementAt by RemoveLastElement/PopLastElement where possible. r=necko-reviewers,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78027
2020-06-10 05:49:28 +00:00
Kartikaya Gupta
37e13b9720 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
Kenrick
08f36c530a Bug 1596160: Re-enable eslint rules within layout and address eslint failures in testcases r=dholbert
This patch was largely automated. It was generated by manually
editing .eslintrc.js and then running mach eslint layout --fix.

Additionally, this includes manual changes to test_bug533845.xhtml
and test_bug467442.xhtml that were necessary to appease eslint.

Differential Revision: https://phabricator.services.mozilla.com/D78615
2020-06-09 15:27:37 +00:00
Razvan Maries
f761608e79 Backed out changeset bca9f7459a16 (bug 1643656) for reftests perma failures. CLOSED TREE 2020-06-09 18:24:48 +03:00
Emilio Cobos Álvarez
6b86e22f72 Bug 1643656 - Remove prefers-color-scheme: no-preference. r=gl,remote-protocol-reviewers,hiro,whimboo
It was removed from the spec. Bug 1643934 updates the WPT tests.

Differential Revision: https://phabricator.services.mozilla.com/D78834
2020-06-09 13:21:54 +00:00
Timothy Nikkel
a1a2512d01 Bug 1632268. Take into account resolution when position select drop downs and form autocomplete. r=botond
One note about this solution: it includes the apz callback transform for the root scroll frame of the root content document, but no other apz callback transform that might be on an ancestor of the select element.

Differential Revision: https://phabricator.services.mozilla.com/D78026
2020-06-08 05:45:47 +00:00
Hiroyuki Ikezoe
6dc530332c Bug 1619169 - Expand the given size with the ratio of the dynamic toolbar max height to the display size in ExpandHeightForDynamicToolbar. r=botond
In some cases the visible area has been already scaled to a certain scale
_visually_ to fit the content to the display, whereas we apply the max height of
the dynamic toolbar to the visible area as it is [1], which means the
resolution of the each value mismatches.  Ideally this mismatch should be fixed
by factoring the resolution differece, but there are some edge cases we can't
simply fix it as I described in bug 1641166.

So, here we take a different approach which is not affected by the content
visible area's resolution value.

[1] https://searchfox.org/mozilla-central/rev/598e50d2c3cd81cd616654f16af811adceb08f9f/layout/base/nsPresContext.cpp#2527
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1641166

Differential Revision: https://phabricator.services.mozilla.com/D78441
2020-06-06 04:45:02 +00:00
Hiroyuki Ikezoe
dc8db2c291 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
c4698ef203 Bug 1627708 - Add boolean telemetry histograms for recording if APZ zooming occurred. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D77827
2020-06-06 00:32:12 +00:00
Kartikaya Gupta
c06eb6ae82 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
445d9cf0b8 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
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
Kenny Levinsen
ceedac76da Bug 1641033 - nsRefreshDriver vsync observer should always post task to main thread. r=jrmuizel
nsRefreshDriver's NotifyVsync method had some slightly convoluted logic: Based on the thread it is called from, it would guess whether it is called from a vsync source, in which case it would schedule itself onto the main thread, or from the self-scheduled task, in which case it would perform work.

This just splits the two: NotifyVsync only takes care of VsyncSource, and schedules a task that calls the tick logic. This also allows Wayland to run the VsyncSource off the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D77044
2020-06-04 10:43:19 +00:00
Jonathan Watt
cf7589cd57 Bug 1600623. Add telemetry probes for print dialog/preview opens/cancels and print target type. r=bobowen,mbalfanz
The probes collect counts for:

 - print preview open, and exit without print
 - print dialog opened from print preview, and cancelled
 - print dialog opened without print preview, and cancelled
 - silent prints
 - print target
   - PDF file
   - XPS file
   - other (probably print to physical printer, but we can never be sure)

There is some overlap with the existing PRINT_* probes, but I think we should
keep those in place temporarily until we confirm that the new probes produce
numbers that are consistent with the old probes.

This patch only adds 'print target' probes for Windows and macOS.

I use nsDeviceContextSpec*::Init() to collect the 'print target' telemetry
because the way we initialize settings from prefs (and the way macOS works in
particular) make it difficult to reliably determine the target type earlier in
the print process for all possible entry points into the printing code.

Differential Revision: https://phabricator.services.mozilla.com/D78033
2020-06-03 21:21:14 +00:00
Timothy Nikkel
2096072d59 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
Tom Ritter
fdd6915c4d Bug 1634602 - Exempt about:black from color scheme preference in RFP mode r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D77833
2020-06-02 20:42:31 +00:00
Ting-Yu Lin
5ca75861f1 Bug 1343948 - Merge overflow container children to next-in-flow's OverflowContainersProperty() if the property already exists. r=mats
This is to prevent the assertion at the beginning of
DrainExcessOverflowContainersList().

The invariant is described in the comment revised in this patch. That
is, "only one overflow containers list exists for a given frame: either
its own OverflowContainersProperty or its prev-in-flow's
ExcessOverflowContainersProperty, not both."

Differential Revision: https://phabricator.services.mozilla.com/D77328
2020-06-02 02:37:28 +00:00
Razvan Maries
a90b180cd2 Backed out changeset 7925ab748617 (bug 1343948) for perma failures on 1343606.html. CLOSED TREE 2020-06-02 03:02:10 +03:00
Ting-Yu Lin
4bdc6951d6 Bug 1343948 - Merge overflow container children to next-in-flow's OverflowContainersProperty() if the property already exists. r=mats
This is to prevent the assertion at the beginning of
DrainExcessOverflowContainersList().

The invariant is described in the comment revised in this patch. That
is, "only one overflow containers list exists for a given frame: either
its own OverflowContainersProperty or its prev-in-flow's
ExcessOverflowContainersProperty, not both."

Differential Revision: https://phabricator.services.mozilla.com/D77328
2020-06-01 21:18:21 +00:00
Kartikaya Gupta
01c7b3c016 Bug 1254030 - Fix size of drag image outline when nglayout.enable_drag_images=false. r=botond
The positioning isn't right, but it's not right even without APZ zooming, so
this patch doesn't mess with it.

Differential Revision: https://phabricator.services.mozilla.com/D77437
2020-06-01 21:40:34 +00:00
Kartikaya Gupta
8ad102a1a2 Bug 1254030 - Fix positioning of drag images with APZ zoom applied. r=botond
This adjusts the position at which the drag images appear when doing drag
actions, so that they appear where you would expect when APZ zoom is applied.
There doesn't seem to be a good way to test this, but I did a bunch of manual
testing, with all the possible expansions of this sentence:
   Dragging {a small image,a large image,some text} in {an iframe,the root
   content document}, with {,no }zooming applied.
In all cases, the drag image/text should appear such that the part under the
cursor is the same as what was under the cursor on the original rendering of
the page.

Differential Revision: https://phabricator.services.mozilla.com/D77436
2020-06-01 21:42:19 +00:00
Kartikaya Gupta
d807edde6f Bug 1254030 - Scale drag image by APZ zoom. r=botond
When rasterizing the drag image, we pick up the resolution from ancestor
presShells and ensure that the drag image is rasterized at that resolution,
with appropriate limits for memory usage.

Differential Revision: https://phabricator.services.mozilla.com/D77435
2020-06-01 21:40:39 +00:00
Matt Woodrow
7adf95e964 Bug 1620679 - Don't fire load event from within Stop(). r=smaug
This matches what the spec says, and what blink does.

Differential Revision: https://phabricator.services.mozilla.com/D73994
2020-05-30 17:19:54 +00:00
Razvan Maries
a36bb7751f Backed out 3 changesets (bug 1638153) for perma failures on cross-origin-objects.html. CLOSED TREE
Backed out changeset f7aedc92d396 (bug 1638153)
Backed out changeset 07ec713926c6 (bug 1638153)
Backed out changeset 5a656842e241 (bug 1638153)
2020-06-01 23:51:35 +03:00
Kris Maglione
b3fcd970ec Bug 1638153: Part 2 - Fix uses of .rootTreeItem to get top browser window. r=geckoview-reviewers,nika,snorp
Differential Revision: https://phabricator.services.mozilla.com/D75429
2020-06-01 17:59:01 +00:00
Micah Tigley
81f5f0e8d0 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
Masatoshi Kimura
b9a2ffc214 Bug 1482279 - Stop using Cu.forcePermissiveCOWs() in SpecialPowers. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D74641
2020-05-31 03:41:03 +00:00
Timothy Nikkel
6cedbd9795 Bug 1642088. Use a ResolutionChangeOrigin for when the resolution is changing by tests that overides and sets the restore resolution. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D77582
2020-05-30 21:34:39 +00:00
Sylvestre Ledru
63be8d152d Bug 1519636 - Reformat recent changes to the Google coding style r=necko-reviewers,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D77580
2020-05-30 09:55:27 +00:00
Dorel Luca
0c8ff16ba2 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
62367a9af9 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
Hiroyuki Ikezoe
935fac58d0 Bug 1640223 - Expand the given size in ExpandHeightForViewportUnits by multiplying the 'vh value / visible area height'. r=botond
The viewport units size doesn't match the aspect ratio of the screen size in
some cases.

For example, in the case of the reftest in this commit, the meta viewport is
"width=1600, height=device-height" and the screen size during reftest is
"800x1000". Thus the viewport units size will be "1600x1000". In such cases
with the old way ExpandHeightForViewportUnits shrinks the given size
"1600x1800" to "1600x1000" with 100px dynamic toolbar max height (and the
MOZ_ASSERT in the function happens on debug builds).

Differential Revision: https://phabricator.services.mozilla.com/D77176
2020-05-29 17:18:21 +00:00
Erik Nordin
4c06dea151 Bug 1639990 - Rename defaultPrinterName to lastUsedPrinterName r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D76955
2020-05-29 17:37:01 +00:00
Erik Nordin
3a7fc409b7 Bug 117233 - Implement nsIPrinterEnumeratorX r=jwatt
- Implement the nsPrinterEnumeratorX
- Enable the contract @mozilla.org/gfx/printerenumerator;1 for macOS
- Add test for default printer name.
- Remove restrictions preventing some tests from running on macOS

Differential Revision: https://phabricator.services.mozilla.com/D76356
2020-05-28 15:36:44 +00:00
Kartikaya Gupta
01892da471 Bug 1641246 - Remove unrelated stray function declaration. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D77112
2020-05-27 21:33:55 +00:00