1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 13:58:49 +00:00
Commit Graph

424 Commits

Author SHA1 Message Date
FranklinDM 010db07bf3 Issue #2135 - Bug 1066965: Make contentEditable and spellchecking to work in Shadow DOM 2023-03-06 16:16:21 +08:00
FranklinDM b40c87a59a Issue #1375 - Follow-up: Get the insertion point right when reconstructing direct children of a shadow root
This should've been changed alongside bug 1404789 when it landed.
2023-02-28 10:45:05 +08:00
FranklinDM 6a26ce3455 Issue #1375 - Follow-up: Remove shadow tree hacks in the frame constructor
This should've been removed alongside bug 1404789 when it landed.
2023-02-28 10:44:45 +08:00
FranklinDM edc45f6849 Issue #1593 - Follow-up: Fix :host selector matching
Previously, we would match `:host` if:
(a) we don't have any arguments and our parent is the shadow root, or;
(b) if any of the arguments match, then reject if we don't have a containing shadow

Revised, we would match `:host` if:
(Preconditions) The element must have a shadow root, the selector must not have any feature selectors, and it is not blocked from matching `:host` (e.g. .matches outside of the shadow root context)
(a) The selector does not have any arguments, or;
(b) It matches any of its arguments in the functional part of the pseudo-class

With this, we now pass these tests that were previously failing:
http://wpt.live/css/css-scoping/css-scoping-shadow-host-rule.html
http://wpt.live/css/css-scoping/host-descendant-002.html
http://wpt.live/css/css-scoping/host-multiple-001.html
Improved (1 less red box):
http://wpt.live/css/css-scoping/css-scoping-shadow-host-namespace.html
2023-02-27 11:03:50 +08:00
FranklinDM ebe27baa23 Issue #1382 - Part 2: Add crash test
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=842114
2023-02-27 11:03:31 +08:00
FranklinDM 691afc8c8b Issue #1382 - Part 1: Remove assertion that GetPreEffectsVisualOverflowRect is called only by frames whose parent is an anonymous block
This is always hit if an SVG effect is applied on other frame types.

Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1340257
2023-02-27 11:03:05 +08:00
FranklinDM 439c671b26 Issue #2078 - Follow-up: Propagate combinator restriction to :is()/:where()
Based on spec discussion: https://github.com/w3c/csswg-drafts/issues/5093
2023-02-23 21:15:40 +08:00
FranklinDM 83484a34f5 Issue #2078 - Follow-up: aPreventComplexSelectors should be passed 2023-02-23 21:15:12 +08:00
FranklinDM 53f5905381 Issue #2078 - Follow-up: Move isForgiving check to ParsePseudoClassWithSelectorListArg 2023-02-23 21:14:58 +08:00
FranklinDM 03a3385702 No issue - Move Has* function definition out of the header file for consistency 2023-02-23 21:14:41 +08:00
FranklinDM 9037d5662d Issue #1593 - Follow-up: Accept only a single selector in the argument of :host/:host-context
Current spec says these two pseudo-classes accept only a single compound selector:
:host( <compound-selector> )
:host-context( <compound-selector> )
2023-02-22 07:07:39 +08:00
FranklinDM 0391e8ab09 Issue #1593 - Follow-up: Copy mIsRelevantLink value over rather than calling IsLink
Calling IsLink ignores whatever state we have for aTreeMatchContext and will trigger an assertion if aTreeMatchContext.mForStyling is false. This also adds a comment about what that line effectively does.
2023-02-22 07:07:21 +08:00
FranklinDM 9bebb3a61a Issue #1593 - Follow-up: :host() should not automatically match if we have a non-empty selector list 2023-02-22 07:07:01 +08:00
FranklinDM ba7e29a052 Issue #1823 - Ensure :host() and :host-context() are given proper weights 2023-02-22 07:06:43 +08:00
FranklinDM 6d77f755da Issue #2078 - Part 6: Replace empty list head with the next non-empty list for forgiving selector lists
What happens here if aListHead is an empty selector list:
(1) next selector group is parsed and continues to the next iteration if it's empty or invalid
(2) if we're a forgiving selector list and aListHead is empty, replace it with the selector group that we've just parsed
(3) step 1 ignores invalid/empty, so we assert that step 2 should never have an empty selector list
2023-02-22 07:06:24 +08:00
FranklinDM 4ece7873e0 Issue #2078 - Part 5: Ensure :is() and :where() are given proper weights 2023-02-22 07:06:05 +08:00
FranklinDM 1c1473166f Issue #2078 - Part 4: Unify selector list matching
This should allow pseudo-classes that accept selector lists to properly handle complex selectors. `:visited` is also matched inside selector lists.
A previous iteration of this commit had incorrect matching behavior when called from `RestrictedSelectorListMatches`.
2023-02-22 07:05:44 +08:00
FranklinDM 14e8922dca Issue #2078 - Part 3: Rename nsCSSRuleProcessor::SelectorListMatches to RestrictedSelectorListMatches
This is in preparation for merging the logic of RestrictedSelectorListMatches and AnySelectorInArgListMatches.
2023-02-22 07:05:25 +08:00
FranklinDM 0648ec64bb Issue #2078 - Part 2: Rename nsPseudoClassList->u.mSelectors to mSelectorList
This makes it clear that we're accessing a selector list (nsCSSSelectorList), which is different from the selectors (nsCSSSelector) contained inside a selector list. Previously, both were confusingly referred to as mSelectors.
2023-02-22 07:05:08 +08:00
FranklinDM 453b715ef6 Issue #2078 - Part 1: Update CSS rule processor to handle :is() and :where() CSS pseudo-classes
This modifies selector list parsing to accommodate being "forgiving". Aliases for the :is selector's former names were also included. Note that the older and prefixed variant `-moz-any` remains unforgiving.
2023-02-22 07:04:49 +08:00
FranklinDM 6d3500bb48 Issue #2111 - Implement CSSStyleRule.selectorText setter
Unlike the original patch, this copies Chrome behavior: ignores invalid values of selectorText without any console log.

Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=37468
2023-02-21 08:20:21 +08:00
Job Bautista cc6b0f11e7 Issue #2107 - Clean up caret when destroying editor.
Editor changes caret visibility during drag and drop. But when destroying
editor, we don't restore caret state. So we should restore it when destroying
editor.

Co-authored-by: Makoto Kato <m_kato@ga2.so-net.ne.jp>
2023-02-20 11:11:02 +08:00
FranklinDM 4c9665a4ae Issue #2104 - Part 2: Indicate if a label was cropped via the "_is_cropped" attribute 2023-02-08 16:57:11 +08:00
FranklinDM 60c344a56b Issue #2104 - Part 1: Implement "clip" attribute value for XUL string cropping
This implements the "clip" attribute value for the "crop" attribute found in XUL label elements. It functions similarly to having the text-overflow property set to an empty string or "". This shouldn't break previously established behavior as it only adds a new value to be checked.

The behavior of the "none" attribute value in the documentation (https://udn.realityripple.com/docs/Archive/Mozilla/XUL/Attribute/crop) is incorrect. The "none" attribute value literally means "don't crop anything" if you'd check the code and is also equivalent to not setting the "crop" attribute at all. This has always been the case since Firefox 2 (earliest version I checked) and apparently, this section of the documentation was copied verbatim from XULPlanet without even checking if it's correct.
2023-02-08 16:56:51 +08:00
FranklinDM 56e636d8ec Issue #2084 - Part 2: Simplify logic in CSSParserImpl::LookupKeywordPrefixAware
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1259348
2023-01-10 07:41:39 +08:00
FranklinDM db3ce13f28 Issue #2084 - Part 1: Remove CSSUnprefixingService.js and associated code
It's effectively dead code since it's been supplanted by built-in webkit-prefixed-CSS support (landed before fork point in Firefox 49).

Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1259348
2023-01-10 07:37:30 +08:00
Moonchild e38f362d44 Issue #2075 - Part 5: Allow logical aliases in the property database. 2023-01-06 20:36:35 +08:00
Moonchild 1b22ef40f9 Issue #2075 - Part 4: Update tests
* Update reftests to use inset-*
* Update property database
* Update logical properties test
2023-01-06 20:36:22 +08:00
Moonchild 07af4123d1 Issue #2075 - Part 2: Update devtools for inset-* 2023-01-06 20:35:53 +08:00
Moonchild 0c37c0db8f Issue #2075 - Part 1: Rename offset-* logical properties to inset-*
This adds aliases behind a pref with the old offset-* names
2023-01-06 20:35:40 +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
Martok 3f073056de Issue #2030 - Pref-gate default button event dispatch logic 2022-12-02 23:56:21 +08:00
Martok 4354c7a1bc Issue #2030 - Allow child nodes of button to participate in mouse hit tests
This is needed for web compatibility, even if standards compliance is debatable.
2022-12-02 23:55:57 +08:00
Martok 4d310562d9 Issue #2030 - (chore) refactor event dispatch functions
Based on selected bits of M-C 1461708:
- EventStateManager::CheckForAndDispatchClick() to early-return style
- split EventStateManager::CheckForAndDispatchClick() into:
  EventCausesClickEvents, PostHandleMouseUp, DispatchClickEvents
- Move implementation of UIEvent::GetRangeParent() and UIEvent::RangeOffset() to nsLayoutUtils
2022-12-02 23:55:37 +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
roytam1 e46011bcc3 Revert "Issue #1986 - Add in reftests for new behavior."
This reverts commit cf5dfc5e7d.
2022-09-29 15:18:00 +08:00
Moonchild fa8bc1e81c Issue #1992 - Part 1: Un-prefix -moz-{min|max}-content keywords. 2022-09-23 11:03:34 +08:00
Moonchild b27475f6a9 Issue #80 - Re-unify most of the layout engine 2022-09-09 10:12:59 +08:00
Moonchild 5dfded811d Issue #80 - reinstated unified building for some large chunks of our code.
This should reduce compile complexity saving time and reducing linker stress.
2022-09-07 10:36:23 +08:00
Jeremy Andrews cf5dfc5e7d Issue #1986 - Add in reftests for new behavior.
Almost forgot to do this. This is in case we need to revisit this for
regressions in the future and the tests are not available online. Never know
when they might come in handy again.
2022-08-24 09:28:06 +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 bbbfa54ee4 Issue #1970 - Part 5: Move combobox/select padding to the select rule.
This doesn't change behavior by default but allows authors to remove the padding
previously enforced to align with focus ring padding, if they wish to.
2022-08-04 14:24:57 +08:00
Moonchild 8101720ca8 Issue #1970 - Part 4: Don't overflow -moz-focus-inner border. 2022-08-04 14:24:41 +08:00