Commit Graph

3284 Commits

Author SHA1 Message Date
Csoregi Natalia
4c99b23b6c Merge mozilla-central to mozilla-inbound. CLOSED TREE 2019-02-17 00:14:07 +02:00
Sylvestre Ledru
553ecbeed8 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
Summary: # ignore-this-changeset

Reviewers: Ehsan

Reviewed By: Ehsan

Subscribers: emilio, jandem, bbouvier, jya

Bug #: 1519636

Differential Revision: https://phabricator.services.mozilla.com/D20062
2019-02-16 20:20:37 +01:00
Markus Stange
619ba4cb84 Bug 1500692 - Add LAYOUT subcategories. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D11341
2019-02-16 17:38:35 +00:00
Boris Zbarsky
cbbe425e59 Remove no longer relevant comment. No bug. r=emilio
The primary frame hashtable is long gone; we have a pointer on the node now.

Differential Revision: https://phabricator.services.mozilla.com/D19952
2019-02-15 19:01:11 +00:00
Emilio Cobos Álvarez
4f202b9bdf Bug 1528098 - Remove content-select code. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D19869
2019-02-15 01:51:33 +00:00
Ting-Yu Lin
5fc4ae9007 Bug 1527519 Part 3 - Replace remaining nsLayoutUtils::GetAsBlock() with do_QueryFrame(), and delete nsLayoutUtils::GetAsBlock(). r=mats
Depends on D19861

Differential Revision: https://phabricator.services.mozilla.com/D19863
2019-02-15 01:38:05 +00:00
Ting-Yu Lin
e7c211a933 Bug 1527519 Part 2 - Replace some nsLayoutUtils::GetAsBlock() with nsIFrame::IsBlockFrameOrSubclass(). r=mats
Depends on D19860

Differential Revision: https://phabricator.services.mozilla.com/D19861
2019-02-15 01:38:04 +00:00
Emilio Cobos Álvarez
df05b5492b Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D18734
2019-02-07 11:15:36 +01:00
Emilio Cobos Álvarez
5ac7dcc7cc Bug 1525134 - Move image loads out of the style struct accessors. r=heycam
After this I can pass the document from the caller to ResolveSameStructsAs, and
get rid of the pres context pointer.

Differential Revision: https://phabricator.services.mozilla.com/D18600
2019-02-05 19:47:29 +00:00
Razvan Maries
bb63ca688a Backed out changeset 919de32d4905 (bug 1525134) for build bustages. CLOSED TREE 2019-02-05 19:36:46 +02:00
Emilio Cobos Álvarez
8bce3786c3 Bug 1525134 - Move image loads out of the style struct accessors. r=heycam
After this I can pass the document from the caller to ResolveSameStructsAs, and
get rid of the pres context pointer.

Differential Revision: https://phabricator.services.mozilla.com/D18600
2019-02-05 18:07:18 +01:00
Razvan Maries
ebcf2ddc23 Backed out changeset 992f27cfecac (bug 1525134) for build bustages. CLOSED TREE 2019-02-05 18:54:14 +02:00
Emilio Cobos Álvarez
4702c4f188 Bug 1525134 - Move image loads out of the style struct accessors. r=heycam
After this I can pass the document from the caller to
ResolveSameStructsAs, and get rid of the pres context pointer.

Differential Revision: https://phabricator.services.mozilla.com/D18600
2019-02-05 13:45:04 +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
Ting-Yu Lin
91eaccc5e4 Bug 1523061 Part 2 - Remove static ListTag(FILE*, const nsIFrame*). r=dholbert
Many of the modifications are guarded by #ifdefs. I verify them locally
by manually define them in nsBlockDebugFlags.h and nsLinelayout.cpp.

Note that I replace "mFrame" with "frame" in lines guarded by
NOISY_BLOCK_DIR_MARGINS in nsBlockFrame.cpp because they were
incorrectly renamed in Bug 1277129 Part 6a.
https://hg.mozilla.org/mozilla-central/rev/a70b04f074fc

Differential Revision: https://phabricator.services.mozilla.com/D17733
2019-01-29 21:22:14 +00:00
Ting-Yu Lin
f2e774779b Bug 1516739 - Stop reparenting absolute/fixed positioned blocks when constructing multicol container. r=dbaron
The crash happens when we try to reparent the absolute/fixed
positioned children to the non-column-span wrapper's absolute list.

When constructing the multicol container, we want it to be the
absolute/fixed position container, not the moz-column-content anonymous
blocks. Hence the modification in AppendFramesToParent() and
ConstructBlock().

Delete AdjustAbsoluteContainingBlock() because we'd like to reparent
absolute/fixed children to non-first continuation of block descendant of
multicol. And it doesn't crash anymore today.

Differential Revision: https://phabricator.services.mozilla.com/D16728
2019-01-25 07:09:17 +00:00
Wei-Cheng Pan
2105b8b095 Bug 1515822 - Capture frame state in nsCSSFrameConstructor::ContentRemoved. r=emilio,mats
Move CaptureStateForFramesOf into ContentRemoved, so we can traverse frames
which were under display: contents as well.

Differential Revision: https://phabricator.services.mozilla.com/D15319
2019-01-28 11:55:03 +00:00
Cosmin Sabou
57bb107987 Merge mozilla-inbound to mozilla-central. a=merge 2019-01-19 11:57:49 +02:00
Greg Tatum
7ced9eb1ec Bug 1520526 - Add categories to all profiler markers; r=mstange
This commit adds categories to all markers. This way the profiler's
marker categories and frame label categories agree. There are a few
duplicate category properties on some of the marker payloads, but
this could be cleaned up in a follow-up if needed.

Differential Revision: https://phabricator.services.mozilla.com/D16864
2019-01-18 15:40:15 +00:00
Victor Porof
6a67b6b345 Bug 1507704 - Migrate the columnpicker binding into a custom element, r=bgrins 2019-01-14 09:38:24 +01:00
Ehsan Akhgari
498e2df734 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset
2019-01-18 10:16:18 +01:00
Emilio Cobos Álvarez
1e93768fd8 Bug 1516410 - Fix some display: contents code in ContentRemoved. r=mats
There's no real behavior change, since:

 * aFlags right now is only used for whitespace suppression optimizations (which
   we don't do when display: contents is involved anyway).

 * The CouldBeDisplayContents() check is only an optimization: we're
   unconditionally recursing into ContentRemoved now, which is not incorrect,
   just inefficient.

I found this while reviewing https://phabricator.services.mozilla.com/D15319
(where this _would_ have an impact on behavior).

Differential Revision: https://phabricator.services.mozilla.com/D15373
2019-01-15 18:19:36 +00:00
Ting-Yu Lin
3daa5d3941 Bug 1503420 Part 2 - Fix appending a subtree with column-span descendants under the ::moz-column-content. r=emilio
The elements under <body> are treat as content append, so their frames
will be construct by nsCSSFrameConstructor::ContentAppended.

This patch fixed only the simple "append" case which is appending to the
last continuation of ::moz-column-content. For other more complex
appending or inserting cases, we might need to reframe (bug 1504053).

Differential Revision: https://phabricator.services.mozilla.com/D16076
2019-01-15 03:48:02 +00:00
Ting-Yu Lin
fc359f1610 Bug 1503420 Part 1 - Adjust some callers of nsIFrame::List() to stop passing 0 as a const char* argument. r=dholbert
To reproduce, execute
"GECKO_FRAMECTOR_DEBUG_FLAGS=really-noisy-content-updates ./mach run".

nsIFrame::List()'s second argument should be a const char*, not an
integer. We can fix the bug by omitting it because the default value of
the argument is an empty string.

Differential Revision: https://phabricator.services.mozilla.com/D16075
2019-01-09 21:02:13 +00:00
Emilio Cobos Álvarez
dc336a73ba Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Ting-Yu Lin
8b7ee2ddb8 Bug 1517069 - Make GetMultiColumnContainingBlockFor() return nsContainerFrame*. r=dholbert
GetParent() already returns nsContainerFrame*, and it's easier to use
with API like FinishBuildingColumns() demanding a nsContainerFrame*.

Differential Revision: https://phabricator.services.mozilla.com/D15549
2019-01-02 22:27:43 +00:00
Ting-Yu Lin
e66046a6e6 Bug 1508762 Part 2 - Fix a restyle bug if there's column-span:all under ib-split setting. r=dholbert
This is to prevent Part 1 from breaking
testing/web-platform/tests/css/css-multicol/multicol-span-all-restyle-002.html

After introducing Part 1, we now use CreateContinuingFrame() to create
non-column-span wrapper frames, which use nsFrame::Init() rather than
InitAndRestoreFrame() to initialize them. Because the bits in
aState.mAdditionalStateBits are added to frames only when
nsCSSFrameConstructor::InitAndRestoreFrame() is called. We need a new
way to add the NS_FRAME_PART_OF_IBSPLIT to non-column-span wrapper
frames.

Note that we used to add NS_FRAME_PART_OF_IBSPLIT to both column-span
wrapper and non-column-span wrapper. After this patch, column-span
wrapper won't have NS_FRAME_PART_OF_IBSPLIT. That's fine because
column-span wrappers are not linked with other frames and they
shouldn't get this bit set.

Depends on D15134

Differential Revision: https://phabricator.services.mozilla.com/D15452
2018-12-28 02:25:40 +00:00
Ting-Yu Lin
4031873c0e Bug 1508762 Part 1 - Support column-span:all for a multi-column <details> element. r=dholbert
In CreateColumnSpanSiblings(), aInitialBlock can be a DetailsFrame.
Therefore, when creating a non-column-span wrapper, we cannot assume
it's always a block frame. We need to use CreateContinuingFrame to
ensure the correct type of continuation is created.

Differential Revision: https://phabricator.services.mozilla.com/D15134
2018-12-28 02:15:58 +00:00
Sylvestre Ledru
8a7f808395 Bug 1515556 comment fix-ups for the tree reformat (layout/) r=Ehsan,heycam
Differential Revision: https://phabricator.services.mozilla.com/D13125
2018-12-21 03:07:05 +00:00
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