Commit Graph

2740 Commits

Author SHA1 Message Date
Hiroyuki Ikezoe
6e34a2f0f4 Bug 1409166 - Check whether the target animating frame is scrolled out of each scrollable ancestor. r=birtles,mattwoodrow
Before this patch, we had been checking each scrollable ancestor is scrolled
out of its scrollable ancestor.  So if the target animating frame is at the
bottom of its scrollable parent and if half of the scrollable parent is
scrolled out of its ancestor, the animating frame was considered as 'in-view'.

MozReview-Commit-ID: BDueuF3cT4I
2017-10-26 18:09:32 +09:00
cku
f52362de29 Bug 1402157 - Disassociate a frame with an image loader if that frame indeed has any image request. r=heycam
Before enable stylo, an image request is always been resolved before the
creation time of that request object[1].
As a result, in AddAndRemoveImageAssociations, we always associate the request
objects of style images with the given frame(since they are resolved).

After enable stylo, an image request is resolved after that object been created[2].
We may hit the assertion reported in this bug by the following senario:
1. AddAndRemoveImageAssociations is called. The image request is not resolved
   yet, so we do not associate that frame with that image request.
2. That image request is been resolved via nsStyleXXXX::FinishStyle.
3. Style changed. AddAndRemoveImageAssociations is called again. We try to
   dis-associate the frame with image request and hit this assertion since
   this frame is not associate with any image request at step #1.

[1]
We use this constructor if the backend is gecko
https://hg.mozilla.org/mozilla-central/file/5ed2f3c94155/layout/style/nsStyleStruct.cpp#l2131
[2]
We use this constructor if the backend is stylo
https://hg.mozilla.org/mozilla-central/file/5ed2f3c94155/layout/style/nsStyleStruct.cpp#l2147
MozReview-Commit-ID: 22trSbdogUH
2017-10-13 14:03:44 +08:00
Matt Woodrow
23385146c1 Bug 1405146 - Don't make the decision to build nsDisplayWrapList based on the number of child items, since this can vary when doing partial display list builds. r=mstange 2017-10-25 14:17:25 +13:00
Matt Woodrow
e3ab3eecac Bug 1411426 - When deleting a frame, make sure we invalidate any frames that had display items dependent on us so that they get rebuilt. r=miko 2017-10-25 12:15:11 +13: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
02f1e24195 Bug 1404181 - Part 24: Rebuild all display items when we encounter a blend mode, since we can't easily track changes to whether we need the blend container or not. r=mstange
MozReview-Commit-ID: 9vw1vgDUp60
2017-09-29 10:56:31 +13:00
Matt Woodrow
5475958284 Bug 1404181 - Part 22: Make sure we mark frames as modified any time they change position or style data and make sure we don't accidentally mark the root as being modified when we don't need to. r=mstange
MozReview-Commit-ID: J5ov5cwvvrE
2017-09-29 10:51:49 +13:00
Matt Woodrow
163895d5c2 Bug 1404181 - Part 21: Add RetainedDisplayListBuilder with the code for doing partial display list builds, and merging it into an existing display list. r=mstange
MozReview-Commit-ID: 8pZG5xq3nSB
2017-10-18 16:09:07 +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
054cf34569 Bug 1404181 - Part 17: Track will-change contributions per-frame so that can remove contributions from invalidated frames. r=mstange
MozReview-Commit-ID: 54LwXKkjfFX
2017-09-28 13:53:25 +13:00
Matt Woodrow
2c41044ac8 Bug 1404181 - Part 15: Add the notion of 'modified' frames, that need new display items built for them (and all their descendants). r=mstange
MozReview-Commit-ID: 66vbfSDeOpK
2017-09-28 14:20:13 +13:00
Matt Woodrow
6f5cac7650 Bug 1404181 - Part 9: Add code for detecting if display list building happened for a given frame, and use it to add some tests for retained display lists. r=mstange
MozReview-Commit-ID: AIb0AWU7iiS
2017-09-27 17:17:11 +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
97bacba1d6 Bug 1404181 - Part 3: Track the current set of alive display items on nsIFrame. r=mstange
MozReview-Commit-ID: BgB1XBMpJ8t
2017-09-27 15:35:29 +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
Hiroyuki Ikezoe
5ddf2667fa Bug 1385013 - Check all vertexes for the target frame are outside of the parent frame if the target frame is empty. r=birtles
We create empty rectangle (zero-height or zero-width) frame for element which
has no content inside it, e.g.  '<p></p>'.  And nsRect.Intersects returns false
if either of the rectangles are empty, so if we check
!transformedRect.Intersects(scrollableRect) and transformedRect is empty, we
will end up returning true from IsFrameScrolledOutOfView even though the point
represented by the empty transformedRect might be inside the
scrollableRect.

The reftest causes timeout without this fix since the animation never updates
after the initial paint.

MozReview-Commit-ID: FymFJfjxyGc
2017-10-18 10:43:22 +09:00
Ya-Chieh Wu
bdb5eed911 Bug 1410826 - Check IsPrimaryFrame() first in nsIFrame::HasAnimationOfTransform. r=mats
MozReview-Commit-ID: BFJGmr19ESL
2017-10-25 20:11:00 -04:00
Matt Woodrow
24ca46729c Bug 1406727. r=mstange,froydnj a=abillings 2017-10-17 15:19:44 +13:00
Hiroyuki Ikezoe
0715b582fd Bug 1406211 - Check whether the frame is one of continuation or ib-split-sinbling frames for animating element in nsIFrame::HasOpacityInternal(). r=dbaron
We need this change to generate nsDisplayOpacity for the continuation or
ib-split-sibling frames other than the first continuation so the opacity
animation on the continuation frames runs on the compositor.
When we generate an nsDisplayOpacity, the animation runs on the compositor,
but when we don't, the animation never updates since the animation is throttled
on the main thread.

MozReview-Commit-ID: DESftTLt0wq
2017-10-15 09:56:17 +09:00
Hiroyuki Ikezoe
ae86782910 Bug 1406211 - Early return from nsIFrame::HasOpacityInternal if there is no EffectSet for the frame. r=dbaron
If there is no EffectSet for the frame, it means no animation runs on the
element for the frame.

MozReview-Commit-ID: Ev9Hf3jquvU
2017-10-15 09:56:17 +09:00
Boris Zbarsky
007534b28e Bug 1397815. Add memory reporting for button frame's mInnerFocusStyle and other additional style contexts. r=emilio
MozReview-Commit-ID: cJar2LDrCt
2017-10-13 14:26:55 -04:00
Cameron McCormack
b8dd60db88 Bug 1407246 - Split out Variables struct difference calculation. r=emilio
MozReview-Commit-ID: CtWtG3zkD1D
2017-10-12 09:12:30 +08: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
L. David Baron
374598ba46 Bug 1405875 - Remove old dump/compare regression data methods on frames, and nsIFrameUtil interface and implementation. r=mats
These became unused as a result of the removal of nsRegressionTester and
the removal of the printing debug file mechanism, earlier in this patch
sequence.

MozReview-Commit-ID: 9Tftf2AjpPb
2017-10-05 11:15:57 -07:00
cku
3460667562 Bug 1343147 - Part 1. Do not double applying transform vector of the root frame in a glyph mask into the target context. r=mstange
When we generate the glyph mask for a transformed frame in
GenerateAndPushTextMask, the transform vector had been applied into aContext[1],
so we should find a way to prevent applying the vector again when painting the
glyph mask.

In bug 1299715, I tried to prevent double apply at [2], it caused two problems:
1. We only skip generating nsDisplayTransform, but we may still create a
nsDisplayPerspactive bellow. Since the parent of a nsDisplayPerspective must be
a nsDisplayTransform, which have been ignored, so we hit this assertion.
2. We skip all transform for all frames while painting the glyph mask, which is
not correct. We should only skip double applying transform vector of the root
frame.

This patch fixes both of these issues:
a. We will still create a nsDisplayTransform for the root frame if need. But
the transform matrix we apply into the target context will be an identity
matrix, so we fix #1 above.
b. In #a, we change the transform matrix to an identity matrix only for the root
frame of the  glyph mask, so we fix #2.

[1]
https://hg.mozilla.org/mozilla-central/file/59e5ec5729db/layout/painting/nsDisplayList.cpp#l752
[2]
https://hg.mozilla.org/mozilla-central/file/ce2c129f0a87/layout/generic/nsFrame.cpp#l2806

MozReview-Commit-ID: 973lkQQxLB6
2017-10-03 11:29:19 +08:00
Hiroyuki Ikezoe
360781b203 Bug 1403433 - Add another variant of SchedulePaint that does not call InvalidateRenderingObservers for PendingAnimationTracker. r=birtles
nsFrame::SchedulePaint() invokes InvalidateRenderingObservers, and
InvalidateRenderingObservers ends up posting change hints during we are
processing sequential tasks for animations, but we don't allow posting any
change hints while we are in the middle of restyling process.

Though the change hints posted by InvalidateRenderingObservers are not harmful
in this case since the change hints will be processed in a second post
traversal without problems.  That's said, InvalidateRenderingObservers stuff
should be processed in display list based invalidation anyway (bug 1284053).

MozReview-Commit-ID: GKVRZ98lvEN
2017-09-29 19:42:13 +09:00
Matt Woodrow
aa5c01a9bd Bug 1397671 - Don't treat SVG transformed frames as being transformed for the purposes of computing Combines3DTransformWithAncestors. r=dbaron 2017-09-26 15:57:56 +13:00
Matt Woodrow
b14fd4ecb2 Bug 1402197 - Add an option for GetTransformToAncestor to stop at stacking contexts and displayport. r=mstange 2017-09-26 15:57:55 +13:00
Sebastian Hengst
33dad84671 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 9Z3Ly8icnvh
2017-09-20 11:48:02 +02:00
Ethan Lin
ceab79c1ee Bug 1397375 - Part3. Remove the related webrender user data when destroying a frame. r=jrmuizel
MozReview-Commit-ID: IYjfqWiiPZ
2017-09-14 14:40:31 +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
Jonathan Watt
b691d3e6b4 Bug 1399824, part 2 - Always use nsIFrame::AddStateBits instead of manual bit twiddling. r=xidorn
MozReview-Commit-ID: JoEiQQI2kZ5
2017-08-24 12:09:42 +01:00
Jonathan Watt
3423986d9b Bug 1399824, part 1 - Always use nsIFrame::RemoveStateBits instead of manual bit twiddling. r=xidorn
MozReview-Commit-ID: KynEge1U4aS
2017-08-24 10:55:28 +01: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
Ting-Yu Lin
b221261f75 Bug 1341009 - Pass const reference instead of value for nsReflowStatus. r=dholbert
It's good to save a copy constructor call.

Also, make nsBlockFrame::SplitFloat() return void because the only
caller (BlockReflowInput::FlowAndPlaceFloat()) doesn't check its return
value, and (more importantly) because it only ever returns NS_OK.

MozReview-Commit-ID: 9LmDCXd7xGS
2017-09-13 15:47:51 +08:00
Neerja Pancholi
e50152c2d0 Bug 1381157 - Cache 'mContent->GetPrimaryFrame == this' with a flag on nsIFrame and replace these calls to GetPrimaryFrame. r=mats
MozReview-Commit-ID: 3VoxYlean52
2017-09-17 17:21:32 +02:00
Kartikaya Gupta
f47cba5b2c Bug 1388433 - Remove unnecessary warning as the codepath is handled in an acceptable manner. r=mattwoodrow
MozReview-Commit-ID: 76KuxiDwnas
2017-09-11 10:49:22 -04:00
Daniel Holbert
8fa516d61a Bug 1387152 part 2: Don't let unrelated property "flex-basis" influence the sizing inside of -webkit-box containers. r=mats
We use nsFlexContainerFrame (our modern flexbox implementation) to emulate
-webkit-box, and we use a frame state bit to tell us whether to use
modern-flexbox properties vs. legacy properties.  Up until this patch, we
neglected to check that state bit when determining whether to use the modern
"flex-basis" property for sizing.  This patch makes us *not* use that property
(and just use the axis-appropriate width/height property instead) for legacy
-webkit-box containers.

MozReview-Commit-ID: 14bzOCPCtUY
2017-08-03 11:18:13 -07:00
Daniel Holbert
ef8ff52e92 Bug 1387152 part 1: Adjust indentation and use HasAnyStateBits() instead of manual bitwise arithmetic, in nsFrame size-computation code. r=mats
* HasAnyStateBits is slightly more foolproof and readable -- in particular, you
  can put the logical "!" directly alongside the expression, rather than
  needing to separate it with a layer of logical-grouping-parens.

* The deindentation here isn't super-important, but it conforms better to our
  coding style, and it'll make this code consistent with a new chunk that I'm
  adding in the next patch (and that chunk will *have* to be deindented like
  this, to avoid going over 80 characters).

MozReview-Commit-ID: FWfqrKjHedP
2017-08-03 11:04:08 -07:00
Boris Zbarsky
78dee00e63 Bug 1390389. Fix anon box restyling assertions to correctly handle ib splits. r=xidorn
MozReview-Commit-ID: AtBFlvLyg6b
2017-08-31 09:12:13 -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
Bobby Holley
d4947abb27 Bug 1394156 - Use a smart pointer for nsIFrame::mStyleContext. r=emilio
MozReview-Commit-ID: FizF2iCvp9t
2017-08-27 10:46:00 -07:00
Bobby Holley
b573bf19ee Bug 1394156 - Use a smart pointer for nsIFrame::mContent. r=emilio
MozReview-Commit-ID: 5xsLwXkXym7
2017-08-27 10:45:59 -07:00
Bobby Holley
9aa8eec70d Bug 1394156 - Make static_casts of mContent use GetContent(). r=emilio
This was done with: perl -pi -e 's/\(mContent\)/\(GetContent\(\)\)/g' *.cpp

MozReview-Commit-ID: 7ugPKf5ypGw
2017-08-27 10:45:59 -07:00
Nicholas Nethercote
d9de21e46e Bug 1393636 (part 4) - Move ComputedValues measurements from nsStyleSizes to nsWindowSizes. r=heycam.
Another plumbing-only change, which is a precursor for the next patch.
ComputedValues are a Servo-only thing, so in order to use nsStyleSizes for both
Gecko and Servo, the ComputedValues sizes must be moved out.

MozReview-Commit-ID: BOnQSzzV0vC
2017-08-25 14:50:26 +10:00
Nicholas Nethercote
39c39dd5f2 Bug 1393636 (part 3) - Pass nsWindowSizes to more AddSizeOf*() functions. r=heycam.
This is a purely non-functional plumbing change. Instead of passing a
SizeOfState and an nsStyleSizes a bunch of places, we pass an nsWindowSizes,
which contains both of them.

This is a necessary precursor for the next patch.

MozReview-Commit-ID: Ek03wDM50rB
2017-08-25 14:47:54 +10:00
Nicholas Nethercote
0c060cd7ca Bug 1390760 - Measure ServoComputedData::visited_style. r=bholley.
For the Obama wikipedia page, this covers about 85% of the unmeasured
ComputedValues structs. The about:memory output looks like this:

> +---2,443,648 B (02.41%) -- computed-values
> |   +--1,088,272 B (01.07%) -- dom
> |   +----945,744 B (00.93%) -- non-dom
> |   +----409,632 B (00.40%) -- visited

I'm not sure why some CVs are still being missed.

MozReview-Commit-ID: 1bYWwSi4ihn
2017-08-21 16:07:16 +10:00
cku
5000d14d6e Bug 577824 - Part 1. Set the frame size in nsIFrame::FinishAndStoreOverflow before the ComputeEffectsRect call that uses it. r=jwatt
This change ensures that HTML frames with SVG filters applied are given the
correct overflow regions so that they will display and invalidate correctly.

The bug that this commit fixes does not manifest in many cases since
often elements happen to be reflowed more than once when a document loads.
When that happened the bug would be masked because the filtered frame would be
given a size during the first reflow, and that would then make the overflow
calculations in subsequent reflows work.  It was only in cases where the
filtered frame was only reflowed once (such as when dynamically inserting a
filtered element into the DOM using script) that the lack of a valid frame
size during the overflow calculations would result in bad overflow regions
being calculated.

MozReview-Commit-ID: 79lR27KRSym
2017-08-09 01:04:49 +08:00
Wes Kocher
759e7551f7 Backed out 2 changesets (bug 577824) for reftest failures in 577824.html a=backout CLOSED TREE
Backed out changeset 98f8d05483cf (bug 577824)
Backed out changeset 3b9a469ab1d6 (bug 577824)

MozReview-Commit-ID: HraTkt5uajG
2017-08-17 13:17:28 -07:00