Commit Graph

20766 Commits

Author SHA1 Message Date
Simon Giesecke
9350e6b741 Bug 1613985 - Use MOZ_COUNTED_DEFAULT_CTOR_*/MOZ_COUNTED_DTOR_* macros. r=froydnj
This removes the need for explicit #ifdef NS_BUILD_REFCNT_LOGGING without
introducing user-defined destructors when it is not defined.

Also, some uses of virtual for declaring destructors are replaced by the
appropriate override declaration through these changes.

Differential Revision: https://phabricator.services.mozilla.com/D62604

--HG--
extra : moz-landing-system : lando
2020-02-20 11:40:14 +00:00
Dorel Luca
d5f9df8ee1 Backed out 2 changesets (bug 1613985) for Build bustage on Windows2012. CLOSED TREE
Backed out changeset fd177b40b561 (bug 1613985)
Backed out changeset fb6d62b7f28d (bug 1613985)
2020-02-19 22:22:41 +02:00
Simon Giesecke
59b23375c0 Bug 1613985 - Use MOZ_COUNTED_DEFAULT_CTOR_*/MOZ_COUNTED_DTOR_* macros. r=froydnj
This removes the need for explicit #ifdef NS_BUILD_REFCNT_LOGGING without
introducing user-defined destructors when it is not defined.

Also, some uses of virtual for declaring destructors are replaced by the
appropriate override declaration through these changes.

Differential Revision: https://phabricator.services.mozilla.com/D62604

--HG--
extra : moz-landing-system : lando
2020-02-19 18:05:38 +00:00
Olli Pettay
62617da1ea Bug 1615607 - Consider to always treat high priority runnables as the highest priority runnables, r=farre
The patch removes the tad odd interleave behavior from the main thread and makes RefreshDriver to give
at least a tiny bit time for non-high priority tasks.
Given the recent change to have similar block-until behavior in child and parent process, this should work
consistently in all the processes.

Differential Revision: https://phabricator.services.mozilla.com/D63098

--HG--
extra : moz-landing-system : lando
2020-02-18 16:03:37 +00:00
Emilio Cobos Álvarez
7dbe3f32c3 Bug 1615609 - Rename nsRefreshDriver::IntersectionObservationAdded. r=hiro
The existing name is wrong since recently.

Differential Revision: https://phabricator.services.mozilla.com/D62922

--HG--
extra : moz-landing-system : lando
2020-02-15 07:23:51 +00:00
Timothy Nikkel
34bf1314fd Bug 1613482. Clear nsRefreshDriver::mHasScheduleFlush whenever mViewManagerFlushIsPending is cleared. r=mattwoodrow
mHasScheduleFlush is meant to track mViewManagerFlushIsPending except mViewManagerFlushIsPending gets set to false just before we call ProcessPendingUpdates, whereas mHasScheduleFlush is set to false just after we call ProcessPendingUpdates.

There are a couple places where mViewManagerFlushIsPending gets set to false that don't clear mHasScheduleFlush though. This leaves mHasScheduleFlush true until we get another paint that changed something. This causes this code

https://searchfox.org/mozilla-central/rev/3a0a8e2762821c6afc1d235b3eb3dde63ad3b01a/layout/painting/nsDisplayList.cpp#3058

in nsDisplayList::PaintRoot to always notify of invalidation (with webrender). This in turn causes a loop in the reftest harness: notify invalidation -> mozafterpaint -> update canvas -> paint -> notify invalidation.

This code changed a bunch until settling on the current design in bug 1404091.

Differential Revision: https://phabricator.services.mozilla.com/D61738

--HG--
extra : moz-landing-system : lando
2020-02-11 19:01:29 +00:00
Tim Nguyen
a2e4d99a50 Bug 1610597 - Re-introduce display: -moz-stack; as <legacy-stack>. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D62758

--HG--
extra : moz-landing-system : lando
2020-02-14 16:32:38 +00:00
Olli Pettay
24f52c566a Bug 1506376, make parent process vsync handling to be blocked the same way as in child process r=farre
Because the code becomes more generic, the following renames are done:
mLastChildTick is renamed to mLastTick
mLastProcessedTickInChildProcess is renamed to mLastProcessedTick

To clarify which member variables are used in parent process only
mRefreshTickLock is renamed to mParentProcessRefreshTickLock and
new variables mRecentParentProcessVsync and mPendingParentProcessVsync are
added. (mRecentVsync and mRecentVsyncId don't anymore have the different
behavior in parent and child processes)

The basic idea is to keep the vsync compression in parent process in
NotifyVsync.
(In child processes it is handled by IPDL/IPC compression).
The main functionality change is in ParentProcessVsyncNotifier::Run.
That method doesn't anymore call mObserver->TickRefreshDriver(...)
but mObserver->NotifyParentProcessVsync(...), which then calls
NotifyVsync(...) on the main thread. That way parent process gets the
same vsync block-until behavior as what child process has.

Depends on D62032

Differential Revision: https://phabricator.services.mozilla.com/D62033

--HG--
extra : moz-landing-system : lando
2020-02-14 16:28:22 +00:00
Bogdan Tara
74db09d838 Backed out 3 changesets (bug 1506376) for xpcshell failures CLOSED TREE
Backed out changeset fe7215eefa28 (bug 1506376)
Backed out changeset 621ec02db41c (bug 1506376)
Backed out changeset adbd602610a3 (bug 1506376)
2020-02-14 17:07:49 +02:00
Olli Pettay
1245edd3ba Bug 1506376, make parent process vsync handling to be blocked the same way as in child process r=farre
Because the code becomes more generic, the following renames are done:
mLastChildTick is renamed to mLastTick
mLastProcessedTickInChildProcess is renamed to mLastProcessedTick

To clarify which member variables are used in parent process only
mRefreshTickLock is renamed to mParentProcessRefreshTickLock and
new variables mRecentParentProcessVsync and mPendingParentProcessVsync are
added. (mRecentVsync and mRecentVsyncId don't anymore have the different
behavior in parent and child processes)

The basic idea is to keep the vsync compression in parent process in
NotifyVsync.
(In child processes it is handled by IPDL/IPC compression).
The main functionality change is in ParentProcessVsyncNotifier::Run.
That method doesn't anymore call mObserver->TickRefreshDriver(...)
but mObserver->NotifyParentProcessVsync(...), which then calls
NotifyVsync(...) on the main thread. That way parent process gets the
same vsync block-until behavior as what child process has.

Depends on D62032

Differential Revision: https://phabricator.services.mozilla.com/D62033

--HG--
extra : moz-landing-system : lando
2020-02-14 13:55:35 +00:00
Emilio Cobos Álvarez
cbcf929c90 Bug 1615261 - Fix ImageLoader setup for animated images in print preview. r=tnikkel
It's not clear to me this ever worked before either, I don't think the logic
before my patch was sound before.

But oh well. This should work, gotta add a test for it.

Differential Revision: https://phabricator.services.mozilla.com/D62777

--HG--
extra : moz-landing-system : lando
2020-02-14 12:36:25 +00:00
Simon Giesecke
b50347f917 Bug 1611415 - Prefer using std::move over forget. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-13 14:38:48 +00:00
Markus Stange
ac0687ac8b Back out bug 1592739 due to multiple regressions (bug 1599366, bug 1601183, bug 1602193). a=backout
Differential Revision: https://phabricator.services.mozilla.com/D62753

--HG--
extra : moz-landing-system : lando
2020-02-13 14:26:51 +00:00
shindli
91aa0518dd Backed out changeset 0c982bc69cb3 (bug 1611415) for causing build bustages in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr CLOSED TREE 2020-02-12 20:13:29 +02:00
Simon Giesecke
f604a47fa5 Bug 1611415 - Applied FixItHints from mozilla-non-std-move. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-12 17:24:41 +00:00
Mirko Brodesser
ea1f257885 Bug 1614636: simplify arguments of nsFrameSelection::HandleClick. r=jfkthame
Simplifies understanding its dependent methods.

Differential Revision: https://phabricator.services.mozilla.com/D62433

--HG--
extra : moz-landing-system : lando
2020-02-11 15:12:26 +00:00
Emilio Cobos Álvarez
628f21dc90 Bug 1614510 - Use cbindgen for shape-outside and clip-path. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D62372

--HG--
extra : moz-landing-system : lando
2020-02-11 22:03:53 +00:00
Hiroyuki Ikezoe
1c0f15006d Bug 1599795 - Rename BrowserChild::GetRemoteDocumentRect to GetTopLevelViewportVisibleRectInBrowserCoords. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D62183

--HG--
extra : moz-landing-system : lando
2020-02-11 03:35:56 +00:00
Emilio Cobos Álvarez
6615ff9fad Bug 1614208 - Stop including AccessibleCaretEventHub and PresShell.h from Selection.h. r=TYLin
And fix a bunch of fallout as we now don't include nsDocShell.h everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D62169

--HG--
extra : moz-landing-system : lando
2020-02-11 01:22:29 +00:00
Emilio Cobos Álvarez
fb586787c5 Bug 1614208 - Remove more dependencies on nsStyleConsts.h / ServoStyleConsts.h. r=jfkthame
Mostly what I was seeing come up in the .deps files from my object directory
which sounded feasible.

Differential Revision: https://phabricator.services.mozilla.com/D62167

--HG--
extra : moz-landing-system : lando
2020-02-11 01:22:15 +00:00
Emilio Cobos Álvarez
298c598770 Bug 1614208 - Forward-declare StaticPresData in nsPresContext.h. r=jfkthame
This avoids including nsFont.h and a bunch of other stuff in nsPresContext.h

Differential Revision: https://phabricator.services.mozilla.com/D62166

--HG--
extra : moz-landing-system : lando
2020-02-11 01:23:37 +00:00
Emilio Cobos Álvarez
d7841a5f17 Bug 1614208 - Remove some include dependencies in nsStyleConsts.h. r=jfkthame,jgilbert
We include it everywhere because it's included from gfxTypes.h.

This should avoid including all the generated bindings _everywhere_.

Differential Revision: https://phabricator.services.mozilla.com/D62174

--HG--
extra : moz-landing-system : lando
2020-02-11 01:23:37 +00:00
Botond Ballo
0167696fdf Bug 1612750 - Have the main thread always populate FrameMetrics::mVisualViewportOffset. r=tnikkel
APZ may want to know what the main thread's view of the visual viewport offset
was at the time of the last paint even if the main thread does not want APZ
to scroll to that visual viewport offset.

Differential Revision: https://phabricator.services.mozilla.com/D62093

--HG--
extra : moz-landing-system : lando
2020-02-10 15:19:46 +00:00
Mirko Brodesser
ce8bf8cde1 Bug 1613378: part 4) Declare some methods in nsFrameSelection static. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D62037

--HG--
extra : moz-landing-system : lando
2020-02-07 16:13:27 +00:00
Ting-Yu Lin
c508a968ca Bug 1612983 - Disable APZ only when AccessibleCaret's position is changed. r=botond
`mIsCaretPositionChanged` is used in `UpdateShouldDisableApz()` to
determine whether to disable APZ during scrolling or pinch-zooming.

Suppose the selection is on position:static elements. When
pinch-zooming, the zoom level is changed, but the position is not. We
split `PositionChangedResult::Changed` into two separate states, and set
`mIsCaretPositionChanged` only when the position is changed.

Differential Revision: https://phabricator.services.mozilla.com/D61516

--HG--
extra : moz-landing-system : lando
2020-02-07 22:31:40 +00:00
Emilio Cobos Álvarez
374cabd6e7 Bug 1606628 - Remove nsStyleImageRequest. r=tnikkel,heycam
This removes nsStyleImageRequest by moving the load state to LoadData instead
(where other lazy state like the resolved URL and load id lives).

That way we can use cbindgen for more stuff (there's no blocker for using it for
all images now), and we can undo the image tracking shenanigans that I had to do
in bug 1605803 in nsImageFrame.

This removes the mDocGroup member because well, there's no real upside of that
now that quantum DOM is not a thing.

It also removes the static clones of the image requests, and the need for each
computed value instance to have its own request. These were needed because we
needed the image loader for the particular document to observe the image
changes. But we were also tracking the request -> loader for other purposes.
Instead, Now all the images get loaded with GlobalImageObserver as a listener,
which looks in the image map and forwards the notification to all the interested
loaders instead dynamically.

The style value is only responsible to load the image, and no longer tracks /
locks it. Instead, the loader does so, via the image tracker.

Differential Revision: https://phabricator.services.mozilla.com/D58519

--HG--
extra : moz-landing-system : lando
2020-02-07 20:36:34 +00:00
Emilio Cobos Álvarez
61d0c10572 Bug 1613490 - Cleanup usage of ReferenceBox. r=miko
To avoid computing transform bounds over and over. It is generally just better.

Replace the various "overridebounds" thingies by using the "fallback" of the
transform-reference-box code which we need anyway.

Differential Revision: https://phabricator.services.mozilla.com/D61890

--HG--
extra : moz-landing-system : lando
2020-02-07 13:34:42 +00:00
Miko Mynttinen
ad2536665d Bug 1612895 - Rename nsDisplayHitTestInfoItem to nsDisplayHitTestInfoBase r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D61472

--HG--
extra : moz-landing-system : lando
2020-02-04 22:01:48 +00:00
Thomas Dolezal
062c15357a Bug 1611733 - Bug 1611633 - convert ns style position defines to enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61958

--HG--
extra : moz-landing-system : lando
2020-02-07 12:35:30 +00:00
Emilio Cobos Álvarez
873a349556 Bug 1611701 - Tweak NODE_IS_EDITABLE flag handling for NAC so that it works consistently for <input type=number>. r=bzbarsky,masayuki,whimboo
I thought this would fix <input type=number style="user-select: none">, but
turns out it doesn't.

<input type=number> doesn't have the editor root as a root of the anonymous
subtree, so the current hack wouldn't work, as the anon root wouldn't have the
editable flag. So tweak the code a bit to handle stuff in a simpler way than
setting the flags after the fact, and set the NAC-root flag earlier to avoid
the mOuterWrapper->AppendChildTo(root) call forgetting about root's flags.

I had to tweak one AccessibleCaret test, but that's because it uses <textarea>
with user-select: none, and our behavior there is not particularly sane. It just
happened to work because that test-case also had a bunch of contenteditable
elements, and we stop matching this rule:

  https://searchfox.org/mozilla-central/rev/220a3bd6063fcbe5ca50e88dcabdc7dee0aca448/layout/style/contenteditable.css#22

Because the anonymous div now properly matches :-moz-read-write, which made the
rule apply and the test work. See comment 4 of this bug.

I'll fix this stuff up and add some tests for our behavior here in bug 1611699.

I refactored the dragdrop tests to cover more input types, but I ended up not
being able to use them because they're dependent on the content.

Instead I added an extra test and changed the refactor so that it applies to
<input type=search>, as there's layout work going on in bug 558594, and it'd be
unfortunate to regress this there too.

Differential Revision: https://phabricator.services.mozilla.com/D61094

--HG--
extra : moz-landing-system : lando
2020-02-06 22:15:19 +00:00
Mihai Alexandru Michis
823e8c21f1 Backed out changeset c9f4dd3ed78b (bug 1606628) for causing failures in ImageLoader.cpp
CLOSED TREE
2020-02-06 23:19:55 +02:00
Emilio Cobos Álvarez
77c6b3e983 Bug 1606628 - Remove nsStyleImageRequest. r=tnikkel,heycam
This removes nsStyleImageRequest by moving the load state to LoadData instead
(where other lazy state like the resolved URL and load id lives).

That way we can use cbindgen for more stuff (there's no blocker for using it for
all images now), and we can undo the image tracking shenanigans that I had to do
in bug 1605803 in nsImageFrame.

This removes the mDocGroup member because well, there's no real upside of that
now that quantum DOM is not a thing.

It also removes the static clones of the image requests, and the need for each
computed value instance to have its own request. These were needed because we
needed the image loader for the particular document to observe the image
changes. But we were also tracking the request -> loader for other purposes.
Instead, Now all the images get loaded with GlobalImageObserver as a listener,
which looks in the image map and forwards the notification to all the interested
loaders instead dynamically.

The style value is only responsible to load the image, and no longer tracks /
locks it. Instead, the loader does so, via the image tracker.

Differential Revision: https://phabricator.services.mozilla.com/D58519

--HG--
extra : moz-landing-system : lando
2020-02-06 20:32:59 +00:00
Emilio Cobos Álvarez
69c87f6cb2 Bug 1613349 - Rename nsINode::DeleteProperty to RemoveProperty. r=smaug
And the related methods as well.

Differential Revision: https://phabricator.services.mozilla.com/D61768

--HG--
extra : moz-landing-system : lando
2020-02-06 16:06:49 +00:00
Emilio Cobos Álvarez
c5c0ef9787 Bug 1613349 - Rename nsIFrame::DeleteProperty to RemoveProperty. r=dholbert
As it doesn't necessarily call delete and that may be confusing.

Differential Revision: https://phabricator.services.mozilla.com/D61764

--HG--
extra : moz-landing-system : lando
2020-02-06 16:06:49 +00:00
Emilio Cobos Álvarez
bf6256b1fc Bug 1613349 - Make nsIFrame::TakeProperty MOZ_MUST_USE. r=dholbert
Depends on D61756

Differential Revision: https://phabricator.services.mozilla.com/D61757

--HG--
extra : moz-landing-system : lando
2020-02-06 00:39:10 +00:00
Emilio Cobos Álvarez
86ca3370c2 Bug 1613349 - Rename nsINode::UnsetProperty to nsINode::TakeProperty. r=smaug
For consistency with the previous change for layout.

Depends on D61755

Differential Revision: https://phabricator.services.mozilla.com/D61756

--HG--
extra : moz-landing-system : lando
2020-02-05 22:26:20 +00:00
Emilio Cobos Álvarez
bba367ec8f Bug 1613349 - Rename nsIFrame::RemoveProperty to nsIFrame::TakeProperty. r=dholbert
This is hopefully clearer naming.

Differential Revision: https://phabricator.services.mozilla.com/D61755

--HG--
extra : moz-landing-system : lando
2020-02-06 00:13:38 +00:00
Emilio Cobos Álvarez
09932803bc Bug 1611462 - Optimize position changes better. r=dholbert
When our position changes from / to absolute / fixed, then we need to reframe
(most likely, at least). But in some easier cases we can just live with a reflow
plus (optionally) a containing-block update or a repaint, depending on the case.

We need to delete the normal position property when this happens and we switch
from static to relative/sticky, and also need to update the handling of
UpdateContainingBlock to avoid making decisions based on position not changing.

This will actually not cause more reframes, as one would expect, because that
optimization became somewhat obsolete by bug 1519371 (which made the
optimization exact).

Differential Revision: https://phabricator.services.mozilla.com/D61142

--HG--
extra : moz-landing-system : lando
2020-02-04 21:20:34 +00:00
Daniel Holbert
ae192ec3a5 Bug 1613192: Fix non-unified build bustage in layout/{base,generic} directories. r=TYLin
Summary of the changes/reasons:

- LayoutTelemetryTools.h directly uses several types whose headers it needs to
  include. (These includes were present in its .cpp file; I'm migrating them
  from there to the .h file, and I'm adding a new include for "Saturate.h" to
  provide the SaturateUint8 type.)

- LayoutTelemetryTools.cpp needs an include for MainThreadUtils.h, to provide
  NS_IsMainThread().

- StaticPresData.cpp needs an include for ServoUtils.h, to provide
  AssertIsMainThreadOrServoFontMetricsLocked().

- ZoomConstraintsClient.h needs a forward-decl for mozilla::dom::Document since
  it uses a pointer of that type in a function-decl.

- ScrollSnap.h needs forward-decls of nsPoint/nsRect for some references to
  those types in a method signature.

- nsGridContainerFrame.cpp needs an include for nsBoxLayoutState.h since it
  uses that type (it instantiates a nsBoxLayoutState instance).

- nsPlaceholderFrame.cpp needs a "using" decl for the mozilla::dom namespace in
  order to use the un-namespace-prefixed "Element" type.

Differential Revision: https://phabricator.services.mozilla.com/D61603

--HG--
extra : moz-landing-system : lando
2020-02-04 19:34:51 +00:00
Christian Holler
71231ac083 Bug 1612707 - Disable various slow tests under TSan. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D61562

--HG--
extra : moz-landing-system : lando
2020-02-04 14:34:07 +00:00
Ting-Yu Lin
22ea8326d7 Bug 1610670 - Add AllPhysicalHalfCorners() to support range-based for loops. r=mats
This patch is generated via:
1. Manually modify gfx/2d/Types.h
2. Run the following script and clang-format.
3. Add brackets for the for loop in nsCSSRendering.cpp.

```

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "NS_FOR_CSS_HALF_CORNERS\(i\)" "for (const auto i : mozilla::AllPhysicalHalfCorners())"
rename "NS_FOR_CSS_HALF_CORNERS\(corner\)" "for (const auto corner : mozilla::AllPhysicalHalfCorners())"
```

Differential Revision: https://phabricator.services.mozilla.com/D61252

--HG--
extra : moz-landing-system : lando
2020-02-04 03:28:47 +00:00
Boris Zbarsky
c8713bf40a Bug 1612444. Improve some error messages for exceptions in layout. r=emilio
I used ThrowNotSupportedError for the not-implemented case.

Differential Revision: https://phabricator.services.mozilla.com/D61324

--HG--
extra : moz-landing-system : lando
2020-02-03 20:35:54 +00:00
Tim Nguyen
3b6875eeb1 Bug 1610404 - Remove nsGroupBoxFrame (display: -moz-groupbox). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61422

--HG--
extra : moz-landing-system : lando
2020-02-03 09:55:51 +00:00
Tetsuharu OHZEKI
b63fa8f929 Bug 1597475 - Fix uses of nsIDocShellTreeItem in nsDocumentViewer::GetContentSize(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61415

--HG--
extra : moz-landing-system : lando
2020-02-02 16:53:54 +00:00
Tetsuharu OHZEKI
fc8693795b Bug 1597478 - follow up: add the null check for mPresContext. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61416

--HG--
extra : moz-landing-system : lando
2020-02-02 17:02:38 +00:00
Tetsuharu OHZEKI
b4b96cb31e Bug 1597478 - Fix uses of nsIDocShellTreeItem in nsDocumentViewer::ShouldAttachToTopLevel(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61413

--HG--
extra : moz-landing-system : lando
2020-02-02 16:47:14 +00:00
Thomas Dolezal
2770364f87 Bug 1612148 - Replace transform style defines to an enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61388

--HG--
extra : moz-landing-system : lando
2020-02-01 20:23:26 +00:00
Narcis Beleuzu
585bab844e Backed out 2 changesets (bug 1612148) for reftest failures. CLOSED TREE
Backed out changeset e1432ef26779 (bug 1612148)
Backed out changeset 0c1831f15450 (bug 1612148)
2020-02-01 19:23:06 +02:00
Thomas Dolezal
523017b0f6 Bug 1612148 - Replace transform style defines to an enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61388

--HG--
extra : moz-landing-system : lando
2020-02-01 15:50:04 +00:00
Eric Rahm
7b7fc1c992 Bug 1610387 - Remove nsAutoPtr usage from layout/. r=dbaron
Differential Revision: https://phabricator.services.mozilla.com/D60455

--HG--
extra : moz-landing-system : lando
2020-02-01 09:40:36 +00:00