Граф коммитов

299 Коммитов

Автор SHA1 Сообщение Дата
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
Mats Palmgren 42d6c7ccea 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
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 03730e94c4 Bug 1680406 - Allow a prev-in-flow to have an ExcessOverflowContainers list and merge it to our OverflowContainers as needed. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D99637
2020-12-14 19:40:04 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Jon Bauman f5c1a59332 Bug 1675987 - No derogatory language: Remove references to "crazy" in layout module r=emilio,AlaskanEmily
Differential Revision: https://phabricator.services.mozilla.com/D97657
2020-11-20 21:21:03 +00:00
Ting-Yu Lin 545a6376cd Bug 1677635 Part 4 - Rename nsOverflowAreas to OverflowAreas, and move it into mozilla namespace. r=layout-reviewers,emilio
This patch is generated via the rename functionality in my editor; add
`mozilla::` prefix to `OverflowAreas` in headers; and remove the
`OverflowType` alias added in Part 1.

Differential Revision: https://phabricator.services.mozilla.com/D97235
2020-11-18 00:08:12 +00:00
Ting-Yu Lin 8c17380539 Bug 1674450 Part 6 - Convert ReflowInput::Init()'s optional border and padding parameters to Maybe<LogicalMargin>. r=layout-reviewers,jfkthame
Similar to the optional aContainingBlockSize parameter, both border and
padding should use logical coordinates in ReflowInput::mFrame's writing
mode.

Table frames that need to override border and padding can be simplified a bit.
However, DR_init_constraints_cookie and DR_init_offsets_cookie become more
complex, but they're only for debugging. I'm not planning to update their
internal APIs.

Differential Revision: https://phabricator.services.mozilla.com/D95369
2020-10-31 14:39:23 +00:00
Ting-Yu Lin b0d0dbd24b Bug 1669393 - Fix up position of overflow container children in a vertical-rl block once we know the final block size. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D93727
2020-10-28 18:07:22 +00:00
Ting-Yu Lin 2eeff177cf Bug 1668411 - Change IS_TRUE_OVERFLOW_CONTAINER macro into a nsIFrame's inline method. r=emilio
`IS_TRUE_OVERFLOW_CONTAINER` is defined in nsContainerFrame.h, but is
already used in several places in nsIFrame. It really should be an
nsIFrame's method.

Differential Revision: https://phabricator.services.mozilla.com/D92007
2020-10-01 02:39:40 +00:00
Ting-Yu Lin 4041fe929c Bug 1668387 - Make nsContainerFrame::StealFrame() return void since it shouldn't fail. r=emilio
The three implementations of StealFrame() -- nsContainerFrame,
nsBlockFrame, and nsInlineFrame -- all have assertions to guarantee
aChild can be found, so the operation shouldn't fail.

This change shouldn't change behavior at all.

Differential Revision: https://phabricator.services.mozilla.com/D91996
2020-09-30 23:38:41 +00:00
Ting-Yu Lin 6ef06ff583 Bug 1660122 Part 7 - Implement GetAspectRatio(). r=emilio
This patch moves the preferred aspect-ratio calculation from each
replaced elements' GetIntrinicRatio() into GetAspectRatio(), because
they share the same logic.

For nsImageFrame, the cached mIntrinsicRatio now stores only the image's
intrinsic ratio, not considering the aspect-ratio property.

This patch fixed "object-fit:contain" for canvas, image because
GetIntrinicRatio() no longer considers aspect-ratio. This also fixed
replaced elements' size when both "aspect-ratio:<ratio>" and
"contain:size" is specified.

This also makes us pass some of the aspect-ratio tests because we change
GetIntrinicRatio() into GetAspectRatio() in
nsLayoutUtils::IntrinsicForAxis() in Part5, which is used by nsBlockFrame
(via nsLayoutUtils::IntrinsicForContainer) to implement GetMinISize().

Differential Revision: https://phabricator.services.mozilla.com/D91229
2020-09-29 22:33:05 +00:00
Botond Ballo 948cec1b06 Bug 1667594 - Avoid including nsLayoutUtils.h in nsContainerFrame.h. r=emilio
nsContainerFrame.h was only using the enum nsLayoutUtils::IntrinsicISizeType,
which this patch moves to LayoutConstants.h instead.

Depends on D91505

Differential Revision: https://phabricator.services.mozilla.com/D91506
2020-09-26 18:19:14 +00:00
Ting-Yu Lin ecca275fc4 Bug 1168478 Part 2 - Combine the border and padding arguments for nsIFrame::ComputeSize(). r=dholbert
Also combine the border and padding arguments for
nsContainerFrame::ComputeSizeWithIntrinsicDimensions(), too. This method
is used as a helper to implement ComputeSize() for various replaced
elements. Its callers are all within nsIFrame's derived classes'
overridden methods, so I'm not bothering to convert them in a separate
patch.

This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D90064
2020-09-14 20:42:22 +00:00
Ting-Yu Lin ff5d92f454 Bug 1168478 Part 1 - Combine the border and padding argument for nsIFrame::ComputeAutoSize(). r=dholbert
Also, revise the nsIFrame::ComputeAutoSize()'s documentation.

This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D90063
2020-09-14 20:39:17 +00:00
Ting-Yu Lin a11075f9e1 Bug 1663822 Part 3 - Move ComputeSizeFlags to LayoutConstants.h, and put it under mozilla namespace. r=dholbert
In the next part, I'm going to use ComputeSizeFlags as the arguments in
some ReflowInput's methods. Because nsIFrame.h includes ReflowInput.h,
to solve the circular dependency, ComputeSizeFlags needs to be moved to
somewhere else.

Also, revise the document for ComputeSizeFlag. The rest of the patch is
just dropping `nsIFrame::` and adding `mozilla::` as needed.

This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D89542
2020-09-11 18:32:08 +00:00
Ting-Yu Lin a4ceb26acb Bug 1641085 Part 7 - Simplify the definition of FrameListPropertyDescriptor. r=mats
It's easier to jump to the definition of FrameListPropertyDescriptor in editors
without too many indirections.

Differential Revision: https://phabricator.services.mozilla.com/D88461
2020-08-29 00:22:45 +00:00
Ting-Yu Lin 71a0063df5 Bug 1641085 Part 6 - Remove GetPropTableFrames() and RemovePropTableFrames() in nsContainerFrame. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D88460
2020-08-29 00:22:43 +00:00
Ting-Yu Lin a69c3e6644 Bug 1641085 Part 5 - Remove SetPropTableFrames() in nsContainerFrame. r=mats
We already use SetProperty() extensively for nsFrameList properties like
OutsideMarkerProperty(), BackdropProperty(), etc, so we can simplify the
interface by removing SetPropTableFrames().

Differential Revision: https://phabricator.services.mozilla.com/D88459
2020-08-29 00:22:41 +00:00
Ting-Yu Lin f6a350f66e Bug 1641085 Part 4 - Revise DrainAndMergeSelfOverflowList() so that it's free of explicit allocation and deletion of nsFrameList. r=mats,emilio
Because the frame property look-up is expensive, change the
SetOverflowFrames(), SetOverflowContainers(), and
SetExcessOverflowContainers() to return the frame list so that the
caller don't need to use Get methods to retrieve it again.

Differential Revision: https://phabricator.services.mozilla.com/D88458
2020-08-31 04:06:26 +00:00
Ting-Yu Lin 9cb3f93c40 Bug 1641085 Part 3 - Add APIs to manipulate excess overflow containers list. r=mats
This patch is similar to Part 2, but for adding APIs for
ExcessOverflowContainersProperty().

Differential Revision: https://phabricator.services.mozilla.com/D88457
2020-08-29 00:22:31 +00:00
Ting-Yu Lin 45b86ae08f Bug 1641085 Part 2 - Add APIs to manipulate overflow containers list. r=mats
Not all APIs added in this patch are used immediately, but for the sake of
completeness, they are all added.

Their document will be updated in Part 3 after adding the relevant APIs for
ExcessOverflowContainersProperty().

nsContainerFrame::DrainExcessOverflowContainersList() has several calls to set
OverflowContainersProperty() whose life cycle need special attention. We will
deal with them later in Part 4.

Differential Revision: https://phabricator.services.mozilla.com/D88456
2020-08-29 00:22:23 +00:00
Ting-Yu Lin 0076add365 Bug 1641085 Part 1 - Add move semantic to nsFrameList, and use it on SetOverflowFrames(). r=mats
It's useful to use `std::move()` to indicate the frames' ownership in one list
is transferred to the another list.

For a frame list managed by AutoFrameListPtr, after moving its frames to
another list, it can be automatically deleted when it is going out of
scope.

Differential Revision: https://phabricator.services.mozilla.com/D88455
2020-08-29 00:22:16 +00:00
Ting-Yu Lin fdc00547f6 Bug 1637130 - Rename visual overflow to ink overflow. r=dbaron
This patch is generated by:

```
# Rename the nsOverflowType enum.
rg -l "eVisualOverflow" layout/ gfx/ | xargs sed -i "s/eVisualOverflow/eInkOverflow/g"

# Rename and drop the "Get" prefix from various functions.
rg -l "GetVisualOverflowRect" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowRect/InkOverflowRect/g"
rg -l "GetPreEffectsVisualOverflowRect" layout/ gfx/ | xargs sed -i "s/GetPreEffectsVisualOverflowRect/PreEffectsInkOverflowRect/g"
rg -l "GetVisualOverflowFromDeltas" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowFromDeltas/InkOverflowFromDeltas/g"
rg -l "GetScrollableOverflowRect" layout/ gfx/ | xargs sed -i "s/GetScrollableOverflowRect/ScrollableOverflowRect/g"

# Rename, drop the "Get" prefix, and change the suffix "Area" to "Rect"
# (because they return nsRect) for the two methods in nsLineBox.
rg -l "GetVisualOverflowArea" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowArea/InkOverflowRect/g"
rg -l "GetScrollableOverflowArea" layout/ gfx/ | xargs sed -i "s/GetScrollableOverflowArea/ScrollableOverflowRect/g"

# Rename rest of the functions and variables.
rg -l "VisualOverflow" layout/ gfx/ | xargs sed -i "s/VisualOverflow/InkOverflow/g"
rg -l "visual overflow" layout/ gfx/ | xargs sed -i "s/visual overflow/ink overflow/g"
rg -l "visualOverflow" layout/ gfx/ | xargs sed -i "s/visualOverflow/inkOverflow/g"
rg -l "visOverflow" layout/ gfx/ | xargs sed -i "s/visOverflow/inkOverflow/g"
rg -l "vis-overflow" layout/ gfx/ python/ | xargs sed -i "s/vis-overflow/ink-overflow/g"

./mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D84231
2020-07-20 20:17:36 +00:00
Ting-Yu Lin 358c2f9ef1 Bug 1651202 Part 1 - Extract nsBlockFrame's printing child lists logic to a helper methods. r=heycam
`ListChildLists` lives in nsContainerFrame because I'm going to use it
to improve nsContainerFrame::List() in a later patch.

Differential Revision: https://phabricator.services.mozilla.com/D82602
2020-07-08 00:59:02 +00:00
Ting-Yu Lin cd61c7d575 Bug 1645549 Part 1 - Move GetFirstNonAnonBoxDescendant() to nsContainerFrame. r=dholbert
Also, rename it to GetFirstNonAnonBoxInSubtree() to reflect its
functionality more precisely that it can return the argument aFrame
itself.

Differential Revision: https://phabricator.services.mozilla.com/D81000
2020-07-01 02:33:11 +00:00
Kagami Sascha Rosylight 91d8e0a89a Bug 1647525 - Use HasAnyStateBits() in nsContainerFrame r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81199
2020-06-27 14:07:43 +00:00
Ting-Yu Lin 883f8f5f85 Bug 1405813 - Move prev-in-flow's EOC list to this container frame's OC list in NormalizeChildLists(). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D78848
2020-06-12 19:03:49 +00:00
Ting-Yu Lin 1022daa063 Bug 1643173 Part 1 - Convert enum nsIFrame::DISPLAY_CHILD_* to enum class. r=dholbert
The modifications are all straightforward conversion except the one in
nsMathMLContainerFrame, where it is simplified by calling the equivalent
BuildDisplayListForInline() helper.

Differential Revision: https://phabricator.services.mozilla.com/D78166
2020-06-05 02:52:05 +00:00
Ting-Yu Lin 5ca75861f1 Bug 1343948 - Merge overflow container children to next-in-flow's OverflowContainersProperty() if the property already exists. r=mats
This is to prevent the assertion at the beginning of
DrainExcessOverflowContainersList().

The invariant is described in the comment revised in this patch. That
is, "only one overflow containers list exists for a given frame: either
its own OverflowContainersProperty or its prev-in-flow's
ExcessOverflowContainersProperty, not both."

Differential Revision: https://phabricator.services.mozilla.com/D77328
2020-06-02 02:37:28 +00:00
Razvan Maries a90b180cd2 Backed out changeset 7925ab748617 (bug 1343948) for perma failures on 1343606.html. CLOSED TREE 2020-06-02 03:02:10 +03:00
Ting-Yu Lin 197bb3cfff Bug 1642038 Part 2 - Mark [[nodiscard]] for StealOverflowFrames() and RemovePropTableFrames(). r=emilio
StealOverflowFrames() and RemovePropTableFrames() use TakeProperty() to
remove the property, and transfer the ownership to the caller. Since
TakeProperty() is already marked as [[nodiscard]], so should they.

Differential Revision: https://phabricator.services.mozilla.com/D77567
2020-06-01 19:02:25 +00:00
Ting-Yu Lin e49672dd8f Bug 1642038 Part 1 - Move the definition of helpers manipulating overflow list to their declarations. r=emilio
SetOverflowFrames() is simplified a bit. Other methods are moved
verbatim.

Differential Revision: https://phabricator.services.mozilla.com/D77566
2020-06-01 19:02:22 +00:00
Ting-Yu Lin 4bdc6951d6 Bug 1343948 - Merge overflow container children to next-in-flow's OverflowContainersProperty() if the property already exists. r=mats
This is to prevent the assertion at the beginning of
DrainExcessOverflowContainersList().

The invariant is described in the comment revised in this patch. That
is, "only one overflow containers list exists for a given frame: either
its own OverflowContainersProperty or its prev-in-flow's
ExcessOverflowContainersProperty, not both."

Differential Revision: https://phabricator.services.mozilla.com/D77328
2020-06-01 21:18:21 +00:00
Ting-Yu Lin fae28a9fe1 Bug 1640275 Part 1 - Move some nsGridContainerFrame's helper methods to nsContainerFrame. r=mats
In the next part, I'll extend these helpers, and use them in
nsFlexContainerFrame.

Differential Revision: https://phabricator.services.mozilla.com/D77203
2020-05-28 18:03:11 +00:00
Kagami Sascha Rosylight b77454b2ee Bug 1630704 - Part 6: Move helper methods to nsContainerFrame r=emilio
Those methods are only used in subclasses of nsContainerFrame.

Differential Revision: https://phabricator.services.mozilla.com/D75070
2020-05-13 18:09:32 +00:00
Ting-Yu Lin b510e66915 Bug 1622935 Part 2 - Move nsGridContainerFrame's NormalizeChildLists() and related helpers to nsContainerFrame. r=mats
Also, add relevant bits to be able to use them in the flex container.

Differential Revision: https://phabricator.services.mozilla.com/D73166
2020-05-01 23:34:22 +00:00
Ting-Yu Lin 7323697f18 Bug 1625362 Part 3 - Extract grid container's PushIncompleteChildren logic, and move it to nsContainerFrame. r=mats
I left all the bits that related to grid container, such as setting
aStatus, NS_STATE_GRID_DID_PUSH_ITEMS, and aState.mIter in
nsGridContainerFrame::ReflowRowsInFragmentainer().

Differential Revision: https://phabricator.services.mozilla.com/D68492

--HG--
extra : moz-landing-system : lando
2020-04-15 18:31:35 +00:00
Ting-Yu Lin a2e0d00564 Bug 1625362 Part 2 - Move some helpers manipulating overflow lists from nsGridContainerFrame to nsContainerFrame. r=mats
We can utilize these helpers to implement flex item fragmentation.

Differential Revision: https://phabricator.services.mozilla.com/D68491

--HG--
extra : moz-landing-system : lando
2020-04-15 18:31:33 +00:00
Ting-Yu Lin 97c3b1d8cb Bug 1625362 Part 1 - Move ReparentFrame and ReparentFrames into nsContainerFrame. r=mats
We have duplicated ReparentFrame and ReparentFrames define in both
nsBlockFrame and nsGridContainerFrame. We should move them into
nsContainerFrame.

Differential Revision: https://phabricator.services.mozilla.com/D68490

--HG--
extra : moz-landing-system : lando
2020-04-15 18:31:25 +00:00
Emily McDonough a076865928 Bug 1628837 - Add subgrid property address to nsGridContainerFrame frame dump output r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D70436

--HG--
extra : moz-landing-system : lando
2020-04-09 21:25:12 +00:00
Ting-Yu Lin 5610a9711b Bug 1627398 Part 1 - Convert nsIFrame::List flags to EnumSet. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D69914

--HG--
extra : moz-landing-system : lando
2020-04-08 00:22:19 +00:00
Ting-Yu Lin c64c145dd4 Bug 1620749 - Adjust FinishReflowChild()'s relative positioning conversion, to make it a writing-mode-agnostic API. r=dholbert
Currently, when using ReflowChildFlags::ApplyRelativePositioning flag in
FinishReflowChild(), we (implicitly) force the callers to pass aWM and
aPos in the same writing-mode as the reflow input, i.e. the child's
writing-mode. This results in an unintuitive LogicalPoint conversion
`mContainerSize - mMetrics.PhysicalSize()` in
nsBlockReflowContext::PlaceBlock().

We should allow the callers to use their preferred aWM and aPos (either
in parent's wm or child's wm), and do the necessary conversion in
FinishReflowChild() (like we did to convert aDesiredSize from
ReflowOutput's wm to aWM).

Also, correct the documentation for aWM in ReflowChild() and
FinishReflowChild(). aWM doesn't need to be the containing frame's
writing-mode. It can be any as long as it is the writing-mode that aPos
is used.

Differential Revision: https://phabricator.services.mozilla.com/D65859

--HG--
extra : moz-landing-system : lando
2020-03-09 18:15:48 +00:00
James Teh c604c6018c Bug 1616078: Don't use HTMLListBulletAccessible for CSS ::marker content. r=eeejay,emilio,MarcoZ
::marker content gets handled like text from any other CSS pseudo-class.
Therefore, using HTMLListBulletAccessible ends up duplicating the content already exposed in the a11y tree.
Now, we only use HTMLListBulletAccessible for nsBulletFrames instead of all marker frames.

As part of this, remove nsContainerFrame::GetSpokenMarkerContent, since we no longer need it to retrieve ::marker content.
The bulk of its other work was done by nsBulletFrame::GetSpokenContent, which we now call directly.
It also handled producing a default bullet character for list-style-image, but it makes sense for this to live in the a11y code.

Differential Revision: https://phabricator.services.mozilla.com/D63443

--HG--
extra : moz-landing-system : lando
2020-02-21 01:23:37 +00:00
Ting-Yu Lin e50292bfb5 Bug 1613732 Part 1 - Revise documentation for ReflowChildFlags, ReflowChild(), and FinishReflowChild(). r=dholbert
The entire comment deleted in nsContainerFrame.cpp belongs to
FinishReflowChild(), which is already documented in the header.

Change `aChildFrame` to `aKidFrame` for ReflowChild() to match its
implementation.

Differential Revision: https://phabricator.services.mozilla.com/D61885

--HG--
extra : moz-landing-system : lando
2020-02-07 04:17:30 +00:00
Emilio Cobos Álvarez bba367ec8f Bug 1613349 - Rename nsIFrame::RemoveProperty to nsIFrame::TakeProperty. r=dholbert
This is hopefully clearer naming.

Differential Revision: https://phabricator.services.mozilla.com/D61755

--HG--
extra : moz-landing-system : lando
2020-02-06 00:13:38 +00:00
Emilio Cobos Álvarez 4812f9408a Bug 1611583 - Use cbindgen for css-align types. r=dholbert
This provides stronger typing and removes a bunch of subtle constants matching.

Differential Revision: https://phabricator.services.mozilla.com/D61058

--HG--
extra : moz-landing-system : lando
2020-01-31 00:56:49 +00:00
Xidorn Quan 3bb05cef1c Bug 1606192 - Remove some unused nsresult return value in layout code. r=dbaron
Differential Revision: https://phabricator.services.mozilla.com/D58342

--HG--
extra : moz-landing-system : lando
2019-12-28 03:27:13 +00:00
Ting-Yu Lin dee8773f2c Bug 1602407 - Update documents with wiki.m.o continuation model link added. r=dbaron
DONTBUILD because this is a comment-only change.

Differential Revision: https://phabricator.services.mozilla.com/D56342

--HG--
extra : moz-landing-system : lando
2019-12-12 23:57:11 +00:00
Mats Palmgren 53321dfa54 Bug 1105868 part 4 - Accessibility support for inline list-items. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39833

--HG--
extra : moz-landing-system : lando
2019-08-14 14:37:16 +00:00