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

701 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez e1af3b4e1c Bug 1478069: Remove ContentInfo::mChildren. r=bz
It's not needed anymore, since we tag the pseudo-elements at creation time for
styling.

Differential Revision: https://phabricator.services.mozilla.com/D2330

MozReview-Commit-ID: 7j4DVEHXYIC
2018-07-25 11:31:23 +02:00
Emilio Cobos Álvarez 26b508d03c Bug 1478069: Trivial frame constructor cleanup. r=TYLin
Using references helps to see when stuff can and cannot be null.

I removed useless aTag / aNamespaceId arguments which are useless now that XBL
can't override them (bug 1450617), so FindXULData is the only one that keeps
them alive.

Also, I took the liberty of renaming a few fooComputedStyle variables to just
fooStyle, and clarify naming in some pseudo-element-related functions to say
originating element (the spec term) and avoid confusing it with the generated
_moz_generated_content_before / _moz_generated_content_after element.

Note that this is a partial state, more stuff will come in the future.

Differential Revision: https://phabricator.services.mozilla.com/D2326

MozReview-Commit-ID: 39B30doREUH
2018-07-25 11:31:18 +02:00
Paolo Amadini dc49387df8 Bug 1472555 - Part 5 - Remove the listbox layout. r=bz,surkov
MozReview-Commit-ID: Bx1p1nTurCz

--HG--
extra : rebase_source : 6910e500f30eb42b45032dbab85a3dc9c014390b
2018-07-18 11:23:32 +01:00
Emilio Cobos Álvarez 0da3dae9c9 Bug 1472403: Simplify generated image content. r=bz,dholbert
This way we reuse the same machinery everywhere for the content property.

The only difference is that we need to look at the parent style for content
instead of just our style, and at a given index.

Again, this is fine because changing content reframes, so no chance to mess up.

This allows the generated content stuff to not implement nsImageLoadingContent
and all that stuff, nor deal with events, which makes it much simpler IMO.

Now it just tracks an index. We may not even need for it to be an HTML element,
but I've kept that for now.

I added a crashtest that used to crash because of the bogus
nsCSSFrameConstructor code which trusted the node name without checking it was
native anonymous.

Differential Revision: https://phabricator.services.mozilla.com/D1897

MozReview-Commit-ID: 1pAzIvRRVnL
2018-07-16 18:06:38 +02:00
shindli ba72001f71 Backed out 2 changesets (bug 1473813, bug 1472403) for bustages in /builds/worker/workspace/build/src/dom/base/MessageSender.cpp:24:19 on a CLOSED TREE
Backed out changeset 93e4dff7e346 (bug 1473813)
Backed out changeset 365a0841117a (bug 1472403)
2018-07-16 18:45:33 +03:00
Emilio Cobos Álvarez 966f1a9206 Bug 1472403: Simplify generated image content. r=bz,dholbert
This way we reuse the same machinery everywhere for the content property.

The only difference is that we need to look at the parent style for content
instead of just our style, and at a given index.

Again, this is fine because changing content reframes, so no chance to mess up.

This allows the generated content stuff to not implement nsImageLoadingContent
and all that stuff, nor deal with events, which makes it much simpler IMO.

Now it just tracks an index. We may not even need for it to be an HTML element,
but I've kept that for now.

I added a crashtest that used to crash because of the bogus
nsCSSFrameConstructor code which trusted the node name without checking it was
native anonymous.

Differential Revision: https://phabricator.services.mozilla.com/D1897

MozReview-Commit-ID: 1pAzIvRRVnL
2018-07-16 17:30:14 +02:00
Emilio Cobos Álvarez fb4762b5e6 Bug 1461749: Fix slow path for finding the next sibling frame for appending in presence of Shadow DOM. r=mats
In this case we have a shadow hoot with display: contents, with no children.
Those children wouldn't be flattened tree children of the shadow host.

Instead of using the last light dom child and seek to it, use
FlattenedChildIterator's reverse iteration.

MozReview-Commit-ID: 18XL5Ong7ww

--HG--
extra : rebase_source : 2d34bd5b1fdd509a069ffa5052a7b7b3302be24c
2018-05-23 18:20:33 +02:00
Emilio Cobos Álvarez 543a797d15 Bug 1421807: Wallpaper SVG text code which makes too many assumptions about the DOM. r=heycam
Second test-case is because I initially made this code work with
display: contents. But then realised that display: contents meant allowing
Shadow DOM in there, which I don't really want to deal with right now.

MozReview-Commit-ID: HSjFbWEbPAb

--HG--
extra : rebase_source : 51b950d5e74e17b0200112a7d447b3e3b9414602
2018-04-23 21:23:50 +02:00
Emilio Cobos Álvarez 4d7ccac45c Bug 1454340: Get rid of SetAsUndisplayedContent. r=mats
Move the assertion to the earliest point where it can happen instead, and do it
automatically on exit if it's generated content instead of relying on manual
calls.

MozReview-Commit-ID: 5oPwXg2o22V
2018-04-16 19:53:38 +02:00
Emilio Cobos Álvarez e5e108a524 Bug 1453702: [css-display] Move unboxing to style, and handle display: contents before other suppressions. r=mats,xidorn
This also adopts the resolution of [1] while at it, and switches XUL to not
support display: contents until a use case appears.

This makes our behavior consistent both with the spec and also in terms of
handling dynamic changes to stuff that would otherwise get suppressed.

Also makes us consistent with both Blink and WebKit in terms of computed style.
We were the only ones respecting "behaves as display: none" without actually
computing to display: none. Will file a spec issue to get that changed.

It also makes us match Blink and WebKit in terms of respecting display: contents
before other suppressions, see the reftest which I didn't write as a WPT
(because there's no spec supporting neither that or the opposite of what we do),
where a <g> element respects display: contents even though if it had any other
kind of display value we'd suppress the frame for it and all the descendants
since it's an SVG element in a non-SVG subtree.

Also, this removes the page-break bit from the display: contents loop, which I
think is harmless.

As long as the tests under style are based in namespace id / node name /
traversal parent, this should not make style sharing go wrong in any way, since
that's the first style sharing check we do at [2].

The general idea under this change is making all nodes with computed style of
display: contents actually honor it. Otherwise there's no way of making the
setup sound except re-introducing something similar to all the state tracking
removed in bug 1303605.

[1]: https://github.com/w3c/csswg-drafts/issues/2167
[2]: https://searchfox.org/mozilla-central/rev/fca4426325624fecbd493c31389721513fc49fef/servo/components/style/sharing/mod.rs#700

MozReview-Commit-ID: JoCKnGYEleD
2018-04-16 12:56:30 +02:00
Ciure Andrei 873d562bc3 Backed out 8 changesets (bug 1451169) on request from njn a=backout
Backed out changeset b92f856e15a8 (bug 1451169)
Backed out changeset 348e825756fa (bug 1451169)
Backed out changeset 624d82428726 (bug 1451169)
Backed out changeset 4d51610ca08e (bug 1451169)
Backed out changeset bb76a9589717 (bug 1451169)
Backed out changeset c145fbd03947 (bug 1451169)
Backed out changeset 6d36289e0f54 (bug 1451169)
Backed out changeset 914fb7cd9fc3 (bug 1451169)

--HG--
extra : histedit_source : 94de6631919f895dec422bc0e564f5baf885ba4a%2C18f52c6c11d3064d3137a6847575effb7d407894
2018-04-11 11:22:05 +03:00
Emilio Cobos Álvarez b508e66696 Bug 1447827: Move members from ServoRestyleManager to RestyleManager. r=xidorn
This leaves ServoRestyleManager as just a typedef.

MozReview-Commit-ID: 5wfTkiDc2Nr
2018-04-07 15:40:00 +02:00
Emilio Cobos Álvarez 0ea369c6a3 Bug 1450717: Remove unneeded / inconsistent arguments from nsCSSFrameConstructor. r=mats
Much in the spirit of bug 1442207.

They're not only unneeded, and cheap to get, but also we call them
inconsistently with the light DOM and flattened tree parent (like ContentRemoved
for display: contents), so they're really confusing, and kind of a footgun.

MozReview-Commit-ID: 9u3Kp8Kpp5i
2018-04-07 15:37:39 +02:00
Emilio Cobos Álvarez 93fa973783 Bug 1303605: Make LazyFC assertions actually hold. r=bz
The code was trying to assert that we had frames constructed for all the nodes
in the parent chain, but we don't bail out in the
!GetContentInsertionFrameFor(aContainer) in the case that it's a children
element, because they actually have no insertion frame, though their children
do.

Move the LazyFC check after the insertion point check. That makes the previous
check work on the insertion point of the child, which makes it sound.

This also fixes bug 1410020, and with it a Shadow DOM test-case that was failing
because we had two sibling assigned to two different <slot>s, and the second one
wasn't getting properly flagged, and thus the second sibling never got a frame.

The other two test failures in this test are an event dispatch failure, where
the position of the target is not what the test expects (we don't account for
margin and padding). Filed that as bug 1450027.

Also, added a test for which we have wrong layout without these patches, and
that crashes with "Called Servo_Element_IsDisplayNone" with the first patch of
this bug applied but not this one, due to the bogus check mentioned above.

MozReview-Commit-ID: 6OeaVrZhTDv
2018-04-07 15:22:06 +02:00
Emilio Cobos Álvarez c0f2f96f66 Bug 1303605: Remove the undisplayed maps. r=bz,mats
This is mostly code removal, changing GetDisplayContentsStyle(..) checks by an
FFI call to Servo.

The tricky parts are:

 * MaybeCreateLazily, which I fixed to avoid setting bits under display: none
   stuff. This was a pre-existing problem, which was wallpapered by the
   sc->IsInDisplayNoneSubtree() check, which effectively made the whole
   assertion useless (see bug 1381017 for the only crashtest that hit this
   though).

 * ContentRemoved, where we can no longer know for sure whether the element is
   actually display: contents if we're removing it as a response to a style
   change. See the comment there. That kinda sucks, but that case is relatively
   weird, and it's better than adding tons of complexity to handle that.

 * GetParentComputedStyle, which also has a comment there. Also, this function
   has only one caller now, so we should maybe try to remove it.

The different assertions after DestroyFramesForAndRestyle are changed for a
single assertion in the function itself, and the node bit used as an
optimization to avoid hashtable lookups is taken back.

MozReview-Commit-ID: AZm822QnhF9
2018-04-07 15:21:56 +02:00
Emilio Cobos Álvarez 92232a9bc4 Bug 1451239: Remove resolved namespace id and tag from FCItems. r=bz
Tag is unused.

This changes how some mixes of MathML and html get wrapped in anonymous table
boxes (in particular, it changes whether it uses a MathML or an HTML table
frame). The main thing this affects is whether the frame responds to certain
attributes. Responding to mathml attributes on its mContent when that mContent
is not a MathML element is weird. So arguably this is also more correct.

However, that seems acceptable to me, and you can already get that mixing
manually. On a few (arguably simple) manual test-cases mixing MathML and HTML
tables I couldn't manage to get the patched build to render differently.

Plus, neither our reftests nor the WPT MathML test-suite upstreamed by Fred Wang
for WebKit rely on this.

MozReview-Commit-ID: 8IV3iF5xIs0
2018-04-06 11:51:47 +02:00
Nicholas Nethercote e0c05abb10 Bug 1451169 - Reduce indirection for PseudoParentData::mPseudoType. r=xidorn
MozReview-Commit-ID: CiXGCKrpfCB

--HG--
extra : rebase_source : a2c22543668887d1fd20065e71f359aaf33795d9
2018-04-03 22:15:31 +10:00
Nicholas Nethercote bfe00b7ed4 Bug 1451169 - Reduce indirection for FrameConstructionDataByTag::mTag. r=xidorn
MozReview-Commit-ID: 4qNZF7SS2bS

--HG--
extra : rebase_source : b6bda58ac9bf80c45f41427bcec53538fb927f1a
2018-04-03 22:15:31 +10:00
Nicholas Nethercote 65653d8de1 Bug 1451169 - Reduce indirection for static atom pointers in nsCSSFrameConstructor.h. r=xidorn
MozReview-Commit-ID: Kt3QfZsk0zD

--HG--
extra : rebase_source : e4bd0efe51064bb18a446655a52f5b75807ba696
2018-04-03 22:15:30 +10:00
Emilio Cobos Álvarez 364d1d533b Bug 1450617: Only allow extending from / to XUL elements. r=bz
MozReview-Commit-ID: JaFKQDkLGgw
2018-04-04 07:48:31 +02:00
Emilio Cobos Álvarez 729bd14b2b Bug 1447506: Do LazyFC for anonymous nodes too, and clean up MaybeConstructLazily. r=bz
The old style system used FlattenedTreeIterator for lazy frame construction.
That could not find native anonymous nodes, so we had to construct eagerly in
native anonymous subtrees. Servo uses StyleChildrenIterator for the same
purpose, and that knows about native anonymous content, so we can now do lazy
construction for it.

Also, not check the container to do lazyFC on the children, it's no longer
necessary to check for anon content, and the reason we check for XUL is because
of XBL bindings, and those are loaded for the parent already, if we're about to
construct frames for the children.

Also, assert more tightly, we don't insert NAC lazily, that makes no sense.
Well, to be fair editor does insert anonymous nodes lazily sometimes (see al the
ManualNAC machinery), but it goes through the PostRecreateFramesFor path, not
through ContentInserted / LazyFC.

MozReview-Commit-ID: 2TmRNgpWaM
2018-03-23 16:45:07 +01:00
Emilio Cobos Álvarez e341b20ec4 Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE
MozReview-Commit-ID: JPopq0LudD
2018-03-22 20:06:24 +01:00
Emilio Cobos Álvarez 5dd797f154 Back out changeset b683bb3f22a1 (Bug 1447483) for not landing with all the files. r=me on a CLOSED TREE
This reverts commit 1808914126bb9f9e4a82d2c3d7ac961885fe7d62.

MozReview-Commit-ID: 5skESBseEvo
2018-03-22 20:05:22 +01:00
Emilio Cobos Álvarez ca5ac79cca Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt
MozReview-Commit-ID: JPopq0LudD
2018-03-22 19:48:42 +01:00
Emilio Cobos Álvarez ebdc39ab30 Bug 1447476: Simplify ResolveStyleContext. r=xidorn,bz
We don't need the parent style context, nor the pseudo-element dance or anything
like that. All end up in the same place, Servo_ResolveStyle.

We cannot assert for text style resolution because of non-lazy frame
construction, and we cannot remove non-lazy frame construction because of XBL.

This is effectively the same code, since the old code passed the parent style
around from the frame tree / display contents map, which didn't have a similar
assertion either...  Slow steps.

I'll improve and cleanup LazyFC in bug 1447506.

MozReview-Commit-ID: Ck4RCoFLGOi
2018-03-21 17:22:56 +01:00
Emilio Cobos Álvarez 06ce853d3c Bug 1447476: Remove TreeMatchContext. r=xidorn
MozReview-Commit-ID: ETK0uGXytqb
2018-03-21 17:20:59 +01:00
Emilio Cobos Álvarez f7522ae728 Bug 1447358: Unifdef the old style system code. r=jwatt
Summary:
This has been automatically generated using:

  http://dotat.at/prog/unifdef/

And:

find $OBJDIR -type f -name '*.h' |
while read FILE; do
  echo "$FILE"
  unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE";
done

find $OBJDIR -type f -name '*.cpp' |
while read FILE; do
  echo "$FILE"
  unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE";
done

MozReview-Commit-ID: I4NdKqbMXzJ

Reviewers: jwatt

Bug #: 1447358

Differential Revision: https://phabricator.services.mozilla.com/D779
2018-03-21 10:20:34 +01:00
Boris Zbarsky b06aa7e061 Bug 1446533 part 1. Rename nsGenericDOMDataNode to CharacterData. r=mystor
This is not renaming the files yet; that will be a separate changeset.

MozReview-Commit-ID: 5TxkEiQlaKF
2018-03-19 15:18:06 -04:00
Emilio Cobos Álvarez bd1d30c860 Bug 1422653: Make FindSiblingInternal take the iterator by ref to please the static analysis on the next patch. r=mats
MozReview-Commit-ID: XCNVrTNihM
2018-02-28 23:15:31 +01:00
Emilio Cobos Álvarez 9f26540cc4 Bug 1441547: Make character data change notifications use a const reference for the info parameter. r=smaug
It's not intended to be mutated.

MozReview-Commit-ID: 5nkD1YkidlV

--HG--
extra : rebase_source : 810d429208fa3eaf30e220e77a7d27107cb77346
2018-02-27 15:30:27 +01:00
Xidorn Quan d6a3786a64 Bug 1440221 - Track stale computed values and style structs held by undisplayed maps in memory report. r=emilio,njn
MozReview-Commit-ID: 8eXowQvUjyi

--HG--
extra : rebase_source : cb5ba6598e90d9600983aad7f1fff4ff361e8af7
2018-02-22 23:19:50 +11:00
Cameron McCormack cc7db5c40c Bug 1430014 - Part 4: #ifdef out unnecessary code when the old style system is not built. r=xidorn
MozReview-Commit-ID: 1FZ9VzjcPzN

--HG--
extra : source : de22d220635f8c059834b76f769d5215ab1a8b5b
2018-02-01 15:04:04 +11:00
Emilio Cobos Álvarez 927ea89c0d Bug 1426649: Remove nsCSSFrameConstructor updates. r=mats
They used to do quote updates and such but they where moved long ago, and do
nothing now.

MozReview-Commit-ID: 188vzGctbty

--HG--
extra : rebase_source : dd638875f9ef9ceb2343df5f8677a23d820c7a36
2017-12-21 19:34:48 +01:00
Emilio Cobos Álvarez 339814eda4 Bug 1427677: Get rid of nsContentUtils::HasDistributedChildren. r=bz
The whole function doesn't have much sense.

I killed its only DOM use in bug 1427511.

Now it only has two callers in nsCSSFrameConstructor, which basically only want
to know whether the children of the same node can have different flattened tree
parents.

So let's check that directly instead (checking whether the element has a binding
or a shadow root), and simplify a bit other surrounding code while at it.

Leave the XUL popup / menubar code doing the broken thing they were doing
beforehand, because it doesn't look to me like it's trivial to fix... They're
effectively assuming that the children of the menupopup end up in a single
insertion point, which is true, but doesn't need to be. Maybe they should walk
the DOM tree? Don't want to dig into that right now, since XUL insertion points
can be filtered and all that... Not fun.

Also, this removes the broken optimization that used to check
mParentFrame->GetContent()->HasChildren(), because it's pretty broken. It used
to be relevant before bug 653881, because <children> element used to not exist,
but now the insertion point at least needs to contain the <children> element all
the time.

There even used to be a XXX comment saying that the optimization didn't work,
which was removed in:

  https://hg.mozilla.org/mozilla-central/rev/2d8585ec74b3

We could still check for "no insertion points", and optimize that, but it
doesn't seem worth it.

MozReview-Commit-ID: L4lspkxKENr
2018-01-09 20:50:17 +01:00
Emilio Cobos Álvarez 91be560d9c Bug 1427292: [css-display] Update display: contents on Unusual Elements to the spec. r=mats
This will pass[1] whenever the next WPT sync happens.

See: https://drafts.csswg.org/css-display/#unbox-html

[1]: https://github.com/w3c/web-platform-tests/blob/master/css/css-display/display-contents-unusual-html-elements-none.html

MozReview-Commit-ID: 19dqDSxVm7A
2018-01-06 21:52:51 +01:00
Emilio Cobos Álvarez a68efc4059 Backout two changesets (Bug 1427677) until I prove they have no negative performance implication. r=backout
MozReview-Commit-ID: 3xuUAXVfEHd
2018-01-06 19:01:48 +01:00
Emilio Cobos Álvarez 7f7f3991e3 Bug 1427677: Get rid of nsContentUtils::HasDistributedChildren. r=bz
The whole function doesn't have much sense.

I killed its only DOM use in bug 1427511.

Now it only has two callers in nsCSSFrameConstructor, which basically only want
to know whether the children of the same node can have different flattened tree
parents.

So let's check that directly instead (checking whether the element has a binding
or a shadow root), and simplify a bit other surrounding code while at it.

Leave the XUL popup / menubar code doing the broken thing they were doing
beforehand, because it doesn't look to me like it's trivial to fix... They're
effectively assuming that the children of the menupopup end up in a single
insertion point, which is true, but doesn't need to be.

Maybe they should walk the DOM tree? Don't want to dig into that right now,
since XUL insertion points can be reordered and all that... Not fun.

MozReview-Commit-ID: L4lspkxKENr
2018-01-06 11:39:16 +01:00
Emilio Cobos Álvarez 6b2dceda02 Bug 1427908: Never reenter synchronously into frame construction. r=bz
We remove async from the DOM all the time now since bug 1389743.

We could, before this patch, recurse into frame construction in a sync way, due
to the way we handle the weird insertion cases for <fieldset>, <details>, and
<mathml>.

This patch makes those also async, making the IssueSingleInsertNotifications
condition unnecessary.

MozReview-Commit-ID: LujPaYPwA4G

--HG--
extra : rebase_source : 3fc9dc9589a0c43f9f211e22873bf6b960d416f7
2018-01-03 05:51:12 +01:00
Emilio Cobos Álvarez c8eb630ebe Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W
2017-12-25 17:50:10 +01:00
Emilio Cobos Álvarez ffdf5d2cb5 Backout changeset e43f568b3e9a (bug 1423990) because some OSX-only code still doesn't build. r=me 2017-12-25 12:55:45 +01:00
Emilio Cobos Álvarez c0959b2955 Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W

--HG--
extra : rebase_source : 09b82acb4f3d69e8a4345457ab217443bc28d6e2
2017-12-07 19:13:50 +01:00
Mats Palmgren bb0f44962b Bug 1425959 - Only allow ::first-letter/line children when the parent frame is a block frame. r=emilio
MozReview-Commit-ID: 4ARPMUCQKKV
2017-12-20 01:08:53 +01:00
Jeremy Chen a3c09a51bc Bug 1420724 - remove duplicated include declaration in nsCSSFrameConstructor. r=heycam
MozReview-Commit-ID: KZz7C4gF3md

--HG--
extra : rebase_source : b101f60dedeaf4d08880f0d614966c2ca056a9e6
2017-11-26 23:37:46 +08:00
Emilio Cobos Álvarez ae4ab8a9df Bug 1415538: Remove dead frame construction code (InsertFirstLineFrames). r=mats
InsertFirstLineFrames has been dead for a long time, and I don't think it's
worth to keep it around. It's in the VCS history anyway.

MozReview-Commit-ID: FetYB6nf38D

--HG--
extra : rebase_source : bc56cdec7a4e45c7ea1d8cf6354a5a6dc349ac29
2017-11-08 11:57:39 +01:00
Emilio Cobos Álvarez 05a25ccc70 Bug 1413619: Fix insertion point computation when display: contents pseudos are involved. r=mats,bz
This is a significant rework of how do we compute the insertion point of a
node.

We handle pseudos in the same function instead of out of band, and also recurse
up when the parent has display: contents, which simplifies the code IMO.

MozReview-Commit-ID: 1rSfv1Tq5gO
2017-11-04 11:58:16 +01:00
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
Phil Ringnalda d2fa909610 Backed out 4 changesets (bug 1331322) for Android reftest failures in 1169331-1.html and forced-bg-color-outside-visible-region.html
Backed out changeset 96c6b5a11284 (bug 1331322)
Backed out changeset 15877d32de7d (bug 1331322)
Backed out changeset 841d608704d7 (bug 1331322)
Backed out changeset 02096c5eb029 (bug 1331322)
2017-02-15 21:24:00 -08:00
cam@mcc.id.au 34be31a2d7 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
Cameron McCormack f63cdecde2 Bug 1297899 - Part 6: Move RestyleManagerHandle functionality into RestyleManager. r=bholley
MozReview-Commit-ID: 7lsti0bGzNr

--HG--
extra : rebase_source : 13c64026190afe5de25f540adb6deea9f518149f
2017-02-13 11:21:33 +08:00
Cameron McCormack eddea92878 Bug 1297899 - Part 3: Rename RestyleManager to GeckoRestyleManager and RestyleManagerBase to RestyleManager. r=bholley
MozReview-Commit-ID: fFTZKwmGJm

--HG--
extra : rebase_source : 42b99c8a9c5616999abae2d195d16547f1fbc80f
2017-02-13 11:21:32 +08:00
Cameron McCormack 59395be5f8 Bug 1297899 - Part 2: Rename RestyleManagerBase.{h,cpp} to RestyleManager.{h,cpp}. r=bholley
MozReview-Commit-ID: JVsfYommCoI

--HG--
rename : layout/base/RestyleManagerBase.cpp => layout/base/RestyleManager.cpp
extra : rebase_source : 45661c0bffb1bcdbe1496a54ca1d132663d63268
2017-02-13 11:21:31 +08:00