Граф коммитов

606 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 75916bf75c Bug 1413361: EnsureFrameForTextNode shouldn't reconstruct synchronously without up-to-date styles. r=bz
MozReview-Commit-ID: IzpcdCdcPjr
2017-11-01 20:06:28 +01:00
Daniel Holbert 680815cd6e 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

--HG--
extra : rebase_source : 3356d4b80ff6213935192e87cdbc9103fec6084c
2017-10-27 10:33:53 -07:00
Nicholas Nethercote 8ad99dd7fa Bug 1411893 - Introduce nsStaticAtom. r=emilio,froydnj.
It's a sub-class of nsAtom, useful for cases where you know you are dealing
exclusively with static atoms. The nice thing about it is that you can use
raw nsStaticAtom pointers instead of RefPtr<>. (In fact, the AddRef/Release
implementations ensure that we'll crash if we use RefPtr<nsStaticAtom>.)

MozReview-Commit-ID: 4Q6QHX5h44V

--HG--
extra : rebase_source : e4237f85b4821b684db0ef84d1f9c5e17cdee428
2017-10-27 10:31:13 +11:00
Nicholas Nethercote d225f7151b 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

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Emilio Cobos Álvarez f2b7e3f5a3 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
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 9eadef1363 Bug 1374112 part 1 - Move the mUndisplayedItems field to the start to avoid alignment spill after a bool. r=dholbert
MozReview-Commit-ID: 297LgoUFwJL
2017-09-11 00:27:11 +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 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
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
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
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
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
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
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
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
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
Nicholas Nethercote f941156987 Bug 1386600 - Change nsIStringBundle methods to return |AString| instead of |wstring|. r=emk,sr=dbaron.
This removes about 2/3 of the occurrences of nsXPIDLString in the tree. The
places where nsXPIDLStrings are null-checked are replaced with |rv| checks.

The patch also removes a couple of unused declarations from
nsIStringBundle.idl.

Note that nsStringBundle::GetStringFromNameHelper() was merged into
GetStringFromName(), because they both would have had the same signature.

--HG--
extra : rebase_source : ac40bc31c2a4997f2db0bd5069cc008757a2df6d
2017-08-04 14:40:52 +10:00
Emilio Cobos Álvarez de41f4068e Bug 1384542: Remove usage of GetParentAllowServo in the frame constructor. r=bz
MozReview-Commit-ID: HPMzM8p3GSO
2017-07-31 14:29:18 +02:00
Emilio Cobos Álvarez a847138643 Bug 1377902: Trivially cleanup a bit of the FC code. r=mats
MozReview-Commit-ID: HJKVk7lWp4p

--HG--
extra : rebase_source : 8745f9ea8d4a5cd2ddc5bcb0313fb053743ab107
2017-07-05 16:30:24 +02:00
Sylvestre Ledru 4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Carsten "Tomcat" Book 6a0985654f Backed out changeset 9b2f0f827468 (bug 1377902) for bustage 2017-07-05 16:56:22 +02:00
Emilio Cobos Álvarez dfa6bdea00 Bug 1377902: Trivially cleanup a bit of the FC code. r=mats
MozReview-Commit-ID: HJKVk7lWp4p

--HG--
extra : rebase_source : 29a1b91602ef52e02869a028487fde67f815d6ec
2017-07-05 16:30:24 +02:00
Boris Zbarsky 955487f7ab Bug 1324618 part 4. Implement a way to get the first-letter frame, if any, for a block. r=heycam
MozReview-Commit-ID: 1o0d5ugJ1hj
2017-06-26 23:35:07 -07:00
Carsten "Tomcat" Book bb1fe1fc10 Backed out changeset 049b20a12429 (bug 1324618) for bustage 2017-06-27 10:39:58 +02:00
Boris Zbarsky af8c5f3819 Bug 1324618 part 4. Implement a way to get the first-letter frame, if any, for a block. r=heycam
MozReview-Commit-ID: 1o0d5ugJ1hj

--HG--
extra : rebase_source : 6b6900ab2c6fdb3ae07af6e7915b1ecce8cf051d
2017-06-26 23:35:07 -07:00
Emilio Cobos Álvarez 23bce99ae1 Bug 1361051: rename mozilla::FrameType to mozilla::LayoutFrameType. r=xidorn
This avoids conflicts with mozilla::dom::FrameType.

MozReview-Commit-ID: 7aEMbHRaTFk

--HG--
extra : rebase_source : 2d01321f5ce0ec8c0e3f70984674f82678034b3c
2017-05-01 19:32:52 +02:00
Emilio Cobos Álvarez e44543aad4 Bug 1360241: Devirtualize nsIFrame::GetType. r=heycam
MozReview-Commit-ID: 5Nzhyta5Hle

--HG--
extra : rebase_source : c2e9d4bfb9239f5e851d110cd7dff98c1e1a8d8b
2017-04-30 17:30:08 +02:00
Cameron McCormack 67201815a8 Bug 1353317 - stylo: For newly added content, note dirty descendants in the lazy frame construction case through the flattened tree parent. r=bholley
MozReview-Commit-ID: L6MhRK3zmSc

--HG--
extra : rebase_source : 575b146d66898d907b669cbe4295ca25f67a3031
2017-04-04 18:28:05 +08:00
Cameron McCormack 993d5ac341 Bug 1351535 - Part 7: Call StyleSubtreeForReconstruct when doing frame reconstruction. r=bholley
MozReview-Commit-ID: HxoGLPKJpnt

--HG--
extra : rebase_source : 92f2fa9a8f8ce369d067920be762015c879e922f
2017-04-04 19:36:09 +08:00
Cameron McCormack 19734fd5ca Bug 1351535 - Part 2: Explicitly indicate when a ContentRangeInserted call is for frame reconstruction. r=bholley
It wasn't clear to me whether the existing check for whether we are
under a restyle was sufficient to cover all cases of reconstructing
frames, so this patch makes it more explicit by passing that state
into ContentAppended and ContentRangeInserted.

MozReview-Commit-ID: HjlDCzJv97n

--HG--
extra : rebase_source : 8ce4ba097f706e3d9a1f1292515dca64fb8765ab
2017-04-04 19:17:35 +08:00
Cameron McCormack 9f3f895b0e Bug 1349134 - stylo: Style newly appended children of an element with a binding through their flattened tree parents. r=bholley
MozReview-Commit-ID: 3fQouTm2bw4

--HG--
extra : rebase_source : 599fe1e790c9fb352eb0e81f8f9b08e4012541f2
2017-03-24 14:27:22 +08:00
Emilio Cobos Álvarez 401a3ef429 Bug 1296516: Cleanup infallible or unchecked nsCSSFrameConstructor methods. r=heycam
MozReview-Commit-ID: IoMOQyAhadv
2017-03-20 22:28:16 +01:00
Boris Zbarsky 2c7f4763df Bug 1345362 part 6. Make ::-moz-pagebreak a non-inheriting anon box. r=heycam
MozReview-Commit-ID: ClqKv8HOFj4

--HG--
extra : rebase_source : 33785fdf7c14cf401d7c5a519ed2927db13c3077
2017-03-08 23:50:59 -05:00
Boris Zbarsky f12067d36e Bug 1343078 part 7. Make placeholders a non-inheriting anon box. r=dbaron
MozReview-Commit-ID: 3kQQroDRlr8

--HG--
extra : rebase_source : 6b1c8e0c1f287532badedb50439e415f97a4cf81
2017-03-08 00:18:40 -05:00
Emilio Cobos Álvarez 78a1fe605c Bug 1329877: Optimize AncestorFilter usage in lazy frame construction. r=bz
MozReview-Commit-ID: ErzurfQldHf

--HG--
extra : rebase_source : 62ee2020c8fa14b9475a660ea995537d6521779f
2017-02-27 23:35:06 +01:00
cam@mcc.id.au 35e68ba276 Bug 1331322 - Allow tagging of pseudo-implementing native anonymous content with the pseudo type at creation time, and eliminate explicit style contexts in nsIAnonymousContentCreator::ContentInfo. r=bholley
MozReview-Commit-ID: LO0t92orjWZ

--HG--
extra : rebase_source : 56611b57af30555f46e8d417f95690fb5d6ab115
2017-01-13 03:21:11 +00:00