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

20027 Коммитов

Автор SHA1 Сообщение Дата
WhiteMind 073f7a5852 Bug 1827411 - Compilation failure when enabling NOISY_FINAL_SIZE or REALLY_NOISY_REFLOW flags. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175210
2023-04-12 08:40:41 +00:00
Robert Longson e47a68c1a6 Bug 1751025 - Opacity CSS property should apply to all children of text elements r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D174964
2023-04-11 22:08:24 +00:00
Jonathan Kew 193a8ba340 Bug 1827009 - Don't assume the textrun has necessarily been created already. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175108
2023-04-11 15:32:57 +00:00
Natalia Csoregi cd523b2514 Backed out changeset a846d1b82b98 (bug 1751025) for failures on opacity.svg. CLOSED TREE 2023-04-11 09:46:16 +03:00
Robert Longson 3a9c792127 Bug 1751025 - Opacity CSS property should apply to all children of text elements r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D174964
2023-04-11 03:25:14 +00:00
Timothy Nikkel 515fd0c083 Bug 1827318. Restore hunk from bug 1820709 that accidentally got rebased away in bug 1817360. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175086
2023-04-11 01:03:41 +00:00
Emilio Cobos Álvarez 67c9a0ddff Bug 1825623 - Restore nsFileControlFrame fragmentation behavior. r=TYLin
nsCSSFrameConstructor::CreateContinuingFrame creates a frame based on the
result of nsIFrame::Type(). The regressing bug changed the nsFileControlFrame
type from Block to its own FileControlType type, which meant that we stopped
creating nsBlockFrame continuations for it.

Fix it by restoring the previous behavior: changing the Type() back to return
Block, and using QueryFrame instead to check for the specific
nsFileControlFrame where we need to.

This is all rather messy, see bug 1555477 for related discussion.

Differential Revision: https://phabricator.services.mozilla.com/D175062
2023-04-11 00:16:53 +00:00
Ting-Yu Lin 88dc965884 Bug 1827131 - Soften the assertion in nsFlexContainerFrame::ReflowChildren(). r=dholbert
This is derived from the original revision that gets R+ in bug 1826635.
https://phabricator.services.mozilla.com/D174993?id=702649

Differential Revision: https://phabricator.services.mozilla.com/D175024
2023-04-10 23:42:22 +00:00
Ting-Yu Lin b9d6a9ab5c Bug 1826635 - Don't push flex item if available block-size is unconstrained. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D174993
2023-04-09 07:54:02 +00:00
Ting-Yu Lin 84a42fd613 Bug 1826635 - Fix a comment in ReflowChildren(). r=dholbert
SumOfChildrenBlockSizeProperty() was moved into PerFragmentFlexData in
Bug 1804997 Part 4 [1], and later it was renamed in Bug 1743890 Part 4 [2].

[1] https://hg.mozilla.org/mozilla-central/rev/0404d371c42f3e73b56678fe52a89f4f788ea9b5
[2] https://hg.mozilla.org/mozilla-central/rev/6064a73fc99f012a7400393bdc2ade89fbdf30f8

Differential Revision: https://phabricator.services.mozilla.com/D174992
2023-04-09 07:54:01 +00:00
Jonathan Kew 489d96aeb1 Bug 1712703 - Record the "hangable" advance of trailing whitespace in a textframe property, and use this in nsLineLayout to adjust inline positioning. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D174728
2023-04-05 23:58:08 +00:00
Noemi Erli 4583632812 Backed out 3 changesets (bug 1712703) for causing nsLineLayout related crashes CLOSED TREE
Backed out changeset 18c753fda684 (bug 1712703)
Backed out changeset e54195c66f87 (bug 1712703)
Backed out changeset fa98b4c11d52 (bug 1712703)
2023-04-06 00:12:05 +03:00
Jonathan Kew 1c77c30705 Bug 1712703 - Record the "hangable" advance of trailing whitespace in a textframe property, and use this in nsLineLayout to adjust inline positioning. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D174728
2023-04-05 20:28:08 +00:00
Emilio Cobos Álvarez 641fa20731 Bug 1825825 - Simplify NAC setup. r=smaug
Make all UA widgets also NAC.

Keep the UA widget flag but break at anonymous subtree boundaries, so
that only nodes inside the UA widget directly (and not NAC from those)
get the flag.

This is important because two callers depend on this difference:

 * The style system, since we still want to match content rules from
   stylesheets in the UA widget. We also match user rules, which is a
   bit sketchy, but that was the previous behavior, will file a
   follow-up for that.

 * The reflector code, since we want the scope for UA widgets to not
   include the NAC nodes inside that UA widget. nsINode::IsInUAWidget
   got it wrong.

After this patch, ChromeOnlyAccess is equivalent to
IsInNativeAnonymousSubtree, so we should probably unify the naming.
That's left for a follow-up patch because I don't have a strong
preference.

Differential Revision: https://phabricator.services.mozilla.com/D174310
2023-04-05 09:19:15 +00:00
Emilio Cobos Álvarez f96bb05c6e Bug 1826006 - Fix middle-cropping with explicit inline sizes. r=jfkthame,layout-reviewers
If flexbox algorithm imposes a size on us, we want to look at that too,
not only at the available isize.

Differential Revision: https://phabricator.services.mozilla.com/D174445
2023-04-03 11:05:38 +00:00
Jonathan Kew a920605e79 Bug 1825394 - Backed out changeset fcc38c48c35a (bug 1824531) due to tscrollx regressions. r=layout-reviewers,emilio,tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D174437
2023-04-03 10:11:04 +00:00
Jonathan Kew 045b620d20 Bug 1826013 - Tidy up BreakAndMeasureText params, and replace some never-NULL pointers with references. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D174383
2023-04-03 08:19:49 +00:00
Jonathan Kew dccd8a928e Bug 1825983 - Refactor handling of trailing trimmable whitespace. r=emilio
This slightly simplifies gfxTextRun::BreakAndMeasureText, and should make it less confusing
to reason about trailing whitespace in nsTextFrame/nsLineLayout.

Differential Revision: https://phabricator.services.mozilla.com/D174377
2023-04-03 06:41:22 +00:00
Robert Longson 7e65e06613 Bug 1826001 - Change SVGUtils::IsInSVGTextSubtree into a member function on nsIFrame r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D174375
2023-04-02 21:17:07 +00:00
Ting-Yu Lin 75a2789586 Bug 1825434 - Use containing block's inline-size as percentage basis when computing abspos hypothetical position. r=AlaskanEmily
The containing block's block-size (`blockContentSize.BSize(wm)`) can be
unconstrained if the block has `position:relative` at the time we call the
`CalculateBorderPaddingMargin()`. That triggers the warning further down in the
stack in `ComputeCBDependentValue`.

However, the percentage margin and padding should resolve against the containing
block's inline-size rather than the block-size. Hence this patch.

Differential Revision: https://phabricator.services.mozilla.com/D174340
2023-04-01 04:48:53 +00:00
Ting-Yu Lin dbc0cd5615 Bug 1055894 - Add GetLogicalNormalRect() and adapt some callers of GetNormalRect(). r=emilio
This patch makes the API nicer, and shouldn't change the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D174344
2023-04-01 04:17:05 +00:00
Ting-Yu Lin a78e0904e3 Bug 1743890 Part 4 - Rename mSumOfChildrenBSize to mCumulativeContentBoxBSize. r=dholbert
Rename per review comments in
https://phabricator.services.mozilla.com/D165192?id=698523#inline-961796

Differential Revision: https://phabricator.services.mozilla.com/D174172
2023-03-31 16:25:32 +00:00
Ting-Yu Lin f3117a6913 Bug 1743890 Part 2 - Push monolithic flex item exceeding available block-size to next-in-flow. r=dholbert
This patch deals with two things:

1. Push tall monolithic flex items to next-in-flow, and adjust their positions.
2. Grow flex container's block-size if its block-size is unconstrained.

This patch doesn't fix:
1. Item shifts in different lines in a multi-line column-oriented container
   (bug 1806717).
2. Flex container block-size grow due to flex item's block-size grow in
   fragmentation.

If a flex item has break-before:avoid, we don't want to push it to the
next-in-flow (in the computaion of `shouldPushItem`). Otherwise, we'll fail
web-platform/tests/css/css-break/flexbox/multi-line-column-flex-fragmentation-034.html

Differential Revision: https://phabricator.services.mozilla.com/D165192
2023-03-31 16:25:31 +00:00
Ting-Yu Lin fafca7f824 Bug 1743890 Part 1 - Add more log to flex container. r=dholbert
MoveFlexItemToFinalPosition() already has a log printing flex item's position.
This patch adds a log in ReflowFlexItem() to print flex item's position, too.

Differential Revision: https://phabricator.services.mozilla.com/D165191
2023-03-31 16:25:30 +00:00
Emily McDonough e3e801ac9e Bug 1824490 - Use the end page value rather than the start page value of the previous frame when performing named-page breakpoints r=dholbert
Adding the test from this bug so that this can't happen next time.

Differential Revision: https://phabricator.services.mozilla.com/D174037
2023-03-30 21:58:08 +00:00
Jonathan Watt 84688dc421 Bug 1824852. Ensure PrintedSheetFrame calls MoveOverflowToChildList before reflow. r=dholbert
The intention is to allow PrintedSheetFrame::Reflow to access the page style
prior to reflowing its child so that it can decide whether to apply page style
to the sheet (in the case of one page-per-sheet). This will happen in a
subsequent bug.

Differential Revision: https://phabricator.services.mozilla.com/D173773
2023-03-30 11:29:29 +00:00
Iulian Moraru ac5a007d9c Backed out changeset a13beb2f76da (bug 1824490) for causing wp failures on page-name-002-print.html. CLOSED TREE 2023-03-30 03:59:44 +03:00
Emily McDonough 3568650420 Bug 1824490 - Use the end page value rather than the start page value of the previous frame when performing named-page breakpoints r=dholbert
Adding the test from this bug so that this can't happen next time.

Differential Revision: https://phabricator.services.mozilla.com/D174037
2023-03-29 23:22:58 +00:00
Emilio Cobos Álvarez 2d0e69f4a1 Bug 1824957 - Remove a bunch of now completely dead XUL layout code. r=layout-reviewers,desktop-theme-reviewers,devtools-reviewers,dao,TYLin
And some related tests.

A bunch of -moz-box* properties are web exposed, so I'll file a
follow-up for hiding them.

Differential Revision: https://phabricator.services.mozilla.com/D173819
2023-03-29 21:23:55 +00:00
Emilio Cobos Álvarez 28e6c8dbfe Bug 1824986 - Factor widget styling in nsMenuPopupFrame. r=mstange
We had these spread around, it's better to have a single central place where we
update the widget based on the styling of the popups.

Differential Revision: https://phabricator.services.mozilla.com/D173836
2023-03-28 14:33:18 +00:00
Emilio Cobos Álvarez 58acdee9a2 Bug 1824667 - Remove nsTextBoxFrame. r=jwatt
Use a MiddleCroppingBlockFrame subclass that looks at the value attribute
instead. We don't need accesskey etc for these so we can just reuse it as is.

Differential Revision: https://phabricator.services.mozilla.com/D173669
2023-03-27 23:46:51 +00:00
Emilio Cobos Álvarez b9d1536d46 Bug 1824489 - Remove nsBoxFrame, nsBoxLayout and related code. r=jwatt
We still have some remnants of XUL layout due to nsBox / nsLeafBoxFrame
which XUL trees / nsTextBoxFrame still use.

However all this code can go away before we get rid of those.
nsSplitterFrame was the last thing inheriting from nsBoxFrame.

Differential Revision: https://phabricator.services.mozilla.com/D173601
2023-03-27 23:25:42 +00:00
Emilio Cobos Álvarez 3eae0f27f2 Bug 1824236 - Remove a crashtest.
We don't want to support randomly-styled scrollbar boxes. This asserts
because it removes the scrollbar appearance. It's only a debug assert
but I don't think we want to support this.

MANUAL PUSH: Orange fix CLOSED TREE
2023-03-27 23:58:59 +02:00
Emilio Cobos Álvarez 38b10eafda Bug 1824236 - Stop using XUL layout for scrollbars. r=jwatt
This rewrites scrollbar layout to work with regular reflow rather than
box layout.

Overall it's about the same amount of code (mostly because
nsScrollbarFrame::Reflow is sorta hand-rolled), but it cleans up a bit
and it is progress towards removing XUL layout altogether, without
getting into much deeper refactoring.

This also blocks some other performance improvements and refactorings I
want to make in this code.

We make some assumptions to simplify the code that to some extent were
made already before, both explicitly and by virtue of using XUL layout.

In particular, we assume that scrollbar / slider / thumb has no border or
padding and that the writing-mode is horizontal ltr.

Differential Revision: https://phabricator.services.mozilla.com/D173489
2023-03-27 20:54:53 +00:00
Sandor Molnar fcbacc6d6c Backed out changeset 7da2469ac949 (bug 1824236) for causing assertion failures in layout/generic/crashtests/369038-1.xhtml CLOSED TREE 2023-03-27 23:20:35 +03:00
Emilio Cobos Álvarez 914393e83e Bug 1824236 - Stop using XUL layout for scrollbars. r=jwatt
This rewrites scrollbar layout to work with regular reflow rather than
box layout.

Overall it's about the same amount of code (mostly because
nsScrollbarFrame::Reflow is sorta hand-rolled), but it cleans up a bit
and it is progress towards removing XUL layout altogether, without
getting into much deeper refactoring.

This also blocks some other performance improvements and refactorings I
want to make in this code.

We make some assumptions to simplify the code that to some extent were
made already before, both explicitly and by virtue of using XUL layout.

In particular, we assume that scrollbar / slider / thumb has no border or
padding and that the writing-mode is horizontal ltr.

Differential Revision: https://phabricator.services.mozilla.com/D173489
2023-03-27 19:12:52 +00:00
Cosmin Sabou 474b2453f8 Bug 1824667 - Fix Bp-hybrid bustages on MiddleCroppingBlockFrame.cpp. r=emilio
CLOSED TREE
2023-03-27 21:23:06 +03:00
Emilio Cobos Álvarez 894fd5d4c3 Bug 1824667 - Factor middle-cropping out of nsFileControlFrame. r=jfkthame,layout-reviewers
Factor a MiddleCroppingBlockFrame that does the double reflow shenanigans.

That should both be faster and easier to reason about. The only thing we need
to be careful about is to use the current inline coord from the line layout if
present to compute the real available isize.

Differential Revision: https://phabricator.services.mozilla.com/D173668
2023-03-27 17:13:50 +00:00
Ting-Yu Lin 0683cbeaf7 Bug 1817235 - Add a web-platform test to exercise text-align-last for a block split in multicol. r=layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D173597
2023-03-26 23:05:33 +00:00
Jonathan Kew ee1583a0a9 Bug 1824531 - Remove baseline-snapping from nsTextFrame::PaintText, as it may interact poorly with APZ. r=emilio
In my local testing, this seems to be harmless, but we should be alert for reports of any erratic
or poorly-rasterized text that results.

Differential Revision: https://phabricator.services.mozilla.com/D173633
2023-03-26 21:44:32 +00:00
Cristian Tuns f7b9131c3f Backed out changeset 5f36e53be4cf (bug 1824531) for causing reftest failures in colrv1-01.html CLOSED TREE 2023-03-26 14:35:18 -04:00
Jonathan Kew f0e6bbc4b5 Bug 1824531 - Remove baseline-snapping from nsTextFrame::PaintText, as it may interact poorly with APZ. r=emilio
In my local testing, this seems to be harmless, but we should be alert for reports of any erratic
or poorly-rasterized text that results.

Differential Revision: https://phabricator.services.mozilla.com/D173633
2023-03-26 17:03:07 +00:00
Fred Chasen 3c5da1ddd8 Bug 1818227 - Prevent drawing backplate when forced-color-adjust is none r=emilio
Prevents backplates from being drawn for any text that has forced-color-adjust: none set by checking the value of StyleText()->mForcedColorAdjust.

Differential Revision: https://phabricator.services.mozilla.com/D173362
2023-03-24 16:48:35 +00:00
David Shin a47e766d75 Bug 1812679 - Handle central baseline calculation in `GetNaturalBaselineBOffset`. r=layout-reviewers,emilio
Previously, for writing-mode using central baseline alignment (i.e. `vertical-(lr|rl)`,
we simply used the center of content-box in `nsLineLayout::VerticalAlignFrames`.
However, this is incorrect for e.g. a `div` with two lines of text - just like how
its alphabetical baseline is the baseline of the second line of text, the central
baseline should be the centerline of the second line.

Differential Revision: https://phabricator.services.mozilla.com/D172165
2023-03-24 16:23:16 +00:00
Emilio Cobos Álvarez 93a0510070 Bug 1817360 - Lazily load broken image icon. r=tnikkel
With the patches of bug 1815229, these errors appear:

browser/base/content/test/performance/browser_startup_images.js | Loaded image resource://gre-resources/loading-image.png should have been shown

It's a real issue, where we eagerly load the broken image icon and so on
even though we don't use them.

This fixes it by lazily-loading the icon once, only when needed.

Differential Revision: https://phabricator.services.mozilla.com/D170159
2023-03-24 14:56:34 +00:00
Hiroyuki Ikezoe 937d8566f7 Bug 1817126 - Revert bug 1745969 mainly. r=tnikkel
I didn't revert some tweaks for tests (e.g. allowing small fractional scroll
position differences) since we will end up allowing the differences until
we fixed all rounding/snapping scroll related metrics issue, bug 1774315 for
example.

Differential Revision: https://phabricator.services.mozilla.com/D170465
2023-03-24 01:42:15 +00:00
Norisz Fay 97050950be Backed out changeset 11ba57726279 (bug 1812679) for causing Wr failures on text-combine-upright-value-all-002.html 2023-03-24 01:51:06 +02:00
David Shin 6cb3b01af3 Bug 1812679 - Handle central baseline calculation in `GetNaturalBaselineBOffset`. r=layout-reviewers,emilio
Previously, for writing-mode using central baseline alignment (i.e. `vertical-(lr|rl)`,
we simply used the center of content-box in `nsLineLayout::VerticalAlignFrames`.
However, this is incorrect for e.g. a `div` with two lines of text - just like how
its alphabetical baseline is the baseline of the second line of text, the central
baseline should be the centerline of the second line.

Differential Revision: https://phabricator.services.mozilla.com/D172165
2023-03-23 17:36:49 +00:00
Stanca Serban 7c4f609327 Backed out changeset 49646b0d59aa (bug 1812679) for causing mochitests failures in layout/style/test/test_revert.html. CLOSED TREE 2023-03-23 17:39:13 +02:00
David Shin 2f94be9968 Bug 1812679 - Handle central baseline calculation in `GetNaturalBaselineBOffset`. r=layout-reviewers,emilio
Previously, for writing-mode using central baseline alignment (i.e. `vertical-(lr|rl)`,
we simply used the center of content-box in `nsLineLayout::VerticalAlignFrames`.
However, this is incorrect for e.g. a `div` with two lines of text - just like how
its alphabetical baseline is the baseline of the second line of text, the central
baseline should be the centerline of the second line.

Differential Revision: https://phabricator.services.mozilla.com/D172165
2023-03-23 14:35:12 +00:00