Commit Graph

766 Commits

Author SHA1 Message Date
Ting-Yu Lin
a4f8b4b599 Bug 1861562 Part 4 - Micro optimization in nsTableRowGroupFrame::InitChildReflowInput(). r=layout-reviewers,jfkthame
We don't need the type-casting if `aBorderCollapse` is false.

Differential Revision: https://phabricator.services.mozilla.com/D192051
2023-10-27 18:38:08 +00:00
Ting-Yu Lin
bc953608c1 Bug 1861562 Part 1 - Replace GetRowBefore() with GetPrevRow(). r=layout-reviewers,jfkthame
We really don't need to call `GetNextRow()` repeatedly from `aStartRow` until
reaching `aRow`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D192048
2023-10-27 18:38:06 +00:00
Ting-Yu Lin
ac41a2729e Bug 1678767 Part 4 - Convert nsTableRowGroupFrame::SplitSpanningCells() to use logical coordinates. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D191370
2023-10-23 18:38:01 +00:00
Ting-Yu Lin
301fd1b5b8 Bug 1678767 Part 3 - Convert nsPresContext and frame arguments from references to pointers. r=dshin
In layout code, we almost always operate on frames via pointers. With this
patch, we can eliminate extra `&` and `*`.

Differential Revision: https://phabricator.services.mozilla.com/D191369
2023-10-23 18:38:00 +00:00
Ting-Yu Lin
759e7cf504 Bug 1678767 Part 2 - Convert nsTableRowGroupFrame::SplitRowGroup() to logical coordinates. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D191368
2023-10-23 18:38:00 +00:00
Ting-Yu Lin
28c1cac16e Bug 1678767 Part 1 - Convert nsTableRowGroupFrame::Reflow() to logical coordinates. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D191367
2023-10-23 18:37:59 +00:00
Ting-Yu Lin
f733dff414 Bug 1859446 Part 6 - Remove unused nsresult return value from various table methods. r=layout-reviewers,jfkthame
We never communicate error status via the `nsresult` return value, and they
always return `NS_OK`. Hence the removal.

Differential Revision: https://phabricator.services.mozilla.com/D191156
2023-10-17 17:30:02 +00:00
Ting-Yu Lin
4ecc4b5aa9 Bug 1859446 Part 5 - Make CreateContinuingRowFrame() return newly created table row frame. r=layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D191155
2023-10-17 17:30:02 +00:00
Ting-Yu Lin
201aec3ce6 Bug 1859446 Part 4 - Rename desiredSize variable for table row children. r=layout-reviewers,jfkthame
Add "kid" prefix for table row's desired size so that it won't be confused with
`aDesiredSize` output argument.

Differential Revision: https://phabricator.services.mozilla.com/D191154
2023-10-17 17:30:01 +00:00
Ting-Yu Lin
c1988278c3 Bug 1859446 Part 3 - Rename member vars in TableRowGroupReflowInput to match coding style. r=layout-reviewers,jfkthame
Also, remove `using TableRowGroupReflowInput` statement since it helps my editor
jump directly to `TableRowGroupReflowInput`'s definition rather than to the
alias.

Differential Revision: https://phabricator.services.mozilla.com/D191153
2023-10-17 17:30:01 +00:00
Ting-Yu Lin
c1e9dcd8c9 Bug 1859446 Part 2 - Remove TableRowGroupReflowInput::tableFrame. r=layout-reviewers,jfkthame
`tableFrame` is seldom used, and all the functions that need the table frame
have already got it via `GetTableFrame()` helper.

Differential Revision: https://phabricator.services.mozilla.com/D191152
2023-10-17 17:30:01 +00:00
Ting-Yu Lin
f609a78727 Bug 1859446 Part 1 - Remove haveRow variable in nsTableRowGroupFrame::ReflowChildren(). r=layout-reviewers,jfkthame
We don't need set `haveRow` to `true` in every iteration in the loop over table
rows. It is sufficient to check `GetFirstRow()`.

Differential Revision: https://phabricator.services.mozilla.com/D191151
2023-10-17 17:30:00 +00:00
Ting-Yu Lin
7d2e810399 Bug 1857585 Part 7 - Revise the helper computing table cell's block-size. r=dholbert
* It used to return useless `nsresult`. Change it to return the block-size
  instead of modifying the argument to return value.
* Shorten its name to `CalcCellActualBSize` to match `CalcBSize`.

Differential Revision: https://phabricator.services.mozilla.com/D190377
2023-10-08 01:05:14 +00:00
Ting-Yu Lin
bbb3e7eb86 Bug 1857585 Part 6 - Use GetFirstRow() to avoid extra do_QueryFrame. r=dholbert
While I'm here, revise GetFirstRow(), GetLastRow(), and GetNextRow(), and add
assertions to them to ensure the correctness of table frame tree structure.

Differential Revision: https://phabricator.services.mozilla.com/D190376
2023-10-08 01:05:14 +00:00
Ting-Yu Lin
85e1c8e57a Bug 1857585 Part 4 - Simplify unpaginated block-size helpers. r=dholbert
We don't ever remove `NS_TABLE_ROW_HAS_UNPAGINATED_BSIZE` bit, so let's set the
bit directly in `SetUnpaginatedBSize()`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D190374
2023-10-08 01:05:13 +00:00
Ting-Yu Lin
f0567a5caa Bug 1857585 Part 1 - Remove unused PresContext parameter. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D190371
2023-10-08 01:05:11 +00:00
Cosmin Sabou
5423c7bf02 Backed out changeset c20fe6f0a048 (bug 1825384) for causing table related reftest failures. CLOSED TREE 2023-09-11 19:51:30 +03:00
David Shin
f516fc2773 Bug 1825384 - Use app units in border-collapsed table data, not dev pixels. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187140
2023-09-11 14:23:01 +00:00
Emilio Cobos Álvarez
0b366c953e Bug 1851787 - Plumb a DestroyContext through all functions that can destroy frames. r=dholbert
This prevents anonymous content getting destroyed at weird times
during frame destruction.

Differential Revision: https://phabricator.services.mozilla.com/D187693
2023-09-08 15:11:17 +00:00
Emilio Cobos Álvarez
ac27a7dbe0 Bug 1852076 - Simplify table part frame-destruction, to remove the need for a destruct root. r=dholbert
This is in order to eventually remove the destruct root.

This is a performance optimization to avoid doing the work of
registration if the table is about to go away anyways. The only thing
this wants to check is whether the first continuation is getting
destroyed. We can do that much more easily, explicitly.

Differential Revision: https://phabricator.services.mozilla.com/D187677
2023-09-08 09:26:25 +00:00
Emilio Cobos Álvarez
6c324c6d1b Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-07 11:46:30 +00:00
Narcis Beleuzu
33592fec5e Backed out changeset 55052ae7d067 (bug 1851868) for reftest failure on 1153695.html . CLOSED TREE 2023-09-07 02:42:25 +03:00
Emilio Cobos Álvarez
0698c96bd1 Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-06 22:34:35 +00:00
David Shin
90331bc670 Bug 1821177: Ensure nsTableRowGroupFrame's CreateContinuingRowFrame and UndoContinuedRow push and pull from overflow lists. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D177631
2023-05-11 15:05:19 +00:00
Emilio Cobos Álvarez
8f36a9e74c Bug 1815552 - Make positioned table parts deal correctly with switching position without being reframed. r=TYLin,layout-reviewers
While looking at the backout, I noticed table parts relied on reframing
on abspos-container-ness changes in a subtle way, see the test, which
fails with the first patch of this bug applied without these changes.

Make the NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN mean the same for table parts
as for everything else. Instead, keep the registration status on each
relevant frame class individually.

Depends on D169127

Differential Revision: https://phabricator.services.mozilla.com/D170969
2023-03-01 19:04:17 +00:00
Cristina Horotan
76f1a8332c Backed out 2 changesets (bug 1815552) for causing Bp-hybrid bustages at ComputedStyle.h on a CLOSED TREE
Backed out changeset da0f9295df91 (bug 1815552)
Backed out changeset cda1ee891058 (bug 1815552)
2023-03-01 16:05:19 +02:00
Emilio Cobos Álvarez
1190d4ca51 Bug 1815552 - Make positioned table parts deal correctly with switching position without being reframed. r=TYLin,layout-reviewers
While looking at the backout, I noticed table parts relied on reframing
on abspos-container-ness changes in a subtle way, see the test, which
fails with the first patch of this bug applied without these changes.

Make the NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN mean the same for table parts
as for everything else. Instead, keep the registration status on each
relevant frame class individually.

Depends on D169127

Differential Revision: https://phabricator.services.mozilla.com/D170969
2023-03-01 10:36:54 +00:00
Emilio Cobos Álvarez
2e5a6c1aa4 Bug 1818851 - Minor cleanups to table classes. r=TYLin
Remove redundant virtual keywords, and initialize stuff in the declaration
when possible.

Differential Revision: https://phabricator.services.mozilla.com/D170968
2023-02-25 00:42:48 +00:00
Ting-Yu Lin
6a0adc1a5c Bug 1803863 Part 3 - Simplify the usages for ReflowOutput. r=emilio
- Remove unnecessary calls to ClearSize() after declaring a fresh ReflowOutput.
- Use ReflowOutput::SetSize() in nsTableFrame::FixupPositionedTableParts().

Differential Revision: https://phabricator.services.mozilla.com/D163763
2022-12-03 18:35:43 +00:00
Martin Robinson
62878408df Bug 1803377 - Rename the values of the IntrinsicDirty enum r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D163607
2022-12-02 12:27:31 +00:00
Ting-Yu Lin
ef6d896662 Bug 1799732 Part 3 - Convert FrameChildListID to enum class. r=emilio
This patch is first generated by the following script under gecko root folder.

```
#!/bin/bash

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "kPrincipalList" "FrameChildListID::Principal"
rename "kPopupList" "FrameChildListID::Popup"
rename "kCaptionList" "FrameChildListID::Caption"
rename "kColGroupList" "FrameChildListID::ColGroup"
rename "kAbsoluteList" "FrameChildListID::Absolute"
rename "kFixedList" "FrameChildListID::Fixed"
rename "kOverflowList" "FrameChildListID::Overflow"
rename "kOverflowContainersList" "FrameChildListID::OverflowContainers"
rename "kExcessOverflowContainersList" "FrameChildListID::ExcessOverflowContainers"
rename "kOverflowOutOfFlowList" "FrameChildListID::OverflowOutOfFlow"
rename "kFloatList" "FrameChildListID::Float"
rename "kBulletList" "FrameChildListID::Bullet"
rename "kPushedFloatsList" "FrameChildListID::PushedFloats"
rename "kBackdropList" "FrameChildListID::Backdrop"
rename "kNoReflowPrincipalList" "FrameChildListID::NoReflowPrincipal"
```

And then:
1. Manually fix `FrameChildListID` definition in nsFrameList.h.
2. Apply clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D161864
2022-11-12 04:38:53 +00:00
Noemi Erli
a66dba1527 Backed out 3 changesets (bug 1799732) for causing build bustages in nsIFrame.cpp CLOSED TREE
Backed out changeset e559f9dbc76f (bug 1799732)
Backed out changeset c40fda7a8b0b (bug 1799732)
Backed out changeset 1f84bfb41ab8 (bug 1799732)
2022-11-12 02:16:45 +02:00
Ting-Yu Lin
60a57a352d Bug 1799732 Part 3 - Convert FrameChildListID to enum class. r=emilio
This patch is first generated by the following script under gecko root folder.

```
#!/bin/bash

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "kPrincipalList" "FrameChildListID::Principal"
rename "kPopupList" "FrameChildListID::Popup"
rename "kCaptionList" "FrameChildListID::Caption"
rename "kColGroupList" "FrameChildListID::ColGroup"
rename "kAbsoluteList" "FrameChildListID::Absolute"
rename "kFixedList" "FrameChildListID::Fixed"
rename "kOverflowList" "FrameChildListID::Overflow"
rename "kOverflowContainersList" "FrameChildListID::OverflowContainers"
rename "kExcessOverflowContainersList" "FrameChildListID::ExcessOverflowContainers"
rename "kOverflowOutOfFlowList" "FrameChildListID::OverflowOutOfFlow"
rename "kFloatList" "FrameChildListID::Float"
rename "kBulletList" "FrameChildListID::Bullet"
rename "kPushedFloatsList" "FrameChildListID::PushedFloats"
rename "kBackdropList" "FrameChildListID::Backdrop"
rename "kNoReflowPrincipalList" "FrameChildListID::NoReflowPrincipal"
```

And then:
1. Manually fix `FrameChildListID` definition in nsFrameList.h.
2. Apply clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D161864
2022-11-11 23:44:17 +00:00
Ting-Yu Lin
2a8260149f Bug 1798373 Part 7 - Change nsContainerFrame::InsertFrames() to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160843
2022-11-01 21:15:55 +00:00
Ting-Yu Lin
0132fff981 Bug 1798373 Part 6 - Change nsContainerFrame::AppendFrames() to take rvalue reference of nsFrameList. r=emilio
Change nsBlockFrame::AppendFrames() helper, too.

Differential Revision: https://phabricator.services.mozilla.com/D160842
2022-11-01 21:15:54 +00:00
Ting-Yu Lin
4cb42a962c Bug 1798373 Part 2 - Change nsFrameList::AppendFrames to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160838
2022-11-01 21:15:52 +00:00
Ting-Yu Lin
b33681f10b Bug 1798373 Part 1 - Change nsFrameList::InsertFrames to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160837
2022-11-01 21:15:52 +00:00
Ting-Yu Lin
9ff6e4d1d3 Bug 1794035 Part 4 - Use range-based for loops to iterate nsFrameList. r=emilio
After this patch, we still need nsFrameList::Enumerator to iterate
nsFrameList::Slice. We might enhance nsFrameList::Iterator to support Slice, but
I'll leave this for another day.

Differential Revision: https://phabricator.services.mozilla.com/D158809
2022-10-07 01:41:41 +00:00
Emilio Cobos Álvarez
163f5ed245 Bug 1793375 - Rename nsILineIterator::GetDirection to IsLineIteratorFlowRTL. r=dholbert
bool GetDirection() is rather meaningless.

Differential Revision: https://phabricator.services.mozilla.com/D158474
2022-10-03 11:00:39 +00:00
Emilio Cobos Álvarez
1dfe44d7d4 Bug 1792333 - Factor out the "find closest frame in the line" checks. r=dholbert
Depends on D158085

Differential Revision: https://phabricator.services.mozilla.com/D158437
2022-10-02 07:06:46 +00:00
Emilio Cobos Álvarez
784307a8e2 Bug 1785310 - Remove mozilla/StaticPrefs_layout.h includes from other headers. r=dholbert
Adding layout prefs cause massive rebuilds because of this.

Differential Revision: https://phabricator.services.mozilla.com/D154928
2022-08-17 21:26:36 +00:00
Ting-Yu Lin
06ddbd2b65 Bug 1464761 Part 4 - Remove nsReflowStatus::mTruncated bit. r=dholbert
In the description of the mTruncated bit, its purpose is the same as calling
SetInlineLineBreakBeforeAndReset(). We've removed all its usages in previous
patches, so the bit is no longer needed.

Differential Revision: https://phabricator.services.mozilla.com/D151461
2022-07-27 21:55:18 +00:00
Ting-Yu Lin
0963d5b692 Bug 1758757 - Remove two ReflowInput::ApplyRelativePositioning methods that require ReflowInput instance. r=emilio
See bug 1758757 comment 0 for the rationale.

Note: the old code in nsTableRowGroupFrame::SlideChild() is bogus because it
calls ApplyRelativePositioning() via the nsTableRowGroupFrame's ReflowInput
instance. That is, it applies relative positioning to nsTableRowGroupFrame, but
not to the aKidFrame (nsTableRowFrame).

While I'm here, I expand `SlideChild` in its only caller, and simplify it.

Differential Revision: https://phabricator.services.mozilla.com/D150323
2022-06-27 20:49:59 +00:00
Miko Mynttinen
a65a273fd8 Bug 1697979 - Part 1: Reuse previously built stacking context display items without merging r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D128413
2022-01-22 02:37:31 +00:00
Alexandru Michis
dce8504d76 Backed out 3 changesets (bug 1697979) for causing reftest failures in retained-dl-displayport-1.html
Backed out changeset e4248d811360 (bug 1697979)
Backed out changeset db3882cc536c (bug 1697979)
Backed out changeset ea7ce38abaab (bug 1697979)
2022-01-21 04:01:27 +02:00
Miko Mynttinen
55ab9e83dd Bug 1697979 - Part 1: Reuse previously built stacking context display items without merging r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D128413
2022-01-21 00:43:34 +00:00
Noemi Erli
47edcb7964 Backed out 3 changesets (bug 1697979) for causing reftest failures CLOSED TREE
Backed out changeset 4edb10a45d13 (bug 1697979)
Backed out changeset 456b57492294 (bug 1697979)
Backed out changeset 1cb3b14f2f6c (bug 1697979)
2022-01-20 22:25:00 +02:00
Miko Mynttinen
cc5862abeb Bug 1697979 - Part 1: Reuse previously built stacking context display items without merging r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D128413
2022-01-20 18:38:59 +00:00
Jonathan Kew
2aefad4cba Bug 1732674 - Make nsLineIterator a lightweight wrapper for an nsLineList_iterator instead of building a separate array. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D126671
2021-11-09 15:55:54 +00:00
Norisz Fay
eff51791b8 Backed out 2 changesets (bug 1732674) for line iterator crashes (bug 1733047) a=backout
Backed out changeset 730555699380 (bug 1732674)
Backed out changeset f529288a6dde (bug 1732674)
2021-10-20 12:24:14 +03:00