Граф коммитов

78083 Коммитов

Автор SHA1 Сообщение Дата
Timothy Nikkel 7b522cebcc Bug 1695598. Allow apz to update the main thread scroll offset if an APZ scroll animation is pending on the main thread or has been sent from the main thread. r=botond
Apz can already update the main thread scroll offset if apz has informed the main thread that it has received a scroll animation and is running it.

This situation can happen when the user holds down an arrow key, or in a test situation if one sends a key event every frame via requestAnimateFrame.

The problem happens in APZCCallbackHelper because aFrame->IsScrollAnimating(IncludeApzAnimation::No) returns true so we don't update the main thread scroll offset from the repaint request. aFrame->IsScrollAnimating(IncludeApzAnimation::No) returns true because there is a smooth scroll request either pending on the main thread, or sent in the last transaction, but not yet acknowledged by apz back to the main thread. (Scroll animations that are acknowledged by apz back to the main thread are ignored in IsScrollAnimating because of the IncludeApzAnimation::No argument.)

So we need to change IsScrollAnimating. However there are two other callers of it:
1) ScrollFrameHelper::SaveState (passes IncludeApzAnimation::No)
2) everything else (passes IncludeApzAnimation::Yes)

We can leave 2) alone, but 1) needs the current behaviour of IncludeApzAnimation::No. This is because there are tests that check that we save mDestination (the destination of the smooth scroll) and restore it. However we do not want to save mDestination if IsApzAnimationInProgress because mDestination has already been overwritten with the current scroll position from apz (via APZCCallbackHelper->ScrollToCSSPixelsApproximate).

So we change IncludeApzAnimation::No to ignore all apz animations (what APZCCallbackHelper needs) and introduce a new value of the enum for what SaveState needs.

Differential Revision: https://phabricator.services.mozilla.com/D106757
2022-03-23 23:58:23 +00:00
Nicolas Silva 6019443efe Bug 1761002 - Restore the clip rect in webrenderized images. r=mstange
In bug 1758942 there was a bit of clipping logic for webrenderized svg images that was removed because we didn't know what it was useful for.

I still don't quite know, other than that it caused layout/reftests/svg/image/image-preserveAspectRatio-01-raster.svg and layout/reftests/svg/image/image-preserveAspectRatio-02-raster.svg to start failing when the gfx.webrender.svg-images pref is enabled, so let's revert it.

Depends on D141847

Differential Revision: https://phabricator.services.mozilla.com/D141848
2022-03-23 20:28:55 +00:00
Nicolas Silva b0457b9551 Bug 1761007 - Fix sizing of WebRenderized SVG images. r=gfx-reviewers,aosmond
The missing line is consistently called after ImageContainer::GetWidth/GetHeight (see TransformContextForPainting for example which would be the equivalent code path for the non-webrenderized case).

This fixes the wptest /density-size-correction/density-corrected-image-svg.html when active svg images are enabled.

Depends on D141846

Differential Revision: https://phabricator.services.mozilla.com/D141847
2022-03-23 20:28:55 +00:00
Butkovits Atila fbd6ad4819 Backed out 5 changesets (bug 1751217) for causing failures at dynamic-range.html. CLOSED TREE
Backed out changeset f0a4879c9709 (bug 1751217)
Backed out changeset 50b6310935d4 (bug 1751217)
Backed out changeset bfa455b8bb1a (bug 1751217)
Backed out changeset 277064a1facb (bug 1751217)
Backed out changeset 21e1650b12db (bug 1751217)
2022-03-23 22:22:54 +02:00
Brad Werth 7ae993e36e Bug 1751217 Part 5: Update test expectations. r=emilio
In addition to adding test support for dynamic-range and video-dynamic-range,
this expands tests of pixelDepth and colorDepth to allow 30 as an acceptable
value.

Differential Revision: https://phabricator.services.mozilla.com/D141307
2022-03-23 18:23:02 +00:00
Brad Werth c2a8cb2d17 Bug 1751217 Part 4: Make macOS declare video-dynamic-range: high with new-enough OS. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D141056
2022-03-23 18:23:01 +00:00
Brad Werth 09e7757ba7 Bug 1751217 Part 2: Change nsDeviceContext::GetDepth to eliminate the outparam. r=emilio
This function always succeeds so there's no reason to maintain an nsresult.

Differential Revision: https://phabricator.services.mozilla.com/D141407
2022-03-23 18:23:01 +00:00
Brad Werth 930a7aac22 Bug 1751217 Part 1: Support media queries for dynamic-range and video-dynamic-range. r=emilio
This is a stub that only matches "standard" for all platforms.

Differential Revision: https://phabricator.services.mozilla.com/D141053
2022-03-23 18:23:00 +00:00
Marian-Vasile Laza 77029463ac Backed out 5 changesets (bug 1751217) for causing wpt(Screen-pixelDepth-Screen-colorDepth001.html) and mochitest(test_media_queries.html) failures. CLOSED TREE
Backed out changeset 60a4497fd1f5 (bug 1751217)
Backed out changeset 785f4c5f719d (bug 1751217)
Backed out changeset 81e41f7a1ee4 (bug 1751217)
Backed out changeset d35c5648c936 (bug 1751217)
Backed out changeset f16305c6ec83 (bug 1751217)
2022-03-23 10:11:53 -07:00
Brad Werth b9a26f4e67 Bug 1751217 Part 5: Update test expectations. r=emilio
In addition to adding test support for dynamic-range and video-dynamic-range,
this expands tests of pixelDepth and colorDepth to allow 30 as an acceptable
value.

Differential Revision: https://phabricator.services.mozilla.com/D141307
2022-03-23 15:24:39 +00:00
Brad Werth e2d894d2e2 Bug 1751217 Part 4: Make macOS declare video-dynamic-range: high with new-enough OS. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D141056
2022-03-23 15:24:39 +00:00
Brad Werth 1c5f34a179 Bug 1751217 Part 2: Change nsDeviceContext::GetDepth to eliminate the outparam. r=emilio
This function always succeeds so there's no reason to maintain an nsresult.

Differential Revision: https://phabricator.services.mozilla.com/D141407
2022-03-23 15:24:38 +00:00
Brad Werth 2cd3c4b978 Bug 1751217 Part 1: Support media queries for dynamic-range and video-dynamic-range. r=emilio
This is a stub that only matches "standard" for all platforms.

Differential Revision: https://phabricator.services.mozilla.com/D141053
2022-03-23 15:24:37 +00:00
Dan Minor 337bc15035 Bug 1402822 - Update unit tests for multiple dictionaries; r=smaug
For the most part these are simple updates to account for multiple
dictionaries and the fact that SetDictionaries is async whereas
SetDictionary was sync.

Fixing test_async_UpdateCurrentDictionary was more involved because
there were flaws in the existing test and it is more difficult to
harmonize the UpdateCurrentDictionary callback with the changes to make
SetDictionaries async.

Differential Revision: https://phabricator.services.mozilla.com/D140245
2022-03-23 13:53:39 +00:00
Emilio Cobos Álvarez 985e75ca3c Bug 1760965 - Remove IntersectionObserver prefs that have been enabled by default for a long time. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D141830
2022-03-23 09:59:13 +00:00
Emilio Cobos Álvarez b75c39ad35 Bug 1760734 - Put overflow: -moz-hidden-unscrollable behind a pref on Nightly. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D141759
2022-03-23 08:41:51 +00:00
Hiroyuki Ikezoe 9f93403b9d Bug 1760918 - Disable partial pre-render animations on all channels. r=boris
The reason why we change the `OMTAdiv`'s width value is that with the original
200px width, the elment in question will be overflowed in our mochitest iframe.

Differential Revision: https://phabricator.services.mozilla.com/D141812
2022-03-23 03:38:49 +00:00
Miko Mynttinen 93cb39c8cf Bug 1760847 - Deallocate linked list nodes when RemoveBottom() is called r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D141789
2022-03-22 22:34:37 +00:00
stransky 19c39f9ec2 Bug 1760172 [Wayland] Rename PreferredPopupRect to MoveToRectPopupRect r=emilio
Rename PreferredPopupRect* methods/attributes to MoveToRectPopupRect* ones as it holds info about coordinates received from move-to-rect popup placement done by Wayland compositor.

Differential Revision: https://phabricator.services.mozilla.com/D141425
2022-03-22 20:04:54 +00:00
Miko Mynttinen 986f578906 Bug 1735265 - Part 2: Add test r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D129682
2022-03-22 18:40:52 +00:00
Miko Mynttinen bf27b1182d Bug 1735265 - Part 1: Set clip on background items for table cols and colgroups, when the table cell has captured clip r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D129681
2022-03-22 18:40:51 +00:00
Timothy Nikkel a392bace4a Bug 1756831. Add test. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D141592
2022-03-22 15:31:45 +00:00
Timothy Nikkel 72ab0ad0ae Bug 1756831. When considering mousemoves over scroll frames to show overlay scrollbars rejects mousemove over content descendants that aren't frame descandants. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D140931
2022-03-22 15:31:45 +00:00
Emilio Cobos Álvarez 2b166b644f Bug 1760609 - Treat line movement on Linux/macOS like Windows. r=masayuki
All platforms seem to behave similarly now. Definitely not like we do
without this patch.

Please sanity-check in case I've missed something but I indeed haven't
seen any current version of other text editing software that behaves
like we do...

Remove some expectAssertions from the test that shouldn't be relevant
anymore.

Differential Revision: https://phabricator.services.mozilla.com/D141635
2022-03-22 11:24:03 +00:00
Matteo Ruello 09684f492a Bug 1756529 - Honor general.smoothScroll.[line|page|other] for keyboard scrolls with MSD physics r=botond,hiro
Differential Revision: https://phabricator.services.mozilla.com/D140090
2022-03-22 04:16:32 +00:00
Emilio Cobos Álvarez 6d5d698b6e Bug 1666059 - Honor background-color: transparent in forced colors mode. r=morgan
See comment as for why, and linked bugs, in particular:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1755713#c16

And the following screenshot for example.

Differential Revision: https://phabricator.services.mozilla.com/D141514
2022-03-21 22:36:13 +00:00
Cristian Tuns 416761cf78 Backed out changeset 1b1df0fb2320 (bug 1666059) for causing mochitest failures in test_dont_use_document_colors.html CLOSED TREE 2022-03-21 16:18:59 -04:00
Emilio Cobos Álvarez eebea40065 Bug 1666059 - Honor background-color: transparent in forced colors mode. r=morgan
See comment as for why, and linked bugs, in particular:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1755713#c16

And the following screenshot for example.

Differential Revision: https://phabricator.services.mozilla.com/D141514
2022-03-21 17:54:03 +00:00
Botond Ballo 9f64c57d75 Bug 1759958 - Implement ScrollAnimationMSDPhysics::ApplyContentShift() correctly. r=hiro
The previous implementation did not actually change what PositionAt() returns.

Differential Revision: https://phabricator.services.mozilla.com/D141319
2022-03-18 05:13:59 +00:00
Botond Ballo 776d789d9a Bug 1759958 - Add comments to clarify the purpose of ScrollAnimationPhysics::Update() and ApplyContentShift(). r=hiro
These methods seem somewhat similar but they have two important differences:

 1. Update() only changes the destination, not the current position.
 2. ApplyContentShift() does not recompute the shape of the animation curve.

Differential Revision: https://phabricator.services.mozilla.com/D141318
2022-03-18 05:13:59 +00:00
Emilio Cobos Álvarez 377390cc8a Bug 1759919 - Don't stop looking for intersecting frames too early in case there are fully-opaque transformed elements. r=miko,mconley
nsDisplayTransform::HitTest clips the rect it passes to its children,
and thus intersecting the whole area isn't relevant.

Depends on D141300

Differential Revision: https://phabricator.services.mozilla.com/D141301
2022-03-17 15:37:31 +00:00
Emilio Cobos Álvarez 1d365913dc Bug 1759749 - Avoid heap-allocating a rect property for most common outline case. r=dholbert
Now that we don't include overflow in outlines (bug 1739894) the
overwhelmingly common case is that innerRect == GetRectRelativeToSelf(),
except on a couple special cases.

Avoid storing the property in those cases. The test introduced in the
patch above still ensures we invalidate rendering correctly even without
the presence of the assert.

Depends on D141320

Differential Revision: https://phabricator.services.mozilla.com/D141321
2022-03-17 12:16:16 +00:00
Emilio Cobos Álvarez 9389eefd95 Bug 1759749 - Fix nsStyleOutline::CalcDifference to account for 'outline-style: auto' properly. r=dholbert
Before this patch we might not update the ink overflow areas when
'outline-style' changes without changing outline-width, if
'outline-width' was zero.

This was triggered by TopLevelVideoDocument which had 'outline-width: 0'
which before bug 1759602 disabled the default outline.

The test reliably triggers the assertion (though I think we should try
to avoid the frame property in the common case the inner rect and frame
rects just match, which would remove the assertion...).

Differential Revision: https://phabricator.services.mozilla.com/D141320
2022-03-17 12:16:15 +00:00
Nicolas Silva ecf93a5a7b Bug 1758942 - Change the way solid rect bounds are computed. r=mstange
I wrote the previous code via trial and error by copying similar code without understanding much what the different values represent.
The result looks about right but I suspect it may be only right because of simplifying assumptions.

Differential Revision: https://phabricator.services.mozilla.com/D140726
2022-03-17 11:07:13 +00:00
Emilio Cobos Álvarez cdb02b1b74 Bug 1759602 - Fix how TopLevelVideoDocument.css avoids outlines.
MANUAL PUSH: Trivial-ish one-liner to fix the increase in rate in bug 1759749.
2022-03-17 03:06:05 +01:00
Jeff Muizelaar 3c891365f9 Bug 1759953 - Remove useless condition in SetBuildingRect. r=emilio
Previously this condition avoided setting mPaintRectValid = false
but that's no longer here.

Differential Revision: https://phabricator.services.mozilla.com/D141313
2022-03-17 01:52:53 +00:00
Emilio Cobos Álvarez cadac0bf3d Bug 1754459 - Improve caret position selection for images. r=dholbert
What saves us in the non-pointer-events: none case is silly, and is
this loop that hits the draggable image:

  https://searchfox.org/mozilla-central/rev/fa69d8b248e6c1df670aa6b019e30ec37e6672be/layout/generic/nsIFrame.cpp#4752

Needs tests (if it doesn't affect existing ones), but uploading for some
initial feedback. I think this makes a lot more sense than the existing
code, and works for editing and dragging the same way, so it's nice to
have less special-cases.

Differential Revision: https://phabricator.services.mozilla.com/D141242
2022-03-16 23:32:44 +00:00
Emilio Cobos Álvarez 11a8108d96 Bug 1759602 - Make outline-style: auto the default focus outline. r=mstange
As per spec: https://html.spec.whatwg.org/#phrasing-content-3

This should generally be better as it is a better outline to begin with,
and allows us to customize it a bit in the future.

Differential Revision: https://phabricator.services.mozilla.com/D141051
2022-03-16 23:27:19 +00:00
Emilio Cobos Álvarez 6e94231e2d Bug 1759866 - Minor clean-up to the selection frame-edge code. r=dholbert
This doesn't change behavior but makes some code a bit nicer to read and
documents some of the code that wasn't obvious otherwise.

Differential Revision: https://phabricator.services.mozilla.com/D141236
2022-03-16 18:55:01 +00:00
Botond Ballo 9604c80ac1 Bug 1759631 - Back out the crashtest for bug 1749190. r=tnikkel
This test runs a lot of JS and triggers a lot of unrelated assertions,
some of which are fatal. The test added in bug 1755790 is much simpler
and a better fit for providing test coverage for the patches in bug
1749190.

Differential Revision: https://phabricator.services.mozilla.com/D141177
2022-03-16 06:00:27 +00:00
Eitan Isaacson d4418e9378 Bug 1713050 - P1: Add granularity to selection change notification. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D139745
2022-03-16 05:56:25 +00:00
Daniel Holbert ccfc2564d5 Bug 133984: Remove no-longer-needed print-specific 'height' for file input widgets. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D141169
2022-03-16 04:45:09 +00:00
Botond Ballo d3db8ed4cd Bug 1753779 - Avoid emitting the same deferred transform item onto an ancestor and descendant WebRenderLayerScrollData node. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D141064
2022-03-16 04:35:07 +00:00
Narcis Beleuzu 4977e9fdb7 Backed out changeset 90e8b423f4bb (bug 1759602) for reftest failures on caret_on_presshell_reinit-2.html . CLOSED TREE 2022-03-16 04:43:46 +02:00
Tooru Fujisawa d3c9c2abef Bug 1752624 - Skip drawing border if the dirty rect and the border rect do not intersect. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D141104
2022-03-15 18:36:04 +00:00
Emilio Cobos Álvarez 2dd7088690 Bug 1759163 - Add origin trial support for worklets. r=asuth
Move the trial getter to nsIGlobalObject, make every implementation
provide a reasonable value, and add a test.

Differential Revision: https://phabricator.services.mozilla.com/D140848
2022-03-15 23:16:14 +00:00
Marian-Vasile Laza f0b42c159c Backed out changeset 558e256fcb31 (bug 1759163) for causing mochitest failures on test_header_simple.html. 2022-03-15 15:23:04 -07:00
Marian-Vasile Laza 21901659f3 Backed out changeset bf5828257d6e (bug 1752624) for causing reftest failures on caret_on_presshell_reinit-2.html. 2022-03-15 15:18:40 -07:00
Botond Ballo 936a965479 Bug 1755790 - Add a crashtest. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D141063
2022-03-15 19:14:34 +00:00
Tooru Fujisawa 3581ab34d1 Bug 1752624 - Skip drawing border if the dirty rect and the border rect do not intersect. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D141104
2022-03-15 18:36:04 +00:00
Emilio Cobos Álvarez aa74099da1 Bug 1759602 - Make outline-style: auto the default focus outline. r=mstange
As per spec: https://html.spec.whatwg.org/#phrasing-content-3

This should generally be better as it is a better outline to begin with,
and allows us to customize it a bit in the future.

Differential Revision: https://phabricator.services.mozilla.com/D141051
2022-03-15 18:15:20 +00:00
Emilio Cobos Álvarez ef103031be Bug 1759204 - Introduce ShmemImage to easily pass images via IPC. r=aosmond
This shares code with the transferable / cursor stuff which are the
other two non-rendering callers that deal with images over IPC.

We're going to introduce a consumer of this new type in a second, but
this was worth getting reviewed separately.

Differential Revision: https://phabricator.services.mozilla.com/D141110
2022-03-15 18:14:07 +00:00
Markus Stange 47c6beb1ee Bug 1759234 - Merge VsyncSource::Display into VsyncSource. r=smaug
Every `VsyncSource` currently only has a single `Display` associated with it.
This means that we're not making use of the `Display` abstraction at all.
This patch gets rid of `Display` by merging it into `VsyncSource`.

Originally, the intention of the `Display` abstraction was to use it for
per-monitor vsync. There would be one software `VsyncSource` and one hardware
`VsyncSource`, and the hardware `VsyncSource` would have one `Display` per
screen. But in reality, things have played out differently: The only platform
with per-monitor vsync is currently Linux Wayland, which has per-**widget**
vsync. And it has chosen to have one `VsyncSource` per widget, with a single
`Display` each.

For the macOS implementation of per-monitor vsync, I think it also makes
sense to have one `VsyncSource` per screen.

We already need to handle switching between VsyncSources, for switching
between software and hardware vsync, if the pref `layout.frame_rate` is
changed. So we might as well reuse that same switching capability for
switching between screens, when a window moves between screens or when a
tab moves between windows on different screens.

Differential Revision: https://phabricator.services.mozilla.com/D140891
2022-03-15 18:13:56 +00:00
Emilio Cobos Álvarez 7961a431ef Bug 1759163 - Add origin trial support for worklets. r=asuth
Move the trial getter to nsIGlobalObject, make every implementation
provide a reasonable value, and add a test.

Differential Revision: https://phabricator.services.mozilla.com/D140848
2022-03-15 17:50:03 +00:00
Daniel Holbert 39e3163129 Bug 1758199: Add null-check for GetPresContext() in nsRefreshDriver::NotifyDOMContentLoaded. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D141054
2022-03-15 04:33:42 +00:00
Botond Ballo c5c4837ed9 Bug 1749190 - Add a crashtest. r=tnikkel
Depends on D137944

Differential Revision: https://phabricator.services.mozilla.com/D137945
2022-03-15 00:56:00 +00:00
Olli Pettay 571d443e4d Bug 1755006, reduce framerate if the main thread is busy handling also other tasks, r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D140046
2022-03-14 23:28:33 +00:00
Emilio Cobos Álvarez cc96c01559 Bug 1759494 - Remove some dead code introduced for PDFium. r=dholbert
IsSyncPagePrinting() only had one implementation which unconditionally
returned true.

So, any code that was conditioned on !IsSyncPagePrinting() is necessarily
dead/unreachable.

These are also crashing due to a null deref in mPrintTarget which might
happen if print is aborted.

Differential Revision: https://phabricator.services.mozilla.com/D140988
2022-03-14 23:18:22 +00:00
Emilio Cobos Álvarez 9e6489d77a Bug 1759121 - Make custom-content-container content not selectable by default. r=smaug
See bug 1741740 for a case where this caused issues.

It doesn't react to pointer-events by default so it also makes sense for
it to not be selectable. Also, our selection code doesn't deal
particularly well with anonymous content being selected, specially in a
non-independent selection.

Differential Revision: https://phabricator.services.mozilla.com/D140830
2022-03-14 21:22:30 +00:00
Miko Mynttinen 328ebe09e8 Bug 1744069 - Restore the previous behavior of merging RDL list traversal r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D140920
2022-03-14 15:11:05 +00:00
Martin Robinson c7ed0eb07c Bug 1759130 - Add support for parsing the `content-visibility` property from the CSS Contain specification r=emilio
Add initial parsing support for the CSS `content-visibility` attribute.
Currently these parsed values have no effect.

Differential Revision: https://phabricator.services.mozilla.com/D140834
2022-03-14 12:33:55 +00:00
Cristian Tuns e4cef4fec2 Backed out changeset 0211ed711a1c (bug 1755006) for causing mochitest failures on browser_ext_pageAction_context.js,browser_panel_list_accessibility.js CLOSED TREE 2022-03-14 06:53:10 -04:00
Olli Pettay 7a4eedf92b Bug 1755006, reduce framerate if the main thread is busy handling also other tasks, r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D140046
2022-03-13 21:26:14 +00:00
Jonathan Kew bc843f9f73 Bug 1758721 - Preload font prefs that may be needed at textrun-construction time, to avoid use of the (main-thread-only) preference service. r=lsalzman
This doesn't in itself make them thread-safe, but it provides a basis to do so by avoiding
dependence on the Preferences service at textrun-construction time.

The FontPrefs record is inert once constructed, so one approach to worker-thread use would
be to make it refcounted, and have the worker hold a strong reference to the record it's using,
so that it won't be affected if the main thread handles a pref-change and replaces its
FontPrefs. Alternatively, maybe we can just protect access with the same lock as other uses
of the font list, once that is in place (bug 1756474).

Differential Revision: https://phabricator.services.mozilla.com/D140914
2022-03-13 09:58:40 +00:00
Narcis Beleuzu 78455bdefd Backed out changeset a6563c69d9c3 (bug 1759121) for mochitest failures on test_hypertext.html . CLOSED TREE 2022-03-13 03:11:58 +02:00
Emilio Cobos Álvarez e049fb4478 Bug 1759121 - Make custom-content-container content not selectable by default. r=smaug
See bug 1741740 for a case where this caused issues.

It doesn't react to pointer-events by default so it also makes sense for
it to not be selectable. Also, our selection code doesn't deal
particularly well with anonymous content being selected, specially in a
non-independent selection.

Differential Revision: https://phabricator.services.mozilla.com/D140830
2022-03-13 00:18:36 +00:00
Mathew Hodson 34da4aaf3e Bug 1751107 Part 3 - Clamp current time for SVG elements. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D140449
2022-03-11 18:13:07 +00:00
Nicolas Silva fe3175568a Bug 1757396 - Prevent SVG geometry with markers from being active. r=gfx-reviewers,lsalzman
We don't currently check whether the geometry has markers, nor do we try to render them properly with WebRender display items.

This is caught by the reftest paint-order-001.svg when active SVG images and rects are enabled.

Differential Revision: https://phabricator.services.mozilla.com/D140808
2022-03-11 13:00:54 +00:00
Sarah Clements e2f78a721c Bug 1756655 - Remove ifdefs from UA style sheets r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D140186
2022-03-11 10:14:34 +00:00
Julien Wajsberg 830ac30ee4 Bug 1752861 - [profiler] Rename and expose to JS some existing frame labels as well as adding a few r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D140389
2022-03-11 09:18:30 +00:00
Masayuki Nakano 45ba6f356a Bug 1753508 - Add logger of selection batch r=smaug
This was required for debugging the bug.

Differential Revision: https://phabricator.services.mozilla.com/D139350
2022-03-11 02:24:24 +00:00
Marian-Vasile Laza 089b6279c6 Backed out changeset d3f40b4651f5 (bug 1755006) for causing mochitest failures on test_pointerlock-api.html. CLOSED TREE 2022-03-10 17:54:53 -08:00
Olli Pettay 50ba1466cf Bug 1755006, reduce framerate if the main thread is busy handling also other tasks, r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D140046
2022-03-10 23:04:55 +00:00
Daniel Holbert 0a7a27d997 Bug 1728379: Add diagnostic logging to reftest 459443-1.html to see how far we get when it times out. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D140766
2022-03-10 21:22:19 +00:00
Ting-Yu Lin 04af168c74 Bug 1758020 - Revise MoveFlexItemToFinalPosition(). r=dholbert
This patch shouldn't change the behavior.

* It's OK to get the item's offset only when its relatively positioned, because
  `ApplyRelativePositioning` doesn't use the offset parameter if the frame is
  sticky positioned. Document `ApplyRelativePositioning`'s parameters to clarify
  this. Also, we don't need to call apply relative positioning to a
  non-relatively-and-non-sticky-positioned item.

* Print `FLEX_LOG` after applying relative-positioning because `aFramePos` will
  be adjusted in `ApplyRelativePositioning`, and we really want to see the
  item's "final position".

* `aReflowInput` parameter is removed because it's only used to get flex
  container's WritingMode. We can get it from FlexItem.

Differential Revision: https://phabricator.services.mozilla.com/D140703
2022-03-10 19:17:44 +00:00
Emilio Cobos Álvarez 6489b27741 Bug 1758564 - Allow rendering children of <img>'s shadow root. r=dholbert
This doesn't change behavior just yet, but seems worth doing separately.

With this patch, we can render content overlaid on top of an image
frame, by attaching a shadow root to it. The idea is to use this for
text recognition (OCR) of text inside images.

I chose to implement this using the DynamicLeaf stuff that I removed in
bug 1746310 (because nsMenuPopupFrame was its only user).

That seems simpler than either a new frame class, or more special cases
in the frame constructor, etc. But let me know if you disagree.

There are further changes that we want to do. For example, trying to
select the overlaid text with the mouse right now will start dragging
the image. For that, we might need to tweak our selection / mouse
dragging code. But those seem all changes that can go on top of this.

Differential Revision: https://phabricator.services.mozilla.com/D140638
2022-03-10 05:11:38 +00:00
Iulian Moraru 6df286bfe3 Backed out changeset 58f10ceb16ba (bug 1756529) for causing mochitest failures on test_group_keyboard.html. CLOSED TREE 2022-03-10 06:25:37 +02:00
Matteo Ruello 44f4c447d2 Bug 1756529 - Honor general.smoothScroll.[line|page|other] for keyboard scrolls with MSD physics r=botond,hiro
Differential Revision: https://phabricator.services.mozilla.com/D140090
2022-03-10 03:13:02 +00:00
criss d9d5a15c01 Backed out changeset cd50b8570bd8 (bug 1756655) for causing mochitest failures on browser_parsable_css.js. CLOSED TREE 2022-03-09 15:06:51 +02:00
Sarah Clements 6433b09afd Bug 1756655 - Remove ifdefs from UA style sheets r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D140186
2022-03-09 11:46:50 +00:00
Emilio Cobos Álvarez a819845751 Bug 1756210 - Let native theme focus outline be controlled only by CSS. r=mstange
This might be a bit more controversial, but matches Chromium at least,
and it makes sense to me... Would've also fixed this particular bug,
though I think the previous patch is also desirable if devtools ever
wants to add `:disabled` locked states or so.

Depends on D140529

Differential Revision: https://phabricator.services.mozilla.com/D140530
2022-03-09 11:45:10 +00:00
Emilio Cobos Álvarez 340de6fd0f Bug 1756210 - Use pseudo-class locks in nsNativeTheme::GetContentState. r=mstange
Seems harmless, and more in line with what authors would expect when
toggling DevTools pseudo-classes.

Differential Revision: https://phabricator.services.mozilla.com/D140529
2022-03-09 11:45:10 +00:00
Timothy Nikkel 209384a505 Bug 1757314. Use the current scroll origin to determine if we should update the main thread copy of the visual viewport offset. r=botond
This patch was originally posted to bug 1756762, however we found a better patch to fix that bug. This patch still seems like a good idea though so we want to land it in another bug.

I observed the following sequence of events when running gfx/layers/apz/test/mochitest/browser_test_background_tab_load_scroll.js in one of the cases that it fails for me locally.

-ScrollFrameHelper::NotifyApzTransaction is called after sending a transaction to webrender, this sets mAllowScrollOriginDowngrade = true.
-the scroll frame is destroyed and re-created (I'm not sure why this destroy and re-create happened, I didn't investigate), we call SaveState and RestoreState. So now mLastScrollOrigin == Other, and mAllowScrollOriginDowngrade == true.
-the test calls ScrollBy, so we get a call to ScrollToImpl with aOrigin == Relative
-aOrigin gets changed to Other here https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/generic/nsGfxScrollFrame.cpp#2979
-the code just below that determines that it is not a downgrade, so we update mLastScrollOrigin to Other (not a change) and set mAllowScrollOriginDowngrade = false
-ScrollFrameHelper::NotifyApzTransaction is _not_ called (probably because we are in a background tab), so mAllowScrollOriginDowngrade remains false
-the scroll frame is now at position 20000 and the visual viewport offset (stored on the presshell) is also 20000.
-the scroll frame is destroyed and re-created (this one I investigated, it's because the font subsystem has finished loading and asks for a global reconstruct https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/base/PresShell.cpp#9830), we call SaveState and RestoreState. So mLastScrollOrigin == Other, and mAllowScrollOriginDowngrade == true (the same values.
-we get a call to ScrollToRestoredPosition for the newly re-created scroll frame, we are trying to scroll from the current layout scroll position of 0 to the one we had before destruction and re-creation (20000). The visual viewport offset that is stored on the presshell has not been affected, it is still 20000.
-this gets to ScrollToImpl and with aOrigin == Restore
-we arrive at https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/generic/nsGfxScrollFrame.cpp#3000 and Restore is a downgrade from Other, and mAllowScrollOriginDowngrade is false so we do not change mLastScrollOrigin (still Other) and mAllowScrollOriginDowngrade remains false
-we arrive at the code in ScrollToImpl that updates the visual viewport offset on the presshell https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/generic/nsGfxScrollFrame.cpp#3232
-mLastScrollOrigin is Other, which can clobber apz, so we enter the if and add the difference between the before/after layout scroll position from this ScrollToImpl call (20000-0 = 20000) to the visual viewport offset (20000), getting 40000, which gets clamped to the max ~38000.
-and now the layout scroll position and the visual viewport offset have been detached when they shouldn't be.

Whenever we are doing a Restore scroll we expect that there has been a ScrollToImpl call in the past that got us to the position we are restoring to, and that past ScrollToImpl call should have resulted in the visual viewport offset on the presshell getting updated. So if the origin is Restore then the visual viewport offset should have already incorporated this scroll, and so we don't need to update the visual viewport offset for this scroll. If our assumption that the visual viewport offset on the presshell is already up-to-date is wrong that is okay because after an apz transaction they will be reconciled: the main thread is only trying to make an effort to sync with apz in advance and it is better to be conservative here, only updating the visual viewport offset when we know its correct, because as we've seen if we incorrectly update it they can get out of sync and cause bugs.

Another way to think of it: mLastScrollOrigin is the accumulation of all scroll origins since sending the last apz transaction and tells apz if the main thread should take precedence over the apz scroll position, and similarly the layout scroll position that we sned to apz is the accumulation of all scrolls since the last apz transaction. Whereas aOrigin tells us about one scroll, and we want to treat each scroll in that accumulation separately for determining how to update the main thread copy of the visual viewport offset.

Previously in https://phabricator.services.mozilla.com/D137873 I had stated that bug 1753881 (have PresShell::GetVisualViewportOffset() either return a maybe or layout scroll offset if vv offset is not set) would fix these cases in the test but I didn't understand why. Now I understand why. The reason is that although there is an obvious patch for bug 1753881 (return the layout scroll offset if the visual viewport offset isn't set) that patch is not correct. The reason is that in PresShell::SetVisualViewportOffset https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/base/PresShell.cpp#11199 we compare the new offset to the old offset which we get by calling GetVisualViewportOffset. So in the common case where we are in ScrollToImpl and we update the layout scroll offset and then call SetVisualViewportOffset to update the visual viewport offset then GetVisualViewportOffset is going to return the already updated layout scroll offset (if the visual viewport offset hasn't been set on the presshell yet). So SetVisualViewportOffset will determine that we are already up to date and not end up setting any visual viewport offset on the presshell at all. And so no visual viewport offset gets set at all. And since the original bug comes about because of a disagreement between the visual viewport offset and the layout scroll offset, we avoid the bug entirely by never setting a visual viewport offset. This is not acceptable because we thus never send visual viewport offset change events (mozvisualscroll) which we have several tests depending on (browser/components/sessionstore/test/browser_scrollPositions.js is one in particular that I want to note).

The reason I wanted to note browser/components/sessionstore/test/browser_scrollPositions.js was that this patch causes that test to fail. What happens in the test is a scroll frame gets a non-zero layout scroll position (and the same visual viewport offset on the presshell), then the page is reloaded. The layout scroll position is restored via a call to ScrollToImpl with origin Restore, thus it does not touch the visual viewport offset on the presshell. Before this patch we would have looked at mLastScrollOrigin instead and touched the visual viewport offset. And because the page was reloaded we got a new presshell so it does not have a visual viewport offset. The test then gets the visual viewport offset and expects it to have the non-zero layout scroll offset, but it does not. So we can fix this by landing the (corrected) patch for bug 1753881 (have PresShell::GetVisualViewportOffset() either return a maybe or layout scroll offset if vv offset is not set).

Differential Revision: https://phabricator.services.mozilla.com/D139473
2022-03-09 10:16:56 +00:00
Mathew Hodson 1753bc7103 Bug 1751828 - Clamp the inline size when reflowing text. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D140447
2022-03-09 09:16:31 +00:00
Butkovits Atila a563f4db9f Backed out changeset 3c67de8ae3fd (bug 1756210) for causing failures at test_focusrings.xhtml. CLOSED TREE 2022-03-09 01:43:11 +02:00
Daniel Holbert 9f74bc949f Bug 1758029: Gracefully bail out of canvas SVG-filter invalidation codepath, if the canvas has been unlinked due to cycle collection. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D140419
2022-03-08 23:08:32 +00:00
Butkovits Atila 9692831c13 Backed out changeset 5d94320c8ec2 (bug 1756210) for causing failures at test_focusrings.xhtml. CLOSED TREE 2022-03-08 23:29:15 +02:00
Emilio Cobos Álvarez 6f9869bf94 Bug 1756210 - Let native theme focus outline be controlled only by CSS. r=mstange
This might be a bit more controversial, but matches Chromium at least,
and it makes sense to me... Would've also fixed this particular bug,
though I think the previous patch is also desirable if devtools ever
wants to add `:disabled` locked states or so.

Depends on D140529

Differential Revision: https://phabricator.services.mozilla.com/D140530
2022-03-08 18:13:52 +00:00
Emilio Cobos Álvarez 2b6f586ab8 Bug 1756210 - Use pseudo-class locks in nsNativeTheme::GetContentState. r=mstange
Seems harmless, and more in line with what authors would expect when
toggling DevTools pseudo-classes.

Differential Revision: https://phabricator.services.mozilla.com/D140529
2022-03-08 18:13:51 +00:00
Mark Banner aa27ba2794 Bug 1758472 - Stop using ChromeUtils.import(..., null) for importing modules in tests. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D140515
2022-03-08 16:59:20 +00:00
Marian-Vasile Laza 6957b335a7 Backed out changeset d161da1543bc (bug 1751828) for causing crashtest failures on 459968.html. 2022-03-08 08:55:17 -08:00
Mathew Hodson 0049706b3b Bug 1751828 - Clamp the inline size when reflowing text. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D140447
2022-03-08 11:05:16 +00:00
Hector Zhao 777803423b Bug 1757800 - Calculate scrollbar marks' positions with explicit `window.scrollMin{X,Y}`. r=jfkthame,emilio
In `vertical-rl` & `sideways-rl` writing modes, `window.scrollMinX` is not 0.

Differential Revision: https://phabricator.services.mozilla.com/D140485
2022-03-08 05:27:42 +00:00
Glenn Watson efffdf3c63 Bug 1758227 - Add 3 more fuzziness pixels for tier2 android tests r=gfx-reviewers,sotaro
Differential Revision: https://phabricator.services.mozilla.com/D140455
2022-03-07 00:46:30 +00:00
Lee Salzman d22d724cc2 Bug 1511493 - Ensure PushGlyphs uses the current transaction's IpcResourceUpdateQueue. r=emilio
WebRenderBridgeChild::GetFontKeyForScaledFont can currently cause a IpcResourceUpdateQueue race.
If we're in the middle of a transaction building a blob image, GetFontKeyForScaledFont is called
in the blob image building code using the transaction's IpcResourceUpdateQueue as expected, such
that resource updates are sent out when the transaction is finalized.

However, TextDrawTarget calls into PushGlyphs without passing along its IpcResourceUpdateQueue,
calling GetFontKeyForScaledFont without it, and causing it to immediately send out the resource
update.

So if a blob image uses a font key and submits a resource update, but a display list is built
after that also using the font key within the transaction, the display list will fail to send
the resource update because it thinks the blob image already did, even though the blob image
transaction has not yet been finalized.

The simple fix is to just pass IpcResourceUpdateQueue from TextDrawTarget into PushGlyphs, thus
ensuring the resource updates are properly ordered.

Differential Revision: https://phabricator.services.mozilla.com/D140438
2022-03-05 23:35:16 +00:00
Ting-Yu Lin 7eb2cec4ea Bug 1377072 - Minor cleanup related to overflow areas. r=dholbert
None of these changes should change the behavior.

- In `ConsiderChildOverflow()`, replace the legacy term "visual" overflow.

- `GetOverflowAreasRelativeToSelf()`, `ScrollableOverflowRectRelativeToSelf()`,
  `InkOverflowRectRelativeToSelf()` can really be terser.

- Replace `mRect.TopLeft()` with `Position()`, and
  `nsRect(nsPoint(0, 0), GetSize())` with `GetRectRelativeToSelf()`, making them
  shorter and clearer.

- Move `GetOverflowRect()` to private section because it's an implementation
  detail of `InkOverflowRect()` and `ScrollableOverflowRect()`.

Differential Revision: https://phabricator.services.mozilla.com/D140437
2022-03-05 22:27:22 +00:00
Ting-Yu Lin 451290249c Bug 1377072 - Include child frame's overflow area locating at its normal position into parent's overflow. r=dholbert
When a position:sticky element "sticks" in the scroll container's scrollport, we
compute its containing block's overflow areas by including its overflow areas
located at its relative position. This makes the element's normal position
unreachable because its overflow areas located at its "normal position" might
not be within its containing block's overflow areas. Block frame doesn't have
this problem because `nsLineBox` always includes the element's normal position
rect in its own rect.

Therefore, when including a sticky child frame's overflow area into its parent's
overflow area, the overflow areas located at its normal position should be
included as well. This behavior is consistent with a relatively positioned child
frame. (A position:relative frame's normal position is always reachable when
scrolling, at least in both axes that grow positively.)

Differential Revision: https://phabricator.services.mozilla.com/D140373
2022-03-05 22:27:22 +00:00
Glenn Watson f511dd6255 Bug 1758119 - Add some extra fuzziness for android hw tests r=gfx-reviewers,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D140407
2022-03-05 02:54:29 +00:00
Nika Layzell 05dc5e0d76 Bug 1754037 - Part 3c: Automatically update all ParamTraits implementations, r=ipc-reviewers,media-playback-reviewers,bryce,mccr8
Automatically generated rewrites of all ParamTraits and IPDLParamTraits
implementations in-tree to use IPC::Message{Reader,Writer}.

Differential Revision: https://phabricator.services.mozilla.com/D140004
2022-03-04 15:39:41 +00:00
Jan Varga 4b0b18b972 Bug 1757577 - Fix non-unified-build bustage in layout/base/PresShell.cpp; r=layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D139949
2022-03-04 12:40:23 +00:00
Emilio Cobos Álvarez cff9bc48a3 Bug 1757996 - Improve context menu handling on Wayland. r=stransky
What caused the issue was that nsMenuPopupFrame::MoveTo didn't account
for the change in bug 312891. But our context menu / popup positioning
code can be much simpler if we account for the context menu offset
before-hand as an extra horizontal / vertical margin in all directions.

Then we don't need to special-case it at all.

Differential Revision: https://phabricator.services.mozilla.com/D140263
2022-03-04 11:45:41 +00:00
Noemi Erli d69b2997c4 Backed out changeset 86a8141f5590 (bug 1757996) for causing failures in test_popup_attribute.xhtml CLOSED TREE 2022-03-04 13:27:43 +02:00
Emilio Cobos Álvarez 9c57b41359 Bug 1757996 - Improve context menu handling on Wayland. r=stransky
What caused the issue was that nsMenuPopupFrame::MoveTo didn't account
for the change in bug 312891. But our context menu / popup positioning
code can be much simpler if we account for the context menu offset
before-hand as an extra horizontal / vertical margin in all directions.

Then we don't need to special-case it at all.

Differential Revision: https://phabricator.services.mozilla.com/D140263
2022-03-04 10:31:32 +00:00
Glenn Watson 15704e4696 Bug 1757845 - Fix nested local scale within surface hierarchy r=gfx-reviewers,nical
Also include the raster scale in the PictureKey, so that WR will
invalidate when everything is the same apart from the raster
scale (was causing the included wrench reftest to not re-render).

Differential Revision: https://phabricator.services.mozilla.com/D140282
2022-03-04 09:18:31 +00:00
Ting-Yu Lin b48196dcda Bug 1758018 Part 2 - Add helpers testing only "position:relative", and adapt them at some callsites. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D140274
2022-03-04 03:02:01 +00:00
Ting-Yu Lin 7e0c39f9b1 Bug 1758018 Part 1 - Rename the helpers testing "position:relative" or "position:sticky". r=emilio
`nsIFrame::IsRelativelyPositioned()` tests "position:relative" or
"position:sticky", but its naming is misleading until you've dug into the
underlying helper `nsStyleDisplay::IsRelativelyPositionedStyle()`.

Differential Revision: https://phabricator.services.mozilla.com/D140273
2022-03-04 03:02:00 +00:00
Nika Layzell 564010e5d0 Bug 1757253 - Use CheckedInt to avoid unnecessary warning in 64-bit builds, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D140237
2022-03-03 21:10:35 +00:00
Markus Stange 1ea4bbaa4e Bug 1757822 - Restore pre-bug 1676760 runnable priority in non-e10s mode. r=smaug
This should be unnecessary, but using vsync priority in non-e10s mode caused
an existing intermittent to become more frequent, see bug 1737709 comment 22.
This special case will go away once mozilla::BrowserTabsRemoteAutostart is removed.

Differential Revision: https://phabricator.services.mozilla.com/D140105
2022-03-03 18:11:30 +00:00
Jonathan Kew 091447cf5b Bug 1756750 - Reftest for SVG-in-OT font with embedded bitmaps. r=emilio
The testcase includes a 1-second pause after the onload event fires, because the test font
includes PNG bitmaps which are asynchronously decoded. This is in theory unreliable,
but for these small images it should be plenty of time (even without any delay, the test
fails only very intermittently) -- if we're failing to decode the images even with the
1-second delay, something is probably truly broken.

(The file svg-bitmap.ttx file is not actually required to run the test, but is the source
for the svg-bitmap.ttf font file, constructed by inserting base64-encoded PNG images
into a minimal font framework.)

Differential Revision: https://phabricator.services.mozilla.com/D140057
2022-03-03 13:27:44 +00:00
smolnar 27376f0656 Backed out changeset aa7a48cff13c (bug 1756750) for causing reftest failures layout/reftests/text-svgglyphs/svg-in-ot-bitmap-1.html 2022-03-02 21:17:26 +02:00
Jonathan Kew dd2faa9bfa Bug 1756750 - Reftest for SVG-in-OT font with embedded bitmaps. r=emilio
The testcase includes a 1-second pause after the onload event fires, because the test font
includes PNG bitmaps which are asynchronously decoded. This is in theory unreliable,
but for these small images it should be plenty of time (even without any delay, the test
fails only very intermittently) -- if we're failing to decode the images even with the
1-second delay, something is probably truly broken.

(The file svg-bitmap.ttx file is not actually required to run the test, but is the source
for the svg-bitmap.ttf font file, constructed by inserting base64-encoded PNG images
into a minimal font framework.)

Differential Revision: https://phabricator.services.mozilla.com/D140057
2022-03-02 15:58:14 +00:00
Emilio Cobos Álvarez 0547fa3491 Bug 1756750 - Add a missing null-check.
MANUAL PUSH: Trivial crashtest fix CLOSED TREE
2022-03-02 17:19:33 +01:00
Emilio Cobos Álvarez 676faeb637 Bug 1756750 - Ensure we observe SVG glyph changes inside <svg:text>. r=jfkthame
This gets done usually in BreakSink::Finish, but we don't do
line-breaking in SVG Text so we need to do this here instead.

Do you know where I could crib a test for this?

Depends on D139964

Differential Revision: https://phabricator.services.mozilla.com/D139965
2022-03-02 14:31:58 +00:00
Emilio Cobos Álvarez ad92f744aa Bug 1756750 - Don't reframe <svg:image> on loading / broken changes. r=jfkthame
Doesn't change behavior but makes debugging easier and should be a perf
improvement anyways.

Differential Revision: https://phabricator.services.mozilla.com/D139964
2022-03-02 14:31:58 +00:00
Jonathan Kew 9f7ae29b2c Bug 1757578 - For resolving font prefs, accept lang attribute with underscore in place of hyphen separators. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D139951
2022-03-02 13:15:27 +00:00
stransky 52970abaec Bug 1755521 - Don't lose track of anchor rect width on popup position change. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D138827
2022-03-02 12:33:27 +00:00
stransky 88a2067f30 Bug 1755521 Store SizedToPopup attribute to use in nsMenuPopupFrame::MoveTo() to avoid unwanted popup resize r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D139944
2022-03-02 10:27:54 +00:00
Hiroyuki Ikezoe e57033a3d2 Bug 1746989 - Use NSToCoordRoundWithClamp in nsLayoutUtils::TransformRect to avoid undefined behavior in conversions from float to int. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D140015
2022-03-02 06:18:58 +00:00
Hiroyuki Ikezoe e4685b149d Bug 1751110 - Clamp the max size for partial pre-render to nscoord_MAX. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D139911
2022-03-02 05:30:18 +00:00
Markus Stange 3ce08a4e07 Bug 1676760 - Rename Add/RemoveChildRefreshTimer. r=smaug
It is used by far more than just content process refresh driver timers.

Differential Revision: https://phabricator.services.mozilla.com/D139769
2022-03-01 22:48:19 +00:00
Markus Stange 9912a6a4a3 Bug 1676760 - Use DataMutex for pending vsync tracking and rename variables so that they don't refer to "parent process" even though they're also used in the content process. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D139767
2022-03-01 22:48:18 +00:00
Markus Stange 3865c1aeeb Bug 1676760 - Remove ParentProcessVsyncNotifier. r=smaug
Seems excessive to have a separate class for this, it really just calls a method on a different thread.

Differential Revision: https://phabricator.services.mozilla.com/D139766
2022-03-01 22:48:18 +00:00
Markus Stange 4062a118bc Bug 1676760 - Always use vsync priority for the ParentProcessVsyncNotifier runnable. r=smaug
This check was there for single process Android and is no longer needed.

Differential Revision: https://phabricator.services.mozilla.com/D139765
2022-03-01 22:48:18 +00:00
Markus Stange 1a8dfa72f1 Bug 1676760 - Rename NotifyParentProcessVsync to NotifyVsyncOnMainThread and add some comments. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D139764
2022-03-01 22:48:17 +00:00
Markus Stange 66b0bde4d9 Bug 1676760 - Fix comments on VsyncRefreshDriverTimer member variables. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D139763
2022-03-01 22:48:17 +00:00
Markus Stange f046915352 Bug 1676760 - Replace VsyncRefreshDriverTimer constructors with named creation methods. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D139762
2022-03-01 22:48:16 +00:00
Jonathan Kew 331c406f5c Bug 1756720 - When using legacy MS Symbol fonts, map character codes from the U+00xx range to the PUA range U+F0xx found in the cmap subtables. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D139724
2022-03-01 15:22:56 +00:00
Emilio Cobos Álvarez d85e707e95 Bug 1751108 - Deal with nan context scale in SVGTextFrame::UpdateFontSizeScaleFactor. r=layout-reviewers,jfkthame
Depends on D139936

Differential Revision: https://phabricator.services.mozilla.com/D139937
2022-03-01 14:35:36 +00:00
Emilio Cobos Álvarez 12a3368643 Bug 1751108 - Make nsLayoutUtils::ConstrainToCoordValues deal better with inf/nan. r=layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D139936
2022-03-01 14:35:35 +00:00
Hector Zhao 37cef69543 Bug 1700292 - reftest for marks on horizontal scrollbar. r=layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D139002
2022-03-01 13:19:00 +00:00
Hector Zhao 1efb3c674c Bug 1700292 - Draw scroll marks on horizontal scrollbar as well. r=emilio,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D139001
2022-03-01 13:19:00 +00:00
Emilio Cobos Álvarez a8d5f9838a Bug 312891 - Right align RTL context menus on non-Wayland platforms. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D139484
2022-03-01 11:58:22 +00:00
Cameron McCormack 844fb17be9 Bug 1607913 - Use Consolas instead of Courier New in Windows monospace font prefs. r=jfkthame
A number of tests (and expectations) are updated here to either avoid
accidentally relying on the size of Courier New on Windows, or to
explicitly use Courier New instead of monospace, where it's harder to
work out how to rewrite the test correctly.

Differential Revision: https://phabricator.services.mozilla.com/D87222
2022-03-01 11:03:42 +00:00
Timothy Nikkel 22b5bfa1de Bug 1756762. When the root scroll frame is destroyed, reset the visual viewport offset on it's presshell. r=botond
The regular scroll position restoration code will restore it.

Specifically, in ScrollFrameHelper::SaveState

https://searchfox.org/mozilla-central/rev/44ae61c5eeb150cb77b6b8511ceee7ddd6892cb7/layout/generic/nsGfxScrollFrame.cpp#7376

we store the visual viewport offset. ScrollFrameHelper::ScrollToRestoredPosition will try to restore both the layout scroll offset and the visual viewport offset by calling ScrollToWithOrigin (which leads to ScrollToImpl) and PresShell::ScrollToVisual respectively.

I observed the following sequence of events when running gfx/layers/apz/test/mochitest/browser_test_background_tab_load_scroll.js in one of the cases that it fails for me locally.

-ScrollFrameHelper::NotifyApzTransaction is called after sending a transaction to webrender, this sets mAllowScrollOriginDowngrade = true.
-the scroll frame is destroyed and re-created (I'm not sure why this destroy and re-create happened, I didn't investigate), we call SaveState and RestoreState. So now mLastScrollOrigin == Other, and mAllowScrollOriginDowngrade == true.
-the test calls ScrollBy, so we get a call to ScrollToImpl with aOrigin == Relative
-aOrigin gets changed to Other here https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/generic/nsGfxScrollFrame.cpp#2979
-the code just below that determines that it is not a downgrade, so we update mLastScrollOrigin to Other (not a change) and set mAllowScrollOriginDowngrade = false
-ScrollFrameHelper::NotifyApzTransaction is _not_ called (probably because we are in a background tab), so mAllowScrollOriginDowngrade remains false
-the scroll frame is now at position 20000 and the visual viewport offset (stored on the presshell) is also 20000.
-the scroll frame is destroyed and re-created (this one I investigated, it's because the font subsystem has finished loading and asks for a global reconstruct https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/base/PresShell.cpp#9830), we call SaveState and RestoreState. So mLastScrollOrigin == Other, and mAllowScrollOriginDowngrade == true (the same values.
-we get a call to ScrollToRestoredPosition for the newly re-created scroll frame, we are trying to scroll from the current layout scroll position of 0 to the one we had before destruction and re-creation (20000). The visual viewport offset that is stored on the presshell has not been affected, it is still 20000.
-this gets to ScrollToImpl and with aOrigin == Restore
-we arrive at https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/generic/nsGfxScrollFrame.cpp#3000 and Restore is a downgrade from Other, and mAllowScrollOriginDowngrade is false so we do not change mLastScrollOrigin (still Other) and mAllowScrollOriginDowngrade remains false
-we arrive at the code in ScrollToImpl that updates the visual viewport offset on the presshell https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/generic/nsGfxScrollFrame.cpp#3232
-mLastScrollOrigin is Other, which can clobber apz, so we enter the if and add the difference between the before/after layout scroll position from this ScrollToImpl call (20000-0 = 20000) to the visual viewport offset (20000), getting 40000, which gets clamped to the max ~38000.
-and now the layout scroll position and the visual viewport offset have been detached when they shouldn't be.

If we reset the visual viewport offset when the scroll frame is destroyed we avoid the problem here.

Differential Revision: https://phabricator.services.mozilla.com/D139792
2022-03-01 01:51:27 +00:00
Emilio Cobos Álvarez a0014f1385 Bug 1757106 - Fix early-out in nsMenuPopupFrame::MoveTo to account for margins. r=stransky
This was also broken.

Differential Revision: https://phabricator.services.mozilla.com/D139670
2022-03-01 01:11:20 +00:00
Emilio Cobos Álvarez 4b49d8b1fa Bug 1757106 - Clean up menu popup rect handling. r=stransky
Store preferred rect in dev pixels, which simplifies a bit other calculations,
and ensures that the nsMenuPopupFrame code accounts for zoom etc.

Use existing conversion methods for GDK <-> Device <-> CSS conversions.

Differential Revision: https://phabricator.services.mozilla.com/D139623
2022-03-01 01:06:37 +00:00
Marian-Vasile Laza a0a962b604 Backed out changeset cd5ac5f6ff6e (bug 1756720) for causing reftest failures on 399636-standards-css.html. CLOSED TREE 2022-02-28 16:53:40 -08:00
Nika Layzell 6f3de9dc9b Bug 1751948 - Part 3: Build IPDL sources within the directory they were declared, r=glandium
This change allows IPDL sources to respect FINAL_LIBRARY when building, which
is important for allowing us to build gtest-only IPDL_SOURCES files.

Differential Revision: https://phabricator.services.mozilla.com/D137167
2022-02-28 21:01:47 +00:00
Jonathan Kew 6901bd37b7 Bug 1756720 - When using legacy MS Symbol fonts, map character codes from the U+00xx range to the PUA range U+F0xx found in the cmap subtables. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D139724
2022-02-28 20:38:38 +00:00
Miko Mynttinen ed38473dcc Bug 1757184 - Allocate display list nodes from nsPresArena instead of ArenaAllocator r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D139863
2022-02-28 19:16:04 +00:00
Emilio Cobos Álvarez 8724285359 Bug 1757402 - Add basic native context menu support on GTK. r=stransky
I had this written somewhere in a branch, but given bug 1419151, I
cleaned it up a bit and turned it into an actual patch that works.

Behind a pref for now, because at the very least it needs:

 * Support for some testing-only functions.
 * Support for custom icons (for web extensions and so on).

The key point is that this adds the relevant code to map a XUL menu to a
GMenuModel, which we could then export via
`g_dbus_connection_export_menu_model()`, which seems like a much simpler
approach to support stuff like bug 1419151.

See the MenuModel class in NativeMenuGtk as for how is this done.

Differential Revision: https://phabricator.services.mozilla.com/D139845
2022-02-28 14:53:24 +00:00
Jonathan Watt 8d542d93ce Bug 1756445 - Stop saving print settings in platform code after printing. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D139291
2022-02-27 21:12:08 +00:00
Timothy Nikkel 4b48b3dd2d Bug 1753881. Simplify a few IsVisualViewportOffsetSet callers. r=botond
Depends on D139472

Differential Revision: https://phabricator.services.mozilla.com/D139683
2022-02-27 13:09:27 +00:00
Timothy Nikkel ed30449176 Bug 1753881. If the visual viewport offset hasn't been set on the presshell return the layout scroll position. r=botond
Because that is the correct value.

Differential Revision: https://phabricator.services.mozilla.com/D139472
2022-02-27 13:09:27 +00:00
Olli Pettay 1edf4c885e Bug 1754562, make parent process' idle detection be aware of active RefreshDrivers in the other processes, r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D138504
2022-02-26 22:37:03 +00:00
Emilio Cobos Álvarez 8c99b6befb Bug 1754522 - Limit cross-document content loadable via <svg:use>. r=dholbert
It seems Blink / WebKit run this even if in the same document, but it
seems less-potentially-breaking to restrict this to the cross-document
case.

Though at least on the test-case it seems it's loading from the same
origin, which is a bit dubious to restrict...

Differential Revision: https://phabricator.services.mozilla.com/D138369
2022-02-26 16:17:17 +00:00
Emilio Cobos Álvarez 89a8d46834 Bug 1757230 - Add missing includes elsewhere to unbust hybrid builds.
MANUAL PUSH: Trivial orange fix CLOSED TREE
2022-02-26 01:08:16 +01:00
Morgan Reschenberg 7aae56705c Bug 1744573: Apply single-level transforms in RemoteAccessibleBase::Bounds r=eeejay,Jamie,emilio
Differential Revision: https://phabricator.services.mozilla.com/D131554
2022-02-25 22:23:13 +00:00
Morgan Reschenberg 618acab981 Bug 1744573: Cache the transform matrix r=eeejay,Jamie
Differential Revision: https://phabricator.services.mozilla.com/D133134
2022-02-25 22:23:13 +00:00
Emilio Cobos Álvarez 384bfcf2b6 Bug 1757230 - Avoid unneeded includes in nsTextFrame.h. r=longsonr
Move stuff to the C++ file where possible, and move ClipEdges to
nsTextFrame since it's the only thing using it (rather than keeping it
in nsDisplayText).

Also avoids a RemoteBrowser.h include from nsDisplayList.h while at it.

This came up in https://phabricator.services.mozilla.com/D137271#inline-768125

Differential Revision: https://phabricator.services.mozilla.com/D139759
2022-02-25 22:18:11 +00:00