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

35 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 6fb72d4a3f Bug 1754579 - Don't keep so much alive when returning DOMRects & co. r=smaug
We keep the parent alive for wrapping. It's unnecessary to keep alive
the individual element / range / etc. Pass the relevant global /
document.

Differential Revision: https://phabricator.services.mozilla.com/D138357
2022-02-10 00:38:45 +00:00
Emilio Cobos Álvarez dc4988bbd0 Bug 1729805 - Make async OpenMenu simpler/sound. r=NeilDeakin,mstange
There's only one caller of it and it's not sound: The runnable captures a
raw frame pointer etc. Instead, just do a dispatch to the main thread
and call OpenMenu there. This simplifies the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D131082
2022-01-25 21:40:22 +00:00
criss d68f0e9684 Backed out changeset 5c921d8e51bd (bug 1741089) for causing mochitest failures on test_bug557987.xhtml . CLOSED TREE 2021-11-16 18:27:45 +02:00
Emilio Cobos Álvarez 3cf56f8e1f Bug 1741089 - Make async OpenMenu simpler/sound. r=mstange
There's only one caller of it and it's not sound: The runnable captures a
raw frame pointer etc. Instead, just do a dispatch to the main thread
and call OpenMenu there. This simplifies the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D131082
2021-11-16 15:43:38 +00:00
stransky 957f603c7e Bug 1708709 Use appunits for mScreenRect to avoid rounding errors, r=emilio
We have to use wayland to position popup windows and we need to propagate the modified
position (if happens) back to nsView. The mScreenRect in the nsMenuPopupFrame is in the CSS units
and that produce rounding error when font scale factor is not 1. To fix that we will use appunits
for the mScreenRect.

Differential Revision: https://phabricator.services.mozilla.com/D114577
2021-09-01 13:02:51 +00:00
Neil Deakin 0b4418c6a7 Bug 1696214, use moveToAnchor to position the tab and places tooltips so that the close and mute button tooltips appear correctly, r=jaws
This involves changing moveToAnchor to be allowed while the popup is showing. This change allows the buttons within the tab to use the normal algorithm for determining the tooltip position. This also fixes bug 1695900 so that tooltips for items in bookmarks menus also appear offset as well. Only the main tab and bookmarks on the toolbar appear aligned with the button's bottom edge.

Differential Revision: https://phabricator.services.mozilla.com/D115558
2021-05-31 13:07:35 +00:00
Neil Deakin 525d4000cd Bug 1709439, activateItem should allow any descendant of an open submenu to be used, r=mstange,emilio
This patch also fixes an issue where hidden native items could be activated, and makes the
error message consistent between both implementations in this case.

Differential Revision: https://phabricator.services.mozilla.com/D114503
2021-05-10 18:44:03 +00:00
Markus Stange 404f71ee33 Bug 1706434 - For native menus, make XULPopupElement.getOuterScreenRect() return the rect that the menu was initialized with. r=tnikkel
The position of this rectangle is the position at which we asked the OS to open the menu.

Depends on D112803

Differential Revision: https://phabricator.services.mozilla.com/D112804
2021-04-20 22:16:07 +00:00
Markus Stange a70e89dbac Bug 1704879 - Allow specifying the command event's button field in XULPopupElement.activateItem. r=emilio
Depends on D111956

Differential Revision: https://phabricator.services.mozilla.com/D111979
2021-04-20 22:13:24 +00:00
Markus Stange 1807ef4020 Bug 1704554 - Make XULPopupElement::GetState go through the popup manager. r=tnikkel
Depends on D112273

Differential Revision: https://phabricator.services.mozilla.com/D112274
2021-04-16 16:18:29 +00:00
Narcis Beleuzu daa77699e2 Backed out 7 changesets (bug 1704948, bug 1704879) for bc failures on browser_ext_menus_capture_secondary_click.js
Backed out changeset 02705918c4bf (bug 1704879)
Backed out changeset 79945b876a1d (bug 1704879)
Backed out changeset eb725de20b11 (bug 1704948)
Backed out changeset 454597ac2ba3 (bug 1704948)
Backed out changeset a43a8ef206ea (bug 1704948)
Backed out changeset 2369e321069e (bug 1704948)
Backed out changeset bdf396edd692 (bug 1704948)
2021-04-15 03:30:52 +03:00
Markus Stange 9e9970605b Bug 1704879 - Allow specifying the command event's button field in XULPopupElement.activateItem. r=emilio
Depends on D111956

Differential Revision: https://phabricator.services.mozilla.com/D111979
2021-04-14 22:24:31 +00:00
Markus Stange b4750b7fb3 Bug 1704209 - Make XULPopupElement.activateItem work for native menus. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D111521
2021-04-13 02:52:41 +00:00
Markus Stange d9d0069c71 Bug 1704206 - Add XULPopupElement.activateItem as a way to activate menu items. r=tnikkel,emilio
Differential Revision: https://phabricator.services.mozilla.com/D111519
2021-04-12 00:32:19 +00:00
Emilio Cobos Álvarez 4ad501e86f Bug 1666497 - Don't flush layout from popuppositioned events. r=mconley,Gijs,smaug
We don't need to flush before dispatching the event because we know that
if the values we cared about changed, then we'd get another event.

Differential Revision: https://phabricator.services.mozilla.com/D92444
2020-10-06 16:28:41 +00:00
Emilio Cobos Álvarez 78ce42a419 Bug 1666497 - Fix various issues with anchored popups. r=NeilDeakin
The patch in bug 1666497 (which makes regular <window>-based XUL
documents with other the XHTML-based ones) uncovers an issue in the
anchored popup tests, which starts timing out.

The underlying issue is that it changes the reflow order from popups in
XUL-only documents with respect to their anchors. Note that Firefox
already uses the "broken" code, because we moved to xhtml and
browser.xhtml doesn't use a XUL <window> anymore.

Since we reflow now the popup _after_ the anchor rather than before, we
don't need to rely on CheckForAnchorChange() to deal with changes. This
means that we need to notify on the positioning changes that happen
during reflow though.

We should be able to simplify a bit the CheckForAnchorChange() stuff
now, but it also takes care of hiding popups and such so I don't plan to
do it on this bug to minimize risk.

Differential Revision: https://phabricator.services.mozilla.com/D91012
2020-10-06 16:28:33 +00:00
Narcis Beleuzu 55d91af3b8 Backed out 2 changesets (bug 1666497, bug 1489259) for bc failure on browser_appmenu.js
Backed out changeset aa49cdc20ff4 (bug 1489259)
Backed out changeset 368f054779b2 (bug 1666497)
2020-10-05 21:38:08 +03:00
Emilio Cobos Álvarez 13f858ff1a Bug 1666497 - Fix various issues with anchored popups. r=NeilDeakin
The patch in bug 1666497 (which makes regular <window>-based XUL
documents with other the XHTML-based ones) uncovers an issue in the
anchored popup tests, which starts timing out.

The underlying issue is that it changes the reflow order from popups in
XUL-only documents with respect to their anchors. Note that Firefox
already uses the "broken" code, because we moved to xhtml and
browser.xhtml doesn't use a XUL <window> anymore.

Since we reflow now the popup _after_ the anchor rather than before, we
don't need to rely on CheckForAnchorChange() to deal with changes. This
means that we need to notify on the positioning changes that happen
during reflow though.

We should be able to simplify a bit the CheckForAnchorChange() stuff
now, but it also takes care of hiding popups and such so I don't plan to
do it on this bug to minimize risk.

Differential Revision: https://phabricator.services.mozilla.com/D91012
2020-10-05 13:34:59 +00:00
Csoregi Natalia 231777144e Backed out changeset 1b76f477b19c (bug 1666497) for unexpected reflow failures. CLOSED TREE 2020-10-03 00:50:15 +03:00
Emilio Cobos Álvarez 43e7bad0b6 Bug 1666497 - Fix various issues with anchored popups. r=NeilDeakin
The patch in bug 1666497 (which makes regular <window>-based XUL
documents with other the XHTML-based ones) uncovers an issue in the
anchored popup tests, which starts timing out.

The underlying issue is that it changes the reflow order from popups in
XUL-only documents with respect to their anchors. Note that Firefox
already uses the "broken" code, because we moved to xhtml and
browser.xhtml doesn't use a XUL <window> anymore.

Since we reflow now the popup _after_ the anchor rather than before, we
don't need to rely on CheckForAnchorChange() to deal with changes. This
means that we need to notify on the positioning changes that happen
during reflow though.

We should be able to simplify a bit the CheckForAnchorChange() stuff
now, but it also takes care of hiding popups and such so I don't plan to
do it on this bug to minimize risk.

Differential Revision: https://phabricator.services.mozilla.com/D91012
2020-10-02 14:33:14 +00:00
Neil Deakin 707aba1b0b Bug 1644337, add an isAnchored property to popups, as popups can be anchored to a rectangle as well as a node. This prevented the arrow from appearing in panels, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D86099
2020-08-10 09:47:38 +00:00
Sean Feng a104d39094 Bug 1377999 - Make nsXULElement to adapt the DOMArena changes r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D57705

--HG--
extra : moz-landing-system : lando
2020-03-17 14:53:33 +00:00
Masayuki Nakano 5e41233499 Bug 1540990 - Get rid of unnecessary nsIPresShell.h inclusions r=emilio
A lot of files include `nsIPresShell.h` even though currently they don't
need it.  This patch removes the unnecessary inclusions.

Differential Revision: https://phabricator.services.mozilla.com/D25744

--HG--
extra : moz-landing-system : lando
2019-04-04 00:19:48 +00:00
Razvan Maries 1cd564b971 Backed out changeset 3b94c20ba873 (bug 1540990) for build bustages. CLOSED TREE 2019-04-04 02:44:00 +03:00
Masayuki Nakano b2bba953cc Bug 1540990 - Get rid of unnecessary nsIPresShell.h inclusions r=emilio
A lot of files include `nsIPresShell.h` even though currently they don't
need it.  This patch removes the unnecessary inclusions.

Differential Revision: https://phabricator.services.mozilla.com/D25744

--HG--
extra : moz-landing-system : lando
2019-04-03 23:29:38 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Neil Deakin 51f69a2c2a Bug 1494000, use Element::GetFrame in XULMenuElement and XULPopupElement, r=bz 2018-10-18 08:40:10 -04:00
Nathan Froyd 846d8789ee Bug 1492894 - part 1 - make the node hierarchy consistently constructed with NodeInfo&&; r=mccr8
Various places in dom/ use the pattern:

  already_AddRefed<NodeInfo> ni = ...;

which is supposed to be disallowed by our static analysis code, but
isn't, for whatever reason.  To fix our static analysis code, we need to
eliminate instances of the above pattern.

Unfortunately, eliminating this pattern requires restructuring how Nodes
are created.  Most Node subclasses take `already_AddRefed<NodeInfo>&` in
their constructors, and a few accept `already_AddRefed<NodeInfo>&&`.  We
need to enforce the latter pattern consistently, which requires changing
dozens of source files.
2018-09-21 16:45:49 -04:00
Brendan Dahl cba4aa7f3a Bug 1466897 - Rename nsIRootBox to nsIPopupContainer. r=mats
MozReview-Commit-ID: D4GgReAEelG

--HG--
rename : layout/xul/nsIRootBox.h => layout/xul/nsIPopupContainer.h
extra : rebase_source : 6670156e9958d6fb51860fe92bbb4ffbf5789267
2018-06-26 17:29:55 -07:00
Ciure Andrei 177ceadc18 Backed out 3 changesets (bug 1466897) for xpcshell failures test_ext_schemas_interactive.js and test_ext_contentscript_create_iframe.js CLOSED TREE
Backed out changeset 87bb8b686a7e (bug 1466897)
Backed out changeset 4443f1f6e8f3 (bug 1466897)
Backed out changeset 067ee6342782 (bug 1466897)

--HG--
rename : layout/xul/nsIPopupContainer.h => layout/xul/nsIRootBox.h
2018-07-03 06:03:15 +03:00
Brendan Dahl 79c6912c4e Bug 1466897 - Rename nsIRootBox to nsIPopupContainer. r=mats
MozReview-Commit-ID: D4GgReAEelG

--HG--
rename : layout/xul/nsIRootBox.h => layout/xul/nsIPopupContainer.h
extra : rebase_source : 5f4c2f2da75bac4f499a23cecc368e996991c6fe
2018-06-26 17:29:55 -07:00
Jeff Gilbert 5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Chris Peterson 2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Emilio Cobos Álvarez fe09ffd3af Bug 1465478: Introduce Element::FromNode. r=smaug
And use it in a couple places I noticed.

MozReview-Commit-ID: 8baSMrbdEbF
2018-05-31 02:46:10 +02:00
Neil Deakin ef5f9b4b23 Bug 1446961, move PopupBoxObject to XULPopupElement, a new subclass of XULElement. Remove popup.xml methods, r=paolo,bz
Test changes for removal of PopupBoxObject and popup.xml methods, some reflow tests now have different stacks now that they are not going through popup.xml binding methods, test_popupanchor.xul changes due to need to wait for popuppositioned event after resizing. The old code would just adjust the arrow directly when sizeTo was called, but the new code does this through an asynchronous popuppositioned event. Changes to some places that check for XULElement class.

--HG--
rename : dom/webidl/PopupBoxObject.webidl => dom/webidl/XULPopupElement.webidl
rename : layout/xul/PopupBoxObject.cpp => dom/xul/XULPopupElement.cpp
rename : layout/xul/PopupBoxObject.h => dom/xul/XULPopupElement.h
2018-04-27 11:04:38 -04:00