Commit Graph

2873 Commits

Author SHA1 Message Date
Boris Zbarsky
889fa1df76 Bug 1434273. Make nsGenConImageContent's inheritance match the way it's used. r=mccr8
MozReview-Commit-ID: AYL4iZkMJiH
2018-01-30 14:48:26 -05:00
Boris Zbarsky
a86373f271 Bug 1418076 part 11. Eliminate the nsIDOMHTMLDocument interface. r=mystor
MozReview-Commit-ID: 4lEcUeenbg3
2018-01-26 01:03:25 -05:00
Boris Zbarsky
a04420f06a Bug 1432186 part 19. Remove the nsIDOMNode::*_NODE constants. r=mccr8
MozReview-Commit-ID: KvKjeKIOB9K
2018-01-29 23:10:53 -05:00
Emilio Cobos Álvarez
631f8eec7e 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
2017-12-21 19:34:48 +01:00
Emilio Cobos Álvarez
c617825580 Bug 1426649: Stop tracking DOM changes from painting. r=dbaron
I'm pretty sure this is not a problem now, since we don't mutate the DOM from
painting, and we don't have legacy extensions anymore.

Just to confirm, I did a try run with a RELEASE_ASSERT(!CheckDOMModified()), and
it passed.

MozReview-Commit-ID: HTekD8tsz9v
2017-12-21 14:09:32 +01:00
KuoE0
9726342c40 Bug 1428297 - (Part 2) Ignore the widget/view usage that is used to show the dropdown menu when content-select is enabled. r=mats
MozReview-Commit-ID: 68HYWmniXwt
2018-01-08 11:43:51 +08:00
KuoE0
da575c9d20 Bug 1428297 - (Part 1) Add an nsLayoutUtils function to check whether content-select is enabled r=mats
MozReview-Commit-ID: KVQ25Dhl9xl
2018-01-11 10:37:41 +08:00
Coroiu Cristina
56d935855a Backed out 1 changesets (bug 1429088) for crashes, e.g. in reftest/tests/layout/reftests/bugs/309914-1.xul on a CLOSED TREE
Backed out changeset 7647a5900c99 (bug 1429088)
2018-01-13 12:50:05 +02:00
Emilio Cobos Álvarez
ba70e77323 Bug 1429088: Only style children on non-lazy frame construction after we found an insertion point. r=bz
Servo tries to keep this invariant that stuff under a display: none element
subtree doesn't get styled.

This invariant isn't checked in StyleNewChildRange, but we can fix this by just
doing the work after finding an insertion point, which guarantees that.

Do the same for listboxes, since we also style early for them without knowing
whether they actually have a listbox parent frame.

MozReview-Commit-ID: Glyx24wQ6qY
2018-01-09 17:19:00 +01:00
Daniel Holbert
5974c6309d Bug 1430297: Use AddRef() instead of NS_ADDREF (when keeping generated content alive in nsCSSFrameConstructor). r=mats
MozReview-Commit-ID: ECz1SCYO4ia
2018-01-12 15:33:01 -08:00
Emilio Cobos Álvarez
86eb34976c Bug 1429088, Bug 1429125: Add a comment about why we can't remove the XUL check, at least yet. r=me
MozReview-Commit-ID: wzzzGQpXVV
2018-01-10 05:50:31 +01:00
Emilio Cobos Álvarez
09e057ec1f Bug 1429125: Enable lazy frame construction in the browser chrome, but not XUL yet. r=heycam,tnikkel
This is on top of the patch to re-enable them in shadow trees for bug 1429088.

MozReview-Commit-ID: 3dwQ9J5nFcS
2018-01-10 05:47:13 +01:00
Emilio Cobos Álvarez
651bc21310 Bug 1429088: Enable lazy frame construction for shadow trees. r=bz
There's no reason it wouldn't work after bug 1404789.

MozReview-Commit-ID: 28X5x2rDqYn
2018-01-10 05:47:05 +01:00
Emilio Cobos Álvarez
5791ce7eb5 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
KuoE0
ac615c361d Bug 1425088 - (Part 3) Put the dropdown frame's placeholder into the principal child list of the combobox frame when content-select is enabled. r=mats
MozReview-Commit-ID: HJrltVmJCOj
2018-01-05 17:50:38 +08:00
KuoE0
28b5155923 Bug 1425088 - (Part 2) Change the dropdown frame to a top-level absolute frame when content-select is enabled. r=mats
MozReview-Commit-ID: E77XdiELqhm
2017-12-13 17:59:29 -06:00
Emilio Cobos Álvarez
abf75f306c 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
54b8b3b3f5 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
8746f1a67e 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
fd2f0df512 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
2018-01-03 05:51:12 +01:00
Emilio Cobos Álvarez
4b667b388a Bug 1427824: Remove invalid assertion in presence of display: contents. r=bz
MozReview-Commit-ID: 4jFGHcD5wds
2018-01-05 19:12:42 +01:00
Andrea Marchesini
6034999d9d Bug 1425440 - Get rid of GetChildAt_Deprecated in nsCSSFrameConstructor, r=catalinb 2018-01-03 16:30:15 +01:00
Andrea Marchesini
98865c5324 Bug 1425321 - Renaming nsINode::GetChildAt to GetChildAt_Deprecated, r=catalinb
We want to deprecate nsINode::GetChildAt as the first step of removing DOM node
child array storage. See bug 651120.
2018-01-03 13:59:54 +01:00
Emilio Cobos Álvarez
ebc2e23e06 Bug 1427511: Make GetFlattenedTreeParent more straight-forward. r=smaug
Now that accessing nsIContent slots is not a blob of virtual function calls, we
should be able to unify logic here, and speed up the not-so-rare case for
chrome, while keeping the usual case fast.

MozReview-Commit-ID: 87iY5Cbhx4T
2018-01-02 18:00:25 +01:00
Emilio Cobos Álvarez
8a71d3197b 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
ecd202d763 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
b3956b6171 Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W
2017-12-07 19:13:50 +01:00
Emilio Cobos Álvarez
42b8e68243 Bug 1420547: Fix removal of <area> elements from an image map. r=bz
This code was relying on nsImageFrame::ContentRemoved running before it.

MozReview-Commit-ID: Imjhd9exjQS
2017-12-13 01:58:48 +01:00
Emilio Cobos Álvarez
a12241bd7d Bug 1420547: Notify the pres shell specially, instead of via mutation observers. r=bz
This makes the pres shell be notified as the last observer unconditionally.

In practice this doesn't matter, and it may already be the case if an iframe
goes display: none and back. In practice, the only dependency that requires this
order is that the pres shell needs to be notified _after_ the content sink, so
we don't try to enter frame construction before beginning the shell update.

That may be worth looking into, but definitely not in the scope of this bug... :)

MozReview-Commit-ID: 9WeJ5kaUtBq
2017-12-06 05:26:32 +01:00
Emilio Cobos Álvarez
ba0cde9fc6 Bug 1426536: Remove nsContentUtils::IsContentInsertionPoint. r=smaug
We're not going to need it in Shadow DOM v1.

MozReview-Commit-ID: HOokTPlm2Wt
2017-12-20 22:45:19 +01:00
Mats Palmgren
b6257747b6 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
Daniel Holbert
4e1b798cc9 Bug 1398963 part 7: Add an about:config flag to optionally emulate -moz-box with flexbox. r=mats
This feature is intended to help Firefox frontend developers experiment with
replacing XUL content with modern flexbox.  We might also eventually use
this emulation to *actually* render most or all of our legacy XUL UI.

MozReview-Commit-ID: 3g2W9o3t23H
2017-10-26 11:12:17 -07:00
Daniel Holbert
f608ba3a3d Bug 1398963 part 5: Treat XUL Popups like other OOF boxes when generating anon flex items, since they spawn placeholders. r=mats
XUL popups (i.e. FrameConstructionItem instances with mIsPopup==true) behave
like out-of-flow content -- in particular, they generate nsPlaceholderFrame
instances.  So, they need the same placeholder-wrapping behavior that we have
for other out-of-flow frames inside of an emulated legacy box, in order to
satisfy our existing invariants.

MozReview-Commit-ID: KnspN4kTPnx
2017-12-18 12:17:10 -06:00
Daniel Holbert
c230cb8658 Bug 1398963 part 4: Refactor logic in nsCSSFrameConstructor's IsXULDisplayType() function (idempotent patch). r=mats
This patch does not change behavior. This patch just refactors the logic in
IsXULDisplayType so that -moz-box and -moz-inline-box are handled via a
dedicated early-return.  This lets a later patch in this series make a more
understandable targeted tweak to add pref-controlled behavior for these display
values.

MozReview-Commit-ID: 6keGrxJcA5l
2017-12-18 12:17:10 -06:00
Daniel Holbert
3ceb8c2c7c Bug 1398963 part 3: Generalize "webkit-box" variable names and code-comments in nsCSSFrameConstructor.cpp (idempotent patch). r=mats
Now that (per previous patch) NS_STATE_FLEX_IS_EMULATING_LEGACY_BOX isn't just
a webkit-box-specific tag: this patch here generalizes the variable-names and
comments associated with that flag in nsCSSFrameConstructor.cpp.

This patch does not make any changes to behavior; it's simply renaming &
comment tweaks.

MozReview-Commit-ID: DcF5GirAQwD
2017-12-18 12:17:10 -06:00
Daniel Holbert
7d219d6c3a Bug 1398963 part 1: Rename frame-state bit from NS_STATE_FLEX_IS_LEGACY_WEBKIT_BOX to NS_STATE_FLEX_IS_EMULATING_LEGACY_BOX (idempotent patch). r=mats
This patch isn't changing semantics of this bit at all - it just renames it to
a more general name. In other words, this patch does not change behavior.

MozReview-Commit-ID: 4wb13X4YinJ
2017-12-18 12:17:10 -06:00
Mats Palmgren
f630476df9 Bug 1424524 part 2 - Use IsFlexOrGridContainer() in a few more places. r=dholbert
MozReview-Commit-ID: 3BwSheNfbrx
2017-12-14 16:21:49 +01:00
Mats Palmgren
ba292e12df Bug 1424524 part 1 - Use IsFlexContainerForLegacyBox() to avoid code duplication. r=dholbert
MozReview-Commit-ID: 6LY3iW4YnbY
2017-12-14 16:21:49 +01:00
Emilio Cobos Álvarez
e672b5c225 Bug 1424680: Fix appending in some situations to display: contents stuff. r=bz
I've verified that this asserts without the patch.

MozReview-Commit-ID: 8j6x4xswrCe
2017-12-11 06:44:44 +01:00
Emilio Cobos Álvarez
1328840715 Bug 1424094: Remove second argument for GetLastIBSplitSibling, and always append to the last continuation of an IB split. r=mats
The LastContinuation stuff behavior was what we did before the other patches, so
let's do that all the time to avoid surprises, though unfortunately I don't have
test-cases.

This effectively restores exactly the same behavior we had before all my frame
constructor patches, just with less code.

MozReview-Commit-ID: IkQ3H3rtlQM
2017-12-08 00:24:36 +01:00
Emilio Cobos Álvarez
0b0b1494f4 Bug 1419964: Remove AdjustParentFrameForAfterContent. r=mats
Instead, handle the display: contents case and the ::after case using
FindNextSibling.

The removal of line frames is moved up to not interfere with the insertion point
computation.

Also parentAfterFrame is renamed to nextSibling, which is more relevant to what
it was doing with display: contents.

MozReview-Commit-ID: 1cqclsGQlaw
2017-12-08 00:02:00 +01:00
Emilio Cobos Álvarez
2480b400db Bug 1419762: Return the inline continuation of an IB split when appending. r=mats
The only reason not to do that is when there's after content in there. We know
that there isn't really any ::after content, since it would've been handled by
FindNextSibling, so we know we're performing a real append.

MozReview-Commit-ID: ExoPolZy4gG
2017-12-07 23:57:39 +01:00
Emilio Cobos Álvarez
c10ea9ea04 Bug 1423167: Move most attribute-related methods from nsIContent to Element. r=bz
MozReview-Commit-ID: 6WXqNiODttD
2017-12-06 16:05:59 +01:00
Emilio Cobos Álvarez
13332c287a Bug 1422654: stylo: Avoid restyling XBL-bound element if the binding doesn't have stylesheets. r=heycam
MozReview-Commit-ID: An2McUbpCLk
2017-12-04 02:47:54 +01:00
Emilio Cobos Álvarez
f6451b69ce Bug 1417661: Use the correct parent style for inheriting from first-letter if the container is an anonymous box. r=bz
MozReview-Commit-ID: 1B7DrAVa274
2017-11-28 19:29:46 +01:00
KuoE0
ed8ea5e117 Bug 1419337 - Remove aStyleContext parameter from nsFrameConstructorState::AddChild(). r=TYLin
We don't use aStyleContext inside nsFrameConstructorState::AddChild(), so I
think we should remove it.

MozReview-Commit-ID: JQUlEDyVcUj
2017-11-21 18:01:53 +08:00
Emilio Cobos Álvarez
1ceef98650 Bug 1418560: Don't build IsFlattenedTreeChild in release builds. r=bustage
MozReview-Commit-ID: GP7Qds5loBI
2017-11-20 18:07:06 +01:00
Emilio Cobos Álvarez
f7e7d95d27 Bug 1418560: Properly return null from GetFlattenedTreeParent if the node is XBL fallback content and the binding is active. r=heycam
Otherwise we may inappropriately style it or what not. This asserts with the
patches of bug 1414999 plus the cleanup of bug 1418456, since we no longer do
StyleNewChildren (which walks over the flattened tree children).

Too bad that GetXBLBinding is a virtual call in Gecko, probably can do just
MAY_BE_IN_BINDING_MGR...

MozReview-Commit-ID: CNU0YdKeaR0
2017-11-20 17:32:07 +01:00
Emilio Cobos Álvarez
a96e393970 Bug 1418456: Yet another followup: Always re-get the style context in the servo case after loading an XBL binding to avoid tripping otherwise useful assertions. r=me
Now we always restyle the whole subtree for Servo, so we may create another
style context for the bound element.

This trips assertions if we happen to create pseudo-element styles for them.

Since that assertion is pretty useful, just re-get the style context all the
time, which is a cheap operation otherwise.

The CLOSED TREE nightmare should end. This wasn't caught in my try run because
another assertion made the crashtests stop running, apparently.

MozReview-Commit-ID: 6U0phWFvvXO
2017-11-20 17:09:29 +01:00
Emilio Cobos Álvarez
061ab063bb Bug 1418456: followup: Re-add the HasServoData check because I was too optimistic addressing review comments. r=me
On a CLOSED TREE.

MozReview-Commit-ID: 8vpoqBv1E3
2017-11-20 14:49:45 +01:00