Commit Graph

3105 Commits

Author SHA1 Message Date
Ting-Yu Lin
639c0434e0 Bug 1506314 - Fix reframing ColumnSetWrapperFrame when it already has column-span children. r=dbaron
If a ColumnSetWrapperFrame already has column-span children,
ColumnSetWrapperFrame::GetContentInsertionFrame() will return itself to
let WipeContainingBlock() aware this is the case to reframe.

To make this work, we need to move the reframe condition prior to check
NS_FRAME_HAS_MULTI_COLUMN_ANCESTOR bit because the top level
ColumnSetWrapperFrame never has NS_FRAME_HAS_MULTI_COLUMN_ANCESTOR bit
set.

Differential Revision: https://phabricator.services.mozilla.com/D14819
2018-12-20 00:11:26 +00:00
Ting-Yu Lin
831e31c857 Bug 1507244 Part 2 - Suppress column-span descendants under a new block formatting context. r=dbaron
Bug 1506163 fixed only part of the issue. There are more types of frames
such as table, grid, flex, etc. that create their own block formatting
context.

Instead of propagating NS_FRAME_HAS_MULTI_COLUMN_ANCESTOR to the
children, we explicit carry the bit over to block and inline frames by
checking that their parent doesn't suppress column-span descendants.

Also, remove the unused "onload" from <body> in the tests.

Differential Revision: https://phabricator.services.mozilla.com/D13597
2018-12-18 00:40:58 +00:00
Ting-Yu Lin
6413b12f6c Bug 1507244 Part 1 - Add block formatting context bits for column-span in nsBlockFrame::Init(). r=dbaron
That's the common place where the bits are added.

Differential Revision: https://phabricator.services.mozilla.com/D13596
2018-12-17 18:41:01 +00:00
Timothy Guan-tin Chien
2505278a53 Bug 1510848 - Do not unattach UA Widget Shadow Root if the element is already re-attached to the tree r=emilio,smaug
This patch moves all UA Widget calls to helper functions in Element.cpp. The helper function AttachAndSetUAShadowRoot sets the shadow root in a runnable, so that it is in the same order of NotifyUAWidget* runnables.

Differential Revision: https://phabricator.services.mozilla.com/D13479
2018-12-15 02:48:46 +00:00
Daniel Holbert
0d1b724969 Bug 1512112: Remove redundant includes from source files in layout. r=TYLin
All of the removed includes are redundant (i.e. they're #included elsewhere in
the same file).

In most cases, I'm removing the second (redundant) copy of the
#include, except when that copy makes more sense (i.e. if it's in better sorted
order, or if it's paired alongside a closely-associated header while the
earlier copy is not).

Here's the script that I used to generate candidates here -- I ran this in
every subdirectory of layout, on my linux machine (warning, this writes two
files to your /tmp directory):

for FILE in *.h *.cpp; do
  nonunique=$(grep \#include $FILE | grep -v List\.h | cut -f2 -d'"'  | cut -f2- -d'/'| cut -f2- -d'/' | sort | wc -l)
  unique=$(   grep \#include $FILE | grep -v List\.h | cut -f2 -d'"'  | cut -f2- -d'/'| cut -f2- -d'/' | sort | uniq | wc -l)
  if [[ "$unique" != "$nonunique" ]]; then
    echo "$FILE: $nonunique / $unique"
    grep \#include $FILE | cut -f2 -d'"'  | grep -v List\.h | cut -f2- -d'/'| cut -f2- -d'/' | sort  > /tmp/nonunique.txt
    grep \#include $FILE | cut -f2 -d'"'  | grep -v List\.h | cut -f2- -d'/'| cut -f2- -d'/' | sort | uniq  > /tmp/unique.txt
    diff /tmp/nonunique.txt /tmp/unique.txt
    echo
  fi
done

Depends on D13773

Differential Revision: https://phabricator.services.mozilla.com/D13774
2018-12-05 18:55:59 +00:00
Cameron McCormack
3c9d4e9a6c Bug 1511854 - Part 2: Fix some more formatting oddities in layout/ after the clang-format. r=TYLin
Depends on D13686

Differential Revision: https://phabricator.services.mozilla.com/D13775
2018-12-05 18:44:05 +00:00
Ting-Yu Lin
5cfc78e30e Bug 1511536 - Restore the comment in nsCSSFrameConstructor::ConstructBlock(), and disable clang-format. r=sylvestre
The example frame tree didn't survive the global clang-format change.

DONTBUILD because this is a comment-only change.

Differential Revision: https://phabricator.services.mozilla.com/D13602
2018-12-01 13:48:45 +00:00
Sylvestre Ledru
e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Emilio Cobos Álvarez
89ff1f8802 Bug 1510080 - Fix appending into a fragmented fieldset. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D13079
2018-11-29 21:54:57 +00:00
Mats Palmgren
f6be9192e4 Bug 1506895 - Only create an ib-split sequence for truly block-outside children. r=emilio
This changes the logic from !IsInlineOutside() to IsBlockOutside()
so that table-internal display types etc are now excluded
(i.e. no longer creates an ib-split).
2018-11-27 20:33:31 +01:00
Daniel Holbert
017441bb42 Bug 1509972 part 5: Use UniquePtr (not nsAutoPtr) to store a few local vars in nsCSSFrameConstructor. r=TYLin
This patch also gives nsCSSFrameConstructor.h its own UniquePtr include (since
we have some UniquePtr usage there, but no include).  Presumably it's already
getting the include indirectly (via some other header) right now, but it should
really include it directly if it uses the type directly.

(This leaves one nsAutoPtr usage in nsCSSFrameConstructor, for 'mNode'. We can
probably convert that one without too much trouble, but I'm not doing so yet,
in part because we intentionally leak that variable in one spot and I haven't
fully worked out the ownership transfer for that case.)

Differential Revision: https://phabricator.services.mozilla.com/D12992
2018-11-26 22:48:31 +00:00
Ting-Yu Lin
b0ef79b004 Bug 1509196 - Remove #ifdef NOISY_FINDFRAME. r=mats
The code using FFWC_* variables was removed in
https://hg.mozilla.org/mozilla-central/rev/e4438ed238da

Differential Revision: https://phabricator.services.mozilla.com/D12611
2018-11-22 00:55:45 +00:00
Ting-Yu Lin
35370b3b48 Bug 1509196 - Remove ::IsFlexOrGridContainer(). r=mats
This is equivalent to nsIFrame::IsFlexOrGridContainer().

Differential Revision: https://phabricator.services.mozilla.com/D12610
2018-11-22 00:55:36 +00:00
Ting-Yu Lin
df2e5d2bd1 Bug 1509196 - Remove unused variable isFlexOrGridContainer in ProcessChildren(). r=mats
The other uses of isFlexOrGridContainer were removed in
https://hg.mozilla.org/mozilla-central/rev/fa81899efb5e

We can rely on ShouldSuppressFloatingOfDescendants() to look
IsFlexOrGridContainer() up.

Also, move ::IsFlexOrGridContainer() to be the first condition to check in
ShouldSuppressFloatingOfDescendants() since it should be a more common use
case than the others.

Differential Revision: https://phabricator.services.mozilla.com/D12609
2018-11-22 00:55:27 +00:00
Ting-Yu Lin
58028b9428 Bug 1506163 - Do not span column-span:all element across all columns if it's under different block formatting context. r=bz
multicol-span-all-004-ref.html is the same as multicol-span-all-004.html except
for the "column-span" value in h3.

Differential Revision: https://phabricator.services.mozilla.com/D12192
2018-11-19 11:27:45 -08:00
Ting-Yu Lin
69fe7e9405 Bug 1506204 - Check the in flow frame to determine when to reframe the multicol container. r=dbaron
When removing an out of flow frame under a multicol subtree, it shouldn't affect
the multicol tree structure. We should instead check the in flow frame's
relationship with the multicol subtree.

Differential Revision: https://phabricator.services.mozilla.com/D11540
2018-11-18 00:11:55 +00:00
Ting-Yu Lin
4f65703277 Bug 1491915 - Fix bullet frame creation for columns. r=bzbarsky
The modification to nsLayoutUtils::GetFirstLinePosition() is needed because we
need to get the correct first line position from child (i.e. ColumnSet) when
there's an outside bullet on ColumnSetWrapperFrame.

The difference between the two newly added tests is "overflow: hidden" on
the columns.

Differential Revision: https://phabricator.services.mozilla.com/D7009
2018-11-16 21:46:23 +00:00
Emilio Cobos Álvarez
22a94a22f2 Bug 1507127 - Move the page-break-{before,after} properties to not use mako. r=heycam
And respect the computed value of `left` / `right` / etc.

Differential Revision: https://phabricator.services.mozilla.com/D11872
2018-11-15 08:15:13 +00:00
Gurzau Raul
412b8e6f9c Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-11-09 07:46:56 +02:00
Mats Palmgren
43f2766c6d Bug 1504576 - Remove XUL nsProgressMeterFrame. r=dholbert 2018-11-08 22:15:38 +01:00
Ting-Yu Lin
9f6fd81b9d Bug 1421105 Part 5 - Fix anonymous -moz-column-span-wrapper block's style is overridden after restyling. r=bzbarsky,emilio
The major change in this patch is ::-moz-column-span-wrapper blocks are no
longer linked into the continuation chains when they're created in
CreateColumnSpanSiblings(). We can do that because
::-moz-column-span-wrapper is an non-inheriting anon box, which doesn't need
to be restyled.

This prevents RestyleManager::ProcessPostTraversal or
nsIFrame::UpdateStyleOfOwnedChildFrame, which set the same style on all
continuations of the frame they are working with, from overriding the
::-moz-column-span-wrapper style.

GetNextContinuationWithSameStyle was deleted in bug 1447367. Delete the comment
in nsInlineFrame::UpdateStyleOfOwnedAnonBoxesForIBSplit() to avoid confusion.

This patch also adds another condition to reframe the multi-column container
in MaybeRecreateContainerForFrameRemoval(). That condition is when an
element has a "column-span:all" descendant, i.e. the element's frame has
"column-span:all" siblings (which is created by CreateColumnSpanSiblings).
The added test multicol-span-all-dynamic-remove-006.html will fail without
this patch.

Depends on D5212

Differential Revision: https://phabricator.services.mozilla.com/D9988
2018-11-08 19:11:55 +00:00
Ting-Yu Lin
eb08c16091 Bug 1421105 Part 3 - Support dynamically adding or removing elements under multi-column subtree. r=bzbarsky,dbaron
Depends on D5209

Differential Revision: https://phabricator.services.mozilla.com/D5210
2018-10-24 22:19:19 +00:00
Ting-Yu Lin
642664c789 Bug 1421105 Part 2 - Implement column-span for block and inline frames. r=bzbarsky,dbaron
Other frames calling InitAndWrapInColumnSetFrameIfNeeded() needs to be
modified to support column-span (bug 1489295).

Depends on D5208

Differential Revision: https://phabricator.services.mozilla.com/D5209
2018-10-30 05:41:30 +00:00
Ting-Yu Lin
6e8f32c1cf Bug 1421105 Part 1 - Add a helper IsColumnContainerStyle() to StyleColumn. r=dbaron
This helper will also be used in next part.

Differential Revision: https://phabricator.services.mozilla.com/D5208
2018-10-18 06:26:38 +00:00
Emilio Cobos Álvarez
a84c498ba3 Bug 1505420 - Remove the first-letter bit from the first-line parent's first continuation. r=bzbarsky
Since the first-line could've been pushed to another column.

Differential Revision: https://phabricator.services.mozilla.com/D11352
2018-11-08 17:58:58 +00:00
Ting-Yu Lin
ff149eedd4 Bug 916972 - Eliminate nsIFrame::GetSplittableType() completely. r=mats,dholbert
Currently, GetSplittableType() is called only in
nsCSSFrameConstructor::CreateContinuingFrame(). The splittable concrete frames
should inherit from nsSplittableFrame, and must explicitly create continuing
frame in CreateContinuingFrame(). Thus, no need to maintain GetSplittableType().

Differential Revision: https://phabricator.services.mozilla.com/D10798
2018-11-05 19:11:12 +00:00
Timothy Guan-tin Chien
e665860c8d Bug 1496242 - Part II, Convert datetimebox to UA Widget r=dholbert,jaws,smaug
This patch converts datetimebox.xml to datetimebox.js and loads it as a UA Widget,
while touches things here and there to make it work.

In HTMLInputElement manages the lifecycle of the datetimebox UA Widget.
It is loaded when in <input> has type date or time, or have its type switch to date or time.

nsDateTimeControlFrame is changed so that when UA Widget is enabled,
it would not generate <xul:datetimebox>.

Like bug 1483972, a check is added in nsCSSFrameConstructor::CreateGeneratedContentItem()
to make sure we don't generate pseudo content inside <input>.

Assertions in IntlUtils is changed to allow UAWidget to call the methods.

Depends on D9056

Differential Revision: https://phabricator.services.mozilla.com/D9057
2018-11-03 05:31:05 +00:00
Emilio Cobos Álvarez
2721c54a5c Bug 1498873 - Simplify a check. r=bzbarsky
And make will-change: position properly create an abspos cb while at it, since the check was missing the `mWillChangeBitfield & ABSPOS_CB` bit.

Differential Revision: https://phabricator.services.mozilla.com/D8743
2018-10-17 20:40:08 +00:00
Emilio Cobos Álvarez
a6bbfc28c2 Bug 1498873 - Pass the right frame to PushAbsoluteContainingBlock to determine whether we're a fixed-pos containing block. r=bzbarsky
When we're creating a scrollframe with let's say, display: flex or grid, the
containing block is the grid container itself, but the transformed frame is the
scroll frame.

This is the only caller that (incorrectly) passes the same frame to
PushAbsoluteContainingBlock.

Our painting code deals with it, mostly, because it starts from the placeholder
to paint fixed items, and it hits the scrollframe, but it gets confused
sometimes causing the issue described here.

I'll find a way to add a crashtest for this, and maybe a reftest, though this
works in non-WR.

We should probably add a few more assertions to the frame constructor...

Differential Revision: https://phabricator.services.mozilla.com/D8724
2018-10-17 20:22:38 +00:00
Cameron McCormack
602e2cc27c Bug 1499408 - Part 2: Have css::URLValue get URLExtraData from its CssUrlData. r=emilio
MozReview-Commit-ID: IqZGzkHlSZD

Depends on D8874

Differential Revision: https://phabricator.services.mozilla.com/D8875
2018-10-17 09:43:32 +00:00
Brian Grinstead
b1c4ba522c Bug 1499428 - Remove display="xul:menu" on menulist and menulist-popuponly;r=emilio
Instead, set the NS_NewMenuFrame directly on menulist elements.

Differential Revision: https://phabricator.services.mozilla.com/D8897
2018-10-16 19:58:33 +00:00
Emilio Cobos Álvarez
3dfc3a8664 Bug 1498067 - Add event markers for WipeContainingBlock and other expensive paths in the frame constructor. r=dbaron
I removed the debug-only printf spew because I think this is superior.

Let me know if you want to keep it around.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1496817#c8, this needs a fix
to the profiler UI which is still not deployed, but can be tested already and I
expect will be deployed soon.

Differential Revision: https://phabricator.services.mozilla.com/D8323
2018-10-11 01:22:05 +00:00
Daniel Varga
ed1019ec4e Merge mozilla-central to mozilla-inbound. a=merge 2018-10-10 13:56:40 +03:00
Cameron McCormack
198a280c43 Bug 1496308 - Require URLExtraData::mPrincipal to be non-null r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D7682
2018-10-10 03:10:07 +00:00
Nicholas Nethercote
644f8ac68f Bug 1497734 - Rename nsStaticAtom subclasses. r=heycam
Specifically:
- nsICSSAnonBoxPseudo --> nsCSSAnonBoxPseudoStaticAtom
- nsICSSPseudoElement --> nsCSSPseudoElementStaticAtom

The `nsI` prefix isn't necessary because these are no longer XPIDL types, and
the `StaticAtom` suffix makes their meaning clearer.
2018-10-10 16:49:13 +11:00
Nicholas Nethercote
2941cd164a Bug 1451169 - Reduce indirection for PseudoParentData::mPseudoType. r=xidorn 2018-04-03 22:15:31 +10:00
Nicholas Nethercote
7cd45dc653 Bug 1451169 - Reduce indirection for FrameConstructionDataByTag::mTag. r=xidorn 2018-04-03 22:15:31 +10:00
Nicholas Nethercote
e923575758 Bug 1451169 - Reduce indirection for static atom pointers in nsCSSFrameConstructor.h. r=xidorn 2018-04-03 22:15:30 +10:00
Nazım Can Altınova
31b38059e9 Bug 1494608 - Remove the frame construction markers r=mstange
Markers are taking so much time(~10%) to allocate and in a website
like Speedometer, it takes ages to load the profile data since
there are so many frame construction markers.

Differential Revision: https://phabricator.services.mozilla.com/D7064
2018-09-28 01:26:02 +00:00
Timothy Guan-tin Chien
49140cca5d Bug 1493741 - Don't generate elements around UA Widget shadow root r=emilio
This patch make nsCSSFrameConstructor::CreateGeneratedContentItem() early
returns if the originating element contains an UA Widget shadow root.

Differential Revision: https://phabricator.services.mozilla.com/D6828
2018-09-28 00:23:15 +00:00
Emilio Cobos Álvarez
98cd995de5 Bug 1494332 - Avoid setting the has-first-letter child bit on a first-line. r=bzbarsky
We rely on the bit being on the block to restyle them in the right order.

Differential Revision: https://phabricator.services.mozilla.com/D7086
2018-09-27 13:16:00 +00:00
Emilio Cobos Álvarez
6ba6e374ff Bug 1494030 - Fix an assertion. r=mats
We're trying to insert a table caption via an append into a display: contents
element. We pass the content-insertion-frame (the table frame) instead of the
siblings' parent (the table wrapper frame).

This is the right thing to pass though, we adjust the caption parent frame
later, on AdjustCaptionParentFrame, and we ensure that we don't get here for a
non-caption thing because of IsValidSibling (though note that that can actually
lie, see bug 1424656, we'd get the layout wrong if the title element was a
replaced element for example), so a normal append without a previous sibling
will still be correct.

It'd be nice to make this a bit less messy, fwiw, but I don't have the ideas or
the time to do it now.

Differential Revision: https://phabricator.services.mozilla.com/D7067
2018-09-27 11:20:47 +00:00
Ting-Yu Lin
817e09b94c Bug 1486602 Part 4 - Introduce FCDATA_MAY_NEED_BULLET to support "display: list-item" on legend r=mats
Depends on D6841

Differential Revision: https://phabricator.services.mozilla.com/D6842
2018-09-26 20:51:01 +00:00
Ting-Yu Lin
1ad540c6ce Bug 1486602 Part 3 - Create bullet frame for block frames in nsCSSFrameConstructor::ConstructBlock() instead of in their SetInitialSingleChild() r=mats
nsCSSFrameConstructor::FindDisplayData() guarantees a block with "display:
list-item" will be constructed by ConstructBlock() (either through
ConstructScrollableBlock() or ConstructNonScrollableBlock()).

This is also a preparation to fix bug 1491915 since we want to control
bullet frame creation under column hierarchy.

Depends on D6840

Differential Revision: https://phabricator.services.mozilla.com/D6841
2018-09-26 20:55:26 +00:00
Neil Deakin
57105b6149 Bug 326944, remove nsIComboboxControlFrame interface, r=mats 2018-09-26 10:41:12 -04:00
Neil Deakin
a9503bbfd9 Bug 328680, remove nsIListControlFrame interface, r=mats 2018-09-26 10:41:01 -04:00
Nathan Froyd
e3cc1897b1 Bug 1492894 - part 3 - eliminate already_AddRefed variables in layout/; r=emilio
We need to disallow these to fix our static analysis, which should have
already been disallowing them.
2018-09-21 16:45:49 -04:00
Jean-Luc Bonnafoux
3cddd11ff8 Bug 1491639 - rename function IS_TABLE_CELL r=dbaron
rename function IS_TABLE_CELL

Differential Revision: https://phabricator.services.mozilla.com/D5974
2018-09-18 01:29:19 +00:00
Emilio Cobos Álvarez
9bda9d152b Bug 1488817 - Remove the has-first-letter-child bit from the block when the first-letter is removed from a first-line. r=bzbarsky
Always new reasons to remove the first-line frame and this reparenting stuff...
I hope I can get to it.

Differential Revision: https://phabricator.services.mozilla.com/D5075
2018-09-17 17:36:06 +00:00
Ting-Yu Lin
2db09d4b3b Bug 1489015 - Make NS_NewPlaceholderFrame() return nsPlaceholderFrame* to avoid type casting r=bzbarsky
Depends on D5112

Differential Revision: https://phabricator.services.mozilla.com/D5113
2018-09-14 17:14:53 +00:00