Commit Graph

3208 Commits

Author SHA1 Message Date
Ting-Yu Lin
07000ca10b Bug 1102175 Part 1 - Propagate used writing-mode from body element to its ancestors. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D45481
2019-10-09 22:11:02 +00:00
Brendan Dahl
bf272a3bca Bug 1510785 - Only build XBL related code when MOZ_XBL is defined. r=bzbarsky
When XBL is disabled, no code in dom/xbl will be built. Also, adds ifdefs
to remove any of the XBL related code elsewhere. There's definitely more
that can be done here, but I think it's better to wait to do the rest of
the cleanup when we actually remove the code.

Depends on D45612

Differential Revision: https://phabricator.services.mozilla.com/D45613
2019-10-08 23:52:14 +00:00
Emilio Cobos Álvarez
e25bb5100d Bug 1581467 - Use DisplayInside() / DisplayOutside() a bit more. r=mats
And remove some unused display values from the C++ bindings.

Differential Revision: https://phabricator.services.mozilla.com/D45974
2019-10-07 12:27:27 +00:00
Sylvestre Ledru
49802d0a8e Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D47737
2019-10-06 18:29:55 +00:00
Daniel Holbert
6ff2001dc3 Bug 1584638: Relax -mox-box blockification assertions to be debug-only. r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D47505
2019-09-27 21:31:04 +00:00
Daniel Holbert
afb15161af Bug 1584187: Pass an assertion-only variable to mozilla::Unused, to fix non-nightly opt build error. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D47319
2019-09-26 21:11:33 +00:00
Daniel Holbert
fec22de422 Bug 1582819: Add diagnostic assert to catch positioned elements with display:-moz-box or -moz-inline-box that were previously blockified to 'block' but won't be anymore. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D46681
2019-09-25 20:38:55 +00:00
Ting-Yu Lin
0e45ab1630 Bug 1580576 - Remove an assertion to check <details> element's frame type when reframing. r=emilio
If a <details> is a multi-column container, and has a column-span child
inside, aFrame can be ColumnSetWrapper or column-span-wrapper frame (due
to GetInsertionPrevSibling()'s modification). The latter case is handled
by "Situation #5 in WipeContainingBlock(), and can be reproduced by
changing `<article>` tag to `<details>` in
testing/web-platform/tests/css/css-multicol/multicol-span-all-dynamic-add-005.html

In any case, aFrame might end up in a frame generated by the <details>
element. I feel the assertion to check frame types might not be very
useful. Let's remove it.

Differential Revision: https://phabricator.services.mozilla.com/D45585
2019-09-11 21:52:40 +00:00
Ting-Yu Lin
1de8acee2e Bug 1579953 - Check details element to determine whether to reframe. r=emilio
If the <details> has ::first-letter, insertion.mParentFrame may be
modified by GetInsertionPrevSibling(), and points to nsFirstLetterFrame.

Fortunately, nsFirstLetterFrame's content is the details element. We can
check the content to determine if reframing the <details> is needed.

Also, add a reftest to test that an appended text should apply styles in
details::first-line.

Differential Revision: https://phabricator.services.mozilla.com/D45454
2019-09-11 00:04:26 +00:00
Ting-Yu Lin
f9e43f6a72 Bug 1523582 Part 2 - Make -moz-column-content a BFC when column-span is enabled. r=dbaron
Based on CSS working group's resolution in
https://github.com/w3c/csswg-drafts/issues/2582#issuecomment-402619872,
column-boxes are BFC.

Add NS_BLOCK_FORMATTING_CONTEXT_STATE_BITS to -moz-column-content, but
only for the new multicol layout.

Differential Revision: https://phabricator.services.mozilla.com/D43904
2019-09-09 17:42:12 +00:00
Mats Palmgren
76728bbb7f Bug 1574552 - Push float/abs.pos. CB for 'block ruby' as needed. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D42701
2019-08-20 21:28:01 +00:00
Mats Palmgren
66432bdda6 Bug 1574994 part 2 - Remove display:-moz-inline-grid/-moz-inline-stack. r=emilio
Depends on D42551

Differential Revision: https://phabricator.services.mozilla.com/D42552
2019-08-19 21:19:04 +00:00
Emilio Cobos Álvarez
00c82387ac Bug 1574544 - Remove now-unnecessary condition that makes the frame constructor get confused with editor anonymous nodes. r=mats
This condition was needed when FindInsertionPrevSibling and co didn't understand
display: contents.

Editor is pretty broken (and calls into PresShell::ContentRemoved directly, and
incorrectly, using anonymous nodes).

In this case we were taking the XBL path because of display: contents, which
means that we tried to seek to the editor anonymous node, and crash (since it's
not an explicit kid).

Editor needs to get fixed, but this is technically more correct and fixes the
crash, so we may as well take it in the interim.

Differential Revision: https://phabricator.services.mozilla.com/D42472
2019-08-19 12:16:28 +00:00
Emilio Cobos Álvarez
c3215fc33d Bug 1568536 - Don't propagate viewport styles from display: none or display: contents elements. r=dholbert
Resolution is at:

 * https://github.com/w3c/csswg-drafts/issues/3779#issuecomment-481762912

Tests are at https://chromium-review.googlesource.com/c/chromium/src/+/1547974,
I'll make sure to wait until they're in the tree and ensure they're passing.

Note that we need to ensure in the frame constructor that the document element
is styled _before_ calling UpdateViewportScrollStylesOverride(). This saves
duplicated work (since ResolveStyleLazily throws away the style).

ResolveStyleLazily already returns out of date styles, unless the element is not
styled yet, or is in a `display: none` subtree, in which case it computes and
returns a new (up-to-date) style.

So the switch to the FFI call only should change behavior for the display: none
subtree case (since we ensure the unstyled case isn't hit by styling the
document earlier). But that case is one of the cases we're interested in
changing, conveniently.

Depends on D40080

Differential Revision: https://phabricator.services.mozilla.com/D39204
2019-08-16 11:43:36 +00:00
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