Commit graph

152 commits

Author SHA1 Message Date
Moonchild
cc8e336172 [layout] Always reserve 64 bits for frame property value
This ensures frame property values can always be stored even in edge cases
on 32-bit machines (where a void ptr is half the width).
2025-02-19 07:10:18 +08:00
Moonchild
25570dc572 Issue #2694 - Improve nested grid layout performance by caching.
This improves performance by caching the grid items' block axis
measurement, avoiding potentially exponential calculations and reflows.
Resolves #2694
2025-02-19 00:34:42 +08:00
Moonchild
2da039daac Revert "Issue #2693 - Don't reflow children if they have 0 width."
This reverts commit 61a19f00f72598510ca8991a0831c82a09faa7be.
2025-02-19 00:34:27 +08:00
Moonchild
cb233feea0 Issue #2693 - Don't reflow children if they have 0 width.
This seems to be the main reason for the reflow storm.
2025-02-18 19:11:56 +08:00
Moonchild
0849deeacf Issue #2688 - Don't apply auto min-sizing when flex max-sizing.
A grid item spanning multiple grid rows/columns which include a flexible
track should not participate in the auto min-sizing calculation.

Resolves #2688
2025-01-29 12:24:07 +08:00
Moonchild
7b6e3a2d4a Issue #2653 - Part 1: Initial cleanup of AppId and isolated mozbrowser.
This removes a lot of the plumbing for having the platform embed itself
through IPC which was required for B2G running the browser as both
shell and browser application.
2024-11-21 21:01:27 +08:00
Moonchild
c096b46278 Issue #1925 - Convert NS_SIDE_TO_HALF_CORNER to a constexpr function. 2024-08-05 10:38:32 +08:00
Moonchild
b0b13b8719 Issue #1925 - Convert NS_SIDE_IS_VERTICAL to a constexpr function. 2024-08-05 10:38:00 +08:00
Moonchild
f507d2cdbc Issue #1925 - Convert NS_HALF_CORNER_IS_X to a constexpr function. 2024-08-05 10:35:13 +08:00
Moonchild
8dc8875db6 Issue #1925 - Convert half-corner index macros to an enum. 2024-08-05 10:34:31 +08:00
Moonchild
ec7351a5d4 Issue #1925 - Remove use of NS_SIDE_* macros. 2024-08-05 10:31:46 +08:00
Moonchild
e6e2796541 Issue #1925 - Remove mozilla::css::Side typedef. 2024-08-05 10:30:50 +08:00
Daniel Holbert
0e05cb9630 [layout] Initialize PerSpanData members mBaseline and mReflowInput.
We null-initialize all of the other pointer members in NewPerSpanData; we should
do the same for these ones, for consistency & robustness.

(In practice, the callers end up initializing these members before reading them
anyway, so it's been benign that we weren't initializing them. But better for
safety & futureproofing to have them reliably initialized.)
2024-06-13 11:31:46 +08:00
Moonchild
79c7489bb0 Issue #2472 - Part 3: Refactor Fullscreen stack to Top Layer stack
Fullscreen stack isn't part of the spec anymore; it's been changed to a more
generic version called Top Layer stack, which is being used by both full-screen
APIs and dialog elements.

This patch refactors it to Top Layer stack so that it can be reused for dialog
elements.

Top Layer stack spec: https://fullscreen.spec.whatwg.org/#new-stacking-layer
2024-05-08 09:55:18 +08:00
FranklinDM
6803c1f710 Issue #2488 - Part 4: Remove the RestyleManagerHandle smart pointer class 2024-04-02 22:50:07 +08:00
FranklinDM
4bf43b8fb4 Issue #2488 - Part 3: Remove the StyleSetHandle smart pointer class 2024-04-02 22:49:48 +08:00
FranklinDM
d6852b3170 Issue #2112 - Part 10: Remove remaining Stylo/Servo includes and code
Some classes have been marked for removal/merging, macros used for forwarding/casting were moved to DeprecatedUtils.h.
2024-04-02 22:44:24 +08:00
FranklinDM
10bf8705d0 Issue #2112 - Part 6: Remove IsStyledByServo function and callers 2024-04-02 22:41:54 +08:00
FranklinDM
a93a7bed47 Issue #2112 - Part 5: Remove Servo from forwarding code used by magic pointer classes 2024-04-02 22:41:34 +08:00
Eitan Isaacson
2eea07fc65 [layout] Process pairs in coord list in PolyArea.
Range -1 assures the array is even with a step size of 2, avoiding lone
value processing.
2024-02-23 10:52:22 +08:00
Moonchild
47ebb88310 Issue #2388 - Part 5: Make Selection::ToString flush frames 2024-01-18 10:16:36 +08:00
Moonchild
4a438e6607 Issue #2388 - Part 4: Align focus behavior more with Blink/Gecko 2024-01-18 10:16:05 +08:00
Moonchild
681193a256 Issue #2388 - Part 2: move focus at every selection change when it's called by JS 2024-01-18 10:15:43 +08:00
Moonchild
a83e4b6a34 Issue #2388 - Part 1: Mark Selection as "called by JS" when caused by a JS call to the selection API 2024-01-18 10:15:26 +08:00
Moonchild
8fe53f59d0 [layout] Always check against fragment length in nsTextFrame 2023-12-21 10:16:53 +08:00
Moonchild
5235861f6e Issue #2284 - Add exception for flex/grid items resolving percentages against parent.
This folds in BZ bugs 1578586 and 1092007 part 2.
2023-08-17 09:09:43 +08:00
Moonchild
2f117eecaa Issue #1656 - Remove more vim control lines.
Vim control lines were re-introduced or not entirely cleaned up.
This nukes them again.
Removing from embedding, extensions, gfx, hal, ipc, layout, mailnews,
media and memory. More to come.
2023-05-05 22:57:19 +08:00
FranklinDM
010db07bf3 Issue #2135 - Bug 1066965: Make contentEditable and spellchecking to work in Shadow DOM 2023-03-06 16:16:21 +08:00
Job Bautista
ca3361fb57 Issue #2068 - Only wrap the last line of inline elements when positively padding to the right.
This fixes the 21 year old Mozilla bug 122795.

Co-authored-by: Jonathan Kew <jfkthame@gmail.com>
2022-12-30 09:21:14 +08:00
Job Bautista
09cbcd3413 Issue #2063 - Ensure a floated ::first-letter inherits from ::first-line.
This fixes the 24 year old Mozilla bug 13610.

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2022-12-30 09:09:13 +08:00
Moonchild
1868e88741 Fix some debug assertions.
refactored code porting in assertions causing debug build failures.
2022-10-06 10:26:38 +08:00
roytam1
52a48df032 Revert "Issue #1986 - Use logical coordinates in flex containers."
This reverts commit 7527371d78.
2022-09-29 15:18:18 +08:00
roytam1
c522a01d6c Revert "Issue #1986 - Part 2: Add IsItemInlineAxisMainAxis() and rework some nsFrame code."
This reverts commit c3e18955ad.
2022-09-29 15:18:10 +08:00
Moonchild
b27475f6a9 Issue #80 - Re-unify most of the layout engine 2022-09-09 10:12:59 +08:00
Jeremy Andrews
c3e18955ad Issue #1986 - Part 2: Add IsItemInlineAxisMainAxis() and rework some nsFrame code.
It turns out part 10 was actually needed, but Bug 1449838 had a significantly
better version of what that code does that was easy enough to backport to what
we have. As far as I can tell, this passes the relevant reftests now.
2022-08-24 09:27:32 +08:00
Jeremy Andrews
7527371d78 Issue #1986 - Use logical coordinates in flex containers.
This mostly reworks the way nsFlexContainerFrame handles things so that it can
deal with more than just height.
2022-08-24 09:27:13 +08:00
Jeremy Andrews
05d0cf7d47 Issue #1970 - Follow-up: Better fix for Unix that works on newer GCC.
My previous fix apparently only worked with GCC 7. Having that return at the
end doesn't seem to hurt anything on Windows, so I see no reason to ifdef it.

I don't remember where I heard this, but I vaguely remember hearing that
ending a function without a return statement may be undefined behavior that
differs between compilers and operating systems. If so, that would explain why
this has behaved so differently across platforms and compilers.
2022-08-24 09:26:55 +08:00
Moonchild
b18a680d4f Issue #1970 - Part 7: Restore proper spacing in select for CJK/asian
The issue is that select elements may contain some non-Latin characters that
need extra block-size to display than the one line-height calculated by using a
Latin font spec in the style.
Before this patch, when a control has an unconstrained block-size, we set
the element's block-size to one line-height in Reflow(), which is intended to
properly initialize `BlockReflowInput::mMinLineHeight` since it uses
`line-height:-moz-block-height`.

However, this simply prevents the display from choosing a larger block-size
after the reflow occurs. Previously, this discrepancy was absorbed by the extra
padding present to make select elements the same intrinsic size as buttons, but
since we did away with that, we're losing the extra space and the font glyphs
get clipped.

This patch fixes the issue by carrying the computed line height over to the
element's display so that its computed block-size is still unconstrained.
This way it can accommodate taller characters in the display text.

After this patch, a <select><option> containing non-Latin characters should have
the same block-size as <button>, and no characters should be clipped.
2022-08-04 14:25:30 +08:00
Moonchild
7203916733 Issue #1970 - Part 6: Rename CalcLineHeight(), and cache used line height
To better distinguish the calculation of line height (still present with args)
and simply getting the line height without args, it's now called GetLineHeight()
This also introduces `mLineHeight` to cache specifically calculated line heights
that aren't "auto" (which is a magic value), and it opens up the possibility to
override it in Part 7.
2022-08-04 14:25:13 +08:00
Moonchild
5ed7e7d56d Issue #1805 - Improve stack size limits for all targets.
This allows us to use a greater rendering depth for exceedingly-deep DOM trees
in layout, better matching what mainstream browsers are capable of. Note that
for 32-bit Windows the stack size MUST be set to larger than the default or Bad
Things Will Happen™ - we use 1.5 MB for this as a carefully-tuned value.

This needs to be capped specifically for JS use because some JavaScript
obfuscators deliberately trigger stack overflows and would lock up the browser
otherwise as long as there's still stack space to abuse. For web compatibility
we therefore limit this to 2MB in JS only (3x for ASAN) while still allowing
a greater depth for the layout engine.
2022-07-26 22:26:38 +08:00
Job Bautista
797ddb4d88 Issue #1916 - Part 2: Add a flag to allow FinishReflowChild to handle relative positioning, and convert the caller for which this makes sense.
Backported from Mozilla bug 1547759.
2022-06-22 09:01:41 +08:00
Job Bautista
0423d83560 Issue #1916 - Part 1: Convert flags passed to ReflowChild, FinishReflowChild, etc into an enum class.
Backported from Mozilla bug 1571250.
2022-06-22 09:01:25 +08:00
Moonchild
afbfbcb1e1 Issue #1914 - Implement white-space: break-spaces
This also simplifies GetCSSWhitespaceToCompressionMode (FFS with the function
names, Mozilla!) to be less fragile.
2022-06-13 09:10:57 +08:00
Brian Smith
d5c43d1d35 Issue #1829 - Readd code cleanup that is not Mac related that got clobbered by reverting Issue #1751 2022-05-04 10:01:23 +08:00
Brian Smith
13fcc4a046 Issue #1829 - Revert "Issue #1751" 2022-05-04 09:40:24 +08:00
FranklinDM
8a7587b401 Issue #21 - Remove use counters telemetry
This reverts Bug 968923 - Implement some equivalent of Chrome's use counters (on top of telemetry?)

For reference: https://bugzilla.mozilla.org/show_bug.cgi?id=968923
2022-04-28 10:43:09 +08:00
Moonchild
8d800b1cb0 Issue #21 - Remove Telemetry plumbing and fix build.
Note this won't give working applications. Requires FE changes and
additional js module changes (next part).
2022-04-28 10:25:48 +08:00
roytam1
92a1cc3139 Revert "Issue #21 - Remove use counters telemetry"
This reverts commit 8ca9db6b65.
2022-04-27 16:25:00 +08:00
FranklinDM
8ca9db6b65 Issue #21 - Remove use counters telemetry
This reverts Bug 968923 - Implement some equivalent of Chrome's use counters (on top of telemetry?)

For reference: https://bugzilla.mozilla.org/show_bug.cgi?id=968923
2022-04-27 16:15:31 +08:00
FranklinDM
e765c8edbf Issue #1370 - Follow-up: Give table wrapper boxes a special case during flex base size resolution, so that percent main-sizes can be respected
This is a workaround, based on https://bugzilla.mozilla.org/show_bug.cgi?id=1455976
2022-04-19 22:05:36 +08:00