Commit Graph

1369 Commits

Author SHA1 Message Date
Miko Mynttinen
896b0f3d84 Bug 1425078 - Remove nsDisplayList::AppendNewToTop and nsDisplayList::AppendNewToBottom r=mattwoodrow
MozReview-Commit-ID: E3neKT2sV4Q
2017-12-13 11:23:04 -06:00
Emilio Cobos Álvarez
c10ea9ea04 Bug 1423167: Move most attribute-related methods from nsIContent to Element. r=bz
MozReview-Commit-ID: 6WXqNiODttD
2017-12-06 16:05:59 +01:00
Mats Palmgren
03018ea47a Bug 1422839 part 1 - Add internal overflow-clip-box-block/-inline properties and make overflow-clip-box a shorthand. r=dholbert
MozReview-Commit-ID: axoDaWnOJQ
2017-12-05 21:08:41 +01:00
Kartikaya Gupta
2075a2d6da Bug 1422950 - Move the area calculation to the display item constructor to hit the ToReferenceFrame fastpath. r=mstange
MozReview-Commit-ID: 6ROpprO26JV
2017-12-04 15:47:29 -05:00
Botond Ballo
cd5ffe3d62 Bug 1300864 - Disable paint skipping for scroll frames that contain out-of-flow content inside a CSS filter. r=mstange
MozReview-Commit-ID: 5TwC75wzOsm
2017-11-27 16:45:29 -05:00
Mike Conley
b43ed7f682 Bug 1421351 - Queue chrome-only scrollend event in refresh driver scroll event queue instead of firing immediately. r=kats
MozReview-Commit-ID: KVQ5kp1t7NW
2017-11-28 13:09:56 -05:00
Kartikaya Gupta
b8a2ddbb19 Bug 1418397 - Add dispatch-to-content hit info to WR hit-test for inactive scrollframes. r=mstange
MozReview-Commit-ID: F6HgYPRc9Bi
2017-11-27 12:37:30 -05:00
Kartikaya Gupta
cf138e782c Bug 1418387 - Propagate scrollbar direction for scrollbar containers to APZ. r=botond
Most of this patch is just mechanical changes, but note that this patch
now makes the mFlags in scrollbar-container nsDisplayOwnLayer instances
have one of the direction bits set. As a result, this requires changing
the implementation of nsDisplayOwnLayer::IsScrollThumbLayer().

MozReview-Commit-ID: 2BLdbpz5Sa8
2017-11-24 16:23:05 -05:00
Kartikaya Gupta
ebe523672a Bug 1418387 - Make the nsDisplayOwnLayer flags more strongly typed. r=mstange
MozReview-Commit-ID: 8s14jKhp9Lb
2017-11-24 16:23:04 -05:00
Ting-Yu Lin
5ef96b463f Bug 1418905 - Move nsRuleNode::ComputeCoordPercentCalc() into nsStyleCoord. r=heycam
MozReview-Commit-ID: GLLseBxhUiP
2017-11-20 14:05:19 +08:00
Ting-Yu Lin
25ad28cc7e Bug 1417376 Part 3 - Pass nsPoint parameters by const references instead of values. r=mats
It's good to save some copy constructor calls.

MozReview-Commit-ID: 6TveqwkOvc0
2017-11-15 17:55:36 +08:00
Mike Conley
3884de7657 Bug 1172171 - Add a chrome-only scrollend event. r=kats
MozReview-Commit-ID: 1mUqPdsb31I
2017-10-10 14:54:49 -04:00
Mats Palmgren
2544eb586c Bug 1414666 part 1 - Add nsIFrame::PresShell() for convenient access to the shell. r=emilio
MozReview-Commit-ID: 8FPTPKWyVtY
2017-11-09 03:00:48 +01:00
Mats Palmgren
616f910f82 Bug 1400618 part 1 - Collect NAC / generated content and call DestroyAnonymousContent / UnbindFromTree on those after the frames are destroyed. r=bz
MozReview-Commit-ID: 2trDgeJPw25
2017-11-07 01:20:33 +01:00
Kyle Machulis
7252caefb4 Bug 1412437 - Remove nsIDOMHTMLTextAreaElement; r=bz
MozReview-Commit-ID: JAON7Rd7IAo
2017-11-01 14:28:22 -07:00
Daniel Holbert
8fea3c215f Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py

For every file that is modified in this patch, the changes are as follows:
 (1) The patch changes the file to use the exact C++ mode lines from the
     Mozilla coding style guide, available here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

 (2) The patch deletes any blank lines between the mode line & the MPL
     boilerplate comment.

 (3) If the file previously had the mode lines and MPL boilerplate in a
     single contiguous C++ comment, then the patch splits them into
     separate C++ comments, to match the boilerplate in the coding style.

MozReview-Commit-ID: EuRsDue63tK
2017-10-27 10:33:53 -07:00
Kartikaya Gupta
3233ea98b3 Bug 1411238 - Make APZ test logging work in layers-free WR mode. r=botond
Most of this change is just fiddling with function signatures so that they take
a LayerManager* instead of a Layer* (or in some cases, both). This allows
the WebRender codepaths to pass a WebRenderLayerManager* instead of having to
produce a Layer* which it doesn't have.

MozReview-Commit-ID: Fb0C8OUVDin
2017-10-25 13:22:04 -04:00
Matt Woodrow
bace862100 Bug 1404181 - Part 27: Add some retained-dl debugging tools. r=mstange
MozReview-Commit-ID: EQO1lAbUnpY
2017-10-21 16:54:24 +13:00
Matt Woodrow
71282ed1ae Bug 1404181 - Part 23: Only rebuild items within a displayport when the displayport changes, rather than rebuilding the whole document. r=mstange
MozReview-Commit-ID: IYEPCKSvtBY
2017-09-29 10:54:15 +13:00
Matt Woodrow
de10332349 Bug 1404181 - Part 20: Add code to override the display list builder dirty area for a stacking context or displayport. This lets us restrict partial building to within one of these contexts. r=mstange
MozReview-Commit-ID: Dn46eaqeyPX
2017-09-28 14:23:03 +13:00
Matt Woodrow
bbae43b96d Bug 1404181 - Part 5: Store an annotated list of rectangles in nsDisplayLayerEventRegions so that we can remove contributions that belong to invalidated frames. r=mstange
MozReview-Commit-ID: G2kTPnrhxs4
2017-10-21 21:01:50 +13:00
Matt Woodrow
15aab29cca Bug 1404181 - Part 4: Add code to save and restore changes made to display items during FrameLayerBuilder so that we can use them again. r=mstange
MozReview-Commit-ID: 23WqS2Xv3Qx
2017-09-27 16:55:11 +13:00
Matt Woodrow
90fe1ff121 Bug 1404181 - Part 2: Track a 'visible' rect for display list building as well as the 'dirty' rect, so that we can do partial building by specifying a smaller 'dirty' rect. r=mstange
MozReview-Commit-ID: 7DUV9dl4zb1
2017-10-04 14:28:38 +13:00
Matt Woodrow
24ca46729c Bug 1406727. r=mstange,froydnj a=abillings 2017-10-17 15:19:44 +13:00
Kris Maglione
1895b2d74a Bug 1404198: Part 2e - Switch to NS_NewTimer* in layout. r=njn
MozReview-Commit-ID: 2WxyAXpJ3Fg
2017-10-15 23:13:31 -07:00
Timothy Nikkel
21691a950e Bug 1408607. Make all uses of mWillBuildScrollableLayer conditional on painting to the window. r=mstange
This mostly restores us to the previous behaviour where we would set mWillBuildScrollableLayer to false for event handling display lists. But it's better because we don't keep flipping its value.

The real reason we want to do this is that it fixes bugs with event handling.
2017-10-16 01:50:35 -05:00
Timothy Nikkel
d8304a9940 Bug 1408607. mWillBuildScrollable only keeps updated during display list building. So change Is(Maybe)ScrollingActive to not use it so they are always accurate. r=mstange
This seems like a good idea, not sure if it fixes any bugs though.
2017-05-19 17:04:19 -05:00
Botond Ballo
e6d41c0236 Bug 1402995 - Reflow scrollbars after partial reflow of scroll frame. r=tnikkel
MozReview-Commit-ID: 6ZuOkjfL1Jg
2017-10-04 13:19:13 -04:00
Timothy Nikkel
9d97af9161 Bug 1405397. Part 2. ScrollFrameHelper::BuildDisplayList should only have one way to determine if we are using a displayport/building a async scrollable layer. r=mstange
The variable usingDisplayPort was determining if we applied a clip to the displayport (and one other thing), and otherwise mWillBuildScrollableLayer was used to determine those type of things.

When https://hg.mozilla.org/mozilla-central/rev/4c8b85e80aeb of bug 1364295 landed it actually changed behaviour even though it was only supposed to simplify code. Before that changeset mWillBuildScrollableLayer was always set to false if we weren't painting to the window because we never considered whether a displayport was set. After that changeset we actually looked to see if a displayport was set and set mWillBuildScrollableLayer to true if we had a displayport even when we weren't painting to the window.

So we would have usingDisplayPort == false, and mWillBuildScrollableLayer == true. We fix that be getting rid of usingDisplayPort and using everywhere.

This means that after this patch and bug 1364295 we will build display lists for event handling with mWillBuildScrollableLayer == true where we had it false before. So another patch we could make is to make all uses of mWillBuildScrollableLayer also check if we are painting to the window.

The decision to expand the dirty rect to the displayport is still restricted to when we are painting to the window and happens in DecideScrollableLayer, so we don't regress bug 745936.
2017-10-12 17:06:21 -05:00
Timothy Nikkel
5104a82932 Bug 1405397. Part 1. Only add scrollbars in the "ignore scroll frame" case if we are painting to the window. r=mstange
This change is effectively a no-op since usingDisplayPort is only true if IsPaintingToWindow() but we need it for the next patch. So I will explain why this patch is correct.

At first we set usingDisplayPort to whether or not we had a displayport, which makes sense. But then in https://hg.mozilla.org/mozilla-central/rev/372d32e0ea61 (bug 745936) we had to limit this to when we weren't handling events so we didn't override the event handling dirty/hit rect of size 1x1 with the entire displayport.

Then in https://hg.mozilla.org/mozilla-central/rev/254c675a98c5 (bug 980500) we added support for adding scrollbars when we are ignoring the current scroll frame. This was a hack for b2g (and maybe android, where it might still be required) since we shouldn't be drawing the scrollbars when we are specifically ignoring the scrollframe. Only android and b2g have ever used the "ignore scroll frame" mode for their main rendering, so the change was only relevant for them. This changeset simply copied the same condition for using a displayport (!aBuilder->IsForEventDelivery()) to determine when to add scrollbars.

Then in https://hg.mozilla.org/mozilla-central/rev/2dc71497e243 (bug 1073290) we determined that it is useless to use displayports when we aren't drawing to the window (and actually can cause problems), so we changed the condition to use a displayport to require painting to the window (which is more restrictive then just not for event handling). However this change understandably missed the changing the condition for adding scrollbars. Thus this patch.

The reason we need this is the next patch (essentially) removes the IsPaintingToWindow condition from usingDisplayPort, and then we will erroneously add scrollbars when doing drawWindow calls that also ask to ignore the root scroll frame.
2017-10-12 17:06:19 -05: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
Timothy Nikkel
4674aaa593 Bug 1364295. Simplify some code now that we don't create displayports during display list building. r=mstange 2017-10-02 16:00:16 -05:00
Timothy Nikkel
adcc3e778d Bug 1364295. Walk the frame tree looking for a scrollframe to add a displayport to, or one that already has a displayport before displaylist building. r=mstange
And stop creating displayports during display list building.

One thing we can investigate in the future is whether we should use the value of mHaveScrollableDisplayPort stored on the display list builder retained between paints. If it's true then we could potentially skip this pass. It would mean that if there are large changes to the page we wouldn't set a displayport. And we'd need to make sure the value is cleared when we load a new page.
2017-05-19 17:04:19 -05:00
Markus Stange
8e3da089e6 Bug 1402498 - Add ScrollAnimationMSDPhysics, can be enabled using general.smoothScroll.msdPhysics.enabled. r=rhunt
MozReview-Commit-ID: fr8Q9iod5k
2017-09-26 20:55:35 -04:00
Markus Stange
0079b2af6f Bug 1402498 - Separate out ScrollAnimationBezierPhysics and make ScrollAnimationPhysics an interface. r=rhunt
MozReview-Commit-ID: K3b8vjY5xaO
2017-09-29 18:37:14 -04:00
Markus Stange
41371c4014 Bug 1402498 - Clean up ScrollAnimationPhysics code after the separation. r=rhunt
MozReview-Commit-ID: Ldm96zHxqWD
2017-09-22 15:08:39 -04:00
Markus Stange
ce0e958398 Bug 1402498 - Rename AsyncScrollBase to ScrollAnimationPhysics and use composition instead of inheritance. r=rhunt
MozReview-Commit-ID: 7UFf0mZsrEr
2017-09-22 13:42:29 -04:00
Nicholas Nethercote
9fda5528d2 Bug 1400459 (part 2) - Devirtualize nsIAtom. r=heycam.
This patch merges nsAtom into nsIAtom. For the moment, both names can be used
interchangeably due to a typedef. The patch also devirtualizes nsIAtom, by
making it not inherit from nsISupports, removing NS_DECL_NSIATOM, and dropping
the use of NS_IMETHOD_. It also removes nsIAtom's IIDs.

These changes trigger knock-on changes throughout the codebase, changing the
types of lots of things as follows.

- nsCOMPtr<nsIAtom> --> RefPtr<nsIAtom>

- nsCOMArray<nsIAtom> --> nsTArray<RefPtr<nsIAtom>>
  - Count() --> Length()
  - ObjectAt() --> ElementAt()
  - AppendObject() --> AppendElement()
  - RemoveObjectAt() --> RemoveElementAt()

- ns*Hashtable<nsISupportsHashKey, ...> -->
  ns*Hashtable<nsRefPtrHashKey<nsIAtom>, ...>

- nsInterfaceHashtable<T, nsIAtom> --> nsRefPtrHashtable<T, nsIAtom>
  - This requires adding a Get() method to nsRefPtrHashtable that it lacks but
    nsInterfaceHashtable has.

- nsCOMPtr<nsIMutableArray> --> nsTArray<RefPtr<nsIAtom>>
  - nsArrayBase::Create() --> nsTArray()
  - GetLength() --> Length()
  - do_QueryElementAt() --> operator[]

The patch also has some changes to Rust code that manipulates nsIAtom.

MozReview-Commit-ID: DykOl8aEnUJ
2017-09-26 08:33:21 +10:00
Matt Woodrow
63559fb631 Bug 1402204 - Remove NS_SCROLLFRAME_INVALIDATE_CONTENTS_ON_SCROLL as it doesn't appear to be needed any more. r=mats 2017-09-20 13:12:37 +12:00
Ting-Yu Lin
d93880e505 Bug 1341009 - Add nsReflowStatus::IsEmpty() assertions to all nsIFrame::Reflow() methods and some reflow helpers, and remove unneeded Reset(). r=dholbert
nsReflowStatus::IsEmpty() assertions are added after DISPLAY_REFLOW in the
beginning of the Reflow().

A few Reflow() implementations have Reset() calls at the end which are left
in place by this patch (with an explanatory comment added to each). These
ending Reset()s are only needed for cases where a non-splittable frame
passes its own nsReflowStatus to a child's reflow method. Just in case the
child leaves a "not fully complete" value in the nsReflowStatus, the
non-splittable parent frame must clear out the nsReflowStatus before
returning, so that its own parent doesn't then try to split it.

MozReview-Commit-ID: 6Jj3jfMAqj4
2017-09-13 18:00:25 +08: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
Ehsan Akhgari
2d9c8b15b3 Bug 1394191 - Remove unneeded nsContentList.h includes from layout; r=dholbert 2017-08-29 07:29:11 -04:00
Bobby Holley
c2ce4d2e27 Bug 1393791 - Stop unbinding native-anonymous content off a script runner. r=emilio
The failure mode in the attached crashtest is an inconsistency in the flattened
tree. Specifically, we null out mVideoControls in an nsVideoFrame, but defer
the UnbindFromTree call on that NAC element, which measn that its mParent still
points to the nsVideoFrame's mContent. Because all this stuff runs off of script
runners, and the anonymous content destroyer is not guaranteed to run before
other potential script runners, we end up running arbitrary script while the
tree mismatch exists. This script calls back into ProcessPendingRestyles, which
causes trouble.

We could build a separate deferral mechanism, but it's not clear that we actually
need to defer the unbind anymore. The deferred unbind was added in bug 489008,
which predated a lot of simplifications in layout/dom interaction.

MozReview-Commit-ID: 1JYAhiXKVJC
2017-08-27 15:29:36 -07:00
Bas Schouten
e8a3f7a60a Bug 1363922 - Part 1: Remember about the reference frame during BuildDisplayList for ScrollFrameHelper so GetScrolledRect can use it. r=mstange
MozReview-Commit-ID: 8GO6xuSH5xY
2017-08-17 15:45:30 +02:00
Botond Ballo
3f5caab980 Bug 1340684 - Fire the scroll event before the style flush. r=mstange
This ensures that if the scroll event triggers style changes, they are
reflected on the same paint.

This is accomplished by having the refresh driver fire scroll events as
an explicit step after FlushType::Style observers and rAF callbacks, and
before the actual style flush.

MozReview-Commit-ID: 4kgauD5SgVo
2017-08-09 21:08:38 -04:00
Bevis Tseng
940e989545 Bug 1390790 - Label ScrollFrameHelper::ScheduleSyntheticMouseMove. r=tnikkel 2017-08-16 17:10:36 +08:00
Matt Woodrow
8370362323 Bug 1388162 - Add a Destroy function to nsDisplayItem to use instead of manually invoking the destructor, this will allow us to recycle them in the future. r=mstange
* * *
[mq]: fix

MozReview-Commit-ID: LUXZAIL73BJ
2017-08-07 16:07:43 +12:00
Matt Woodrow
e62cf6dd69 Bug 1388161 - Store the dirty rect on the display list builder rather than passing it as a parameter to BuildDisplayList. r=mstange 2017-08-07 14:23:35 +12:00