Commit Graph

459 Commits

Author SHA1 Message Date
Sebastian Hengst
6adb214468 Backed out changeset 759a43ebc6bf (bug 1405541) for asserting in devtools/client/performance/test/browser_perf-console-record-03.js on Windows 7. r=backout 2017-10-11 13:15:26 +02:00
Nicholas Nethercote
7ea563fdf2 Bug 1405541 - Split AUTO_PROFILER_LABEL_DYNAMIC into three macros. r=mstange.
It's easy to mess up the scoping so that (a) the label is pushed and then
immediately popped, and/or (b) the string doesn't live long enough. It's also
easy to do a utf16-to-utf8 conversion unnecessarily when the profiler is
inactive.

This patch splits that macro into three new ones that are harder to mess up.

- AUTO_PROFILER_LABEL_DYNAMIC_CSTR: same as current.
- AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING: for nsCStrings.
- AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING: for nsStrings.
2017-10-11 13:03:34 +02:00
Phil Ringnalda
9b852fb562 Backed out changeset 901a16fec9fc (bug 1405541) for Windows assertion failures
MozReview-Commit-ID: DRGWXU4Tbfk
2017-10-10 23:28:33 -07:00
Nicholas Nethercote
7085f47fb7 Bug 1405541 - Split AUTO_PROFILER_LABEL_DYNAMIC into three macros. r=mstange.
It's easy to mess up the scoping so that (a) the label is pushed and then
immediately popped, and/or (b) the string doesn't live long enough. It's also
easy to do a utf16-to-utf8 conversion unnecessarily when the profiler is
inactive.

This patch splits that macro into three new ones that are harder to mess up.

- AUTO_PROFILER_LABEL_DYNAMIC_CSTR: same as current.
- AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING: for nsCStrings.
- AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING: for nsStrings.
2017-10-04 13:44:24 +11:00
Sebastian Hengst
7d14f8623a merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: EE6DcCgHufi
2017-10-09 11:19:20 +02:00
Nicholas Nethercote
a35e82f193 Bug 1403868 (part 4) - Reduce tools/profiler/public/*.h to almost nothing in non-MOZ_GECKO_PROFILER builds. r=mstange.
Currently the Gecko Profiler defines a moderate amount of stuff when
MOZ_GECKO_PROFILER is undefined. It also #includes various headers, including
JS ones. This is making it difficult to separate Gecko's media stack for
inclusion in Servo.

This patch greatly simplifies how things are exposed. The starting point is:

- GeckoProfiler.h can be #included unconditionally;

- everything else from the profiler must be guarded by MOZ_GECKO_PROFILER.

In practice this introduces way too many #ifdefs, so the patch loosens it by
adding no-op macros for a number of the most common operations.

The net result is that #ifdefs and macros are used a bit more, but almost
nothing is exposed in non-MOZ_GECKO_PROFILER builds (including
ProfilerMarkerPayload.h and GeckoProfiler.h), and understanding what is exposed
is much simpler than before.

Note also that in BHR, ThreadStackHelper is now entirely absent in
non-MOZ_GECKO_PROFILER builds.
2017-10-04 09:11:18 +11:00
Nicholas Nethercote
7dbfdaf890 Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP
2017-10-03 09:05:19 +11:00
Wes Kocher
1f45ffa62d Merge m-c to autoland, a=merge
MozReview-Commit-ID: 43R3aNMoMyN
2017-10-03 14:58:01 -07:00
Kartikaya Gupta
5142d6e6e5 Bug 1403915 - Remove some leftover painting callback goop. r=jrmuizel
MozReview-Commit-ID: BycK4Ug1sgm
2017-10-03 16:31:08 -04:00
Kartikaya Gupta
997b6a1f90 Bug 1403176 - Turn on empty transactions support in layers-free WebRenderLayerManager. r=mstange
By returning true from WebRenderLayerManager::EndEmptyTransaction, we
avoid doing a full paint in cases where the caller decides an empty
transaction would be sufficient. WebRenderLayerManager already rejects
attempts to set some forms of empty-transaction data (specifically
transform and scroll offset updates). This means that we will never get
a call to EndEmptyTransaction where the caller is expecting a transform
or scroll offset update to be sent over to the compositor. So if we have an
implementation of EndEmptyTransaction that ignores that data, it will not
break expectations.

There is still one piece of information that WebRenderLayerManager
doesn't reject in this manner, the APZ focus state. That is, if the
layout code sets a pending APZ focus state on the WRLM, followed by a
all to EndEmptyTransaction, it expects the focus state to get propagated
to the compositor. This patch makes sure that it does happen by using
the new API added in the previous patch.

MozReview-Commit-ID: 596UgW9ZWAF
2017-10-02 16:49:56 -04:00
Catalin Badea
fc6ab5f0ea Bug 651120 - Remove index argument from content removed/appended/inserted notifications. r=peterv 2017-10-03 11:09:08 +01:00
Arthur Edelstein
17ede5027d Bug 1404570 - Fix ubsan runtime error for nsEventStatus enum in PresShell.cpp. r=smaug 2017-09-29 21:57:00 -04:00
Stone Shih
7a4343786c Bug 1316251 Part3: Trigger pointer event implementation in EventStateManager. r=masayuki
To manage pointer event "state" in ESM.

MozReview-Commit-ID: HiAwvSmVTwx
2017-09-08 11:01:22 +08:00
Stone Shih
c4e445dbfc Bug 1316251 Part2: Revise pointer event implementation. r=masayuki
Revise the pointer event implementation, includes
- Revise the implementation to fetch preference values.
- Separate the logic to get the pointer capturing frame to PointerEventHandler.

MozReview-Commit-ID: 7pdAr0XFNT2
2017-09-06 17:28:28 +08:00
Stone Shih
4961fa9f1f Bug 1316251 Part1: Separate pointer event implementation from PresShell. r=masayuki
This patch moves pointer event related implementations to a new class.

MozReview-Commit-ID: FdBYl7vYC5I
2017-09-06 15:47:49 +08:00
Alexander Surkov
f069fc6d3e Bug 1321960 - rename nsIPresShell::mSuppressInterruptibleReflows to mWasLastReflowInterrupted to reflect better its purpose, r=dholbert 2017-09-26 16:25:12 -04:00
Stone Shih
9d98fb52c7 Bug 1344108 Part2: Only prevent drag when capturing the pointer events by content. r=smaug.
MozReview-Commit-ID: FENTYwMYdZr
2017-09-05 10:37:14 +08:00
Stone Shih
59fecec897 Bug 1344108 Part1: Fire lostpointercapture event immediately after pointerup/pointercancel. r=smaug.
MozReview-Commit-ID: DlSqgyWqQrV
2017-09-04 17:34:52 +08:00
Jonathan Watt
e3204e3c0c Bug 1401356, part 2 - Rename nsSVGEffects to SVGObserverUtils. r=longsonr 2017-08-30 15:58:31 +01:00
Jonathan Watt
7428c44f4d Bug 1401356, part 1 - Rename nsSVGEffects.h/.cpp to SVGObserverUtils.h/.cpp. r=longsonr 2017-08-30 14:14:46 +01:00
Bobby Holley
675c2164c3 Bug 1398980 - Remove warning about stylo not supporting document state changes. r=me
It's spammy and we already have a bug on file.

MozReview-Commit-ID: DB7KGuj0V3I
2017-09-15 12:22:27 -07:00
Miko Mynttinen
e4c7cf9eaa Bug 1399977 - Allocate some DisplayClipChains using nsDisplayListBuilder arena r=mattwoodrow
MozReview-Commit-ID: 9TB4S6G4rJR
2017-09-14 11:37:15 -04:00
Sebastian Hengst
fba940c63f merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 2iVDKexRjxu
2017-09-13 23:58:43 +02:00
Michael Layzell
c25b2d35d2 Bug 1398883 - Disable the DataTransfer::Protected state for Firefox 57, r=baku
This isn't a super essential feature, and is just a change to try to bring us in
line with chromium and the spec. As this has apparent web compat issues, and
DataTransfer is a hard to test area, this patch moves the changes behind a pref,
which we can come back to turning on after we ship 57.
2017-09-13 11:45:48 -04:00
Botond Ballo
4d2530f251 Bug 1367765 - Propagate the mHandledByAPZ flag when dispatching a touch event to the DOM. r=rhunt
This ensures that, if the touch event is over a scrollbar thumb and
makes it into nsSliderFrame::StartAPZDrag(), nsSliderFrame knows
that the event went through APZ and that therefore APZ will handle
the drag.

MozReview-Commit-ID: 92wAc1l9Pqz
2017-09-06 23:42:04 -04:00
Matt Woodrow
c1428d377d Bug 1397054 - Reset nsDisplayListBuilder state each frame so that we can use it multiple times. r=mstange
MozReview-Commit-ID: Gb7AnKoZaPu
2017-09-12 14:10:39 -04:00
Emilio Cobos Álvarez
bc608eec3f Bug 1398448: Always insert async when reconstructing ancestors to avoid pathological frame construction cases. r=bz
MozReview-Commit-ID: 5ARTWW9dt7X
2017-09-11 20:41:43 +02:00
Daniel Holbert
1e602f971e Bug 1398379 part 2: Remove GetRootScrollFrameAsScrollableExternal() since it has no more callers. r=mats
MozReview-Commit-ID: 5m6p7sS2jRS
2017-09-08 16:36:34 -07:00
Daniel Holbert
5590031f7b Bug 1398376 part 3: Collapse formerly-MOZILLA_INTERNAL_API-guarded Foo()/FooInternal() functions together in nsIPresShell and nsPresContext. r=mats
This is just simplifying things by eliminating a layer of now-unnecessary
abstraction.

MozReview-Commit-ID: 1MBagjYXbCD
2017-09-08 16:25:03 -07:00
Daniel Holbert
9b4c18de30 Bug 1398376 part 2: Remove formerly-MOZILLA_INTERNAL_API-guarded FooExternal() functions from nsIPresShell and nsPresContext. r=mats
These functions are now dead code.  And really, they were already dead code
even before this patch-stack -- they were only called in never-evaluated
(and now-deleted) #else clauses.

MozReview-Commit-ID: AeY6Z3ybmsv
2017-09-08 16:25:01 -07:00
Wes Kocher
53da9bec37 Merge inbound to central, a=merge
MozReview-Commit-ID: 4FEkd1x2GD
2017-09-08 13:36:31 -07:00
Michael Layzell
0ee5f6d92a Bug 1199729 - Part 3: Clear the DataTransfer after handling Drag and Clipboard events, r=baku 2017-09-08 11:05:07 -04:00
Emilio Cobos Álvarez
4ad6950bf0 Bug 1397091: Merge InsertionKind and LazyConstructionAllowed. r=bz
They now map 1-to-1, so there's no reason to keep them separate.

MozReview-Commit-ID: A2Wqa3QNdw8
2017-09-08 08:56:40 +02:00
Emilio Cobos Álvarez
533f0e367e Bug 1395719: Convert aAllowLazyFrameConstruction to an enum class. r=bz
It's clearer what it means from the callsites.

MozReview-Commit-ID: 7wubYBUQdG0
2017-09-08 08:56:20 +02:00
Emilio Cobos Álvarez
f972bd5a33 Bug 1395719: Make ReconstructDocElementHierarchy take an InsertionKind. r=bz
Otherwise we may unexpectedly sync-construct it.

MozReview-Commit-ID: LybB06img71
2017-09-08 08:56:19 +02:00
Masayuki Nakano
87466056af Bug 1369072 - part3: nsXBLPrototypeHandler::DispatchXBLCommand() should use controller of visible window r=smaug
With previous change, KeyboardEvent is dispatched even when invisible window
has focus.  However, nsRootWindow::GetControllerForCommand() returns controller
for focused window even when the window is invisible because it uses
nsFocusManager::GetFocusedDescendant() to retrieve focused window.

Perhaps, we can assume that users won't expect to do something with invisible
window when they type some keys.  Then, nsRootWindow::GetControllerForCommand()
should return controller for visible ancestor window if focused window is
invisible.

This patch makes nsFocusManager::GetFocusedDescendant() can return only visible
descendants.  However, it already has a bool argument.  Therefore, it should
have a flag instead of adding new flag.  Most changes of this patch is replacing
its callers.

Then, nsRootWindow::GetControllerForCommand() and nsRootWindow::GetControllers()
should have a bool flag if it should return controller(s) for visible window.
This patch adds a bool flag for it.  Fortunately, the interface isn't scriptable.

Finally, this patch makes nsXBLPrototypeHandler::DispatchXBLCommand() and
EventStateManager::DoContentCommandEvent() retrieve controller for visible
window since they are always handles user input.

MozReview-Commit-ID: GygttTHuKRm
2017-09-07 22:54:49 +09:00
Masayuki Nakano
6cbdb205e2 Bug 1369072 - part2: PresShell::HandleEvent() should retarget KeyboardEvent if focused document is invisible r=smaug
When focused document is invisible, PresShell::HandleEvent() won't dispatch
any events.  However, if it's KeyboardEvent, user cannot do anything only with
keyboard.  So, in this case, PresShell should retarget keyboard events to
first visible ancestor.

MozReview-Commit-ID: CvCBcYwvfbe
2017-09-05 19:39:33 +09:00
Masayuki Nakano
4af046fdd1 Bug 1369072 - part1: PresShell should climb up scrollable frames when there is no selection, no focused content and root scrollable frame isn't scrollable r=smaug
When there is no selection and no focused content, aContent of
nsIPresShell::GetScrollableFrameToScrollForContent() is nullptr.  Then, it'll
use root scrollable frame to scroll.  However, the root scrollable frame may
be not scrollable.  In such case, ancestor document's scrollable frame should
be scrolled instead.

MozReview-Commit-ID: 1kOPtDX6G5L
2017-09-05 17:17:21 +09:00
Emilio Cobos Álvarez
e33ccef7b7 Bug 1396018: Don't pass aFlags all the way through RecreateFramesForContent. r=bz
We currently use the aFlags argument of ContentRemoved for two purposes:

 (1) To determine when a frame is being removed due to its element being removed
     from the DOM, so we reframe its now-possibly-no-longer-suppressed
     whitespace siblings as needed.

     In other cases, our ContentRemoved call will be followed by a
     ContentInserted call, which will end up doing AddTextItemIfNeeded() to
     generate the relevant textframes if they're necessary.

     Since we only need to tell apart the "DOM removal" and "anything else"
     cases, we don't need to thread the aFlags argument through all the ways
     ContentRemoved can call itself (on an ancestor).

     All those cases should just be treated as "not DOM removal". In particular,
     even if the original call _was_ for a DOM removal, if we convert it to an
     ancestor reframe, which will call ContentInserted on the ancestor as well,
     we don't need to do anything with text siblings of the ancestor.

 (2) To save the frame tree state from DestroyFramesFor, but the frame tree
     state is unconditionally captured on RecreateFramesForContent, so we only
     need to care about it in the original ContentRemoved call.

     Because of that, we can move that to the callsite, patch incoming for that.

MozReview-Commit-ID: Gy5IhUysBlz
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-06 20:30:26 +02:00
Nicholas Nethercote
d79886e790 Bug 1394729 - Measure memory usage of Stylo's Rule Tree. r=heycam.
This patch splits up the existing "layout/style-sets" measurement into
"layout/gecko-style-sets", or "layout/servo-style-sets/stylist/rule-tree" and
"layout/servo-style-sets/other". (Additional things will be measured under
"layout/servo-style-sets/" later, such as cascade data.)

This requires introducing a new type, ServoStyleSetSizes, for transferring the
multiple measurements from Rust code to C++ code.

MozReview-Commit-ID: FbmzpsjBpgI
2017-08-30 18:21:26 +10:00
Wei-Cheng Pan
98170f2e9f Bug 1373814 - Add new probe to measure start-up input latency. data-r=francois r=francois,smaug
For parent process, users may expect the UI is interactable after they saw the
first tab has restored/shown.
So this patch added a new topic "sessionstore-one-or-no-tab-restored" which
represents the parent process has finished a tab restoring. If there is nothing
to restore, it is effectively equal to "sessionstore-windows-restored".

For centent processes, users may expect web content is interactable when the
top-level-content-document has finished loading, which is different from the
parent case.

MozReview-Commit-ID: AtEUW80Ea6n
2017-08-08 17:54:13 +08:00
Bobby Holley
05834cf54d Bug 1394987 - Flush styles in PresShell::ReconstructFrames. r=emilio
MozReview-Commit-ID: GUuE1dKoDvK
2017-08-29 17:40:57 -07:00
Wes Kocher
08356deb1c Merge m-c to autoland, a=merge
MozReview-Commit-ID: LEKykpTAKjv
2017-08-25 17:32:33 -07:00
Nazım Can Altınova
5e5b68d3c7 Bug 1355721 - stylo: Implement font feature values lookup r=emilio,xidorn
MozReview-Commit-ID: 7wgQ1NCn7vL
2017-08-23 18:05:53 -07:00
Emilio Cobos Álvarez
d64a78fac4 Bug 1389743: followup: Add a comment about why we post a restyle in DestroyFramesFor. r=comment-only
MozReview-Commit-ID: 5xSclV9mqyU
2017-08-25 09:26:24 +02:00
Gregory Szorc
336b6b8347 Backed out changesets b749fc196a50, 2791eac8d760 (bug 1355721) for build bustage
CLOSED TREE
2017-08-24 20:30:17 -07:00
Nazım Can Altınova
639d0c6171 Bug 1355721 - stylo: Implement font feature values lookup r=emilio,xidorn
MozReview-Commit-ID: 7wgQ1NCn7vL
2017-08-23 18:05:53 -07:00
Emilio Cobos Álvarez
2a4ade9d7f Bug 1392964: Remove aDidReconstruct outparam from ContentRemoved. r=mats
MozReview-Commit-ID: 4fSAQQAnPWF
2017-08-23 11:03:30 +02:00
Kevin Chen
0403a71b83 Bug 1362321 - Do not crash in gfxPlatform:Init if there is a TDR happening; r=bas
MozReview-Commit-ID: 9gJCErHosg1
2017-08-09 18:00:01 +08:00
Emilio Cobos Álvarez
c4f39df3cf Bug 1389743: Only reconstruct frames synchronously from ContentRemoved when called from frame construction. r=mats
There's only one case of sync frame construction from ContentRemoved now, and
it's not on the element being removed, but on the whitespace siblings if needed,
and _only_ when they don't support lazy frame construction.

Basically, this switches all the RecreateFramesForContent calls to use
`aAsyncInsert` (which I changed to an enum class for readability), except when
we're already reframing.

Also, it switches ReframeTextIfNeeded to opt-in into lazy frame construction,
since it's used only when aFlags == CONTENT_REMOVED.

This allows to simplify the DestroyFramesFor API (which I'm happy to rename to
something more meaningful, since now it's something like
DestroyFramesForAndRecreateThemAsync), and do some other consistency cleanups.

A bunch of the ContentRemoved callsites were pretty random at passing
aAsyncInsert, and that was some kind of a mess. This patch ensures consistency,
and makes it impossible to do O(n^2) work when removing DOM nodes, which is
nice.

The underlying reason for this is explained in the description of bug 1377848,
and basically allows us to remove a bunch of Servo hacks on the longer term (a
few of them are going away already, yay!).

MozReview-Commit-ID: 2DrUTxGV8RX
2017-08-23 09:58:57 +02:00