Commit graph

2779 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
2a9742d4b6 Bug 1398581: Address followup comments. r=me
MozReview-Commit-ID: CymOOl4VLPj
2017-09-11 17:19:05 +02:00
Emilio Cobos Álvarez
762a3ec064 Bug 1398581: Ensure a first-letter doesn't incorrectly inherit from a first-line. r=heycam
This approach kinda sucks, because we woefully throw away the style context
computed in the case it inherited from a first-line, but it's the easiest thing
I could think of without either making it more inefficient, or threading a
parent style ignoring first-line through ResolvePseudoElementStyle and related
functions.

MozReview-Commit-ID: 3uGuU7dHEnE
2017-09-11 11:15:30 +02:00
Mats Palmgren
f03f683f75 Bug 1374112 part 3 - Use AllocateFCItem/FreeFCItem exclusively for allocating FrameConstructionItems. r=dholbert
MozReview-Commit-ID: 7TqWZeTV91J
2017-09-11 00:27:12 +02:00
Mats Palmgren
062e1c6efa Bug 1374112 part 2 - Introduce nsCSSFrameConstructor::AllocateFCItem/FreeFCItem for allocating FrameConstructionItems from an arena/free list. r=dholbert
MozReview-Commit-ID: 5VVhEQOZMlU
2017-09-11 00:27:12 +02:00
Mats Palmgren
d547785f05 Bug 1380749 - Retry AdjustAppendParentForAfterContent in case |parentAfterFrame| was a :first-letter frame that we deleted. r=dholbert
MozReview-Commit-ID: 7uIxm4NLHPN
2017-09-09 22:00:54 +02:00
Emilio Cobos Álvarez
6ad66f91a9 Bug 1398041: Make WipeContainingBlock consistent about reconstructing sync or async. r=bz
MozReview-Commit-ID: 1PL3cqfnarB
2017-09-08 09:29:04 +02:00
Emilio Cobos Álvarez
2776c6f693 Bug 1397091: Remove aForReconstruct. r=bz
It's only used to know whether we may potentially need to sync-style the
subtree.

Given with these patches we guarantee that when inserting sync, we have the
style tree up-to-date, we can just check aInsertionKind for the same effect.

MozReview-Commit-ID: ADvcjkGq5hi
2017-09-08 08:56:41 +02:00
Emilio Cobos Álvarez
635b115223 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
6d9f8e1c9e Bug 1397091: Allow calling RecreateFramesForContent with async insertion for non-elements. r=bz
Using the lazy frame construction path instead of the PostRestyleEvent path.

It'd be nice to unify those though...

MozReview-Commit-ID: CwDHZQUBm8e
2017-09-08 08:56:39 +02:00
Emilio Cobos Álvarez
6d5e03f58b Bug 1395719: Minimal cleanup when using the accessibility service. r=bz
MozReview-Commit-ID: Enexvl1motp
2017-09-08 08:56:21 +02:00
Emilio Cobos Álvarez
8d92630b75 Bug 1395719: Reconstruct ancestors asynchronously when lazy frame construction is allowed. r=bz
The main purpose of this change is avoiding doing frame construction when the
style tree is not up-to-date.

In the test-case above, for example, a MathML element is changed, and we
schedule style invalidation for it, but another MathML element is inserted, and
we reconstruct the whole thing, using the out-to-date styles from the MathML
element.

There are other cases where this is more problematic than "we just happened to
use out-of-date styles, and we'll restyle eventually", which is when this
reconstruct happens to hit an element which was recently inserted but happened
to lazily construct.

In that case, we haven't even performed initial styling on the element, so we
just panic and crash.

After this the only sync frame construction case remaining when the style tree
is not setup is CharacterDataChanged, which I'll address in bug 1397091.

MozReview-Commit-ID: FSI2Zb34SaZ
2017-09-08 08:56:20 +02:00
Emilio Cobos Álvarez
933ecf7682 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
02a3b2a06b 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
Emilio Cobos Álvarez
6ed36d94e6 Bug 1396018: Remove REMOVE_DESTROY_FRAMES. r=bz
Instead, explicitly capture the frame tree state on the only caller that passes
this flag around.

This is somewhat wasteful if we end up reconstructing an ancestor frame, since
we'll capture state for it again. But we do that already in most of the cases
(somewhat inconsistently).

MozReview-Commit-ID: CUJsXaVoIpO
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-06 20:30:27 +02:00
Emilio Cobos Álvarez
f4c424fbc9 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
Emilio Cobos Álvarez
f4bd95813a Bug 1396018: Remove the hacky removeflags check we do for display: contents and XBL. r=bz
It's not needed afaict.

MozReview-Commit-ID: LeLguGEEdNy
2017-09-06 20:30:26 +02:00
Neerja Pancholi
b12bf0cae2 Bug 1389029 - Create custom change hint and post restyle event for rowspan, colspan attribute changes. r=dbaron
MozReview-Commit-ID: IwUlgDa3DAj

--HG--
extra : rebase_source : e99732f1173eba16f2cf42453c6418d72591ce7e
2017-09-05 13:30:40 -07:00
Louis Chang
057601eaa6 Bug 1352238 Part 1 - Make box construction and layout for radio/checkbox elements work the same on Android as on other platforms. r=mats
MozReview-Commit-ID: NmWepjKDVj

--HG--
extra : rebase_source : b8e1c2684672c3426708099225342ebae152b3f4
2017-09-05 22:44:24 +08:00
Sebastian Hengst
4d0bad92dd merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: Gsw48p934sI
2017-09-02 10:54:44 +02:00
Wes Kocher
8b84853ed6 Merge m-c to autoland, a=merge
MozReview-Commit-ID: GcHZLNPPNnI
2017-09-01 16:34:14 -07:00
Wes Kocher
5f157c17dc Merge inbound to central, a=merge
MozReview-Commit-ID: 3JxUEFuinHY
2017-09-01 16:29:10 -07:00
Boris Zbarsky
264b2245fd Bug 1395715. When recovering letter frames, only do first-line fixup when we have a first-line parent. r=emilio
It turns out, this is the only case in which we need to do the fixup at all.
And this way we don't have to guess based on first-line styles, which may not
match the frame tree (for example if we have a pending style change that we
haven't processed yet).
2017-09-01 11:09:02 -04:00
Emilio Cobos Álvarez
80541449d2 Bug 1374235: style: Remove the for reconstruction traversals. r=bholley
One less hack, a few more to go.

MozReview-Commit-ID: 6katL1EGn2U
2017-09-01 18:46:23 +02:00
Emilio Cobos Álvarez
6c5e58f954 Bug 1395351: Don't clobber restyle root flags from frame construction. r=bholley
MozReview-Commit-ID: EsXKiLbYQsY

--HG--
extra : rebase_source : ef87462e8495670b6e0fcfbdfc9f3b511f5f57bc
2017-08-31 21:37:50 +02:00
Boris Zbarsky
71d6942bcb Bug 1395650. Make anonymous column groups into non-inheriting anon boxes, to better match the behavior of other browsers. r=heycam 2017-09-01 00:53:33 -04:00
Emilio Cobos Álvarez
2fe72a41ea Bug 1389645: Don't incorrectly set lazy frame construction bits in ContentAppended and ContentRangeInserted. r=bholley
Before this patch, we may get into that piece of code reentrantly from lazy
frame construction itself leaving stale dirty bits around that we really don't
want.

MozReview-Commit-ID: 2wtKeF3o0Gr
2017-08-27 00:08:43 +02:00
Sebastian Hengst
df63e116bf Backed out changeset 35afffcb4182 (bug 1374235) for build bustage because it landed before its servo commit. r=backout 2017-09-01 14:07:47 +02:00
Emilio Cobos Álvarez
fd2d4e8b6f Bug 1374235: style: Remove the for reconstruction traversals. r=bholley
One less hack, a few more to go.

MozReview-Commit-ID: 6katL1EGn2U
2017-09-01 13:16:09 +02:00
Wes Kocher
4cf89b3423 Merge m-c to inbound, a=merge
MozReview-Commit-ID: FusyUW1CQ4s
2017-09-01 16:33:28 -07:00
Catalin Badea
516b5546f4 Bug 1395945 - Remove child array getter. r=ehsan 2017-09-01 22:13:49 +01:00
Emilio Cobos Álvarez
572cd4acf9 Bug 1392964: Remove aDidReconstruct outparam from ContentRemoved. r=mats
MozReview-Commit-ID: 4fSAQQAnPWF

--HG--
extra : rebase_source : 15cfb8ae703db574db3845b0031feb6aaf451948
2017-08-23 11:03:30 +02:00
Makoto Kato
d458d5c295 Bug 1348073 - Part 2. Enable lazy frame construction for editable regions. r=Ehsan
MozReview-Commit-ID: C92SY2lv8n8

--HG--
extra : rebase_source : 47848b4ec0285991826ecd2bbdd2b5cf692430b3
2017-08-21 15:30:07 +09:00
Emilio Cobos Álvarez
0b1c2eb45e Bug 1389743: Remove various Stylo hacks to deal with XBL edge cases. r=heycam
MozReview-Commit-ID: HN7PfsNrh9e

--HG--
extra : rebase_source : 13a607fbc45285a23a0a107853dcc9be9c1200f7
2017-08-13 20:44:58 +02:00
Emilio Cobos Álvarez
1e6e97fed1 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

--HG--
extra : rebase_source : f428d839a5482477dea22c0fea600d54f3e8799c
2017-08-23 09:58:57 +02:00
Bobby Holley
7210bd7226 Bug 1383332 - Track the restyle root and use it to do less work during the traversal. r=emilio
MozReview-Commit-ID: A8O3JOpsv4E
2017-08-22 21:19:24 -07:00
Bobby Holley
1cf62db957 Bug 1389681 - Move NoteDirty* to Element. r=emilio
MozReview-Commit-ID: KvKAEuYkssx
2017-08-12 10:12:28 -07:00
Hiroyuki Ikezoe
0d870b1b90 Bug 1388031 - Cleanup code that was used for verifying styling results for throttled animation flush in post traversal. r=bholley
Now that we do process normal traversal even in the case of throttled animation
flush so that we don't need to do special handling for the case.

Note about the comment in has_current_styles():
the remaining animation hints is not caused by either this patch or the
previous patch in this patch series, it's been there in the first place, but
it should be fixed somehow later. See bug 1389675.

MozReview-Commit-ID: JojHufxNCiS
2017-08-11 20:34:08 -07:00
Bobby Holley
3e308bd38d Bug 1389385 - Rearrange dirty noting to operate on the element rather than the parent. r=emilio
This will allow us to scope restyle roots more tightly.

MozReview-Commit-ID: 2t2lp5sKBHH
2017-08-11 18:18:22 -07:00
Boris Zbarsky
efd62c0c96 Bug 1388877. Fix insertions under a ::first-line in stylo. r=heycam
MozReview-Commit-ID: CDolJpTtGki

--HG--
extra : rebase_source : dbef95a652491fbfee0a462995938b4801a785ad
2017-08-11 09:11:23 -04:00
Hiroyuki Ikezoe
7940b76630 Bug 1389440 - Replace pseudo style with the one having animations before generating elements corresponding to content propery. r=emilio
This needs for content property animations.

MozReview-Commit-ID: C7ViMQTczJx

--HG--
extra : rebase_source : 3a4cd3b4b656fa5c1f24f0b1ca28fe4a1034aeef
2017-08-11 19:49:56 +09:00
Sebastian Hengst
6ad2efe360 Backed out changeset 6c2389558858 (bug 1388877) for asserting at ServoRestyleManager.cpp:1450 in stylo reftests and crashtests. r=backout 2017-08-11 12:24:37 +02:00
Boris Zbarsky
00efaf7f30 Bug 1388877. Fix insertions under a ::first-line in stylo. r=heycam
MozReview-Commit-ID: CDolJpTtGki

--HG--
extra : rebase_source : 8a2fb19de65cd4dcf708382df844a6bbf81441c9
2017-08-11 03:12:44 -04:00
Boris Zbarsky
a3410dfccf Bug 1385656. Fix the interaction of RecoverLetterFrames and ::first-line. r=heycam
MozReview-Commit-ID: BUt5FDI0IV1

--HG--
extra : rebase_source : 907a1f84a90ee36a777c4eae9b4073a0c3ec756f
2017-08-10 18:59:06 -04:00
Boris Zbarsky
0dd7bb3d5e Bug 1388625 part 6. Flag the in-flow frames of kids of various wrapper frames during frame construction, so we know to restyle the wrapper frames. r=heycam
MozReview-Commit-ID: 8KNug88sGp

--HG--
extra : rebase_source : 02cd19bcab6595a5fe86ea076207a8c84da4229e
2017-08-11 00:10:27 -04:00
Boris Zbarsky
60cd46bdce Bug 1388626. Restyle ::-moz-xul-anonymous-block as needed with stylo. r=heycam
MozReview-Commit-ID: KZ0s1x60VBx

--HG--
extra : rebase_source : d7103464e7563ae7105417f254609cb22481e0e3
2017-08-09 16:43:47 -04:00
Jonathan Watt
0802c22f8d Bug 1388939, part 7 - Give clear names to the nsFrameManager methods for unregistering undisplayed style contexts. r=dholbert
MozReview-Commit-ID: EFtKqKBOPQH
2017-08-01 17:12:44 +01:00
Jonathan Watt
26a2ad3013 Bug 1388939, part 5 - Rename nsFrameManager::GetUndisplayedContent to GetDisplayNoneStyleFor. r=dholbert
MozReview-Commit-ID: Kpe6DcBP8yX
2017-08-01 15:27:59 +01:00
Jonathan Watt
bde9e960a3 Bug 1388939, part 4 - Give clear names to the nsFrameManager methods for updating the registered undisplayed style contexts. r=dholbert
MozReview-Commit-ID: LZuleDSt6LR
2017-08-01 15:11:02 +01:00
Jonathan Watt
b1c7a0f236 Bug 1388939, part 3 - Give clear names to the nsFrameManager methods for registering undisplayed style contexts. r=dholbert
MozReview-Commit-ID: 1i2ilfWXcvo
2017-08-01 15:04:36 +01:00
Hiroyuki Ikezoe
5bf9f97e61 Bug 1384120 - Replace old pseudo style context with a new style context including animations. r=emilio
When a reframe happens on the parent of a pseudo element which has animations,
we need to grab style for the pseudo element that includes the animations'
style and also *replace* old style context (that does not include animations'
style) with it. Otherwise, we will use the old style context that has *no*
animations style, as a result, we will see a flicker right after the reframe.

Two reftests in this patch fail without this fix.  One is for CSS transitions,
the other one is for CSS animations.

MozReview-Commit-ID: 6pCdnQ1DGUY
2017-08-08 11:35:23 +09:00