Commit Graph

1905 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
9850f6ee73 Bug 1617472 - Use enums for text-align / text-align-last. r=jfkthame
This also fixes some backwards logic in nsBlockFrame::ReflowDirtyLines, and adds
some static assertions to nsGenericHTMLElement that almost cause a very subtle
bug.

Depends on D63792

Differential Revision: https://phabricator.services.mozilla.com/D63793
2020-02-24 13:32:57 +00:00
Emilio Cobos Álvarez
c7c1186c47 Bug 1613349 - Rename nsIFrame::DeleteProperty to RemoveProperty. r=dholbert
As it doesn't necessarily call delete and that may be confusing.

Differential Revision: https://phabricator.services.mozilla.com/D61764
2020-02-06 16:06:49 +00:00
Emilio Cobos Álvarez
096deac0e1 Bug 1613349 - Rename nsIFrame::RemoveProperty to nsIFrame::TakeProperty. r=dholbert
This is hopefully clearer naming.

Differential Revision: https://phabricator.services.mozilla.com/D61755
2020-02-06 00:13:38 +00:00
Emilio Cobos Álvarez
79768ff848 Bug 1611181 - Make direction use an enum class. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D60857
2020-01-24 11:46:14 +00:00
Morgan Reschenberg
95ac48d043 Bug 1609581: Ensure backplates inherit color from nearest non-transparent frame to correctly color select multiple's. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60099
2020-01-21 21:01:32 +00:00
Mihai Alexandru Michis
0ffcb1b4be Backed out changeset e91a005196d1 (bug 1609581) for causing reftest failures in backplate-bg-image-009.html
CLOSED TREE
2020-01-21 22:54:43 +02:00
Morgan Reschenberg
3ac627620d Bug 1609581: Ensure backplates inherit color from nearest non-transparent frame to correctly color select multiple's. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60099
2020-01-18 00:05:57 +00:00
Ting-Yu Lin
435d407cfb Bug 1603088 Part 1 - Remove "max-block-size: 100%" for -moz-column-set and -moz-column-content. r=dbaron
Simply remove "max-block-size: 100%" for -moz-column-set and
-moz-column-content breaks abspos-breaking-dynamic-{001,002,003}.html.
We need to reflow ColumnSetWrapper's children whenever
ColumnSetWrapper's block-size or max-block-size is changed because both
size affect the available block-size for ColumnSetWrapper's children.

We set `NS_FRAME_CONTAINS_RELATIVE_BSIZE` for ColumnSetWrapperFrame so
that it will set itself dirty in `selfDirty` in
`nsBlockFrame::ReflowDirtyLines`, and mark its lines dirty if
`aState.mReflowInput.IsBResize()` is true.

Differential Revision: https://phabricator.services.mozilla.com/D58731
2020-01-08 02:48:12 +00:00
Bogdan Tara
abf9fc5f90 Backed out 2 changesets (bug 1603088) for android crashtest failures on 1015844.html
Backed out changeset 2bd2d03f3c45 (bug 1603088)
Backed out changeset d4cc66fb7593 (bug 1603088)
2020-01-08 02:04:06 +02:00
Ting-Yu Lin
76cbdee801 Bug 1603088 Part 1 - Remove "max-block-size: 100%" for -moz-column-set and -moz-column-content. r=dbaron
Simply remove "max-block-size: 100%" for -moz-column-set and
-moz-column-content breaks abspos-breaking-dynamic-{001,002,003}.html.
We need to reflow ColumnSetWrapper's children whenever
ColumnSetWrapper's block-size or max-block-size is changed because both
size affect the available block-size for ColumnSetWrapper's children.

We set `NS_FRAME_CONTAINS_RELATIVE_BSIZE` for ColumnSetWrapperFrame so
that it will set itself dirty in `selfDirty` in
`nsBlockFrame::ReflowDirtyLines`, and mark its lines dirty if
`aState.mReflowInput.IsBResize()` is true.

Differential Revision: https://phabricator.services.mozilla.com/D58731
2020-01-07 19:17:27 +00:00
Ting-Yu Lin
1785c0dc68 Bug 1499281 - Remove column-span pref in nsBlockFrame. r=dbaron
Differential Revision: https://phabricator.services.mozilla.com/D58397
2019-12-31 16:11:07 +00:00
Ting-Yu Lin
f9baf289c1 Bug 1604978 - Move NS_BLOCK_FLAGS_MASK and NS_BLOCK_FLAGS_NON_INHERITED_MASK into nsBlockFrame::Init. r=heycam
The two masks are used only in nsBlockFrame::Init, so they should be
defined closer to their usage.

Note that 'constexpr' declared on functions implies 'inline'.

Differential Revision: https://phabricator.services.mozilla.com/D57724
2019-12-20 03:56:12 +00:00
Mats Palmgren
0be3a22806 Bug 1602430 - Apply min/max-height correctly for fragmented boxes with no height specified. r=TYLin
Depends on D56738

Differential Revision: https://phabricator.services.mozilla.com/D57561
2019-12-17 23:13:13 +00:00
Mats Palmgren
786def0d4c Bug 1574046 - Wallpaper the effect of this bug in nsBlockFrame::ComputeFinalSize. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D56738
2019-12-17 23:03:21 +00:00
Morgan Reschenberg
9470359b72 Bug 1594099: Use the visual overflow area of text-frame descendants (rather than entire lines) to determine the HCM backplate. r=dholbert
The line-box's visual overflow area includes margin/border/padding area on
its descendants, as well as extra empty space for text-indent and text-align.
None of that area contains text & merits a backplate.  So, we can't rely on
the line-box's visual overflow area to determine the backplate -- we have to
actually dig down to find the text frames.

Also, this patch simplifies our suite of backplate reftests in several ways.
Most notably, this patch:
- removes unnecessary backplatable whitespace in the testcase (since that's
  awkward to mock up in the reference case).
- uses a linear-gradient for the background instead of a longer data URI.
- uses the predictably-sized Ahem font inside of tests' form controls.

Differential Revision: https://phabricator.services.mozilla.com/D52065
2019-12-11 19:19:20 +00:00
Dorel Luca
e33d136542 Backed out changeset c25dd569f2cf (bug 1594099) for Reftest failures on reftests/high-contrast/backplate-bg-image-012.html. CLOSED TREE 2019-12-11 20:45:03 +02:00
Morgan Reschenberg
4bb4352828 Bug 1594099: Use the visual overflow area of text-frame descendants (rather than entire lines) to determine the HCM backplate. r=dholbert
The line-box's visual overflow area includes margin/border/padding area on
its descendants, as well as extra empty space for text-indent and text-align.
None of that area contains text & merits a backplate.  So, we can't rely on
the line-box's visual overflow area to determine the backplate -- we have to
actually dig down to find the text frames.

Also, this patch simplifies our suite of backplate reftests in several ways.
Most notably, this patch:
- removes unnecessary backplatable whitespace in the testcase (since that's
  awkward to mock up in the reference case).
- uses a linear-gradient for the background instead of a longer data URI.
- uses the predictably-sized Ahem font inside of tests' form controls.

Differential Revision: https://phabricator.services.mozilla.com/D52065
2019-12-11 17:02:12 +00:00
Mats Palmgren
14723e010f Bug 1572573 - Pushed floats should make block-formatting contexts incomplete, not overflow-incomplete. r=TYLin
So the reason we get the current bogus result is that overflow:hidden
are block-formatting contexts (BFC) and in paginated mode they are
implemented as block frames with NS_BLOCK_CLIP_PAGINATED_OVERFLOW
to do the clipping.  When we have a child float that doesn't fit,
we split it and currently we report that as Overflow-Incomplete
(which is correct for a normal block, but not a BFC) which leads
to creating an overflow-container continuation which has zero
size which we then clip.  We should report it as Incomplete
instead, except if we already are an overflow-container.

Differential Revision: https://phabricator.services.mozilla.com/D56416
2019-12-11 14:17:51 +00:00
Mats Palmgren
827d2bf4c2 Bug 1596310 - Clamp negative available size to zero and ensure page break frames don't apply margins. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D53040
2019-11-18 20:36:52 +00:00
Emilio Cobos Álvarez
74d9dc2fee Bug 1596050 - Centralize logic to ignore document colors. r=jfkthame
This was a follow-up from the backplate stuff which I requested but didn't
happen.

Differential Revision: https://phabricator.services.mozilla.com/D53170
2019-11-15 13:39:08 +00:00
Morgan Reschenberg
2cba008ac7 Bug 1587127: Ensure no backplate is drawn for lines that have only visibility:hidden descendants. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D48725
2019-10-30 15:45:45 +00:00
Ting-Yu Lin
1714657884 Bug 1591546 Part 1 - Add WritingMode::IsBidiRTL(). r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D50771
2019-10-28 09:33:05 +00:00
Daniel Holbert
bee0f244b9 Bug 1590639 part 1: Fix non-unified build issues in layout/generic. r=TYLin
The issues fall into these categories:
 - Files that used StaticPrefs::layout_XYZ() API or gfxVars::XYZ that needed an
   include. (Addressed by adding the missing include.)
 - Files that use mozilla::dom::XYZ or mozilla::gfx::XYZ without qualifying the
   namespace & without a 'using' decl. (Addressed by adding "using".)
 - A few other includes for types/inlines that were used without their header.

Depends on D50162

Differential Revision: https://phabricator.services.mozilla.com/D50163
2019-10-23 22:05:22 +00:00
Ting-Yu Lin
cf67df29a1 Bug 1102175 Part 4 - Add BFC bits to a block if its used writing-mode is different from the parent's. r=jfkthame
Without this patch, the `CHECK_BLOCK_AND_LINE_DIR` soft assertion in
nsFloatManager can be triggered with
wm-propagation-body-dynamic-change-002.html added in Part 3.

Add the test as a crashtest because web-platform reftest doesn't seem to
catch our soft assertions.

Add reftests to verify that BFC bits are added to the child block if the
parent and child has the same block-direction, but different sideways
bit; also, add reftests to ensure that "text-orientation: sideways"
doesn't add BFC bits.

Differential Revision: https://phabricator.services.mozilla.com/D45912
2019-10-10 04:44:38 +00:00
Ting-Yu Lin
3461268cdd Bug 1168921 - Stop cloning block direction margins for box-decoration-break:clone. r=mats
This can also fix bug 1586470.

This change basically reverts Bug 1025669 Part 1.
https://hg.mozilla.org/mozilla-central/rev/ae2fd5b2defb0df1bd30521f4793de6757d1e98b

In box-decoration-break-block-margin.html, the `height` in `.inner` is
changed to 79px so that 79px plus 7px margin top and 1px margin end,
total 87px, can be divided by 3 (columns). The modification to reference
file reflects what we currently rendered.

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

Differential Revision: https://phabricator.services.mozilla.com/D48484
2019-10-10 13:38:07 +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
1916ec2c56 Bug 1102175 Part 4 - Add BFC bits to a block if its used writing-mode is different from the parent's. r=jfkthame
Without this patch, the `CHECK_BLOCK_AND_LINE_DIR` soft assertion in
nsFloatManager can be triggered with
wm-propagation-body-dynamic-change-002.html added in Part 3.

Add the test as a crashtest because web-platform reftest doesn't seem to
catch our soft assertions.

Add reftests to verify that BFC bits are added to the child block if the
parent and child has the same block-direction, but different sideways
bit; also, add reftests to ensure that "text-orientation: sideways"
doesn't add BFC bits.

Differential Revision: https://phabricator.services.mozilla.com/D45912
2019-10-09 22:11:19 +00:00
Morgan Reschenberg
e8c9606021 Bug 1539212: Add readability backplate for all elements containing text when HCM or a11y theme is active. r=dholbert,mattwoodrow,Jamie
Differential Revision: https://phabricator.services.mozilla.com/D42979
2019-10-04 16:44:49 +00:00
Bogdan Tara
e1da155b31 Backed out changeset 928b755ef57b (bug 1539212) for backplate-bg-image-006.html failures 2019-09-20 03:59:03 +03:00
Morgan Reschenberg
baa6e4c231 Bug 1539212: Add readability backplate for all elements containing text when HCM or a11y theme is active. r=dholbert,mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D42979
2019-09-19 21:25:12 +00:00
Brindusan Cristian
d0eb035ed7 Backed out changeset f5b8fba989b4 (bug 1539212) for reftest failures on backplate-bg-image-001.html. CLOSED TREE 2019-09-17 00:01:04 +03:00
Morgan Reschenberg
d5a5de8f5c Bug 1539212: Add readability backplate for all elements containing text when HCM or a11y theme is active. r=dholbert,mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D42979
2019-09-16 18:26:04 +00:00
Ting-Yu Lin
41ab03b21d Bug 1523582 Part 3 - Adjust GetLogicalSkipSides() to check non-fluid continuations. r=dbaron
Frames split by column-span are linked together by non-fluid
continuations. We want GetLogicalSkipSides() to recognize that. The
documentation in nsIFrame::GetLogicalSkipSides() already
uses *continuation* rather than *in-flow*, so no need to adjust the
wording.

However, after patching GetLogicalSkipSides(), the first column-content
after a column-span split starts to skip the block-start side because it
has a previous continuation. We want the content in the first column to
consider applying its block-start margin. Hence the modification in
BlockReflowInput's constructor. (Note that the first column-content is
always a block-start margin-root, which is fixed in the previous part.)
This is necessary to avoid breaking
testing/web-platform/tests/css/css-multicol/multicol-span-all-margin-bottom-001.xht

In multicol-span-all-children-height-006.html, add "margin-top: 1em;" to
the container to expose the bug if we still check GetPrevInFlow() rather
than GetPrevContinuation() when computing applyBStartMargin in
nsBlockFrame::ReflowBlockFrame().

Differential Revision: https://phabricator.services.mozilla.com/D43905
2019-09-09 17:42:14 +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
Ting-Yu Lin
36c1441887 Bug 1575106 Part 3 - Use unconstrained block-size to measure last column, and revise condition to create overflow columns. r=dbaron
This patch changes behavior only if column-span is enabled. It fixes a
lot of fuzzing test cases which will be added in the next part.

It changes the column balancing behavior in the following ways.

1) By using unconstrained block-size to measure the last column in the
   first balancing iteration, we can guarantee that mKnownFeasibleBSize
   has the correct feasible block-size.

2) Always reflow one more time if the content cannot fit in the
   available content block-size. Due to 1), the content (last column)
   always returns fully complete in the first balancing iteration even if
   it's in an inner column with a constrained available block-size. We need
   to reflow again to get the correct *incomplete* reflow status so that
   the outer column can create next-in-flows for the inner column.

3) ColumnSet gives up balancing only when ColumnSetWrapper is running
   out of block-size. When a ColumnSetWrapper has constrained block-size,
   i.e. it's in a fragmentation context like pages or nested columns, we
   prioritize fragmenting ColumnSetWrapper over creating overflow columns
   within the nsColumnSet.

Differential Revision: https://phabricator.services.mozilla.com/D43128
2019-08-26 07:03:36 +00:00
Ting-Yu Lin
be511c4e90 Bug 1575106 Part 2 - Rename blockReflowInput to childReflowInput in nsBlockFrame::ReflowBlockFrame(). r=dbaron
Every time I read the code, the name `blockReflowInput` makes me think
the variable is an instance of `BlockReflowInput`, but it is not.

Differential Revision: https://phabricator.services.mozilla.com/D43127
2019-08-26 06:10:21 +00:00
Ting-Yu Lin
6fdc8da64b Bug 1575377 - Remove BlockReflowInput::mHasUnconstrainedBSize, and update documents. r=dholbert
The flag's original form `mUnconstrainedHeight` was added in
nsBlockReflowState.h in
e580331b37

Nowadays, we often check available block-size in reflow directly in nsBlockFrame.

Differential Revision: https://phabricator.services.mozilla.com/D42733
2019-08-21 19:53:08 +00:00
Ting-Yu Lin
a791330c80 Bug 1575305 Part 1 - Remove an unneeded condition used for ::-moz-column-content. r=dbaron
Before bug 1411422, a ::-moz-column-content has height:100%, so it could
go into this path if ColumnSet's available block-size is unconstrained.

However, after bug 1411422, height:100% was removed for
::-moz-column-content. That is, its computed block-size is
unconstrained, so it can't go into this path. This applies regardless of
whether column-span is enabled or not.

Differential Revision: https://phabricator.services.mozilla.com/D42708
2019-08-20 22:29:55 +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
Ting-Yu Lin
92903384ba Bug 1569701 Part 2 - Use ColumnSetWrapper's effective computed content block-size to impose constraint for ColumnSet. r=dbaron
Run broken-column-rule-1.html with column-span enabled because it was
regressed by Bug 1548100 Part 2, but fixed by this patch.

Differential Revision: https://phabricator.services.mozilla.com/D41907
2019-08-15 16:59:13 +00:00
Ting-Yu Lin
d3b16d837d Bug 1569701 Part 1 - Make BlockReflowInput::mConsumedBSize a constant, and delete it assessor method. r=dbaron
We always pass consumed block-size into BlockReflowInput's constructor
in nsBlockFrame::Reflow(). By making mConsumedBSize a constant, its
assessor method becomes redundant.

Update the documentation to reflect the reality that ConsumedBSize()
accumulates content block-size from all previous *continuations*, which
was done in Bug 1506293 Part 2.

Differential Revision: https://phabricator.services.mozilla.com/D41906
2019-08-15 16:49: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
78ed7e52c0 Bug 1105868 part 4 - Accessibility support for inline list-items. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39833
2019-08-14 14:37:16 +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
L. David Baron
94e5b517b7 Bug 1571250 - Convert flags passed to ReflowChild, FinishReflowChild, SyncFrameViewAfterReflow and from GetXULLayoutFlags / GetLayoutFlags into an enum class. r=TYLin
It seems better to convert this before adding a new flag (in bug
1547759) and risking replacing the wrong 0 with a flag.

Differential Revision: https://phabricator.services.mozilla.com/D40562
2019-08-08 19:48:19 +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
Ting-Yu Lin
7bbc854b8d Bug 1571118 - Keep NS_FRAME_FIRST_REFLOW bit in nsBlockFrame::Reflow() until nsFrame::DidReflow(). r=dholbert
This patch lets nsBlockFrame keep its NS_FRAME_FIRST_REFLOW bit a bit
longer, for the full duration of its first reflow, so that in the future
we may add more code to inspect it if needed before nsFrame::DidReflow()
clears it.

Differential Revision: https://phabricator.services.mozilla.com/D40512
2019-08-05 17:54:34 +00:00
Ting-Yu Lin
0cb468ba90 Bug 1571135 - Remove the preference that controls breaking floats inside columns. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D40587
2019-08-05 17:39:19 +00:00
L. David Baron
e0f6989e68 Bug 1404868 - Always reflow float placeholders when they move to a different block fragment. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D40276
2019-08-02 21:05:20 +00:00