Commit graph

368 commits

Author SHA1 Message Date
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
trav90
c782076add Issue #457 - Remove the constructor from gfxShapedText::CompressedGlyph and make it a trivial class
Also provide a couple of convenience "factory" methods to create simple and complex glyph values.
2022-05-31 09:13:12 +08:00
FranklinDM
d81a856374 Fix property alias indentation 2022-05-04 10:11:06 +08:00
FranklinDM
317b7dec08 Issue #1853 - Follow-up: Add missing end of array marker to scrollbar width keyword table
This prevents the parser from accepting values outside the keyword table.
2022-05-04 10:10:58 +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
roytam1
470a6e4401 Revert "Issue #1860 - Change LayerManagerData::mDisplayItems to a vector instead of hashtable"
This reverts commit 070b283e38.
2022-05-02 23:11:34 +08:00
roytam1
1f85f6ab93 Revert "Issue #1860 - Follow-up: Make sure we don't add duplicate frames"
This reverts commit f039cc7ef8.
2022-05-02 23:11:24 +08:00
roytam1
6be9a7c374 Revert "Issue #1860 - Follow-up: Fix indentation."
This reverts commit 5422762839.
2022-05-02 23:11:16 +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
eaf9e756a0 Issue #21 - Remove remaining telemetry structs, callers and flags. 2022-04-28 10:33:44 +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
Moonchild
7c93047283 Issue #1885 - Allow unitless rootMargin entries for IntersectionObserver.
I could have done this through a CSSLoader to allow all CSS unit quirks but
I wasn't planning to start passing around document and element references
everywhere, so instead just did it manually by accepting numbers/floats in
addition to pixel and percent.
2022-04-25 20:52:00 +08:00
FranklinDM
37753e32a8 Issue #1881 - Interpret empty or whitespace root margin string as zero length
This attempts to get the first non-whitespace token, which if exists, continues with previous behavior of parsing the margin string. Otherwise, if the specified margin string is empty or consists only of whitespace characters, is interpreted as zero length.

IntersectionObserver is the only consumer of the `ParseMarginString` method, as far as I can tell, so this should not affect anything else.

Note: For some reason, Firefox and Chrome treat the unitless zero length as invalid, while with this change, we do not change existing behavior in that regard and continue to accept that value.
2022-04-25 20:51:48 +08:00
Jeremy Andrews
9bf01d6708 Issue #1593 - Part 4: Make :host pass DOM parsing test and basic specificity tests. 2022-04-21 21:52:56 +08:00
Jeremy Andrews
c373707516 Issue #1593 - Part 3: Add selector logic for :host and :host-context. 2022-04-21 21:52:52 +08:00
Jeremy Andrews
7472bc02be Issue #1593 - Part 1: Import William Chen's patches w/o selector implementation, fixed up. 2022-04-21 21:52:40 +08:00
roytam1
ecdf4bfb29 Revert "Issue #3024 - First pass support for :host and :host-context"
This reverts commit 4cc56c2cb6.
2022-04-21 21:51:52 +08:00
FranklinDM
fc9ac112d2 Issue #1873 - Part 3: Fix indentation 2022-04-19 22:10:34 +08:00
FranklinDM
f2a9abd212 Issue #1873 - Part 2: Ensure normalized parent is used for UndisplayedMap handling code
We have four entry points that deal with the parents of display:none/ display:contents content. These are the functions for setting, changing, getting and removing a style context. Or more specifically:

GetStyleContextInMap called by GetDisplay[None|Contents]StyleFor

SetStyleContextInMap called by RegisterDisplay[None|Contents]StyleFor

ChangeStyleContextInMap called by ChangeRegisteredDisplay[None|Contents]StyleFor

UnregisterDisplay[None|Contents]StyleFor okay, this is actually two functions, but they act as a pair

This change makes all these functions call GetApplicableParent up front and act on and pass around the parent that it returns. This is so that throughout the code we are always handling the parent that will be used as the key in the UndisplayedMap entry. This is necessary so that all the code that sets/gets the 'MayHaveChildrenWithLayoutBoxesDisabled' bit on/from an nsIContent object is using the same object, otherwise everything breaks down.

Partially based on part 2 of https://bugzilla.mozilla.org/show_bug.cgi?id=1367214
2022-04-19 22:10:31 +08:00
FranklinDM
c5f6e6155b Issue #1873 - Part 1: Introduce ParentForUndisplayedMap helper method
This introduces the `ParentForUndisplayedMap` helper method to reduce duplication in terms of getting the parent and asserting parent existence.

Partially based on parts of https://bugzilla.mozilla.org/show_bug.cgi?id=1341083
2022-04-19 22:10:26 +08:00
Moonchild
5422762839 Issue #1860 - Follow-up: Fix indentation. 2022-04-19 22:10:14 +08:00
Moonchild
f039cc7ef8 Issue #1860 - Follow-up: Make sure we don't add duplicate frames
Changing to vector makes manipulating display list items more risky.
This is to make sure we don't inadvertently end up with duplicates in
the list of display items avoiding double-free scenarios.
2022-04-19 22:10:10 +08:00
win7-7
070b283e38 Issue #1860 - Change LayerManagerData::mDisplayItems to a vector instead of hashtable
This should improve cache locality and help speed up layer building.
2022-04-19 22:09:59 +08:00
FranklinDM
e16a340a33 Issue #1838 - Follow-up: Prevent grid shorthand from resetting gutter properties
This also fixes crashing when using the grid shorthand property.
2022-04-19 22:05:56 +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
win7-7
c0591cb147 Issue #1861 - Cache the most recent nsGenConNode to speed up future insertions.
Cache the most recent nsGenConNode to speed up future insertions.
2022-04-19 22:05:17 +08:00
FranklinDM
3c6a52a0a6 Issue #1370 - Part 6: Update tests 2022-04-19 21:58:08 +08:00
FranklinDM
b315caec8a Issue #1370 - Part 4: Treat flex-basis: content as max-content
This uses a different approach and builds upon the refactoring made in the 576eb6ee01fb9ee3669cad634b26473c2886cab1.

Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1374540
2022-04-19 21:56:39 +08:00
FranklinDM
9dc59c43f1 Issue #1370 - Part 3: Implement content keyword for flex-basis property
Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1105111
2022-04-19 21:56:35 +08:00
FranklinDM
b6b20a04ec Issue #1370 - Part 2: Remove redundant special-case code for treating flex-basis enum values as 'auto' in vertical axis
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1436881
2022-04-19 21:56:32 +08:00
FranklinDM
9d0492be56 Issue #1370 - Part 1: Refactor nsFrame to use a separate function for handling flex-basis
This removes the need to keep the `flex-basis` handling code of the ComputeSize* functions in sync since they both call the same function now for this purpose.
2022-04-19 21:56:29 +08:00
FranklinDM
870fee82e6 Issue #1838 - Part 7: Update tests 2022-04-19 21:56:17 +08:00
FranklinDM
5800b95cd0 Issue #1838 - Part 6: Re-resolve row-gap against the sum of row track sizes for auto-sized grid containers
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1458902
2022-04-19 21:56:11 +08:00
FranklinDM
57d616da4c Issue #1838 - Part 5: Address follow-up issues to initial flexbox layout for (column|row)-gap properties
Notes:
* Bug 1473044 - Make flexbox cross size take row/column gap into account
https://bugzilla.mozilla.org/show_bug.cgi?id=1473044
* Bug 1473047 - Re-resolve row-gap percentages after intrinsic block size calculated
https://bugzilla.mozilla.org/show_bug.cgi?id=1473047
* Bug 1612401 - Prevent absolute-positioned children from contributing gap size to flexbox's inline-size
https://bugzilla.mozilla.org/show_bug.cgi?id=1612401
* Bug 1639627 - Make flex-container percent 'row-gap' values resolve to 0, when they're resolved against an indefinite block-size (essentially reverts Bug 1473047)
2022-04-19 21:56:07 +08:00
FranklinDM
d0cbf1a74f Issue #1838 - Part 4: Implement flexbox layout for (column|row)-gap properties
This implements flexbox layout for the gap properties without the refactoring work performed on `nsFlexContainerFrame`.

Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1398483 and https://bugzilla.mozilla.org/show_bug.cgi?id=1454822

This excludes the second part of bug 1454822, the width caching implementation, because it is out of scope and currently causes unstable layout with `writing-mode: vertical-lr` (see bug 1709937).
2022-04-19 21:56:01 +08:00
FranklinDM
b4f2c83687 Issue #1838 - Part 2: Remove grid- prefix from grid-(column|row)-gap properties
This removes the `grid` prefix from the gap-related properties of grid since they are now part of the box alignment specification. Former grid-gap* properties were aliased to the unprefixed properties to maintain compatibility.

The previously multi-column layout only `column-gap` property has been modified to apply to the Grid layout (and Flexbox in a following commit), moving the `mColumnGap` member variable from `nsStyleColumn` to `nsStylePosition`.

Notes:
* Bug 1398537 - support for percent values in column-gap for multi-column layout landed as part of Issue #1230. However, it was incomplete because it did not update `nsRuleNode` to allow transformation of percentage values for `column-gap`. This was consequently fixed as part of this commit.
* Bug 1456166 - this might not apply because we don't have that devtools test in UXP
* `nsRuleNode`, `nsCSSParser`, `Declaration`, and other related classes were merged into Stylo. These should be taken into consideration when porting patches from Mozilla.

Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1398482
2022-04-19 21:55:52 +08:00
FranklinDM
4f059d2c8b Issue #1838 - Part 1: Remove CSS grid preference
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1398492
2022-04-19 21:55:49 +08:00
Moonchild
602bb0a877 Issue #3059 - Implement Selection.setBaseAndExtent() 2022-03-22 23:08:04 +08:00
Moonchild
94f3f356ed Issue #3050 - Follow-up: extend attribution mapping to resize and corner controls to allow themes to respond to scrollbar-width.
Also clean up the comments and whitespace a bit.
2022-03-22 23:06:12 +08:00
Moonchild
4bdd388989 Issue #3050 - Map scrollbar-width to an element attribute.
By mapping this to an attribute, this allows browser themes to respond to
the various available scrollbar width settings in CSS.
2022-03-22 23:05:57 +08:00
Matt A. Tobin
4cc56c2cb6 Issue #3024 - First pass support for :host and :host-context 2022-03-22 22:57:05 +08:00
Jeremy Andrews
74698b4560 Issue #3017 - Shadow boundaries not accounted for in nsFrameManager. 2022-03-22 22:32:49 +08:00
roytam1
bf632ce22a Bug 1730120, close ContentViewer properly if initialization fails, r=nika a=RyanVM 2021-12-14 23:10:14 +08:00
roytam1
6bc10cbc95 Bug 1730048, reorder the code in nsMenuFrame::PassMenuCommandEventToPopupManager a bit, r=mstange a=RyanVM 2021-11-10 09:10:25 +08:00
Moonchild
a05b76ff1a Issue #1781 - Follow-up: fix debug assert in MergeMultiplicativeR() 2021-07-28 10:10:09 +08:00
Moonchild
a0ee1f3c0d [layout] Ensure we set the primary frame for native anon content where needed. 2021-07-16 09:21:17 +08:00