Commit Graph

3194 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
cc3be970d3 Bug 1568536 - Simplify some style system APIs. r=heycam
Return a raw pointer instead of a strong reference to a ComputedStyle, and
handle the case of the style not being present by returning null rather than
requiring an extra function to check it and crashing if the precondition is not
met.

Also, name them so that it's clear they just return outdated styles and don't
make any extra effort.

This is just cleanup that makes the next patch easier / more obvious.

Differential Revision: https://phabricator.services.mozilla.com/D40080
2019-08-16 05:59:03 +00:00
Mats Palmgren
21e0017dd1 Bug 1574060 - Implement layout for 'display: flow-root list-item'. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D42087
2019-08-16 06:30:24 +00:00
Emilio Cobos Álvarez
23c61825eb Bug 1574101 - Use the right parent frame for block ruby if it's out of flow. r=mats
I should've caught this when reviewing, in fairness.

Differential Revision: https://phabricator.services.mozilla.com/D42163
2019-08-15 22:21:35 +00:00
Daniel Holbert
8865537b64 Bug 1574310: clang-reformat the layout directory. (no review, just doing automated reformatting)
This patch is auto-generated by the following command:
./mach clang-format -p layout/

Differential Revision: https://phabricator.services.mozilla.com/D42218
2019-08-15 22:13:49 +00:00
Noemi Erli
025090856f Backed out changeset 4d8eb840fc2e (bug 1574101) so it can reland without unrelated reformatting changes r=dholbert CLOSED TREE 2019-08-16 01:00:14 +03:00
Emilio Cobos Álvarez
d4753dbfd7 Bug 1574101 - Use the right parent frame for block ruby if it's out of flow. r=mats
I should've caught this when reviewing, in fairness.

Differential Revision: https://phabricator.services.mozilla.com/D42163
2019-08-15 21:14:34 +00:00
Mats Palmgren
096cb3e48f Bug 1557825 part 1 - Implement 'display:block ruby'. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D40211
2019-08-14 14:38:31 +00:00
Mats Palmgren
fddfc948d1 Bug 1105868 part 3 - Implement 'inline list-item' and 'inline flow-root list-item' values for the 'display' property. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39832
2019-08-14 14:37:03 +00:00
Mats Palmgren
1b48239683 Bug 1105868 part 2 - Use nsStyleDisplay::DisplayInside() in a few places to prepare for inline list-items. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39831
2019-08-14 14:36:53 +00:00
Mats Palmgren
7183051087 Bug 1105868 part 1 - Use nsStyleDisplay::IsListItem() in a few places to prepare for inline list-items. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39830
2019-08-14 14:36:18 +00:00
Mats Palmgren
1bb31cf3d5 Bug 1038294 part 14 - Use only the DisplayInside() value to decide which type of frame to create. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39766
2019-08-14 14:35:06 +00:00
Mats Palmgren
21e7f7c301 Bug 1038294 part 11 - Remove FindXULDisplayData and handle all display types in FindDisplayData instead. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39763
2019-08-14 14:34:19 +00:00
Mats Palmgren
3662d767ed Bug 1038294 part 10 - Remove dead code that handles display:none/contents which shouldn't reach FindDisplayData. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39762
2019-08-14 14:34:07 +00:00
Mats Palmgren
e9dfb6b089 Bug 1038294 part 9 - Move scroll box suppression inside the switch. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39761
2019-08-14 14:33:46 +00:00
Mats Palmgren
7ceebf967e Bug 1038294 part 8 - Move block box creation inside the switch together with all the other display types. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39760
2019-08-14 14:33:29 +00:00
Mats Palmgren
66904ea317 Bug 1038294 part 7 - Move XUL variants of '-moz-{inline-}box' from FindXULDisplayData to FindDisplayData. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39759
2019-08-14 14:33:16 +00:00
Mats Palmgren
2dbfa59daf Bug 1038294 part 6 - Simplify FindDisplayData by removing a now unnecessary lambda. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39758
2019-08-14 14:32:59 +00:00
Mats Palmgren
b1e0cb735b Bug 1038294 part 5 - Move an assertion about '-moz-{inline-}box'. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39757
2019-08-14 14:32:47 +00:00
Mats Palmgren
69977aa5fd Bug 1038294 part 4 - Move an assertion about display:contents to a place where it's not dead code. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39756
2019-08-14 14:32:40 +00:00
Mats Palmgren
d6e4f8e334 Bug 1038294 part 3 - Remove UNREACHABLE_FCDATA. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39755
2019-08-14 14:32:38 +00:00
Mats Palmgren
c5a6b3b7c3 Bug 1038294 part 2 - Remove FCDATA_FOR_DISPLAY. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39754
2019-08-14 14:32:36 +00:00
Sylvestre Ledru
3067b10938 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D41559
2019-08-13 07:15:25 +00:00
L. David Baron
8099e49d64 Bug 1571249 - Remove the IsTableCell() function. r=TYLin
It was made pointless by the previous patch.

This replaces callers that had a frame type for another reason with the
frame type check that IsTableCell did, and callers that needed to call
Type() with an IsTableCellFrame call.

Differential Revision: https://phabricator.services.mozilla.com/D40561
2019-08-08 19:48:12 +00:00
Ting-Yu Lin
88c956facf Bug 1569252 Part 2 - Let mHasColumnSpanSiblings propagate to all the continuations. r=dbaron
We want mHasColumnSpanSiblings to propagate to all the
continuations (both fixed ones or fluid ones) in nsFrame::Init() so that
we don't need to traverse all the way to FirstInFlow() for the bit in
nsBlockFrame::ComputeFinalBSize().

For the last ColumnSet or the last non-column-span wrapper, we'll need
to unset the bit for them manually after constructing them.

Differential Revision: https://phabricator.services.mozilla.com/D40761
2019-08-07 20:20:25 +00:00
Ting-Yu Lin
d366d2dec4 Bug 1569252 Part 1 - Convert nsIFrame::HasColumnSpanSiblings() property into an nsIFrame bit. r=dbaron
Differential Revision: https://phabricator.services.mozilla.com/D40760
2019-08-07 20:20:18 +00:00
Eitan Isaacson
c33edccd72 Bug 686400 - Delay accessible removal on frame reconstruction. r=Jamie,emilio
We naively remove and then recreate accessibles when their content's
frame is reconstructed. By delaying the removal until we are certain the
content does not have a new layout frame, we can cut down on redundant
recreations.

When reconstructed content is re-inserted we can check it and its
subtree for missing frames and prune those accessibles from the tree.

Differential Revision: https://phabricator.services.mozilla.com/D38380
2019-08-02 22:13:28 +00:00
Ting-Yu Lin
4a12668150 Bug 1570726 Part 1 - Move frame state bits carrying from nsCSSFrameConstructor::CreateContinuingFrame() into nsFrame::Init(). r=dholbert
These frame state bits belong to the generic group, and there is
existing logic in nsFrame::Init() for carrying frame state bits. It's
better to consolidate them in one place.

Differential Revision: https://phabricator.services.mozilla.com/D40244
2019-08-02 17:27:56 +00:00
Ting-Yu Lin
382eda9e61 Bug 1548100 Part 2 - Fix the block-size of the column-rule by consuming available block-size. r=dbaron
After enabling column-span, ColumnSet becomes an anonymous child under
ColumnSetWrapperFrame. It doesn't need to handle border and padding,
containment, and non-auto block-size. ColumnSet's final block-size is
simply the union of ::-moz-column-content frames' rects.

However, we should extend ColumnSet's block-size to consume the
available block-size if the ColumnSetWrapper's block-size is constrained
so that the column rules are drawn to the block-end edge of the multicol
container.

Differential Revision: https://phabricator.services.mozilla.com/D39060
2019-08-01 22:48:55 +00:00
Ciure Andrei
af9491ad4f Backed out 2 changesets (bug 1548100) for causing nsColumnSetFrame.cpp perma asertion failures CLOSED TREE
Backed out changeset a06a6a6e1c5e (bug 1548100)
Backed out changeset 03a11c109d07 (bug 1548100)
2019-08-02 00:44:55 +03:00
Ting-Yu Lin
c7f4a489b5 Bug 1548100 Part 2 - Fix the block-size of the column-rule by consuming available block-size. r=dbaron
After enabling column-span, ColumnSet becomes an anonymous child under
ColumnSetWrapperFrame. It doesn't need to handle border and padding,
containment, and non-auto block-size. ColumnSet's final block-size is
simply the union of ::-moz-column-content frames' rects.

However, we should extend ColumnSet's block-size to consume the
available block-size if the ColumnSetWrapper's block-size is constrained
so that the column rules are drawn to the block-end edge of the multicol
container.

Differential Revision: https://phabricator.services.mozilla.com/D39060
2019-08-01 00:03:22 +00:00
Ting-Yu Lin
ac3684f84c Bug 1506293 Part 2 - Fix the block-size distribution across column-span split. r=dbaron
In frame construction, a block can be split by column-spans into several
fragments and each of the fragments is chained together by non-fluid
continuations. Later in reflow, each fragment can create its own fluid
continuations due to reasons such as the constraint of its available
block-size.

The main idea of this patch is that we calculate the block's final
block-size by shrinkwrapping the children for every fragment except for
those fluid continuations after the final column-span. To do that, we
need to correctly tag each non-column-span-wrappers
nsIFrame::HasColumnSpanSiblings() except the last one.

We also need to modify nsSplittableFrame::ConsumedBSize() so that it
includes the block-size for both fluid and non-fluid continuations.

Differential Revision: https://phabricator.services.mozilla.com/D38124
2019-07-30 18:03:25 +00:00
Alex Catarineu
f7985f498c Bug 1561322 - Allow spoofing strings in HTML forms r=baku,Pike
When privacy.spoof_english = 2, we should hide the user's
locale in content. So we use en-US default strings for HTML
form elements, such as a Submit button.

We also force GetLocalizedEllipsis() to always return the
ellipsis used by en-US.

Differential Revision: https://phabricator.services.mozilla.com/D35815
2019-07-24 13:22:22 +00:00
Kannan Vijayan
c690c1925f Bug 1559414 - Rename unaudited pre-fission methods with SameProcess for future audit burndown. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D39378
2019-07-26 16:48:31 +00:00
Nicholas Nethercote
c4aacd8403 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

Differential Revision: https://phabricator.services.mozilla.com/D39138
2019-07-26 01:10:23 +00:00
Mats Palmgren
e52af45a97 Bug 1567773 - [css-lists] Look for an inside ::marker frame too when searching for a suitable sibling. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D38902
2019-07-22 15:43:16 +02:00
Ting-Yu Lin
e1f1b89eb9 Bug 1566672 - Handle the {ib}-split reframing in multicol subtree properly. r=dholbert
Delete `return false` at the end of the if-statement block that handling
the multicol subtree reframing, and let it fall though the bottom of
WipeContainingBlock() where there is a complete logic for ib-split
reframing.

Differential Revision: https://phabricator.services.mozilla.com/D38548
2019-07-19 19:38:05 +00:00
L. David Baron
ca88671959 Bug 1566945 - Add a parameter to nsContainerFrame::InsertFrames for aPrevFrame's line box. r=dholbert
For now, always pass null, except when passing it through from one
overload to another.

Differential Revision: https://phabricator.services.mozilla.com/D38389
2019-07-17 23:34:45 +00:00
Ting-Yu Lin
d5edb44536 Bug 1565136 - Move some reframing logic out of WipeContainingBlock to make it done earlier. r=dholbert
Also move the duplicate logic for reframing MathML in ContentAppended()
and ContentRangeInserted() into WipeInsertionParent().

Differential Revision: https://phabricator.services.mozilla.com/D38417
2019-07-18 04:55:03 +00:00
Emilio Cobos Álvarez
4d7b885efc Bug 1564366 - Update animations when a pseudo-element had animations but no longer has, and has been re-framed in the meantime. r=birtles
This is the easy fix.

The hard fix (outlined in the comment) would be nice, but I don't think this bug
alone justifies it.

Differential Revision: https://phabricator.services.mozilla.com/D38184
2019-07-16 15:42:08 +00:00
Sylvestre Ledru
3bf4f867df Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D38057
2019-07-16 07:33:44 +00:00
Ting-Yu Lin
3ee8927821 Bug 1562701 - Move the reframing logic of <details> element into WipeContainingBlock. r=dbaron
We don't need to treat a details frame as if it has multiple content
insertion points in order to reframe it. We can just put the logic into
WipeContainingBlock().

The reftests layout/reftests/details-summary/dynamic-add-*.html also
cover adding <summary> into a <details> in various situations.

Differential Revision: https://phabricator.services.mozilla.com/D36529
2019-07-11 05:34:24 +00:00
Cameron McCormack
87ea9b4aa7 Bug 1554571 - Part 3: Cache computed styles of scrollbar part anonymous content. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D33123
2019-06-27 07:22:22 +00:00
Cameron McCormack
e738e1249d Bug 1554571 - Part 1: Remove unused argument from Servo_ResolveStyle. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D33121
2019-06-27 07:22:13 +00:00
Mihai Alexandru Michis
67c201f6ab Backed out 4 changesets (bug 1554571) for causing failures in minimal-xul.css
Backed out changeset 1cc4e6374b8a (bug 1554571)
Backed out changeset 30728685499e (bug 1554571)
Backed out changeset c14e9c381345 (bug 1554571)
Backed out changeset a2143551d7bc (bug 1554571)
2019-06-27 07:09:55 +03:00
Cameron McCormack
af626c09dc Bug 1554571 - Part 3: Cache computed styles of scrollbar part anonymous content. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D33123
2019-06-27 00:25:03 +00:00
Cameron McCormack
d883ec22a0 Bug 1554571 - Part 1: Remove unused argument from Servo_ResolveStyle. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D33121
2019-06-27 00:24:54 +00:00
Ting-Yu Lin
8b884c7f33 Bug 1523595 Part 2 - Add missing NS_FRAME_HAS_MULTI_COLUMN_ANCESTOR for nested ColumnSetWrapper. r=dbaron
Bug 1507244 changes how NS_FRAME_HAS_MULTI_COLUMN_ANCESTOR is propagated
to the child, but I forget to add the bit for nested ColumnSetWrapper.

Currently, no other code depends on this bit being set on nested
ColumnSetWrapper, but Part 3 will. Without this patch,
testing/web-platform/tests/css/css-multicol/multicol-nested-margin-002.xht
will fail with Part 3.

Differential Revision: https://phabricator.services.mozilla.com/D31675
2019-06-19 17:05:18 +00:00
Emilio Cobos Álvarez
eb9d659a69 Bug 1558352 - Ensure canvas anonymous content is always created before constructing the document element frame's children. r=TYLin
Right now that doesn't happen, so you can run into problems like the one
described in bug 1492582 comment 30 for popups.

This is a bit annoying, but it's more consistent with how regular anonymous
content works already:

  https://searchfox.org/mozilla-central/rev/0da35261b6789eec65476dbdd4913df6e235af6d/layout/base/nsCSSFrameConstructor.cpp#9644

It's still not 100% consistent, since the root element's frame would still end
up first in the frame tree, but I think that's both less important and harder to
change. I've left a comment to that effect in the code.

Differential Revision: https://phabricator.services.mozilla.com/D34434
2019-06-12 10:09:28 +00:00
Boris Zbarsky
8e16a497d9 Bug 1557793 part 3. Change the signatures of various nsContentUtils localization methods to play nicer with the new stringbundle API. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D34201
2019-06-08 21:26:12 +00:00
Emilio Cobos Álvarez
36577351db Bug 1487216 - Measure memory usage of RDL. r=mattwoodrow,miko
For now I added everything to the same bucket, but I wrote this so it should be
easy to add more buckets as needed (either to mArenaSizes, or more specific ones
like the style system has). But this is probably enough for now.

Differential Revision: https://phabricator.services.mozilla.com/D34126
2019-06-09 22:58:24 +00:00