Commit graph

798 commits

Author SHA1 Message Date
Mats Palmgren
8e002ac59f Bug 1591366 - Always reserve 64 bits for frame property value r=dholbert
Depends on D115711

Differential Revision: https://phabricator.services.mozilla.com/D124955
2021-09-20 19:52:46 +00:00
Noemi Erli
bb5d736641 Backed out 2 changesets (bug 1591366) for causing failures in table-grid-item-dynamic-004.html CLOSED TREE
Backed out changeset 19be43686dc0 (bug 1591366)
Backed out changeset a2b6f6abda6e (bug 1591366)
2021-09-18 02:42:58 +03:00
Mats Palmgren
aa3e8d4e24 Bug 1591366 - Always reserve 64 bits for frame property value r=dholbert
Depends on D115711

Differential Revision: https://phabricator.services.mozilla.com/D124955
2021-09-17 21:06:53 +00:00
Daniel Holbert
d05867cc4e Bug 1730774 part 2: Add includes and forward-decls to fix non-unified-build bustage in layout/generic. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D125611
2021-09-15 16:15:02 +00:00
criss
196daa1700 Backed out changeset 007ff7f371c9 (bug 1730774) for causing bustages on Bp-hybrid. CLOSED TREE 2021-09-15 09:14:41 +03:00
Daniel Holbert
522de8e4d7 Bug 1730774 part 2: Add includes and forward-decls to fix non-unified-build bustage in layout/generic, and remove REQUIRES_UNIFIED_BUILD declaration. r=TYLin
After the fixes in this patch, the REQUIRES_UNIFIED_BUILD declaration is no
longer needed, so I'm removing it here.  This directory now builds successfully
with that removed and with ac_add_options --disable-unified-build in the
mozconfig.

Depends on D125610

Differential Revision: https://phabricator.services.mozilla.com/D125611
2021-09-15 00:04:16 +00:00
Matt Woodrow
a1f669f3aa Bug 1728709 - Add nsDisplayItem::GetPaintRect that computes a value using the current clip extents. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D124299
2021-09-03 18:58:18 +00:00
Emilio Cobos Álvarez
8b10d3a89d Bug 1693222 - Implement SelectedItem and SelectedItemText system colors. r=mstange
Since Highlight / HighlightText are now equivalent to the text selection
ones, remove those too.

Differential Revision: https://phabricator.services.mozilla.com/D123964
2021-09-02 11:38:01 +00:00
Narcis Beleuzu
92fc260af2 Backed out changeset 28a0487d0291 (bug 1693222) for reftest failure on themed-widget.html. CLOSED TREE 2021-09-02 02:26:12 +03:00
Emilio Cobos Álvarez
c3eb845bbf Bug 1693222 - Implement SelectedItem and SelectedItemText system colors. r=mstange
Since Highlight / HighlightText are now equivalent to the text selection
ones, remove those too.

Differential Revision: https://phabricator.services.mozilla.com/D123964
2021-09-01 18:21:57 +00:00
Emilio Cobos Álvarez
a4e7c9e510 Bug 1722945 - Support break-inside: avoid-{page,column}. r=TYLin
break-before/after: page|column seem harder because you need to deal
with nested breaks, I think, but this should be straight-forward.

Differential Revision: https://phabricator.services.mozilla.com/D121206
2021-08-03 17:56:58 +00:00
Noemi Erli
89a565ea85 Backed out changeset 67c33ba5566e (bug 1722945) for causing bustage in nsContainerFrame.cpp 2021-08-03 20:35:10 +03:00
Emilio Cobos Álvarez
3d1b4f252f Bug 1722945 - Support break-inside: avoid-{page,column}. r=TYLin
break-before/after: page|column seem harder because you need to deal
with nested breaks, I think, but this should be straight-forward.

Differential Revision: https://phabricator.services.mozilla.com/D121206
2021-08-03 13:59:47 +00:00
Alexandru Michis
326297bd47 Backed out changeset e41bfdf79fb8 (bug 1665476) for causing windows mochitest failures in test_windowminmaxsize.xhtml
CLOSED TREE
2021-08-02 02:14:52 +03:00
Emilio Cobos Álvarez
275707a51b Bug 1665476 - Remove nsRootBoxFrame to unify background propagation between XUL and non-XUL documents. r=layout-reviewers,mats
It's unused on mozilla-central, and Thunderbird can just use the canvas
frame as regular (X)HTML documents, so just use a canvas frame instead
of an nsRootBoxFrame for XUL as well.

nsRootBoxFrame was needed because of various XUL-specific things like
tooltips and so on lived there. But with the move away from XUL, that
functionality has been added to nsCanvasFrame already, behind a
principal check instead.

This also allows simplifying our background propagation setup, which was
only half-working for XUL documents (this bug is a consequence of that).

With this, most of the callers of nsCSSRendering::IsCanvasFrame can go.
They're only two of the frames that would return true for that that
actually paint backgrounds (nsCanvasFrame and nsRootBoxFrame), so the
codepaths in display list building and painting can just check
frame->IsCanvasFrame() instead.

The remaining caller to that function is
nsContainerFrame::SyncWindowProperties, and the change is also legit, in
the sense that the only thing SyncWindowProperties() really cares about
is propagating the max/min-width constraints from the root element's
style to the view/widget, and the only frame that would return true from
IsCanvasFrame and have a view is the viewport frame which is the root of
the frame tree.

Differential Revision: https://phabricator.services.mozilla.com/D90846
2021-08-01 21:57:28 +00:00
Mats Palmgren
19f1737894 Bug 1542807 part 2 - Remove (now unused) nsBulletFrame. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D111692
2021-06-14 01:22:05 +00:00
Butkovits Atila
ed3da455ae Backed out 7 changesets (bug 1542807) for causing failures at inert-retargeting-iframe.tentative.html. CLOSED TREE
Backed out changeset e9ef32fa2f2e (bug 1542807)
Backed out changeset 8fa0cb199975 (bug 1542807)
Backed out changeset 38daf64afe59 (bug 1542807)
Backed out changeset e3aee052c495 (bug 1542807)
Backed out changeset a71056d4c7cc (bug 1542807)
Backed out changeset cf91e7d0a37f (bug 1542807)
Backed out changeset eee949e5fd67 (bug 1542807)
2021-06-12 01:38:25 +03:00
Mats Palmgren
1a3fc95ee3 Bug 1542807 part 2 - Remove (now unused) nsBulletFrame. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D111692
2021-06-11 18:10:38 +00:00
Boris Chiou
9a8efaa32e Bug 1699468 - Pass StyleSizeOverrides into ComputeISizeValue(). r=TYLin
The inconsistent usage of block size and aspect ratio in ComputeSize() and
ComputeISizeValue() cause this assertion.

We use StyleSizeOverrides when measuring the content block sizes of flex
items, and the expected computed value of block size is auto.

And so in ComputeISizeValue(), we should use any field in StyleSizeOverrides
that having an override rather than fetching it from the style system.

Differential Revision: https://phabricator.services.mozilla.com/D111031
2021-04-07 23:55:38 +00:00
Emilio Cobos Álvarez
390c6943fe Bug 1702676 - Change public LookAndFeel API to accept a color scheme. r=mstange
This shouldn't change behavior, but is the biggest cross-platform part
of the change so I'd like to get it landed sooner rather than later.

The two calls like:

  GetColor(ColorID::TextSelectBackground, color);
  if (color == 0x000000) {
    mColorTextSelectForeground = NS_RGB(0xff, 0xff, 0xff);
  } else {
    mColorTextSelectForeground = NS_DONT_CHANGE_COLOR;
  }

that I'm removing are just broken. They were calling the version of
GetColor the function that took a default value when the color wasn't
available, not the version of the color with the outparam.

To prevent such mistakes, add two signatures, GetColor(), returning a
Maybe<nscolor> and Color(), returning a color with a fallback.

Differential Revision: https://phabricator.services.mozilla.com/D110651
2021-04-02 12:22:14 +00:00
Narcis Beleuzu
e9fb777466 Backed out changeset 597b9606c3ca (bug 1702676) for reftest failures on mq_prefers_reduced_motion_reduce.html CLOSED TREE 2021-04-02 09:34:53 +03:00
Emilio Cobos Álvarez
f7f84a3c53 Bug 1702676 - Change public LookAndFeel API to accept a color scheme. r=mstange
This shouldn't change behavior, but is the biggest cross-platform part
of the change so I'd like to get it landed sooner rather than later.

The two calls like:

  GetColor(ColorID::TextSelectBackground, color);
  if (color == 0x000000) {
    mColorTextSelectForeground = NS_RGB(0xff, 0xff, 0xff);
  } else {
    mColorTextSelectForeground = NS_DONT_CHANGE_COLOR;
  }

that I'm removing are just broken. They were calling the version of
GetColor the function that took a default value when the color wasn't
available, not the version of the color with the outparam.

To prevent such mistakes, add two signatures, GetColor(), returning a
Maybe<nscolor> and Color(), returning a color with a fallback.

Differential Revision: https://phabricator.services.mozilla.com/D110651
2021-04-02 00:21:37 +00:00
Haik Aftandilian
c45e8b4f76 Bug 1689682 - Include the desktop-to-device scaling factor in SizeConstraints r=mac-reviewers,mstange
Include the scaling factor in the SizeConstraints struct so that widgets can
correctly constrain their width and height when the widget's scaling factor
differs from the nsPresContext.

Differential Revision: https://phabricator.services.mozilla.com/D109265
2021-03-26 02:23:46 +00:00
Xidorn Quan
91de536124 Bug 1696721 part 2 - Refactor DoIntrinsicInlineISize to make it accept a function for handling children. r=dholbert
While nsInlineFrame and nsFirstLetterFrame are going to continue sharing the same code, nsRubyFrame will use the refactored version to compute its intrinsic sizes.

This way we can also eliminate the need for checking the intrinsic type inside the function.

This patch shouldn't change behavior. It's just a refactoring of existing code.

Differential Revision: https://phabricator.services.mozilla.com/D109227
2021-03-23 10:26:17 +00:00
Ting-Yu Lin
e1b891089b Bug 1697325 Part 5 - Add GetOverflowAreasRelativeToParent(), and simplify all the call sites. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D107740
2021-03-10 05:59:49 +00:00
Ting-Yu Lin
7e74c47006 Bug 1690701 Part 2 - Check NS_FRAME_OUT_OF_FLOW bit in nsIFrame::IsAbsolutelyPositioned(). r=emilio
I assume nsIFrame::IsAbsolutelyPositioned()'s callers really want to
check whether a frame is a real abspos frame, not just check a frame has
a abspos style. This could potentially change the behavior, but I feel
its the right thing to do.

Differential Revision: https://phabricator.services.mozilla.com/D106580
2021-03-04 00:34:03 +00:00
Ting-Yu Lin
7a72791226 Bug 799725 Part 1 - Support AspectRatio in StyleSizeOverrides. r=dholbert
This is a preparation patch for Part 2 -- We need a way to ignore
aspect-ratio when measuring a flex item's content block-size, because we
don't want the stretched inline-size transferring through aspect-ratio
to set block-size.

This patch hasn't changed the behavior yet. Part 2 is going to utilize
mAspectRatio.

Differential Revision: https://phabricator.services.mozilla.com/D106383
2021-02-25 20:06:11 +00:00
Ting-Yu Lin
cf926779e7 Bug 1674302 Part 2 - Use StyleSizeOverrides to replace ComputeSizeFlag::UseAutoISize. r=dholbert
`UseAutoISize` flag is buggy when used on table flex items because it
never propagates to inner table frame.

Luckily, we can fix it by replacing the flag with StyleSizeOverrides
emplacing an 'auto' mStyleISize, because when computing the size, the
size overrides already propagates from table wrapper to inner table via
the following path:

  `nsTableWrapperFrame::ComputeSize()` [1] ->
  `nsTableWrapperFrame::ComputeAutoSize()` ->
  `nsTableWrapperFrame::InnerTableShrinkWrapISize()` ->
  `nsTableFrame::ComputeSize()`.

Part 3 is going to propagate the size overrides to inner table in
`nsTableWrapperFrame::CreateReflowInputForInnerTable()` during reflow.

This patch fixes the content size suggestion for table flex items.
Combining this patch with Part 3, we can fix those reftests in Part 4.

[1] In this patch, the table wrapper is still using nsContainerFrame's
ComputeSize(), but Part 3 is going to override it.

Differential Revision: https://phabricator.services.mozilla.com/D103438
2021-02-18 05:45:24 +00:00
Emilio Cobos Álvarez
bebec20c7a Bug 1690706 - Move caption-side outside of mako. r=TYLin
Make it an enum class, etc.

Differential Revision: https://phabricator.services.mozilla.com/D103978
2021-02-07 12:33:45 +00:00
Ting-Yu Lin
49a8e69d8a Bug 1686603 Part 7 - Change two StyleSize variables from pointers to references, and rename them. r=emilio
After Part 5 & Part 6, we don't need to override flex item's flex-basis
proprety or preferred main size in ComputeSize() and
ComputeSizeWithIntrinsicDimensions(), we can change the two style sizes
to references, and give both of them to shorter names.

Differential Revision: https://phabricator.services.mozilla.com/D102475
2021-01-26 02:47:43 +00:00
Ting-Yu Lin
312f1e800f Bug 1686603 Part 5 - Use StyleSizeOverrides to override flex main size when main size can influence cross size. r=dholbert
FlexItem::StyleCrossSize() hasn't been used in this patch, but it will
be used in a later patch that revises size overrides in flex item's
final reflow.

Differential Revision: https://phabricator.services.mozilla.com/D101796
2021-01-26 02:47:33 +00:00
Ting-Yu Lin
4a76528949 Bug 1686603 Part 4 - Use StyleSizeOverrides to revise flex base size resolution. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D101795
2021-01-26 02:47:36 +00:00
Ting-Yu Lin
a43cae175a Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-26 02:47:40 +00:00
Csoregi Natalia
0492d8333a Backed out 8 changesets (bug 1686603) for causing crashtest failures. CLOSED TREE
Backed out changeset 94b5d0986d27 (bug 1686603)
Backed out changeset e7edf6fcc41d (bug 1686603)
Backed out changeset 4c9271f07178 (bug 1686603)
Backed out changeset 7013b95266ae (bug 1686603)
Backed out changeset cf7a55638aef (bug 1686603)
Backed out changeset 7717a0f2a37b (bug 1686603)
Backed out changeset c82593b13a61 (bug 1686603)
Backed out changeset fd1d95a1e706 (bug 1686603)
2021-01-26 04:32:13 +02:00
Ting-Yu Lin
5716640fe2 Bug 1686603 Part 7 - Change two StyleSize variables from pointers to references, and rename them. r=emilio
After Part 5 & Part 6, we don't need to override flex item's flex-basis
proprety or preferred main size in ComputeSize() and
ComputeSizeWithIntrinsicDimensions(), we can change the two style sizes
to references, and give both of them to shorter names.

Differential Revision: https://phabricator.services.mozilla.com/D102475
2021-01-25 22:25:44 +00:00
Ting-Yu Lin
56af7d6040 Bug 1686603 Part 5 - Use StyleSizeOverrides to override flex main size when main size can influence cross size. r=dholbert
FlexItem::StyleCrossSize() hasn't been used in this patch, but it will
be used in a later patch that revises size overrides in flex item's
final reflow.

Differential Revision: https://phabricator.services.mozilla.com/D101796
2021-01-25 22:27:46 +00:00
Ting-Yu Lin
902b99ce81 Bug 1686603 Part 4 - Use StyleSizeOverrides to revise flex base size resolution. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D101795
2021-01-25 22:25:57 +00:00
Ting-Yu Lin
ffce5ed7d6 Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-25 22:29:31 +00:00
Mihai Alexandru Michis
b6b2f1e5f4 Backed out 7 changesets (bug 1686603) for causing crashtest assertion failures.
CLOSED TREE

Backed out changeset 19cba7d34a7f (bug 1686603)
Backed out changeset 3a0d0155ea5e (bug 1686603)
Backed out changeset f1f672cdd0c6 (bug 1686603)
Backed out changeset 63020922e2fd (bug 1686603)
Backed out changeset 8766ce79ba5e (bug 1686603)
Backed out changeset 965dbe8de1e1 (bug 1686603)
Backed out changeset b1328ee45f43 (bug 1686603)
2021-01-21 09:21:12 +02:00
Ting-Yu Lin
403afe657d Bug 1686603 Part 7 - Change two StyleSize variables from pointers to references, and rename them. r=emilio
After Part 5 & Part 6, we don't need to override flex item's flex-basis
proprety or preferred main size in ComputeSize() and
ComputeSizeWithIntrinsicDimensions(), we can change the two style sizes
to references, and give both of them to shorter names.

Differential Revision: https://phabricator.services.mozilla.com/D102475
2021-01-21 04:34:25 +00:00
Ting-Yu Lin
02e1874759 Bug 1686603 Part 5 - Use StyleSizeOverrides to override flex main size when main size can influence cross size. r=dholbert
FlexItem::StyleCrossSize() hasn't been used in this patch, but it will
be used in a later patch that revises size overrides in flex item's
final reflow.

Differential Revision: https://phabricator.services.mozilla.com/D101796
2021-01-21 04:35:54 +00:00
Ting-Yu Lin
d1b6d1f716 Bug 1686603 Part 4 - Use StyleSizeOverrides to revise flex base size resolution. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D101795
2021-01-21 04:22:08 +00:00
Ting-Yu Lin
d0c462cb81 Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-21 04:17:59 +00:00
Boris Chiou
33c0c70a2b Bug 1646100 - min-width:auto together with apect-ratio should take the intrinsic content size into account when width is {min|max|fit}-content or auto. r=TYLin
We have to set the flag, AspectRatioUsage::ToComputedISize if we
resolve the min-content/max-content/fit-content by aspect-ratio, so that
we can handle min-width:auto well.

Differential Revision: https://phabricator.services.mozilla.com/D99406
2021-01-19 21:47:55 +00:00
Boris Chiou
8d1403f488 Bug 1646100 - Take LogicalSize type for containing block and boxing size adjustment for ComputeISizeValue. r=TYLin
We may use the block size to compute the inline size if there is a
non-auto finite aspect-ratio and definite block size, so we need more
information on the block axis. Therefore, we have to pass LogicalSize
for containing block and boxing size adjustment.

Differential Revision: https://phabricator.services.mozilla.com/D99289
2021-01-19 21:51:04 +00:00
Simon Giesecke
d3735bf37a Bug 1687241 - Add missing include. r=mbrodesser
Differential Revision: https://phabricator.services.mozilla.com/D102142
2021-01-18 15:08:46 +00:00
Boris Chiou
11ab842010 Bug 1683424 - Take box sizing into account for replaced elements with aspect-ratio. r=TYLin
If aspect-ratio is '<ratio>', now the aspect-ratio works with box sizing
dimensions for replaced elements.

Also, ComputeRatioDependentSize() already considers writing-mode so we don't
need the conversion like logicalRatio in the old code.

For those calculations for intrinsic size contribution, we will fix them
in a separate patch.

Differential Revision: https://phabricator.services.mozilla.com/D100175
2020-12-23 22:58:35 +00:00
Mats Palmgren
69849dd1cc Bug 1663222 - Move any overflow-container continuations on the OverflowContainers list for the children we pull from our prev-in-flow to the ExcessOverflowContainers to keep frames ordered. r=TYLin CLOSED TREE
Making them non-overflow containers is valid but then we can't just
append them to mFrames since that'll put them on the last line which
may result in some lines in-between the pulled child and its
continuation.  That violates the invariant that in-flow continuations
in the same parent must be on consecutive lines (unless they are
overflow containers in which case they need to be on the
[Excess]OverflowContainers lists).

(The crash happens because if we push the lines in-between the two
continuations to the OverflowLines, then we won't find the 2nd
continuation on the first line of OverflowLines.)

(Note also that this change triggers the assertion in
DrainExcessOverflowContainersList, and depends on bug 1680406
to fix that and merge the lists.)

Differential Revision: https://phabricator.services.mozilla.com/D99560
2020-12-14 15:13:35 +00:00
Mats Palmgren
9e055cb531 Bug 1680406 - Allow a prev-in-flow to have an ExcessOverflowContainers list and merge it to our OverflowContainers as needed. r=TYLin CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D99637
2020-12-14 19:40:04 +00:00
smolnar
007568029c Backed out 2 changesets (bug 1680406, bug 1663222) for causing mochitest failures. CLOSED TREE
Backed out changeset 6de49379342e (bug 1663222)
Backed out changeset 0ad0d59dbeec (bug 1680406)
2020-12-15 06:22:49 +02:00