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

21635 Коммитов

Автор SHA1 Сообщение Дата
Kartikaya Gupta 264e82488a Bug 1670003 - Add back the scroll input methods telemetry. r=botond
This is mostly a revert of the patch in bug 1425686 that removed the old
probe, but rebased to new code locations and clang-formatted. The histogram
entry is also updated with new bug numbers and fields.

The next patch will refine some of these telemetry recording points; the patch
is split into two for easier reviewing as this part is basically what landed
originally.

Differential Revision: https://phabricator.services.mozilla.com/D92995
2020-10-10 17:41:47 +00:00
Masayuki Nakano efdb198637 Bug 1539769 - Make `eSetSelection` event go to focused `BrowserParent` instead of `BrowserPargent` for focused content in the main process r=hsivonen
when there is no composition, `IMEStateManager::HandleSelectionEvent()` calls
`TextComposition::HandleSelectionEvent()` with `BrowserParent` which is
retrieved from `aEventTargetContent` which is focused content in the main
process.  This means that `eSetSelection` event is handled in root document
of the focused tab when there is no composition.  However, following composition
events will go to focused `BrowserParent`, i.e., if an OOP iframe has focus
in the tab, `eSetSelection` event won't be handled in it.  Therefore, IME
always fails to replace existing text with new composition.

This patch makes both `IMEStateManager::HandleSelectionEvent()` and
`PresShell::EventHandler::DispatchEventToDOM()` use
`IMEStateManager::GetActiveBrowserParent()` for sending both `eSetSelection`
and composition events to same process.  Additionally, this patch make
`IMEStateManager::GetActiveBrowserParent()` returns
`IMEStateManager::sFocusedIMEBrowserParent` when it's set to non-nullptr
because native IME tries to modify the editor which enabled IME context.

On the other hand, for making the behavior safer, we should make
`eCompositionStart` event have replacing range optionally.  I filed
bug 1669907 to change the design, but it requires several non-tiny patches.
Once we fix it, we can write automated tests for this simply, but without
the fix, I need to write too many lines with low level API, and it becomes
unnecessary after fixing the bug.  Therefore, I give up to write a test
for this for now.

Differential Revision: https://phabricator.services.mozilla.com/D93053
2020-10-09 07:01:20 +00:00
Razvan Maries 5dcad9e9b5 Backed out changeset 428c9c1eabb8 (bug 1655866) for multiple failures. CLOSED TREE 2020-10-09 22:28:00 +03:00
Kris Maglione 824fb768e1 Bug 1655866: Part 9 - Use the same PermitUnloadAction enum in WGP and nsIContentViewer. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D90939
2020-10-09 18:29:34 +00:00
Agi Sferro b1029e4f28 Bug 1648157 - Add parameter to not iterate subdocs on media change. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D92807
2020-10-09 17:31:52 +00:00
Masayuki Nakano 2fde14a338 Bug 1623918 - part 2: Mark `nsINode::GetSelectionRootContent()` and its root callers as `MOZ_CAN_RUN_SCRIPT` as far as possible r=smaug
This patch tries to mark root callers of `nsINode::GetSelectionRootContent()`
which calls `nsINode::GetAnonymousRootElementOfTextEditor()` as far as possible
(and reasonable).

It's used by `ContentEventHandler` so that a lot of methods of
`EventStateManager`, `ContentEventHandler`, `IMEContentObserver` which are main
users of it are also marked as `MOZ_CAN_RUN_SCRIPT`.  I think that this is
reasonable.

On the other hand, it might not be reasonable to mark `IMEStateManager` methods
as `MOZ_CAN_RUN_SCRIPT` for initializing `IMEContentObserver` because
`IMEStateManager` may be able to initialize `IMEContentObserver` asynchronously
and its root callers are in XUL layout code.  Therefore, this patch uses
`MOZ_CAN_RUN_SCRIPT_BOUNDARY` for `IMEStateManager` at least for now.

Differential Revision: https://phabricator.services.mozilla.com/D92730
2020-10-09 02:37:47 +00:00
Emilio Cobos Álvarez 91e35e71fb Bug 1670051 - Add a stack-capturing marker when calling ThemeChanged in the parent process. r=dholbert
This helps keep track down spurious ThemeChanged calls.

Differential Revision: https://phabricator.services.mozilla.com/D92975
2020-10-09 01:58:24 +00:00
Sylvestre Ledru cad53f4804 Bug 1588458 - Replace dxr links by searchfox in the code/test r=kats,sparky
Differential Revision: https://phabricator.services.mozilla.com/D92792
2020-10-08 14:02:40 +00:00
Kris Maglione eeec43da78 Bug 1669096: Add missing kungFuDeathGrip. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D92490
2020-10-06 18:05:32 +00:00
Denis Palmeiro 71434198b6 Bug 1664475: Add telemetry probes to collect data for script delazification, xdr encoding time, bytecode caching time, and baseline compilation time. r=nbp,Dexter,sefeng,smaug
Differential Revision: https://phabricator.services.mozilla.com/D90798
2020-10-08 13:46:29 +00:00
Kartikaya Gupta 46ab8f0b48 Bug 1668921 - Move ZoomConstraints serializer into a friend function. r=mattwoodrow
Depends on D92845

Differential Revision: https://phabricator.services.mozilla.com/D92846
2020-10-08 12:39:37 +00:00
Narcis Beleuzu c163b394ef Backed out 2 changesets (bug 1623918) for crashtest failure on 1623918.html CLOSED TREE
Backed out changeset 519ca1b069e5 (bug 1623918)
Backed out changeset d8a09a5fea47 (bug 1623918)
2020-10-08 12:06:58 +03:00
Masayuki Nakano da386ef224 Bug 1623918 - part 2: Mark `nsINode::GetSelectionRootContent()` and its root callers as `MOZ_CAN_RUN_SCRIPT` as far as possible r=smaug
This patch tries to mark root callers of `nsINode::GetSelectionRootContent()`
which calls `nsINode::GetAnonymousRootElementOfTextEditor()` as far as possible
(and reasonable).

It's used by `ContentEventHandler` so that a lot of methods of
`EventStateManager`, `ContentEventHandler`, `IMEContentObserver` which are main
users of it are also marked as `MOZ_CAN_RUN_SCRIPT`.  I think that this is
reasonable.

On the other hand, it might not be reasonable to mark `IMEStateManager` methods
as `MOZ_CAN_RUN_SCRIPT` for initializing `IMEContentObserver` because
`IMEStateManager` may be able to initialize `IMEContentObserver` asynchronously
and its root callers are in XUL layout code.  Therefore, this patch uses
`MOZ_CAN_RUN_SCRIPT_BOUNDARY` for `IMEStateManager` at least for now.

Differential Revision: https://phabricator.services.mozilla.com/D92730
2020-10-08 03:56:51 +00:00
Botond Ballo 3e82ab456a Bug 1664101 - When querying the displayport for the purpose of applying it to fixed content, apply an async scroll adjustment suitable for fixed content. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D92508
2020-10-07 22:36:57 +00:00
Botond Ballo 784c840349 Bug 1664101 - Propagate DisplayPortOptions up to GetHighResolutionDisplayPort and down to GetDisplayPortFromMarginsData. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D92507
2020-10-07 22:35:20 +00:00
Botond Ballo 5fac61e3d1 Bug 1664101 - Store displayport margins in unadjusted form. r=kats
Where an adjustment (to reflect a delta between the APZ and layout
scroll offsets) is necessary, the inputs needed to compute the
adjustment are stored with the margins, and the adjustment is
applied at query time.

A couple of notes on this patch:

 * Storing DisplayPortMargins::mLayoutOffset is probably unnecessary,
   we should be able to just query the scroll frame's layout offset
   when applying the margins.

 * Some callers of DisplayPortMargins::WithNoAdjustment() may be
   incorrect, in that they pass in margins that are relative to the
   visual viewport but do not make a corresponding adjustment.
   This is a pre-existing issue that this patch just makes clearer.

As this is a regression-prone area, this patch is careful to avoid
making any functional changes, leaving the above issues to be
addressed in future bugs.

Differential Revision: https://phabricator.services.mozilla.com/D92506
2020-10-07 22:35:07 +00:00
Botond Ballo 715fb4d644 Bug 1664101 - Move DisplayPort*PropertyData below DisplayPortOptions. r=kats
In a later patch, DisplayPortMarginsPropertyData will have a
dependency on one of the options.

Differential Revision: https://phabricator.services.mozilla.com/D92505
2020-10-07 22:34:54 +00:00
Daniel Holbert 3e52de68f4 Bug 1669774 part 2: Rename some APIs and variables for accuracy (s/page/sheet/) in nsPrintJob, nsPagePrintTimer, and nsDocumentViewer. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D92791
2020-10-07 21:00:26 +00:00
Kartikaya Gupta 3c8d434ae6 Bug 1668870 - Ignore touch listeners in the system group for event retargeting. r=smaug
The audio/video controls element has touch listeners on the scrubber, which
steals events when we don't want it to. So let's ignore those listeners.

Ignoring system group listeners for the purposes of event retargeting seems
reasonable in the general case, because those listeners are coming from the
browser itself. If we're relying on the event retargeting to make those browser
elements easy to hit, then we should not be doing that and instead just make
them bigger.

Test coverage for this change is provided by the android-components tests that
failed in bug 1668112. The next patch re-enables touch event retargeting and
exercises this code in the context of those tests.

Depends on D92436

Differential Revision: https://phabricator.services.mozilla.com/D92437
2020-10-06 18:03:25 +00:00
Narcis Beleuzu db9dfe3249 Backed out changeset 5dd5f0d3a09b (bug 1663475) for mochitest failure on test_reftests_with_caret.html CLOSED TREE 2020-10-06 06:22:01 +03:00
Emilio Cobos Álvarez 9d6f081a11 Bug 1663475 - Paint caret geometry from the containing block. r=mats
This matches other browsers and shouldn't be too terrible, though I'm
not quite a fan of it.

Differential Revision: https://phabricator.services.mozilla.com/D89483
2020-10-06 00:06:30 +00:00
Edgar Chen 53a7fb1fb0 Bug 1669197 - Use Element in PointerCaptureInfo; r=smaug
mPendingElement and mOverrideElement are always Element, we could just use
Element to make the code clear.

Differential Revision: https://phabricator.services.mozilla.com/D92433
2020-10-05 15:56:52 +00:00
Timothy Nikkel 35245411b9 Bug 1668966. Only clear PresShell::mResolutionUpdated after the apz transaction. r=kats,botond
We clear PresShell::mResolutionUpdated in nsLayoutUtils::ComputeScrollMetadata here

https://searchfox.org/mozilla-central/rev/7ef5cefd0468b8f509efe38e0212de2398f4c8b3/layout/base/nsLayoutUtils.cpp#9419

but that is incorrect because we call ComputeScrollMetadata twice for one transaction with webrender. This is why ScrollFrameHelper::NotifyApzTransaction exists: to clear things on the layout side after they are sent to the compositor.

Differential Revision: https://phabricator.services.mozilla.com/D92316
2020-10-04 21:26:46 +00:00
Timothy Nikkel 223e9bb630 Bug 1667612. Factor waitToClearOutAnyPotentialScrolls out from various tests and put it in apz_test_utils.js. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D92318
2020-10-03 15:58:16 +00:00
Cameron McCormack 4352fb7b0d Bug 1662839 - Set author style disabled state correctly on newly created iframes. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D90953
2020-10-04 03:25:16 +00:00
Botond Ballo 0d40408d93 Bug 1667475 - Move handling of DisplayportRelativeTo inside GetDisplayPortImpl(). r=kats
Differential Revision: https://phabricator.services.mozilla.com/D92016
2020-10-03 21:08:19 +00:00
Botond Ballo d3e8e5c933 Bug 1667475 - Consolidate displayport-related flags into a DisplayPortOptions struct. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D92015
2020-10-03 21:08:12 +00:00
Botond Ballo ae40fb66f3 Bug 1667475 - Drop the 'aRelativeTo' parameter of GetDisplayPortForVisibilityTesting(). r=kats
The only caller passed in DisplayRelativeTo::ScrollFrame.

Removing this makes it easier to consolidate display port options
in a subsequent patch.

Differential Revision: https://phabricator.services.mozilla.com/D92014
2020-10-03 21:07:54 +00:00
Botond Ballo 3665360cf1 Bug 1667475 - Remove no-longer-used 'aOutPainted' parameters. r=kats
It looks like these are unused as of bug 1629466.

Differential Revision: https://phabricator.services.mozilla.com/D92013
2020-10-03 21:07:41 +00:00
Botond Ballo 5d6a075ae9 Bug 1667475 - Moved displayport-related functions from nsLayoutUtils to a new DisplayPortUtils class. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D92006
2020-10-03 21:07:34 +00:00
Timothy Nikkel b75fe0bf66 Bug 1656689. Use GetAvailableScrollingDirectionsForUserInputEvents in nsLayoutUtils::GetNearestScrollableFrameForDirection. r=kats
Keyboard arrow key scrolls go through PresShell::ScrollLine/ScrollCharacter. When these look for a scroll frame they eventually end up at nsLayoutUtils::GetNearestScrollableFrameForDirection.

nsLayoutUtils::GetNearestScrollableFrameForDirection does two things wrong when determining if the scroll frame is scrollable by apz: it disallows overflow hidden scrolling, and it uses GetAvailableScrollingDirections which is based on the layout scroll range.

Using GetAvailableScrollingDirectionsForUserInputEvents takes into account both of these factors.

GetNearestScrollableFrameForDirection is used by:
-gfx/layers/apz/src/FocusTarget.cpp
-EventStateManager::DoContentCommandScrollEvent
-PageMove, ScrollPage, ScrollLine, ScrollCharacter, CompleteScroll of PresShell
All of these should want the more apz aware function.

Differential Revision: https://phabricator.services.mozilla.com/D90498
2020-09-27 03:27:05 +00:00
Kartikaya Gupta 5234c61e56 Bug 1666792 - Don't allow events to get retargeted outside the nearest z-index container. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D92157
2020-10-02 18:08:12 +00:00
Timothy Nikkel a9912e4bb1 Bug 1668751. Make sure nsFrameSelection::PageMove is only called on a frame in the same document. r=emilio
The frame we pass to PageMove is used to extend the selection, we can't extend a selection outside of the document. The scrolling that takes place can still scroll scroll frames in parent documents afterwards.

Differential Revision: https://phabricator.services.mozilla.com/D92176
2020-10-02 18:04:04 +00:00
Razvan Maries 365b429d6e Backed out changeset 20fadec3e9dc (bug 1187682) for perma failures on layout/reftests/mathml/stretchy-munderover-1c.html. CLOSED TREE 2020-10-02 17:11:33 +03:00
Frederic Wang 6391eed8cc Bug 1187682 - Use ScriptPercentScaleDown and ScriptScriptPercentScaleDown constants. r=emilio
The math-depth implementation is refined to take into account the
ScriptPercentScaleDown and ScriptScriptPercentScaleDown constants (if the
parent's first valid font has a MATH table) in order to calculate the
scale factor between math-deth 0 and 1, and between 0 and 2 respectively.

Behavior is unchanged if the legacy scriptsizemultiplier attribute is
specified or if no MATH table is available.

The preference layout.css.math-depth.enabled remains disabled in nightly
until the remaining bit (support for font-size: math) is implemented in
bug 1667090.

Differential Revision: https://phabricator.services.mozilla.com/D91604
2020-10-02 11:33:34 +00:00
Emilio Cobos Álvarez 584d9d8e68 Bug 1668156 - Fix some IntersectionObserver edge cases, and enable the assertion for good. r=hiro
This patch fixes two issues, described below:

First, the GetTopLevelDocument function was looking at the browsing
context tree. It should look at the window context tree, as looking at
the browsing context tree means that if you're in a discarded or
about-to-get-discarded document, you can end up with a document from a
different tree. Computing intersections between those of course makes no
sense and triggers the assertion we're enabling.

Second, this patch fixes an issue when you have fission enabled, and a
setup such as:

  A1 -> B1 -> A2

If you try to use IntersectionObserver from A2 with the implicit root,
we'd end up with:

  * rootRect: A1's root scrollport rect (this is fine, because it's only
              used to compute the root margin and bounds and so on, not
              to compute geometry).

  * rootFrame: A1's root scroll frame (this is _not_ fine, see below).

Then, we'd try to map rects from A2's target to A1's viewport, and we
can't really do that sensibly with the existing nsLayoutUtils functions,
because we're not accounting for all the OOP iframe transforms that may
be going on. This also triggers the assertion that this patch enables in
same-origin-grand-child-iframe.sub.html.

To fix it, for the A2 case, use the same code that we have for other OOP
iframes. The test tweaks fails with fission enabled without the patch
(because we don't account for the OOP iframe clip).

Differential Revision: https://phabricator.services.mozilla.com/D92089
2020-10-01 22:41:55 +00:00
Emilio Cobos Álvarez fbd95bb29e Bug 1668406 - Introduce nsIPrintSettings.honorPageRuleMargins. r=jfkthame
(Doing the obvious)

This should allow the front-end to expose it in one way or another in
bug 1661663.

Differential Revision: https://phabricator.services.mozilla.com/D92004
2020-10-01 13:18:01 +00:00
Gerald Squelart ee701f64d7 Bug 1667915 - Separate marker category from marker options - r=gregtatum
The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.

Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.

As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`

Differential Revision: https://phabricator.services.mozilla.com/D91680
2020-10-01 11:02:23 +00:00
Olli Pettay 8a508eaa66 Bug 1668357 - Disable tests which fail when fission and session-history-in-parent are enabled, r=peterv,marionette-reviewers,whimboo
In many cases with wpt, most of the tests in the file pass, but it is rather time consuming to annotate
.ini files case by case.

Differential Revision: https://phabricator.services.mozilla.com/D91977
2020-10-01 10:23:47 +00:00
Bogdan Tara ababae891b Backed out 2 changesets (bug 1667915) for platform related bustage CLOSED TREE
Backed out changeset e7a0788a1741 (bug 1667915)
Backed out changeset d34505b2d81b (bug 1667915)
2020-10-01 12:34:39 +03:00
Gerald Squelart e07ae06a1d Bug 1667915 - Separate marker category from marker options - r=gregtatum
The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.

Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.

As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`

Differential Revision: https://phabricator.services.mozilla.com/D91680
2020-10-01 01:44:47 +00:00
Emilio Cobos Álvarez 8128b0a110 Bug 1668156 - Make PositionedEventTargeting code not violate TransformRectToAncestor invariants. r=kats
And enable the assertion for the same-document case.

Without this patch, the assertion would fire in tests like
gfx/layers/apz/test/mochitest/test_group_zoom.html, where stuff like
MaybeHandleEventWithAccessibleCaret, which passes a non-root-frame down
here, and a target, which ends up violating the preconditions of
ClipToFrame, etc.

Enable the assertion for the same-document case, there are other
violations when fission is enabled in the cross-document case.

Differential Revision: https://phabricator.services.mozilla.com/D91966
2020-09-30 17:20:21 +00:00
Botond Ballo 01b3c7969d Bug 1667594 - Move nsLayoutUtils::RectCallback to namespace scope. r=emilio,jgilbert
This allows it to be forward-declared (while a nested class cannot be),
such that headers files that use RectCallback by pointer or reference
do not need to include nsLayoutUtils.h.

This avoids including nsLayoutUtils.h in nsRange.h.

Differential Revision: https://phabricator.services.mozilla.com/D91685
2020-09-30 21:06:47 +00:00
Botond Ballo e6c29de3e7 Bug 1667594 - Move nsLayoutUtils::SurfaceFromElementResult to its own file. r=emilio
Along with a dependent struct DirectDrawInfo.

This allows nsImageRenderer.h and CanvasRenderingContext2D.h to
avoid including nsLayoutUtils.h.

For nsImageRenderer.h in particular, a forward declaration is
not sufficient as nsImageRenderer stores SurfaceFromElementResult
by value.

A couple of method definitions elsewhere are moved out of line
to keep things compiling without including nsLayoutUtils.h in
additional headers.

Differential Revision: https://phabricator.services.mozilla.com/D91684
2020-09-30 21:05:34 +00:00
Kris Maglione f3f0b25ab6 Bug 1667491: Fix null pointer deref. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D91834
2020-09-30 19:18:19 +00:00
Jonathan Watt 9663c812c7 Bug 1668301. Merge the 'printing-widget' NSPR module into the 'printing' module. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D91949
2020-09-30 16:36:29 +00:00
Jonathan Watt 1890bfffde Bug 1667265. Remove nsIPrintSettingsService.globalPrintSettings. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D91366
2020-09-30 12:25:02 +00:00
Razvan Maries 5c478dca3c Backed out changeset 736e01530c6d (bug 1667491) for perma failures on 1667491.html. CLOSED TREE 2020-09-30 06:08:24 +03:00
Emilio Cobos Álvarez 3151472696 Bug 1665447 - Fix BoxToRect when the "relative to" frame is not an ancestor. r=dholbert,mstange
Right now the BoxToRect callback assumes that when it gets a
RECTS_ACCOUNT_FOR_TRANSFORMS flag, the "relative to" is an ancestor.

This holds for all the callers of GetAllInFlowRectsUnion except for [1],
which was introduced in bug 1581876, because they pass
GetContainingBlockForClientRect (that is, the root frame) as the root.

But that caller passes target, so IB split continuations or such would
get two siblings as the from/to frames, messing up the bounds.

An alternative would be to not pass the RECTS_ACCOUNT_FOR_TRANSFORMS
flag for that call (as it's computing a rect relative to self, but I
don't think that'd be quite correct in the presence of fragmentation
with transformed containers (if that's possible at all? would need to
think harder...)), but it seems like the API should just behave more
generally, or assert otherwise.

To that effect, this patch adds an assertion to TransformRectToAncestor
that would've caught this bug (though there are some pre-existing
violations, so we'll fix them in another bug).

[1]: https://searchfox.org/mozilla-central/rev/dfd9c0f72f9765bd4a187444e0c1e19e8834a506/dom/base/DOMIntersectionObserver.cpp#340-341

Differential Revision: https://phabricator.services.mozilla.com/D91883
2020-09-30 02:25:34 +00:00
Ting-Yu Lin 5463efda57 Bug 1660122 Part 6 - Move static function IsXULDisplayType() into nsStyleDisplay. r=emilio
Also rename it to IsXULDisplayStyle() because nsStyleDisplay often has
"Style"-suffix for related helpers.

(Note: IsXULDisplayType() is not used in GetAspectRatio() in the final
revision, but this part is still a good simplification.)

Differential Revision: https://phabricator.services.mozilla.com/D91228
2020-09-29 22:32:57 +00:00
Ting-Yu Lin e0c2b95d53 Bug 1660122 Part 5 - Add nsIFrame::GetAspectRatio() skeleton, and adapt existing callers. r=emilio
For now, GetAspectRatio() is just an alias for GetIntrinicRatio(). In
Part 7, we're going to have GetAspectRatio() consider aspect-ratio
property so that each replaced elements only need to report their
intrinsic ratio via GetIntrinicRatio(). Non-replaced element can also
call GetAspectRatio() to get the ratio suitable to calculate layout
size.

As of this patch, all the replaced elements'
GetIntrinsicRatio() (including nsImageFrame::mIntrinsicRatio) consider
aspect-ratio properties (added in bug 1639963). This is wrong, because
it affects replaced element's content ratio. So we adapt only callers
[1] involving the computation of the frame's external sizes to retain
the behavior after Part 7.

This change shouldn't change behavior.

[1] Exceptions include 1) a caller in nsIFrame::ComputeSize() checking
the frame has no intrinsic ratio; 2) other frame classes implementing
nsIFrame::GetIntrinsicRatio() by calling their parent's
GetIntrinicRatio(). nsSubDocumentFrame::GetIntrinicRatio() is an
example.

Differential Revision: https://phabricator.services.mozilla.com/D91227
2020-09-29 22:32:50 +00:00
Kris Maglione f51ed03f42 Bug 1667491: Fix null pointer deref. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D91834
2020-09-29 20:31:05 +00:00
Kartikaya Gupta f4c6658819 Bug 1667863 - Replace AppendToString of SizeTyped with ostream usage. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D91655
2020-09-29 11:54:33 +00:00
Kartikaya Gupta 5590eaf278 Bug 1667863 - Replace AppendToString for MarginTyped with ostream. r=mattwoodrow
Depends on D91653

Differential Revision: https://phabricator.services.mozilla.com/D91654
2020-09-29 02:57:17 +00:00
Edgar Chen 3af8ce6d7a Bug 1667081 - Part 1: Replace usage of nsIFocusManager with nsFocusManager; r=hsivonen
This patch is bascially done by:
perl -p -i -e "s/nsIFocusManager\* /nsFocusManager* /g;" $( find . -name *.cpp )
perl -p -i -e "s/nsCOMPtr<nsIFocusManager>/RefPtr<nsFocusManager>/g;" $( find . -name *.cpp )

Differential Revision: https://phabricator.services.mozilla.com/D91287
2020-09-29 07:21:09 +00:00
Bogdan Tara 8f6c53bdf5 Backed out 9 changesets (bug 1667081) for assertion failure on nsFocusManager CLOSED TREE
Backed out changeset 156ab3eba505 (bug 1667081)
Backed out changeset 2e37f347082c (bug 1667081)
Backed out changeset 8f59cef879ae (bug 1667081)
Backed out changeset 1298ff140218 (bug 1667081)
Backed out changeset 91342c822425 (bug 1667081)
Backed out changeset aafb1878c590 (bug 1667081)
Backed out changeset 2252e975f0d7 (bug 1667081)
Backed out changeset c3bac5f407d2 (bug 1667081)
Backed out changeset b1e6e81396ae (bug 1667081)
2020-09-28 20:02:52 +03:00
Edgar Chen 6abd74544d Bug 1667081 - Part 1: Replace usage of nsIFocusManager with nsFocusManager; r=hsivonen
This patch is bascially done by:
perl -p -i -e "s/nsIFocusManager\* /nsFocusManager* /g;" $( find . -name *.cpp )
perl -p -i -e "s/nsCOMPtr<nsIFocusManager>/RefPtr<nsFocusManager>/g;" $( find . -name *.cpp )

Differential Revision: https://phabricator.services.mozilla.com/D91287
2020-09-28 14:04:12 +00:00
Olli Pettay 97778cf44a Bug 1667449 - Hide fission.sessionHistoryInParent pref getter behind a function r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D91462
2020-09-28 12:01:12 +00:00
Kartikaya Gupta bf06857e84 Bug 1667656 - Replace AppendToString of nsRegion with ostream usage. r=mattwoodrow
Apparently a bunch of Stringify(nsRect) sites were getting converted to
Stringify(nsRegion(nsRect)) due to the the nsRegion implicit constructor, so
this updates those too.

Depends on D91524

Differential Revision: https://phabricator.services.mozilla.com/D91525
2020-09-28 01:14:00 +00:00
Butkovits Atila 670e13b51d Backed out changeset 8aecf9b4bdc4 (bug 1656689) for causing high failure rate on test_scroll_space_no_range_overflow_scroll.html. CLOSED TREE 2020-09-27 06:24:01 +03:00
Timothy Nikkel 007832c73e Bug 1656689. Use GetAvailableScrollingDirectionsForUserInputEvents in nsLayoutUtils::GetNearestScrollableFrameForDirection. r=kats
Keyboard arrow key scrolls go through PresShell::ScrollLine/ScrollCharacter. When these look for a scroll frame they eventually end up at nsLayoutUtils::GetNearestScrollableFrameForDirection.

nsLayoutUtils::GetNearestScrollableFrameForDirection does two things wrong when determining if the scroll frame is scrollable by apz: it disallows overflow hidden scrolling, and it uses GetAvailableScrollingDirections which is based on the layout scroll range.

Using GetAvailableScrollingDirectionsForUserInputEvents takes into account both of these factors.

GetNearestScrollableFrameForDirection is used by:
-gfx/layers/apz/src/FocusTarget.cpp
-EventStateManager::DoContentCommandScrollEvent
-PageMove, ScrollPage, ScrollLine, ScrollCharacter, CompleteScroll of PresShell
All of these should want the more apz aware function.

Differential Revision: https://phabricator.services.mozilla.com/D90498
2020-09-25 09:32:29 +00:00
Timothy Nikkel ea78ff78a9 Bug 1667469. Fix layout/base/tests/test_scroll_space_no_range_overflow_scroll.html to flush out any scrolling that happens as a result of focusing an element before doing scroll related testing. r=kats
Applying the same kinds of fixes as in

https://hg.mozilla.org/integration/autoland/rev/30cd33572b3d

including the followup fix to that

https://hg.mozilla.org/mozilla-central/rev/f51b6c3688a4

Differential Revision: https://phabricator.services.mozilla.com/D91475
2020-09-26 20:19:24 +00:00
Botond Ballo 948cec1b06 Bug 1667594 - Avoid including nsLayoutUtils.h in nsContainerFrame.h. r=emilio
nsContainerFrame.h was only using the enum nsLayoutUtils::IntrinsicISizeType,
which this patch moves to LayoutConstants.h instead.

Depends on D91505

Differential Revision: https://phabricator.services.mozilla.com/D91506
2020-09-26 18:19:14 +00:00
Botond Ballo 4e4819d795 Bug 1667594 - Avoid including nsLayoutUtils.h in nsIFrame.h. r=emilio
The only thing in nsIFrame.h that was using it was the implementation
of a templated method, which could be moved to nsIFrameInlines.h.

Depends on D91504

Differential Revision: https://phabricator.services.mozilla.com/D91505
2020-09-26 18:18:11 +00:00
Botond Ballo 1976364433 Bug 1667594 - Avoid including nsLayoutUtils.h from various headers. r=kats
This patch covers thw low-hanging fruit: headers that either don't use
nsLayoutUtils.h at all, or where only method implementations that can
easily be moved to the .cpp file use it.

Differential Revision: https://phabricator.services.mozilla.com/D91504
2020-09-26 17:55:00 +00:00
Botond Ballo 90420069cc Bug 1667475 - Remove FrameMetrics::mDisplayPortMargins. r=kats
The two existing uses were inconsistent in whether the margins
were relative to the visual viewport or the layout viewport.

We could fix this, but it turns out both uses are readily
refactored to not need the field, so this patch removes the
field.

Differential Revision: https://phabricator.services.mozilla.com/D91479
2020-09-26 17:44:03 +00:00
Markus Stange 1619a5f700 Bug 1666617 - Fix a typo in the word viewport. r=smaug
Depends on D91379

Differential Revision: https://phabricator.services.mozilla.com/D91380
2020-09-25 09:24:50 +00:00
Markus Stange cfe587cb72 Bug 1666617 - Add refresh observer descriptions to the RefreshDriverTick markers. r=smaug
Depends on D91082

Differential Revision: https://phabricator.services.mozilla.com/D91379
2020-09-25 11:42:35 +00:00
Markus Stange 41c70bcd59 Bug 1666617 - Add an observer description argument to AddRefreshObserver. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D91082
2020-09-25 02:36:29 +00:00
Florian Quèze 84f14af9e6 Bug 1666617 - Add RefreshObserver profiler markers, r=smaug
This creates a marker that starts when an observer is added and ends when it is removed.
If there are multiple observers at the same time, their markers overlap.

The current profiler markers API only lets us insert the marker once we know
both the start and the end timestamp. This means that, if a profile is captured
in the middle of a refresh observer's observation period, there will not be a
marker for that observer in the profile. This can be improved once we have a way
to emit separate start and end markers and a way to associate the correct markers
with each other (bug 1661114).

Differential Revision: https://phabricator.services.mozilla.com/D91059
2020-09-25 11:51:06 +00:00
Markus Stange a19c37ae9f Bug 1666617 - Move kFlushTypeNames into FlushType.h so that it can be used from other files. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D91078
2020-09-23 12:17:20 +00:00
Emilio Cobos Álvarez 2c3d952fc7 Bug 1667342 - Make the "deferred window close" keep making sense after bug 1636728. r=smaug
This was only being checked on OnDonePrinting() which isn't called in
the original docshell. Move it to the window because we don't need to
care about document viewers getting closed during print operations,
they're top level browsers that don't run script.

Differential Revision: https://phabricator.services.mozilla.com/D91416
2020-09-25 13:39:01 +00:00
Kartikaya Gupta cb1b7eb76c Bug 1667176 - Use ostream operator instead of AppendToString for nsPoint. r=mattwoodrow
Depends on D91338

Differential Revision: https://phabricator.services.mozilla.com/D91339
2020-09-25 08:57:24 +00:00
Miko Mynttinen 093f7dcfb5 Bug 1619370 - Return the rect from BrowserChild::GetVisibleRect() in app units r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D91272
2020-09-25 09:38:06 +00:00
Csoregi Natalia 035dfdea2b Backed out changeset 66c2fb744703 (bug 1656689) for causing Bug 1667275. CLOSED TREE 2020-09-25 12:24:03 +03:00
Peter Van der Beken b14a77101d Bug 1666881 - Make fission.sessionHistoryInParent require a restart when switching. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D91260
2020-09-25 09:03:58 +00:00
Timothy Nikkel 4de9f9d9b7 Bug 1656689. Use GetAvailableScrollingDirectionsForUserInputEvents in nsLayoutUtils::GetNearestScrollableFrameForDirection. r=kats
Keyboard arrow key scrolls go through PresShell::ScrollLine/ScrollCharacter. When these look for a scroll frame they eventually end up at nsLayoutUtils::GetNearestScrollableFrameForDirection.

nsLayoutUtils::GetNearestScrollableFrameForDirection does two things wrong when determining if the scroll frame is scrollable by apz: it disallows overflow hidden scrolling, and it uses GetAvailableScrollingDirections which is based on the layout scroll range.

Using GetAvailableScrollingDirectionsForUserInputEvents takes into account both of these factors.

GetNearestScrollableFrameForDirection is used by:
-gfx/layers/apz/src/FocusTarget.cpp
-EventStateManager::DoContentCommandScrollEvent
-PageMove, ScrollPage, ScrollLine, ScrollCharacter, CompleteScroll of PresShell
All of these should want the more apz aware function.

Differential Revision: https://phabricator.services.mozilla.com/D90498
2020-09-24 13:49:28 +00:00
Timothy Nikkel 066a6ba348 Bug 1666991. Remove PresShell::GetNearestScrollableFrame. r=kats
The current formulation is inconsistent. If you call it with ScrollableDirection::Either it goes into nsLayoutUtils::GetNearestScrollableFrame which will return the first scroll frame with a non-hidden overflow. If you call it with any other ScrollableDirection it calls nsLayoutUtils::GetNearestScrollableFrameForDirection which returns the first scrollframe it finds that has non-hidden overflow AND has at least one dev pixel of scroll range.

So remove that function and call nsLayoutUtils::GetNearestScrollableFrameForDirection directly. This is a slight change of behaviour but it seems desirable for all callers.

Differential Revision: https://phabricator.services.mozilla.com/D91236
2020-09-24 13:44:54 +00:00
Mihai Alexandru Michis 8b9238686c Backed out changeset 88337b6e4e3e (bug 1666881) for causing failures regarding the fission.autostart pref.
CLOSED TREE
2020-09-24 15:41:33 +03:00
Peter Van der Beken 55fdbb4384 Bug 1666881 - Make fission.sessionHistoryInParent require a restart when switching. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D91260
2020-09-24 11:14:51 +00:00
Timothy Nikkel 093f97fd96 Bug 1665323. Make sure the visual viewport offset always takes on valid values. r=kats
The problems that it causes that are referred to in the patch is that we use the vvoffset and GetScrollRangeForUserInputEvents to compute the scrollbar cur, min, and max attributes. If we have a non-zero vvoffset when we are zooomed backed out, GetScrollRangeForUserInputEvents will be a zero range and so the cur attribute (non-zero)  will be larger than the max attribute (0).

This then causes nsSliderFrame::AttributeChanged to call ScrollByWhole at

https://searchfox.org/mozilla-central/rev/30e70f2fe80c97bfbfcd975e68538cefd7f58b2a/layout/xul/nsSliderFrame.cpp#204

Which we definitely do not want.

Differential Revision: https://phabricator.services.mozilla.com/D90372
2020-09-24 02:08:07 +00:00
Bogdan Tara d88ac68590 Backed out changeset 1bfa83880712 (bug 1662839) for browser_disable_author_style_oop.js failures CLOSED TREE 2020-09-24 05:55:25 +03:00
Cameron McCormack fc16d8bc27 Bug 1662839 - Set author style disabled state correctly on newly created iframes. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D90953
2020-09-24 01:24:57 +00:00
Stephen A Pohl 1b02356c85 Bug 1661272: Only adjust default font sizes for buttons, lists and fields when non-native theming is enabled. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D91194
2020-09-23 22:25:23 +00:00
Timothy Nikkel b40f06a081 Bug 1665332. Fetch the value of mZoomableByAPZ in the ScrollFrameHelper constructor so it is always correct. r=kats
Otherwise the only time it gets set is when the ZoomConstraintsClient specifically sets it in response to one of the things that can change it. But if the scroll frame gets reconstructed and one of those things don't happen it will be wrong.

This shows up with desktop zooming scrollbars because we check mZoomableByAPZ (or WantAsyncScroll()) before we use the apz scroll path in ScrollFrameHelper::ScrollBy().

Differential Revision: https://phabricator.services.mozilla.com/D90384
2020-09-22 11:21:39 +00:00
Simon Giesecke de7bab0f06 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Timothy Nikkel 75d2f29087 Bug 1665332. Make sure to initialize all fields of the ZoomConstraints to the correct values on ZoomConstraintsClient in all cases. r=kats
The default constructor initializes the two bools to true.

Differential Revision: https://phabricator.services.mozilla.com/D91103
2020-09-23 15:04:07 +00:00
Olli Pettay 8f040d69a3 Bug 1666610 - [BFCache] disable test_bug607529.html because it uses bfcache, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D91052
2020-09-23 13:51:27 +00:00
Hiroyuki Ikezoe 4ea0528441 Bug 1659227 - Handle SVG{Inner,Outer}Frame as the clip frame for partial pre-render. r=heycam,botond
In SVG frame tree SVG{Inner,Outer}Frame is normally not scrollable but clips
descendants, thus nsLayoutUtils::GetNearestScrollableFrame is not able to find
the clip/scroll frame.  So in this change, we introduce
GetNearestOverflowClipFrame which is a similar function to
GetNearestScrollableFrame but it also checks whether the frame is SVGInnerFrame
or SVGOuterFrame which is clipping the given nsIFrame during walking up the
frame tree.

In this change we also change the logic to get the clip/scroll frame and the scroll
id as follows;

1) Get the nearest overflow clip frame in the same document
2) Use the root frame if there is no clip frame
3) Then try to find the scroll id if the clip frame is asynchronously scrollable

so that it becomes clearer before.  It's still messy though.

Differential Revision: https://phabricator.services.mozilla.com/D90647
2020-09-23 06:37:31 +00:00
Kartikaya Gupta 07ba9a1c0e Bug 1637908 - Add some tests for the touchable heuristic to the existing event radius tests. r=snorp
Depends on D91027

Differential Revision: https://phabricator.services.mozilla.com/D91028
2020-09-22 20:39:27 +00:00
Kartikaya Gupta bc09af0d93 Bug 1637908 - Introduce a touchable heuristic and use it for retargeting touch events. r=snorp
The existing heuristics in GetClickableAncestor have evolved over time to be
quite specific to mouse/click events, because those are the ones that we have
enabled by default. The heuristics we want for touch events are different and
should generally be very conservative, because we almost never want to retarget
the raw touch events. This patch introduces a new GetTouchableAncestor
function that implements this new conservative heuristic function and uses it
for determining the retargeting destination for touch events.

Differential Revision: https://phabricator.services.mozilla.com/D91027
2020-09-22 20:40:06 +00:00
Kartikaya Gupta 30be708fe0 Bug 1637908 - Minor cleanup. r=snorp
Depends on D91025

Differential Revision: https://phabricator.services.mozilla.com/D91026
2020-09-22 20:42:52 +00:00
Kartikaya Gupta 81e7ed672a Bug 1637908 - Move the clickableAncestor computation further down. r=snorp
There's a few early-return conditions where we don't need to do this computation
at all. So this patch just moves the computation to after the early-returns. No
functional changes intended.

Differential Revision: https://phabricator.services.mozilla.com/D91025
2020-09-22 20:43:02 +00:00
Razvan Maries 3c91b4555b Backed out changeset bb1437fa93d0 (bug 1665332) for perma failures on ClipManager.cpp. CLOSED TREE 2020-09-22 14:10:37 +03:00
Timothy Nikkel 5039021d77 Bug 1665332. Fetch the value of mZoomableByAPZ in the ScrollFrameHelper constructor so it is always correct. r=kats
Otherwise the only time it gets set is when the ZoomConstraintsClient specifically sets it in response to one of the things that can change it. But if the scroll frame gets reconstructed and one of those things don't happen it will be wrong.

This shows up with desktop zooming scrollbars because we check mZoomableByAPZ (or WantAsyncScroll()) before we use the apz scroll path in ScrollFrameHelper::ScrollBy().

Differential Revision: https://phabricator.services.mozilla.com/D90384
2020-09-22 04:52:18 +00:00
Timothy Nikkel bf1baf1293 Bug 1665332. Have ZoomConstraintsClient keep it's ZoomConstraints around so it can be queried later. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D90383
2020-09-22 04:50:54 +00:00
Kris Maglione 0ae5bf64c5 Bug 1655866: Part 4 - Handle OOP beforeunload listeners in PermitUnload(). r=nika
Differential Revision: https://phabricator.services.mozilla.com/D88317
2020-09-21 22:41:01 +00:00
Kris Maglione aa7e3fbdb4 Bug 1655866: Part 3 - Refactor PermitUnload to simplify handling OOP frames. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D88316
2020-09-21 22:40:53 +00:00
Bas Schouten ab620ae50d Bug 1661881 - Part 4: Prevent additional event loop churn for NotifyVsync when in the child process. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D90863
2020-09-21 14:00:07 +00:00
Sylvestre Ledru ec8859e69e Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D90793
2020-09-20 10:14:09 +00:00
Jonathan Kew 039d64f49f Bug 1665904 - Rename paperName to paperId for better clarity (front-end). r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D90791
2020-09-20 14:09:59 +00:00
Kartikaya Gupta 0a8f544bee Bug 1664626 - Delete now-unused code. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D90724
2020-09-19 00:36:20 +00:00
Botond Ballo 95ba24f326 Bug 1666022 - Make nsLayoutUtils::AsyncPanZoomEnabled() const. r=hiro
The patch also adds a const version of GetDisplayRootFrame().

Differential Revision: https://phabricator.services.mozilla.com/D90754
2020-09-18 20:38:50 +00:00
Kartikaya Gupta fb97ec2e40 Bug 1654836 - Redo how we expand displayport alignment for webrender. r=nical
The displayport is aligned to screen pixels by an alignment number; there was
code to increase that alignment number for the WebRender codepath. This is
desirable because it causes the displayport to move less frequently, which
provides better performance characteristics with WebRender. However, the
way that was implemented, it was possible for the aligned displayport to not
completely enclose the unaligned displayport, which could then result in
perma-checkerboarding.

This patch removes that code and replaces it with a simpler approach to scale
up the existing alignment number by a factor based on the size of the scroller's
base rect (roughly how much of the scroller is visible to the user).

This does make the displayports larger, more so for scrollers with more visible
area. This has negative performance implications, so we mitigate that by also
scaling down the displayport margin multiplier by the same scaling factor. This
isn't perfect, but seems to work well enough in practice.

Differential Revision: https://phabricator.services.mozilla.com/D90503
2020-09-18 12:40:08 +00:00
Kartikaya Gupta ff619cad8f Bug 1654836 - Add a bunch of verbose-level displayport logging. r=nical
Differential Revision: https://phabricator.services.mozilla.com/D90499
2020-09-18 08:05:50 +00:00
Kris Maglione a3b66dd82c Bug 1662841: Remove Fission-incompatible `nsDocumentViewer::AppendSubtree`. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D90615
2020-09-17 22:43:47 +00:00
Olli Pettay 3f30b17ab9 Bug 1665165 - Disable some bfcache tests on Fission, r=jesup
Differential Revision: https://phabricator.services.mozilla.com/D90303
2020-09-17 17:36:24 +00:00
Dorel Luca 72ef712fd0 Backed out 10 changesets (bug 1518999) for GeckoView failures in PanZoomControllerTest.scroll. CLOSED TREE
Backed out changeset 7b5bdd071d05 (bug 1518999)
Backed out changeset 401e488734dd (bug 1518999)
Backed out changeset c13e51e17329 (bug 1518999)
Backed out changeset 2a2d67ba15b8 (bug 1518999)
Backed out changeset 3d4d84003227 (bug 1518999)
Backed out changeset 972731762965 (bug 1518999)
Backed out changeset f21b13582dad (bug 1518999)
Backed out changeset 13a4c749a802 (bug 1518999)
Backed out changeset 5a6cea5fd344 (bug 1518999)
Backed out changeset c3bb552e76a3 (bug 1518999)
2020-09-17 02:58:34 +03:00
Emilio Cobos Álvarez 567d300760 Bug 1663826 - Keep freezing navigation during window.print() for compat. r=smaug
This broke in bug 1636728 because we started setting the bit in the
cloned docshell rather than the original one.

Behavior in other browsers seems to be a bit all over the place, but for
now keeping our behavior during window.print() seems sane.

Differential Revision: https://phabricator.services.mozilla.com/D90456
2020-09-16 22:55:19 +00:00
Timothy Nikkel bd79bff909 Bug 1665507. Back out changeset 25760b432ecb from bug 1663562. The workaround is no longer needed.
Differential Revision: https://phabricator.services.mozilla.com/D90490
2020-09-16 22:30:01 +00:00
Sean Feng 3aaaa826c0 Bug 1518999 - Update ContentfulPaint algorithm to follow the spec r=emilio
This patch includes a couple of changes.
1) Notify contentful paint only during refresh driver ticks.
2) Not only the root document, sub document should also have their own
   contentful paint entry.
3) Consider invisible text as contentful as well.

Differential Revision: https://phabricator.services.mozilla.com/D89498
2020-09-14 18:47:34 +00:00
Sean Feng 11a2849f32 Bug 1518999 - Implement PerformancePaintTiming for FirstContentfulPaint r=smaug,mstange
Spec: https://w3c.github.io/paint-timing/#sec-PerformancePaintTiming
We only support FirstContentfulPaint at the moment.

Differential Revision: https://phabricator.services.mozilla.com/D66463
2020-09-14 15:13:18 +00:00
Andreas Farre f9f96d23ca Bug 1662410 - Part 1: Fix usage of ChildSHistory.legacySHistory . r=peterv
ChildSHistory.legacySHistory isn't valid for content processes when
session history in the parent is enabled. We try to fix this by either
delegating to the parent by IPC or move the implementation partially
or as a whole to the parent.

Differential Revision: https://phabricator.services.mozilla.com/D89353
2020-09-16 14:51:01 +00:00
Emilio Cobos Álvarez 706ceffb4b Bug 1665125 - Make print background settings infallible. r=bobowen
This makes callers simpler.

Differential Revision: https://phabricator.services.mozilla.com/D90285
2020-09-16 11:21:41 +00:00
Emilio Cobos Álvarez ba7373413f Bug 1665064 - Honor print background image settings on WebRender too. r=kats,jwatt CLOSED TREE
We usually suppress background images in
nsCSSRendering::PaintStyleImageLayerWithSC, but that codepath isn't hit
by WebRender, so instead do it during display list building, the same
way we suppress background colors.

Differential Revision: https://phabricator.services.mozilla.com/D90278
2020-09-15 16:26:05 +00:00
Narcis Beleuzu 38f63aa9b6 Backed out changeset 0834b634ea07 (bug 1665125) for reftest failures. CLOSED TREE 2020-09-15 23:32:11 +03:00
Barret Rennie 2e9f3011e1 Bug 1663762 - Add probes to measure input event latency during load correlated with preload r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D90208
2020-09-15 17:43:10 +00:00
Barret Rennie 099ef90095 Bug 1663760 - Add probes to measure TTFI correlated with preload r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D90183
2020-09-15 16:42:54 +00:00
Narcis Beleuzu 746b4430d0 Backed out changeset a572a639204f (bug 1665064) for reftest failures. CLOSED TREE 2020-09-15 21:33:06 +03:00
Emilio Cobos Álvarez f8330284c5 Bug 1665064 - Honor print background image settings on WebRender too. r=kats,jwatt
We usually suppress background images in
nsCSSRendering::PaintStyleImageLayerWithSC, but that codepath isn't hit
by WebRender, so instead do it during display list building, the same
way we suppress background colors.

Differential Revision: https://phabricator.services.mozilla.com/D90278
2020-09-15 16:26:05 +00:00
Emilio Cobos Álvarez f3927b672a Bug 1665125 - Make print background settings infallible. r=bobowen
This makes callers simpler.

Differential Revision: https://phabricator.services.mozilla.com/D90285
2020-09-15 16:19:20 +00:00
Timothy Nikkel 8646146723 Bug 1663562. Don't call MaybeReflowForInflationScreenSizeChange with webrender when running mochitests in dom/base/test to work around webrender bug for now. r=botond
This is sad, but seems like the least bad option to enable desktop zooming scrollbars reasonable soon.

Differential Revision: https://phabricator.services.mozilla.com/D90181
2020-09-15 04:33:49 +00:00
Timothy Nikkel 9a661331df Bug 1663562. Call MaybeReflowForInflationScreenSizeChange when any prefs that could affect font inflation change. r=kats
When I start setting the pref ui.useOverlayScrollbars in bug 1663537 we trigger this assert

```
###!!! ASSERTION: can't mark frame dirty during reflow: '!mIsReflowing', file /builds/worker/checkouts/gecko/layout/base/PresShell.cpp, line 2677
#01: mozilla::PresShell::MaybeReflowForInflationScreenSizeChange() [layout/base/PresShell.cpp:11148]
#02: mozilla::PresShell::CompleteChangeToVisualViewportSize() [layout/base/PresShell.cpp:11177]
#03: MobileViewportManager::UpdateVisualViewportSize(mozilla::gfx::IntSizeTyped<mozilla::ScreenPixel> const&, mozilla::gfx::ScaleFactor<mozilla::CSSPixel, mozilla::ScreenPixel> const&) [layout/base/MobileViewportManager.cpp:504]
#04: MobileViewportManager::RefreshVisualViewportSize() [layout/base/MobileViewportManager.cpp:557]
#05: nsHTMLScrollFrame::Reflow(nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, nsReflowStatus&) [layout/generic/nsGfxScrollFrame.cpp:1340]
#06: nsContainerFrame::ReflowChild(nsIFrame*, nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, int, int, nsIFrame::ReflowChildFlags, nsReflowStatus&, nsOverflowContinuationTracker*) [layout/generic/nsContainerFrame.cpp:1115]
#07: mozilla::ViewportFrame::Reflow(nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, nsReflowStatus&) [layout/generic/ViewportFrame.cpp:297]
#08: mozilla::PresShell::DoReflow(nsIFrame*, bool, mozilla::OverflowChangedTracker*) [layout/base/PresShell.cpp:9650]
#09: mozilla::PresShell::ProcessReflowCommands(bool) [layout/base/PresShell.cpp:9816]
#10: mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) [layout/base/PresShell.cpp:4239]
#11: nsRefreshDriver::Tick(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp) [layout/base/nsRefreshDriver.cpp:2139]
```

This happens after the test is finish when we unset the ui.useOverlayScrollbars pref which (I'm assuming because it must) causes reflow. When running a font-inflation related reftest we also unset the font inflation related prefs that were specified in the reftest.list file. This causes font-inflation to go from enabled to disabled and we detect that for the first time while reflowing the scroll frame.

Instead we should reflow when any pref that could affect font inflation is changed. I scanned the font-inflation code in PresShell and Document::GetViewportInfo for prefs are consulted, but I didn't go a super exhaustive search.

Differential Revision: https://phabricator.services.mozilla.com/D89409
2020-09-15 04:33:38 +00:00
Mihai Alexandru Michis a64de8bf5f Backed out 2 changesets (bug 1663562) for causing bustages in nsPresContext.cpp
CLOSED TREE

Backed out changeset 67cbb5422dbc (bug 1663562)
Backed out changeset 574709176152 (bug 1663562)
2020-09-15 07:22:29 +03:00
Timothy Nikkel 147ca18b99 Bug 1663562. Don't call MaybeReflowForInflationScreenSizeChange with webrender when running mochitests in dom/base/test to work around webrender bug for now. r=botond
This is sad, but seems like the least bad option to enable desktop zooming scrollbars reasonable soon.

Depends on D89409

Differential Revision: https://phabricator.services.mozilla.com/D90181
2020-09-15 04:07:21 +00:00
Timothy Nikkel d1a2ce8468 Bug 1663562. Call MaybeReflowForInflationScreenSizeChange when any prefs that could affect font inflation change. r=kats
When I start setting the pref ui.useOverlayScrollbars in bug 1663537 we trigger this assert

```
###!!! ASSERTION: can't mark frame dirty during reflow: '!mIsReflowing', file /builds/worker/checkouts/gecko/layout/base/PresShell.cpp, line 2677
#01: mozilla::PresShell::MaybeReflowForInflationScreenSizeChange() [layout/base/PresShell.cpp:11148]
#02: mozilla::PresShell::CompleteChangeToVisualViewportSize() [layout/base/PresShell.cpp:11177]
#03: MobileViewportManager::UpdateVisualViewportSize(mozilla::gfx::IntSizeTyped<mozilla::ScreenPixel> const&, mozilla::gfx::ScaleFactor<mozilla::CSSPixel, mozilla::ScreenPixel> const&) [layout/base/MobileViewportManager.cpp:504]
#04: MobileViewportManager::RefreshVisualViewportSize() [layout/base/MobileViewportManager.cpp:557]
#05: nsHTMLScrollFrame::Reflow(nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, nsReflowStatus&) [layout/generic/nsGfxScrollFrame.cpp:1340]
#06: nsContainerFrame::ReflowChild(nsIFrame*, nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, int, int, nsIFrame::ReflowChildFlags, nsReflowStatus&, nsOverflowContinuationTracker*) [layout/generic/nsContainerFrame.cpp:1115]
#07: mozilla::ViewportFrame::Reflow(nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, nsReflowStatus&) [layout/generic/ViewportFrame.cpp:297]
#08: mozilla::PresShell::DoReflow(nsIFrame*, bool, mozilla::OverflowChangedTracker*) [layout/base/PresShell.cpp:9650]
#09: mozilla::PresShell::ProcessReflowCommands(bool) [layout/base/PresShell.cpp:9816]
#10: mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) [layout/base/PresShell.cpp:4239]
#11: nsRefreshDriver::Tick(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp) [layout/base/nsRefreshDriver.cpp:2139]
```

This happens after the test is finish when we unset the ui.useOverlayScrollbars pref which (I'm assuming because it must) causes reflow. When running a font-inflation related reftest we also unset the font inflation related prefs that were specified in the reftest.list file. This causes font-inflation to go from enabled to disabled and we detect that for the first time while reflowing the scroll frame.

Instead we should reflow when any pref that could affect font inflation is changed. I scanned the font-inflation code in PresShell and Document::GetViewportInfo for prefs are consulted, but I didn't go a super exhaustive search.

Differential Revision: https://phabricator.services.mozilla.com/D89409
2020-09-14 22:19:09 +00:00
Bas Schouten 343a7ab31c Bug 1661881 - Part 3: Make RefreshDriver's tick call SetInputHandlingStartTime directly. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D89536
2020-09-14 12:13:13 +00:00
Timothy Nikkel 30f528e804 Bug 1664446. Properly wait to make sure any potential scroll events get fired in several tests. r=kats
Doing rAF rAF flushApzRepaints is not enough to make sure that any potential scroll events are sent to content. The reason is that if the apz repaint request causes us to do scrolling on the main thread then the scrolling will be finished after flushApzRepaints, and the scroll event will be pending, but it's not sent until the next refresh driver tick. So we need to do at least one rAF after flushApzRepaints.

Differential Revision: https://phabricator.services.mozilla.com/D90035
2020-09-13 20:21:11 +00:00
Emilio Cobos Álvarez 948fa5c6d2 Bug 1664156 - Remove -moz-suppressed. r=edgar
Per spec we shouldn't behave differently depending on how we blocked the
image/object/etc.

This may have made sense in the past when ad blockers were implemented
via nsIContentPolicy, but I think nowadays it doesn't make sense, and
showing fallback is preferred.

There's a couple extra cleanups we can do after this lands, like
removing HTMLImageElement.imageBlockingStatus and simplifying a bit that
code. But I'll do that in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D89912
2020-09-13 11:33:13 +00:00
Noemi Erli 733e3b440c Backed out changeset 64eb902728bc (bug 1664156) for causing mochitest failures in test_meta_csp_self.html CLOSED TREE 2020-09-12 22:56:18 +03:00
Emilio Cobos Álvarez 4b18c556e4 Bug 1664156 - Remove -moz-suppressed. r=edgar
Per spec we shouldn't behave differently depending on how we blocked the
image/object/etc.

This may have made sense in the past when ad blockers were implemented
via nsIContentPolicy, but I think nowadays it doesn't make sense, and
showing fallback is preferred.

There's a couple extra cleanups we can do after this lands, like
removing HTMLImageElement.imageBlockingStatus and simplifying a bit that
code. But I'll do that in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D89912
2020-09-12 17:39:18 +00:00
Kartikaya Gupta 8b10d15d15 Bug 1662014 - Remove unused fields/APIs. r=botond,tnikkel
These things are all unused now.

Differential Revision: https://phabricator.services.mozilla.com/D88750
2020-09-12 13:06:39 +00:00
Kartikaya Gupta 378887e276 Bug 1662013 - Introduce a ScrollPositionUpdate and plumb it in. r=tnikkel,botond
This adds a ScrollPositionUpdate class. Code in nsGfxScrollFrame creates
instances of these classes every time the scroll generation is incremented,
and saves them to an array. The array is sent in the scroll metadata to the
compositor as part of a paint transaction.

Currently this data is not used at all on the APZ side, and exists alongside
(independently of) the existing scroll fields, so this patch should not have
any functional effects.

Differential Revision: https://phabricator.services.mozilla.com/D88741
2020-09-12 13:05:53 +00:00
Emilio Cobos Álvarez 1ef2a5628a Bug 1664432 - Remove -moz-user-disabled. r=edgar
We treat it exactly the same as -moz-broken. The pseudo-class is not
exposed to content, so I don't think we have a reason to keep it around.

Differential Revision: https://phabricator.services.mozilla.com/D89904
2020-09-11 19:26:40 +00:00
Razvan Maries 8f97d6d022 Backed out changeset b5d0e150491e (bug 1661544) for perma failures on HTMLBody-ScrollArea_quirksmode.html. 2020-09-12 09:48:34 +03:00
Botond Ballo d5b3bf63f9 Bug 1661544 - Ensure initial viewport is computed before reporting innerWidth. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D88947
2020-09-09 21:14:31 +00:00
Ting-Yu Lin 8763701634 Bug 1663822 Part 6 - Convert the anonymous enum controlling ReflowInput's behavior into an EnumSet. r=dholbert
This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D89545
2020-09-11 17:59:21 +00:00
Ting-Yu Lin a11075f9e1 Bug 1663822 Part 3 - Move ComputeSizeFlags to LayoutConstants.h, and put it under mozilla namespace. r=dholbert
In the next part, I'm going to use ComputeSizeFlags as the arguments in
some ReflowInput's methods. Because nsIFrame.h includes ReflowInput.h,
to solve the circular dependency, ComputeSizeFlags needs to be moved to
somewhere else.

Also, revise the document for ComputeSizeFlag. The rest of the patch is
just dropping `nsIFrame::` and adding `mozilla::` as needed.

This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D89542
2020-09-11 18:32:08 +00:00
Timothy Nikkel 86ef6eea77 Bug 1663537. Fix various tests for desktop zooming scrollbars. r=kats
The test fixes all fell into the follow categories:

A) The test uses requestAnimationFrame to wait one frame and expects scrolling to be complete. With the desktop zooming scrollbars in order for the scrolling to show up on the main thread we need to send the scroll request to the compositor and then hear back from it via an apz repaint request (apz callback helper). Waiting on requestAnimationFrame will complete the first part, but not necessarily the second part. The fix is to wait for a scroll event.

B) Switching tests to wait for scroll events exposes another problem: the test can do things that cause a scroll in order to setup the test (and that may not be obvious that it causes a scroll) before actually proceeding to do the test and do something that causes a scroll and then checks for the scroll change of the second thing. Waiting for a requestAnimationFrame would include both those scrolls without desktop zooming scrollbars, but if we wait for a scroll event we will get the scroll event for the first thing which we are not interested in. So we need to make sure scroll events are cleared out before waiting for any scroll events. We do this by waiting two requestAnimationFrame's and waiting for apz to be flushed. We also use this when a test does something and it wants to test that scrolling is not performed.

The main thing that causes scrolling that may not be obvious: calling node.focus(). With stacks like:

from test_scroll_per_page.html

```
#01: mozilla::ScrollFrameHelper::CompleteAsyncScroll(nsRect const&, mozilla::ScrollOrigin) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x47d6cc0]
#02: mozilla::ScrollFrameHelper::ScrollToWithOrigin(nsPoint, mozilla::ScrollMode, mozilla::ScrollOrigin, nsRect const*, nsIScrollbarMediator::ScrollSnapMode) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x47d7732]
#03: mozilla::layout::ScrollAnchorContainer::ApplyAdjustments() [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4742913]
#04: mozilla::PresShell::FlushPendingScrollAnchorAdjustments() [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4650069]
#05: mozilla::PresShell::ProcessReflowCommands(bool) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x465742b]
#06: mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4656af8]
#07: mozilla::dom::Document::FlushPendingNotifications(mozilla::ChangesToFlush) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1a87d3c]
#08: mozilla::PresShell::ScrollContentIntoView(nsIContent*, mozilla::ScrollAxis, mozilla::ScrollAxis, mozilla::ScrollFlags) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4652b96]
#09: nsFocusManager::ScrollIntoView(mozilla::PresShell*, nsIContent*, unsigned int) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1bedd1c]
#10: nsFocusManager::Focus(nsPIDOMWindowOuter*, mozilla::dom::Element*, unsigned int, bool, bool, bool, bool, bool, nsIContent*) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be6be0]
#11: nsFocusManager::SetFocusInner(mozilla::dom::Element*, int, bool, bool) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be212f]
#12: nsFocusManager::SetFocus(mozilla::dom::Element*, unsigned int) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be32ba]
#13: mozilla::dom::Element::Focus(mozilla::dom::FocusOptions const&, mozilla::dom::CallerType, mozilla::ErrorResult&) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1aaf283]
#14: mozilla::dom::HTMLElement_Binding::focus(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x2d65f3b]
```

from editor/libeditor/tests/test_bug549262.html

```
#01: mozilla::ScrollFrameHelper::CompleteAsyncScroll(nsRect const&, mozilla::ScrollOrigin) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x47d6cc0]
#02: mozilla::ScrollFrameHelper::ScrollToWithOrigin(nsPoint, mozilla::ScrollMode, mozilla::ScrollOrigin, nsRect const*, nsIScrollbarMediator::ScrollSnapMode) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x47d7732]
#03: mozilla::PresShell::ScrollFrameRectIntoView(nsIFrame*, nsRect const&, mozilla::ScrollAxis, mozilla::ScrollAxis, mozilla::ScrollFlags) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x46541bc]
#04: mozilla::PresShell::DoScrollContentIntoView() [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4653776]
#05: mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4656b11]
#06: mozilla::dom::Document::FlushPendingNotifications(mozilla::ChangesToFlush) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1a87d3c]
#07: mozilla::PresShell::ScrollContentIntoView(nsIContent*, mozilla::ScrollAxis, mozilla::ScrollAxis, mozilla::ScrollFlags) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4652b96]
#08: nsFocusManager::ScrollIntoView(mozilla::PresShell*, nsIContent*, unsigned int) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1bedd1c]
#09: nsFocusManager::Focus(nsPIDOMWindowOuter*, mozilla::dom::Element*, unsigned int, bool, bool, bool, bool, bool, nsIContent*) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be6be0]
#10: nsFocusManager::SetFocusInner(mozilla::dom::Element*, int, bool, bool) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be212f]
#11: nsFocusManager::SetFocus(mozilla::dom::Element*, unsigned int) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be32ba]
#12: mozilla::dom::Element::Focus(mozilla::dom::FocusOptions const&, mozilla::dom::CallerType, mozilla::ErrorResult&) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1aaf283]
#13: mozilla::dom::HTMLElement_Binding::focus(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x2d65f3b]
```

C) Several tests use nsIDOMWindowUtils advanceTimeAndRefresh/restoreNormalRefresh and expect scrolling to be done after a call to advanceTimeAndRefresh. This is basically A), advanceTimeAndRefresh does a refresh driver tick but doesn't allow a repaint request to come back to the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D89403
2020-09-11 10:45:28 +00:00
Gerald Squelart a087b2df35 Bug 1663554 - Convert AUTO_PROFILER_TEXT_MARKER_... to new AUTO_PROFILER_MARKER_TEXT - r=gregtatum
The name `AUTO_PROFILER_MARKER_TEXT` is more consistent with the equivalent non-`AUTO` macro, and similarly arguments have been re-ordered to be the same, i.e.: Name, category&options, text.

The different macros with different argument sets can now be collapsed into one macro, and the optional arguments (timing, inner window id, backtrace) can easily be added to the `MarkerOptions` where needed.

As a bonus, a specific start time can optionally be provided at construction time.

Differential Revision: https://phabricator.services.mozilla.com/D89588
2020-09-11 00:42:51 +00:00
Narcis Beleuzu 57fd870466 Backed out 3 changesets (bug 1308104) for bustages on nsHttp.cpp . CLOSED TREE
Backed out changeset e78791b93526 (bug 1308104)
Backed out changeset b5c1875c11c7 (bug 1308104)
Backed out changeset 9c8433be706e (bug 1308104)
2020-09-10 22:43:25 +03:00
Nicklas Boman 7576762235 Bug 1308104 - Replace PL_strchr with a safer Gecko string class or function layout/ r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D89327
2020-09-10 17:38:55 +00:00
Emilio Cobos Álvarez c921f4ff34 Bug 1664227 - The default page margin should be at least the unwriteable section, but not added on top. r=jwatt
We were adding the unwriteable to the default margin. I was going to
consider not painting the headers / footers if they overlapped with the
content box of the page, but turns out our default configuration
overlaps slightly at the bottom, so I just punted on that.

Users can remove the headers / footers quite easily anyhow.

Differential Revision: https://phabricator.services.mozilla.com/D89794
2020-09-10 18:03:04 +00:00
Emilio Cobos Álvarez 5ed9da2bf7 Bug 1664205 - Simplify rect getters in nsIPrintSettings. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D89778
2020-09-10 15:25:59 +00:00
Gerald Squelart 5f9ff13253 Bug 1663543 - Convert PROFILER_ADD_MARKER and 2-arg profiler_add_marker to PROFILER_MARKER_UNTYPED - r=gregtatum
Mostly mechanical change, with some extra work where non-literal names are provided.
Also, when this is the only profiler call in a file, `#include "GeckoProfiler.h"` can be changed to `#include "mozilla/ProfilerMarkers.h"`.

Differential Revision: https://phabricator.services.mozilla.com/D89415
2020-09-10 03:02:36 +00:00
Sean Feng 787c7f4ce9 Bug 1661166 - Don't record paint timings if it is a print context r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D88908
2020-09-09 17:30:05 +00:00
Bogdan Tara f73b69b818 Backed out changeset 6698b842822e (bug 1663562) for mozglue_static::panic_hook crashes CLOSED TREE 2020-09-09 05:14:12 +03:00
Timothy Nikkel 75f67e42ee Bug 1663562. Call MaybeReflowForInflationScreenSizeChange when any prefs that could affect font inflation change. r=kats
When I start setting the pref ui.useOverlayScrollbars in bug 1663537 we trigger this assert

```
###!!! ASSERTION: can't mark frame dirty during reflow: '!mIsReflowing', file /builds/worker/checkouts/gecko/layout/base/PresShell.cpp, line 2677
#01: mozilla::PresShell::MaybeReflowForInflationScreenSizeChange() [layout/base/PresShell.cpp:11148]
#02: mozilla::PresShell::CompleteChangeToVisualViewportSize() [layout/base/PresShell.cpp:11177]
#03: MobileViewportManager::UpdateVisualViewportSize(mozilla::gfx::IntSizeTyped<mozilla::ScreenPixel> const&, mozilla::gfx::ScaleFactor<mozilla::CSSPixel, mozilla::ScreenPixel> const&) [layout/base/MobileViewportManager.cpp:504]
#04: MobileViewportManager::RefreshVisualViewportSize() [layout/base/MobileViewportManager.cpp:557]
#05: nsHTMLScrollFrame::Reflow(nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, nsReflowStatus&) [layout/generic/nsGfxScrollFrame.cpp:1340]
#06: nsContainerFrame::ReflowChild(nsIFrame*, nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, int, int, nsIFrame::ReflowChildFlags, nsReflowStatus&, nsOverflowContinuationTracker*) [layout/generic/nsContainerFrame.cpp:1115]
#07: mozilla::ViewportFrame::Reflow(nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, nsReflowStatus&) [layout/generic/ViewportFrame.cpp:297]
#08: mozilla::PresShell::DoReflow(nsIFrame*, bool, mozilla::OverflowChangedTracker*) [layout/base/PresShell.cpp:9650]
#09: mozilla::PresShell::ProcessReflowCommands(bool) [layout/base/PresShell.cpp:9816]
#10: mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) [layout/base/PresShell.cpp:4239]
#11: nsRefreshDriver::Tick(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp) [layout/base/nsRefreshDriver.cpp:2139]
```

This happens after the test is finish when we unset the ui.useOverlayScrollbars pref which (I'm assuming because it must) causes reflow. When running a font-inflation related reftest we also unset the font inflation related prefs that were specified in the reftest.list file. This causes font-inflation to go from enabled to disabled and we detect that for the first time while reflowing the scroll frame.

Instead we should reflow when any pref that could affect font inflation is changed. I scanned the font-inflation code in PresShell and Document::GetViewportInfo for prefs are consulted, but I didn't go a super exhaustive search.

Differential Revision: https://phabricator.services.mozilla.com/D89409
2020-09-08 20:03:09 +00:00
Emilio Cobos Alvarez ef6d2f0832 Bug 1663426 - Add a null-check to SetDocumentInternal. r=bobowen
This shouldn't generally happen, but seems it can under some circumstances and
even though I've fixed the error condition that triggers this a null-check here is harmless.

Differential Revision: https://phabricator.services.mozilla.com/D89453
2020-09-08 12:32:15 +00:00
Timothy Nikkel 39905f40a3 Bug 1663537. Fix layout/base/tests/test_scroll_event_ordering.html to work with desktop zooming scrollbars. r=kats
sendKey uses our new relative scroll path that does the scroll by the apz. But we don't have any scroll event ordering expectations when apz is doing the scroll. We trade lossing those expectations for smoother apz scrolling.

So change the test to use a method that doesn't use our new relative apz scroll path and goes back to main thread scrolling.

Differential Revision: https://phabricator.services.mozilla.com/D89402
2020-09-08 08:12:25 +00:00