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

21530 Коммитов

Автор SHA1 Сообщение Дата
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