Commit Graph

722 Commits

Author SHA1 Message Date
Botond Ballo
013775a50c Bug 1667594 - Avoid including nsLayoutUtils.h in nsContainerFrame.h. r=emilio
nsContainerFrame.h was only using the enum nsLayoutUtils::IntrinsicISizeType,
which this patch moves to LayoutConstants.h instead.

Depends on D91505

Differential Revision: https://phabricator.services.mozilla.com/D91506
2020-09-26 18:19:14 +00:00
Daniel Holbert
fafdaef2c0 Bug 1652278 part 2: Flesh out PrintedSheetFrame implementation so that it serves as the container for nsPageFrame. r=TYLin
This patch:
- Creates an anon-box pseudo-style for PrintedSheetFrame, in part so that it
  can co-opt the styles that we formerly gave to page-frames in ua.css, to draw
  the sheet of paper and the shadow in Print Preview.
- Adjusts nsCSSFrameConstructor to create a PrintedSheetFrame as the parent of
  nsPageFrame (inserting between it and its nsPageSequenceFrame container, in
  the frame tree).
- Fleshes out out a simple BuildDisplayList() implementation for
  PrintedSheetFrame (taking the responsibility for "paper"-drawing from
  nsPageFrame).
- Fleshes out a simple Reflow implementation for PrintedSheetFrame, just
  placing the child page (assuming there's only one for now) at the origin.
- Adjusts nsPageFrame and nsPageSequenceFrame to account for the fact that
  there's another layer between them now.

Note that PrintedSheetFrame needs to implement AppendDirectlyOwnedAnonBoxes()
(just as nsSimplePageSequence and nsPageFrame do), since it owns anonymous
nsPageFrame instances. This implementation only needs to append the first
child, as explained in the code-comment and in
https://bugzilla.mozilla.org/show_bug.cgi?id=1374761#c9 (and of course, for
now, PrintedSheetFrame only has one child at a time anyway.)

Differential Revision: https://phabricator.services.mozilla.com/D83457
2020-08-05 03:28:32 +00:00
Tim Nguyen
32742ae85a Bug 558594 - Implement layout for <input type='search'>. r=emilio,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D56302
2020-07-27 12:09:40 +00:00
longsonr
ba1943ecf8 Bug 1259861 - Move everything else into the mozilla namespace in layout/svg r=dholbert
Also: adjust include paths to be consistent for usages of various SVG headers,
and remove unused SVG includes (mostly for "utils" classes),
and drop stray "ns" from already-renamed SVG classes in various code comments.

Differential Revision: https://phabricator.services.mozilla.com/D83140
2020-07-11 02:20:20 +00:00
Emilio Cobos Álvarez
6350eead9d Bug 1640917 - Remove XBL mentions in layout. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D76846
2020-05-26 16:16:32 +00:00
Emilio Cobos Álvarez
b9fa2ce48d Bug 1640601 - Also reframe the closest non-anonymous root when switching anonymous content from display: none to something else. r=mats
We were dealing with it correctly when switching display from e.g. block
to inline, or such. But we were not dealing with it when the node was
undisplayed.

Handle it properly, and free one frame bit while at it. We can't really
do this for ManualNAC (the editor resizers) because they request a
reframe explicitly.

Differential Revision: https://phabricator.services.mozilla.com/D76679
2020-05-25 23:54:10 +00:00
Emilio Cobos Álvarez
d052acd76c Bug 1640165 - Address TYLin's and clang-format's comments.
Differential Revision: https://phabricator.services.mozilla.com/D76556
2020-05-22 21:55:10 +00:00
Emilio Cobos Álvarez
6c2f6d5168 Bug 1640165 - Use EnumSet for frame construction item flags. r=mats
And remove the XBL_BASE flag because it's unused.

Differential Revision: https://phabricator.services.mozilla.com/D76474
2020-05-22 18:07:48 +00:00
Emilio Cobos Álvarez
73fd281e70 Bug 1584935 - Clean up a tiny bit more now that lazyfc is infallible. r=tnikkel
Fairly minor clean-up.

Differential Revision: https://phabricator.services.mozilla.com/D74751
2020-05-13 18:02:53 +00:00
Csoregi Natalia
0b1a300610 Backed out 2 changesets (bug 1584935) for accessibility failures on e.g. accessible/tests/mochitest/tree/test_tabbrowser.xhtml CLOSED TREE
Backed out changeset 91e7137acba3 (bug 1584935)
Backed out changeset 28e2781f3026 (bug 1584935)
2020-05-13 09:41:36 +03:00
Emilio Cobos Álvarez
9a967f7bf1 Bug 1584935 - Clean up a tiny bit more now that lazyfc is infallible. r=tnikkel
Fairly minor clean-up.

Differential Revision: https://phabricator.services.mozilla.com/D74751
2020-05-12 22:41:55 +00:00
Bogdan Tara
8be4e678bb Backed out 2 changesets (bug 1584935) for many toolkit/content/tests/chrome/test_* failures CLOSED TREE
Backed out changeset e78fc5cb2ed7 (bug 1584935)
Backed out changeset 8d7c5732cda9 (bug 1584935)
2020-05-12 03:03:58 +03:00
Emilio Cobos Álvarez
3117dfe9a8 Bug 1584935 - Clean up a tiny bit more now that lazyfc is infallible. r=tnikkel
Fairly minor clean-up.

Differential Revision: https://phabricator.services.mozilla.com/D74751
2020-05-11 22:52:16 +00:00
Simon Giesecke
e613597e90 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in layout. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D66016
2020-03-17 09:38:32 +00:00
Ting-Yu Lin
807ebe1c6c Bug 1622008 Part 3 - Remove nsPresContext* and PresShell* from the argument list of some continuing-frame-creation methods. r=dholbert
Both PresShell() and PresContext() are cached in nsIFrame. This
simplifies the setup for the callers to
nsCSSFrameConstructor::CreateContinuingFrame().

Differential Revision: https://phabricator.services.mozilla.com/D66600
2020-03-12 21:50:23 +00:00
Emilio Cobos Álvarez
02472ef6d7 Bug 1561900 - Fix scroll state restoration when not coming from the bfcache on the initial frame construction. r=bzbarsky
There is no way this ever properly worked, as we always passed null for
`aFrameState`.

So it'd only work if we reframed the document element or such...  Which is not
amazing.

For simpler test-cases, when we don't construct the scrollframe via
PresShell::Initialize, but via the regular frame constructor updates
(ContentAppended, etc...), those end up working because we go through lazy frame
construction, which ends up in RecreateFramesForContent, which passes
mTempFrameTreeState.

Differential Revision: https://phabricator.services.mozilla.com/D59569
2020-01-15 13:18:52 +00:00
Ting-Yu Lin
43341db36d Bug 1499281 - Remove column-span pref in nsCSSFrameConstructor. r=dbaron
For BeginBuildingColumns, returning nsBlockFrame, i.e. the original
NS_NewColumnSetWrapperFrame's return type, should be sufficient since no
other caller in frame constructor needs to call ColumnSetWrapper's
methods.

Differential Revision: https://phabricator.services.mozilla.com/D58398
2019-12-31 16:13:41 +00:00
Ting-Yu Lin
a7201ab84c Bug 1593752 - When inserting canonical <body> element, reframe root element only if their used WritingModes are different. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D51889
2019-11-06 05:50:12 +00:00
Emilio Cobos Álvarez
6cc2dd452f Bug 1591297 - Remove XBL binding loading code in the frame constructor. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D50555
2019-10-25 18:46:59 +00:00
Ting-Yu Lin
95145c8845 Bug 1588025 - Change an argument to nsContainerFrame* for ConstructAnonymousContentForCanvas. r=jfkthame
The only caller SetRootElementFrameAndConstructCanvasAnonContent()
already passes nsContainerFrame* to aFrame.

A minor cleanup discovered while working on this bug.

Differential Revision: https://phabricator.services.mozilla.com/D48943
2019-10-28 20:40:30 +00:00
Emilio Cobos Álvarez
5edac25bb5 Bug 1578844 - Fix various issues with display: contents within svg text. r=mats
I'm not happy about all the SVG text / disallow out of flow complexity sprinkled
during frame construction... :(

Maybe we should add some kind of more generic mechanism to disallow some
children for particular kinds of frames, or something.

Co-authored-by: Mats Palmgren <mats@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D44808
2019-10-12 16:28:13 +00:00
Ting-Yu Lin
5fefff9390 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-10 04:44:44 +00:00
Gurzau Raul
1b7047f374 Backed out 4 changesets (bug 1102175) for Android reftest failures at font-inflation-1a.html
Backed out changeset 33914610f60f (bug 1102175)
Backed out changeset 004a0cb8af9f (bug 1102175)
Backed out changeset 2ac28b335c3c (bug 1102175)
Backed out changeset 50b041e06f23 (bug 1102175)
2019-10-10 07:40:38 +03:00
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
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
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
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
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
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
Jonathan Watt
d17e754362 Bug 1557104. Merge nsIPageSequenceFrame and nsSimplePageSequenceFrame. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D33817
2019-05-22 13:01:33 +01:00
Cameron McCormack
8dec0f541b Bug 1553378 - Devirtualize calls to GetText() / TextLength() when we know we have a Text node. r=smaug,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D32100
2019-05-22 15:18:48 +10:00
Emilio Cobos Álvarez
b1b893efab Bug 1552719 - Do some cleanup in the counter initializer code. r=mats
I thought I was going to need it but turns out I don't. Still this is worth it I
think.

Differential Revision: https://phabricator.services.mozilla.com/D31987
2019-05-21 17:29:06 +00:00
Emilio Cobos Álvarez
fb0ce77605 Bug 1546046 - Remove support for XBL resources. r=TYLin
So much unsound code going away :-)

Differential Revision: https://phabricator.services.mozilla.com/D28380
2019-04-23 16:43:15 +00:00
Bogdan Tara
76d9bb886c Backed out changeset e85cb54e5944 (bug 1546046) complementary backout after 1470880 was backed out CLOSED TREE 2019-04-23 06:55:29 +03:00
Emilio Cobos Álvarez
e74cdacc5c Bug 1546046 - Remove support for XBL resources. r=TYLin
So much unsound code going away :-)

Differential Revision: https://phabricator.services.mozilla.com/D28380
2019-04-22 21:57:22 +00:00
Masayuki Nakano
ad09cbb08f Bug 1544343 - part 2: Make factory methods take mozilla::PresShell instead of nsIPresShell r=emilio
Additionally, this patch makes `nsFrame.h` stop including `nsIPresShell.h`
and makes each users include `mozilla/PresShell.h` instead.  So, this improves
rebuild performance of `nsIPresShell.h` (and `mozilla/PresShell.h` in the
future).

Note that due to `nsIFrame::PresShell()`, `mozilla::` prefix is necessary for
`PresShell` in a lot of classes which are derived from `nsIFrame` even in
`.cpp` files.

Differential Revision: https://phabricator.services.mozilla.com/D27476
2019-04-16 07:24:49 +00:00
Masayuki Nakano
07eac02be2 Bug 1544343 - part 1: Make nsFrameManager, nsCSSFrameConstructor and nsFrameConstructorState use mozilla::PresShell directly rather than via nsIPresShell r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D27475
2019-04-16 07:24:29 +00:00
Ting-Yu Lin
38fbc00ef0 Bug 1517080 Part 6 - Remove nsFrameItems alias, and rename variables with suffix "Items" to "List". r=mats
Differential Revision: https://phabricator.services.mozilla.com/D15556
2019-03-30 04:45:47 +00:00
Ting-Yu Lin
4dd2e4db43 Bug 1517080 Part 4 - Make nsFrameItems an alias of nFrameList, and remove nsFrameItems. r=mats
nsFrameItems will be removed in Part 6.

Differential Revision: https://phabricator.services.mozilla.com/D15554
2019-03-30 03:25:10 +00:00
Ting-Yu Lin
6e0e7214db Bug 1517080 Part 1 - Do not adjust table captions' parent when they're created. r=mats
In order to get rid of nsFrameItems::AddChild() and use
nsFrameList::AppendFrame() instead, we need to keep table captions'
parent to be nsTableFrame when they're created (no adjust in
ConstructFramesFromItem) so that their parent remain the same as other
frames in the table when appending into the temporary aFrameItems.

We then adjust captions' parent right before we call
SetInitialChildList()/AppendFrames/InsertFrames().

Also, pass nullptr to AppendFrames() in
nsTableWrapperFrame::AppendFrames() because callers should already set
captions' parent frame properly. No need to reparent them again.

Differential Revision: https://phabricator.services.mozilla.com/D25335
2019-03-30 02:59:25 +00:00
Mats Palmgren
127f3ae120 Bug 205202 part 1 - [css-lists][css-pseudo] Add support for the ::marker pseudo element on list items. Alias :-moz-list-bullet/number to that in the parser. r=emilio 2019-03-24 23:13:53 +01:00
Mats Palmgren
ed33ad3cca Bug 288704 part 3 - Make nsBulletFrame use the built-in 'list-item' CSS counter and remove the old implementation. r=emilio 2019-03-24 23:13:53 +01:00
Ting-Yu Lin
64422673f2 Bug 1489295 Part 4 - Remove InitAndWrapInColumnSetFrameIfNeeded(). r=dbaron
The last consumer of the method is removed in Part 3.

Depends on D24396

Differential Revision: https://phabricator.services.mozilla.com/D24470
2019-03-22 02:47:32 +00:00
Ting-Yu Lin
a63fa88315 Bug 1489295 Part 1 - Rename frame construction data bit that creates flex/grid/column. r=dbaron
After supporting column-span, the top-level container for multicol
layout is no longer the ColumnSetFrame, so remove the "SET" suffix from
FCDATA_ALLOW_GRID_FLEX_COLUMNSET bit to make it sound more general.

Also, update the document and add an assertion.

Differential Revision: https://phabricator.services.mozilla.com/D24394
2019-03-22 02:39:16 +00:00
Emilio Cobos Álvarez
b6c57c6e0d Bug 1450652 - Remove platform support for display="" in XBL bindings. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D12586
2019-03-06 00:47:13 +00:00
Emilio Cobos Álvarez
0b3a16d0f1 Bug 1512993 - Get rid of XBL display usage for buttons and toolbarbuttons. r=mats
This is the last use of them!

Differential Revision: https://phabricator.services.mozilla.com/D21924
2019-03-04 17:20:29 +00:00
Ting-Yu Lin
c0ffdace77 Bug 1524382 - Flush all out-of-flow frames before destroying the frame list when reframing multicol container. r=dbaron
aFrameList can contain placeholder frames. If we decide to nuke
aFrameList, we need to destroy the out-of-flow frames gracefully.

In this case, out-of-flow frames are still in nsFrameConstructorState's
absolute item lists. To rely on nsPlaceholderFrame::DestroyFrom() to
remove its out-of-flow frame properly, we manually flush all the frame
insertions for all the lists in aState before destroying aFrameList.

Differential Revision: https://phabricator.services.mozilla.com/D19460
2019-02-19 22:37:24 +00:00
Emilio Cobos Álvarez
e9ff37af55 Bug 1525955 - Include anon boxes in CSSPseudoElementType, to remove ComputedStyle::mPseudoTag. r=heycam
This is more consistent with what the Rust bits of the style system do, and
removes a pointer from ComputedStyle which is always nice.

This also aligns the Rust bits with the C++ bits re. not treating xul pseudos as
anonymous boxes. See the comment in nsTreeStyleCache.cpp regarding those.

Can't wait for XUL trees to die.

Depends on D19001

Differential Revision: https://phabricator.services.mozilla.com/D19002
2019-02-19 13:44:33 +00:00
Ting-Yu Lin
c467f0d314 Bug 1504053 - Reframe multi-column container if inserting a subtree with a column-span child. r=dbaron
Differential Revision: https://phabricator.services.mozilla.com/D16077
2019-01-31 02:22:49 +00:00