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

6385 Коммитов

Автор SHA1 Сообщение Дата
Kershaw Chang 705e17a537 Bug 1838829 - Skip failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,dimi,valentin,robwu
Differential Revision: https://phabricator.services.mozilla.com/D181251
2023-06-28 13:21:00 +00:00
Masayuki Nakano 23a18fdd2a Bug 831008 - Make `EventListenerManager` assert when a legacy DOM mutation event listener is added in either chrome documents, native anonymous subtrees or the system event groups r=smaug
The legacy DOM mutation events shouldn't be used even in content and must not be
used in chrome.

This patch makes it crash if legacy mutation event listener is:
* added to a node in a chrome document
* added to a node in a native anonymous subtree
* added to the system event group
* implemented by C++

This causes some crash tests and chrome tests.  Therefore, this patch modifies
them to use `MutationObserver` instead or removes them if it's impossible to
rewrite with `MutationObserver`.

Note that if I prevent to dispatch mutation events in some/all of the cases,
that causes performance regression in Speedometer3.  Therefore, this patch
does not touch `EventDispatcher`.

Differential Revision: https://phabricator.services.mozilla.com/D181828
2023-06-27 04:20:17 +00:00
Norisz Fay 07a91b8c6a Backed out 2 changesets (bug 1838829) for causing perma mochitest failure with dom/websocket/tests being skipped CLOSED TREE
Backed out changeset 19a5d4f1850a (bug 1838829)
Backed out changeset 97cd8a256954 (bug 1838829)
2023-06-27 02:52:52 +03:00
Kershaw Chang 75c68b6864 Bug 1838829 - Skip failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,dimi,valentin,robwu
Differential Revision: https://phabricator.services.mozilla.com/D181251
2023-06-26 14:22:14 +00:00
Emilio Cobos Álvarez 4cc6758558 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Norisz Fay e86f1fa0e9 Backed out 5 changesets (bug 1838829) for causing mochitest failures CLOSED TREE
Backed out changeset 693d34c8447d (bug 1838829)
Backed out changeset 903d9ff4afaa (bug 1838829)
Backed out changeset 5e51feff7467 (bug 1838829)
Backed out changeset e125be49d2a6 (bug 1838829)
Backed out changeset 1a8cf3c83dc4 (bug 1838829)
2023-06-22 03:37:07 +03:00
Kershaw Chang 2cdb6b3a96 Bug 1838829 - Skip failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,dimi,valentin,robwu
Differential Revision: https://phabricator.services.mozilla.com/D181251
2023-06-21 19:43:33 +00:00
Emilio Cobos Álvarez c279f7ffe8 Bug 1839066 - Make nsTreeBodyFrame::SetView deal with setting the same view. r=mak
This actually fixes the bug. The issue is that we end up with
nsITreeView.setTree(null) then nsITreeView.setTree(<tree>).

This code deals with the first call:

  https://searchfox.org/mozilla-central/rev/c936f47f3a629ae49a4d528d3366bf29f2d4e4a7/browser/components/places/content/treeView.js#1651

But the later call doesn't restore the state properly and a bunch of nodes end
up unparented. That might be worth fixing on its own...

This is probably a long/forever-standing bug that was uncovered by different
amount of reflow calls.

Depends on D181379

Differential Revision: https://phabricator.services.mozilla.com/D181380
2023-06-20 08:58:10 +00:00
Razvan Cojocaru d45f60d317 Bug 1331390 - Don't over scroll when mouse down on scrollbar if smooth scroll is enabled. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D171017
2023-06-05 17:43:38 +00:00
Mark Banner 8219a5c503 Bug 1826062 - Automatic fixes for Prettier 2.0.5 upgrade. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,owlish
Differential Revision: https://phabricator.services.mozilla.com/D177025
2023-05-20 12:26:49 +00:00
Katherine Patenio ac4145f34d Bug 1830419 - Convert PanelMutiView.jsm and CustomizableUITestUtils.jsm in browser/components/customizableui to ESMs r=search-reviewers,Standard8,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D178362
2023-05-18 18:34:51 +00:00
Drew Willcoxon 929e1e4d77 Bug 1831760 - Use a native popup menu for positioned popups on Mac. r=dao,mstange
This does two things:

* Modify `nsXULPopupManager::ShowPopup()` so it calls `ShowPopupAsNativeMenu()`
  as long as an anchor wasn't passed in, and only on Mac.
* Modify `-[MOZMenuOpeningCoordinator _openMenu:atScreenPosition:forView:withAppearance:]`
  so it also takes a `aIsContextMenu` param. If the param is true, we synthesize
  a right-click event and pop up a context menu as usual. If it's false, we use
  `-[NSMenu popUpMenuPositioningItem:atLocation:inView:]` instead.

The reason this works is because `-[NSMenu popUpMenuPositioningItem:atLocation:inView:]`
opens the menu in a sensible place when the x-y coords are near the right edge
of the screen. In contrast, `+[NSMenu popUpContextMenu:withEvent:forView:]` will
anchor the menu's top-right corner to the mouse cursor when near the right edge.

Differential Revision: https://phabricator.services.mozilla.com/D177355
2023-05-18 05:51:19 +00:00
Botond Ballo c3eec8d47e Bug 1818721 - Invalidate the slider frame when the thumb is moved. r=tnikkel
The thumb's position is sent to the compositor in ScrollbarData::mThumbStart
stored on the OwnLayer item built by the slider frame, so we need to
invalidate the slider frame when the thumb's position changes.

Differential Revision: https://phabricator.services.mozilla.com/D176384
2023-05-15 05:24:38 +00:00
Masayuki Nakano e16a783838 Bug 1829570 - part 2: Add an overload of `AsyncEventDispatcher::RunDOMEventWhenSafe` r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D176488
2023-05-15 01:07:29 +00:00
Emilio Cobos Álvarez 9a3a61642f Bug 1831535 - Fix nsTreeBodyFrame invalidation on height changes. r=layout-reviewers,dlrobertson
The previous code ran right before setting mRect so it triggered a
reflow callback / scrollbar update.

Differential Revision: https://phabricator.services.mozilla.com/D177258
2023-05-12 17:22:49 +00:00
Emilio Cobos Álvarez fa37578f52 Bug 1828413 - Use more non-native rendering of menus. r=stransky
This makes our menus closer to GTK4, and depends less on the native menu
rendering etc. Thunderbird already does this to some extent.

Leave the old code behind a pref for now (just in case). Also fix some
code in nsNativeTheme::GetContentState (fixes rendering of radio menu
items).

Differential Revision: https://phabricator.services.mozilla.com/D175664
2023-04-20 11:42:44 +00:00
Emilio Cobos Álvarez 534aba218e Bug 1828772 - Don't use move-to-rect if layout has flipped our popup. r=stransky
As move-to-rect wouldn't account for those constraints.

Differential Revision: https://phabricator.services.mozilla.com/D175861
2023-04-19 13:00:16 +00:00
Emilio Cobos Álvarez e170de6a14 Bug 1826622 - [wayland] Ensure explicit popup constraints are honored. r=stransky
This makes sure that wayland <select> elements are constrained to the
window.

Differential Revision: https://phabricator.services.mozilla.com/D175039
2023-04-13 07:42:36 +00:00
Emilio Cobos Álvarez cd8effeca0 Bug 1826881 - Fix suspicious tree invalidation code. r=dholbert
Could probably figure out a reasonable way to add a test for this but I
don't think it's the best use of our time tbh.

Differential Revision: https://phabricator.services.mozilla.com/D175117
2023-04-12 22:04:03 +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
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
Emilio Cobos Álvarez feebcb3f8a Bug 1826517 - Simplify DevTools' walker. r=smaug,devtools-reviewers,nchevobbe
The tree devtools uses is the light dom + pseudo-elements + NAC, but sometimes
it wants to know stuff about the flat tree like assigned nodes. Previously it
was using a weird mix of the anonymous vs. non-anonymous walkers to get what it
wants, but that's needlessly complicated.

Instead, make InspectorUtils.getChildrenForNode do the right thing, and add
assigned nodes explicitly.

While _getChildren using a walker might seem like a good idea for performance,
realistically it was using InspectorUtils under the hood, and this is much
simpler.

Differential Revision: https://phabricator.services.mozilla.com/D174491
2023-04-10 11:18:38 +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 e14e3f4311 Bug 1824957 - Use SimpleXULLeafFrame for treebody. r=jwatt
Surprisingly straight-forward:

Use SimpleXULLeafFrame, and override GetIntrinsicBSize to implement the rows
attribute.

Use DidReflow to manage the reflow callback which is equivalent to what the old
code did.

Differential Revision: https://phabricator.services.mozilla.com/D173818
2023-03-28 20:45:03 +00:00
Norisz Fay 93bf71eee0 Backed out changeset 30b054c6db5a (bug 1824957) for causing reftest failures on treechildren-padding-percent-1.xhtml 2023-03-28 21:55:20 +03:00
Emilio Cobos Álvarez 7fd5088695 Bug 1824986 - Use element more in popup manager code. r=mstange
We know these are elements, take advantage of that.

Depends on D173836

Differential Revision: https://phabricator.services.mozilla.com/D173837
2023-03-28 14:33:19 +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 8266de2894 Bug 1824957 - Use SimpleXULLeafFrame for treebody. r=jwatt
Surprisingly straight-forward:

Use SimpleXULLeafFrame, and override GetIntrinsicBSize to implement the rows
attribute.

Use DidReflow to manage the reflow callback which is equivalent to what the old
code did.

Differential Revision: https://phabricator.services.mozilla.com/D173818
2023-03-28 13:24:16 +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 01253550b7 Bug 1824236 - Remove a crashtest using <slider> without a scrollbar.
Another use case we don't want to support.

MANUAL PUSH: Fixes an Android nullptr crash CLOSED TREE
2023-03-28 01:15:35 +02:00
Emilio Cobos Álvarez 97e171a969 Bug 1824489 - Stop using XUL layout for nsSplitterFrame. r=jwatt
Make it a SimpleXULLeafFrame, and carry on. Ideally we'd instead move
this code out of layout altogether into a XULSplitterElement, but given
splitters can have no children, well.

At this point there's only nsTreeBodyFrame an nsTextBoxFrame left to be
able to remove all of XUL layout.

Differential Revision: https://phabricator.services.mozilla.com/D173600
2023-03-27 22:55:09 +00: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
Emilio Cobos Álvarez 91e6e4c5d4 Bug 1823686 - Share URLExtraData between SVG attribute mapping and style attribute. r=smaug
I don't think there's ever a way these should differ.

Got some include hell from removing ReferrerInfo.h from Document.h but
hopefully should be straight-forward to review.

Depends on D173154

Differential Revision: https://phabricator.services.mozilla.com/D173155
2023-03-22 14:54:43 +00:00
Emilio Cobos Álvarez cb2a32d8af Bug 1823455 - Merge ScrollFrameHelper and nsHTMLScrollFrame. r=layout-reviewers,TYLin
Now that we've removed nsXULScrollFrame, ScrollFrameHelper can be
subsumed under nsHTMLScrollFrame.

I want to do this before making scrollbars non-XUL.

Renaming to mozilla::ScrollFrame is left for a follow-up bug.

Differential Revision: https://phabricator.services.mozilla.com/D173063
2023-03-22 13:06:40 +00:00
Emilio Cobos Álvarez 5c659eb4ed Bug 1823764 - Use HasNonEmptyAttr to choose between XUL src and list-style-image. r=tnikkel,layout-reviewers
This preserves the previous behavior more exactly and fixes the display
of the icons, which have src="" but expect list-style-image to take
effect.

Depends on D173265

Differential Revision: https://phabricator.services.mozilla.com/D173266
2023-03-22 11:50:06 +00:00
Emilio Cobos Álvarez d8d7f3f68c Bug 1823552 - Fix test_popup_moveToAnchor.xhtml failures by resetting offset on MoveTo calls.
MANUAL PUSH: Trivial fix CLOSED TREE
2023-03-21 13:46:25 +01:00
Emilio Cobos Álvarez 273cb18ba2 Bug 1823552 - When fixing the position of a followanchor="false" popup, don't lose the anchor rect altogether. r=stransky
Otherwise we lose the anchor constraints which can change our layout.
The only thing we want is to stop following the anchor _node_, so we can
just convert it to an anchor rect instead.

Differential Revision: https://phabricator.services.mozilla.com/D173135
2023-03-21 11:24:07 +00:00
Kershaw Chang 5e58575e28 Bug 1809843 - Skip Failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,valentin,sgalich,robwu
Differential Revision: https://phabricator.services.mozilla.com/D171842
2023-03-21 09:09:58 +00:00
Emilio Cobos Álvarez a8be8e8d20 Bug 1823020 - Set mUntransformedAnchorRect for rect-anchored popups.
I missed setting mUntransformedAnchorRect in one case, causing Wayland
popups to be wrongly positioned.

Differential Revision: https://phabricator.services.mozilla.com/D172886
2023-03-17 19:26:54 +00:00
Emilio Cobos Álvarez da7fa43d4a Bug 1809084 - Stop using XUL layout for menu popups. r=desktop-theme-reviewers,dao,dshin
The underlying issue here is an invalidation bug with XUL layout. When a
popup opens, we try to lay it out at full size, then post a reflow
callback to constrain it.

There's an intermediate step there where the popup might remain at full
size, and the constraining operates directly on mRect, which isn't quite
sound and doesn't update the scrollport of descendants.

Make nsMenuPopupFrame inherit from nsBlockFrame instead, doing
potentially two layout passes when constrained.

This fixes the issue at hand, and removes XUL layout from menu popups,
so it's a win-win.

To make reasoning about it a bit easier, factor out a bunch of the XUL
positioning code to be const. The mutation of mRect etc which was going
on otherwise was pretty hard to reason about.

Differential Revision: https://phabricator.services.mozilla.com/D170368
2023-03-16 19:09:14 +00:00
Emilio Cobos Álvarez 9900adffa0 Bug 1822578 - Make flex="1" on XUL set a zero flex basis like the flex shorthand does. r=Gijs,mconley,settings-reviewers,desktop-theme-reviewers,dao
In a setup with:

<hbox>
 <something flex="1"/>
 <something-else/>
</hbox>

Before bug 1822131 <something flex="1"> ended up with flex-basis: auto,
but was the only thing able to shrink, so <something-else> stayed the
same size.

After that bug however <something-else> is able to shrink too, so both
elements shrink. This wouldn't happen if flex="1" actually worked like
flex: 1 does.

However flex: 1 causes stuff like explicit main sizes to be
(effectively) ignored, so we need to fix up a few cases where now we'd
start flexing too much. For that, add a debug assert to
nsFlexContainerFrame to catch the would-be behavior changes here.

For the most part they're actually no-op since they're setting tiny
sizes, but preferences and devtools needed a couple real fixes.

The profile selection spacer is useless (zero-size).

Hopefully the last xul.css change I need to do :')

Differential Revision: https://phabricator.services.mozilla.com/D172704
2023-03-16 00:06:29 +00:00
Emilio Cobos Álvarez ac370758b4 Bug 1822131 - Allow XUL elements to shrink-by-default. r=dholbert
Bug 1821920 and bug 1821871 are instances of an interesting behavior
change from bug 1820534.

The default flex-basis of old XUL was auto instead of max-content,
because of this code:

  https://searchfox.org/mozilla-central/rev/af78418c4b5f2c8721d1a06486cf4cf0b33e1e8d/layout/generic/nsFlexContainerFrame.cpp#1327

So stuff that used to wrap now no longer does, in an horizontal flex
container, since xul.css prevents XUL elements from shrinking.

Per the comment, a few tests relied on this, but I believe it should
generally be safe to shrink the items. This only causes to shrink if
they have an explicit width but no min-width (including min-width:
auto).

Some tests like test_mousescroll.xhtml hit this, because they have
explicit sizes but min-width: auto ends up being 0 effectively, but I
believe we should tweak those tests instead.

Differential Revision: https://phabricator.services.mozilla.com/D172462
2023-03-14 12:22:11 +00:00
Norisz Fay 0eabfe04d0 Backed out changeset e3fb28ffc489 (bug 1822131) for causing reftest failures on 540247-1.xhtml 2023-03-14 01:20:07 +02:00
Emilio Cobos Álvarez f60d745bc2 Bug 1822131 - Allow XUL elements to shrink-by-default. r=dholbert
Bug 1821920 and bug 1821871 are instances of an interesting behavior
change from bug 1820534.

The default flex-basis of old XUL was auto instead of max-content,
because of this code:

  https://searchfox.org/mozilla-central/rev/af78418c4b5f2c8721d1a06486cf4cf0b33e1e8d/layout/generic/nsFlexContainerFrame.cpp#1327

So stuff that used to wrap now no longer does, in an horizontal flex
container, since xul.css prevents XUL elements from shrinking.

Per the comment, a few tests relied on this, but I believe it should
generally be safe to shrink the items. This only causes to shrink if
they have an explicit width but no min-width (including min-width:
auto).

Some tests like test_mousescroll.xhtml hit this, because they have
explicit sizes but min-width: auto ends up being 0 effectively, but I
believe we should tweak those tests instead.

Differential Revision: https://phabricator.services.mozilla.com/D172462
2023-03-13 20:43:34 +00:00
Marian-Vasile Laza ee72efd1e9 Backed out 5 changesets (bug 1809843) for causing Cargo related build bustages. CLOSED TREE
Backed out changeset 5c494680f448 (bug 1809843)
Backed out changeset 02742b38edab (bug 1809843)
Backed out changeset 2b9b32ca8294 (bug 1809843)
Backed out changeset 56631cb02ae6 (bug 1809843)
Backed out changeset 37e35a60a71f (bug 1809843)
2023-03-13 13:53:26 +02:00
Kershaw Chang a60df34ad0 Bug 1809843 - Skip Failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,valentin,sgalich,robwu
Differential Revision: https://phabricator.services.mozilla.com/D171842
2023-03-13 11:12:33 +00:00