Bug 1713897 Comment 7 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Nika Layzell [:nika] (ni? for response) from comment #2)
> Given that the failure is macOS specific and the action is triggered using a context menu it seems like this might be related in some way to the recent native context menu work on macOS, so leaving a ni? for :mstange.

Your hunch was spot on, Nika. The `browser_firstPartyIsolation_saveAs.js`  failure is indeed happening because of native context menus. [Here's a profile](https://profiler.firefox.com/public/t3ze91m264bqp3gcgj8rzwebpyjhvw2885b3d30/calltree/?globalTrackOrder=182-183-184-185-186-187-188-189-190-191-192-193-194-195-196-197-198-199-0-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18-19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36-37-38-39-40-41-42-43-44-45-46-47-48-49-50-51-52-53-54-55-56-57-58-59-60-61-62-63-64-65-66-67-68-69-70-71-72-73-74-75-76-77-78-79-80-81-82-83-84-85-86-87-88-89-90-91-92-93-94-95-96-97-98-99-100-101-102-103-104-105-106-107-108-109-110-111-112-113-114-115-116-117-118-119-120-121-122-123-124-125-126-127-128-129-130-131-132-133-134-135-136-137-138-139-140-141-142-143-144-145-146-147-148-149-150-151-152-153-154-155-156-157-158-159-160-161-162-163-164-165-166-167-168-169-170-171-172-173-174-175-176-177-178-179-180-181&hiddenGlobalTracks=183-184-185-186-187-188-189-190-191-192-193-194-195-196-197-198-199-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18-19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36-37-38-39-40-41-42-43-44-45-46-47-48-49-50-51-52-53-54-55-56-57-58-59-60-61-62-63-64-65-66-67-68-69-70-71-72-73-74-75-76-77-78-79-80-81-82-83-84-85-86-87-88-89-90-91-92-93-94-95-96-97-98-99-100-101-102-103-104-105-106-107-108-109-110-111-112-113-114-115-116-117-118-119-120-121-122-123-124-125-126-127-128-129-130-131-132-133-134-135-136-137-138-139-140-141-142-143-144-145-146-147-148-149-150-151-152-153-154-155-156-157-158-159-160-161-162-163-164-165-166-167-168-169-170-171-172-173-174-175-176-177-178-179-180-181&hiddenLocalTracksByPid=1549-0-3-4-5-6-2-1-8-7~1593-2-3~1598-0-1~1602-0-1-2~1607-1&localTrackOrderByPid=1549-7-8-0-1-2-3-4-5-6~1560-0-1~1561-2-3-0-1~1564-0-1~1562-0-1~1563-2-3-0-1~1566-0~1565-0-1~1567-2-3-0-1~1572-0~1568-0-1~1570-0-1~1569-2-3-0-1~1571-2-3-0-1~1577-0~1573-1-2-0~1574-1-2-0~1576-0-1~1575-0-1~1580-0-1~1578-0-1~1579-0-1~1584-0~1582-0-1~1581-0-1~1583-0-1~1586-0-1~1585-0-1~1587-0-1~1588-0-1~1589-0-1~1595-0~1590-0-1~1591-3-4-0-1-2~1592-0-1~1594-0-1~1593-4-5-0-1-2-3~1603-0~1601-0~1597-0-1~1598-3-4-0-1-2~1606-0~1604-0-1~1600-0-1~1602-3-4-0-1-2~1605-3-4-0-1-2~1608-2-3-0-1~1607-2-3-0-1~1609-0-1~1611-0-1~1610-0-1~1616-0-1~1620-0~1618-0-1~1617-0-1~1619-0-1~1622-0-1~1621-0-1~1624-0-1~1623-0-1~1627-0~1628-0-1~1625-0-1~1626-0-1~1633-0~1631-0-1~1630-0-1~1636-0-1~1629-0-1~1632-0-1~1637-0-1~1640-0~1643-0~1644-0~1639-0-1~1638-0-1~1652-0~1653-0~1650-0-1~1641-0-1~1655-0-1~1654-0-1~1651-0-1~1656-0~1658-0-1~1657-0-1~1661-0-1~1660-0-1~1659-0-1~1662-0-1~1668-0-1~1663-0-1~1669-0-1~1670-0-1~1671-0~1672-0-1~1673-0-1~1674-0~1676-0~1677-0-1~1675-0-1~1679-0-1~1678-0-1~1680-0-1~1681-0-1~1682-0-1~1684-0~1683-0~1685-0~1686-0-1~1691-0~1687-0-1~1688-0-1~1689-0-1~1690-0-1~1693-0~1694-0-1~1692-0-1~1695-0-1~1696-0-1~1697-0-1~1698-0-1~1700-0-1~1699-0-1~1701-0-1~1702-0~1703-0~1704-0-1~1706-0-1~1705-0-1~1707-0-1~1708-0~1709-0-1~1710-0~1713-0~1712-0~1714-0-1~1711-0-1~1715-0~1716-0~1717-0-1~1722-0~1718-0-1~1720-0-1~1719-0-1~1730-0~1721-0-1~1727-0-1~1729-0-1~1728-0-1~1731-0-1~1732-0~1734-0-1~1735-0-1~1733-0-1~1736-0-1~1741-0~1742-0~1737-0-1~1738-0-1~1739-0-1~1740-0-1~1743-0-1~1744-0-1~1745-0-1~1746-0~1747-0-1~1749-0-1~1748-0-1~1754-0-1~1755-0-1~1761-0~1760-0~1757-0~1759-0~1758-0~1756-0-1~1596-0~1556-0~1559-0~1555-0~1558-0-1~&range=42646m45015~42646m2225~43622m97&thread=0&timelineType=cpu-category&v=5) that shows what's going on.
It looks like what happens is that the call to `activateItem` never closes the menu and never fires the command event. This seems to be happening because macOS forgets about our call to `-[NSMenu cancelTrackingWithoutAnimation]` if we enter a nested native event loop between the call to that method and returning to the NSMenu's tracking event loop. The profile shows that we call `-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]` before we return to the NSMenu's event loop because, at the time of the call to `activateItem`, were in a nested event loop from `nsThread::Shutdown`.

This is pretty bad problem to have, but it only affects tests and it has nothing to do with Fission. So I would say that the `browser_firstPartyIsolation_saveAs.js` failure should not block Fission.

I'm now looking into the `browser_postMessage.js` failure.
(In reply to Nika Layzell [:nika] (ni? for response) from comment #2)
> Given that the failure is macOS specific and the action is triggered using a context menu it seems like this might be related in some way to the recent native context menu work on macOS, so leaving a ni? for :mstange.

Your hunch was spot on, Nika. The `browser_firstPartyIsolation_saveAs.js`  failure is indeed happening because of native context menus. [Here's a profile](https://profiler.firefox.com/public/t3ze91m264bqp3gcgj8rzwebpyjhvw2885b3d30/calltree/?globalTrackOrder=182-183-184-185-186-187-188-189-190-191-192-193-194-195-196-197-198-199-0-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18-19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36-37-38-39-40-41-42-43-44-45-46-47-48-49-50-51-52-53-54-55-56-57-58-59-60-61-62-63-64-65-66-67-68-69-70-71-72-73-74-75-76-77-78-79-80-81-82-83-84-85-86-87-88-89-90-91-92-93-94-95-96-97-98-99-100-101-102-103-104-105-106-107-108-109-110-111-112-113-114-115-116-117-118-119-120-121-122-123-124-125-126-127-128-129-130-131-132-133-134-135-136-137-138-139-140-141-142-143-144-145-146-147-148-149-150-151-152-153-154-155-156-157-158-159-160-161-162-163-164-165-166-167-168-169-170-171-172-173-174-175-176-177-178-179-180-181&hiddenGlobalTracks=183-184-185-186-187-188-189-190-191-192-193-194-195-196-197-198-199-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18-19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36-37-38-39-40-41-42-43-44-45-46-47-48-49-50-51-52-53-54-55-56-57-58-59-60-61-62-63-64-65-66-67-68-69-70-71-72-73-74-75-76-77-78-79-80-81-82-83-84-85-86-87-88-89-90-91-92-93-94-95-96-97-98-99-100-101-102-103-104-105-106-107-108-109-110-111-112-113-114-115-116-117-118-119-120-121-122-123-124-125-126-127-128-129-130-131-132-133-134-135-136-137-138-139-140-141-142-143-144-145-146-147-148-149-150-151-152-153-154-155-156-157-158-159-160-161-162-163-164-165-166-167-168-169-170-171-172-173-174-175-176-177-178-179-180-181&hiddenLocalTracksByPid=1549-0-3-4-5-6-2-1-8-7~1593-2-3~1598-0-1~1602-0-1-2~1607-1&localTrackOrderByPid=1549-7-8-0-1-2-3-4-5-6~1560-0-1~1561-2-3-0-1~1564-0-1~1562-0-1~1563-2-3-0-1~1566-0~1565-0-1~1567-2-3-0-1~1572-0~1568-0-1~1570-0-1~1569-2-3-0-1~1571-2-3-0-1~1577-0~1573-1-2-0~1574-1-2-0~1576-0-1~1575-0-1~1580-0-1~1578-0-1~1579-0-1~1584-0~1582-0-1~1581-0-1~1583-0-1~1586-0-1~1585-0-1~1587-0-1~1588-0-1~1589-0-1~1595-0~1590-0-1~1591-3-4-0-1-2~1592-0-1~1594-0-1~1593-4-5-0-1-2-3~1603-0~1601-0~1597-0-1~1598-3-4-0-1-2~1606-0~1604-0-1~1600-0-1~1602-3-4-0-1-2~1605-3-4-0-1-2~1608-2-3-0-1~1607-2-3-0-1~1609-0-1~1611-0-1~1610-0-1~1616-0-1~1620-0~1618-0-1~1617-0-1~1619-0-1~1622-0-1~1621-0-1~1624-0-1~1623-0-1~1627-0~1628-0-1~1625-0-1~1626-0-1~1633-0~1631-0-1~1630-0-1~1636-0-1~1629-0-1~1632-0-1~1637-0-1~1640-0~1643-0~1644-0~1639-0-1~1638-0-1~1652-0~1653-0~1650-0-1~1641-0-1~1655-0-1~1654-0-1~1651-0-1~1656-0~1658-0-1~1657-0-1~1661-0-1~1660-0-1~1659-0-1~1662-0-1~1668-0-1~1663-0-1~1669-0-1~1670-0-1~1671-0~1672-0-1~1673-0-1~1674-0~1676-0~1677-0-1~1675-0-1~1679-0-1~1678-0-1~1680-0-1~1681-0-1~1682-0-1~1684-0~1683-0~1685-0~1686-0-1~1691-0~1687-0-1~1688-0-1~1689-0-1~1690-0-1~1693-0~1694-0-1~1692-0-1~1695-0-1~1696-0-1~1697-0-1~1698-0-1~1700-0-1~1699-0-1~1701-0-1~1702-0~1703-0~1704-0-1~1706-0-1~1705-0-1~1707-0-1~1708-0~1709-0-1~1710-0~1713-0~1712-0~1714-0-1~1711-0-1~1715-0~1716-0~1717-0-1~1722-0~1718-0-1~1720-0-1~1719-0-1~1730-0~1721-0-1~1727-0-1~1729-0-1~1728-0-1~1731-0-1~1732-0~1734-0-1~1735-0-1~1733-0-1~1736-0-1~1741-0~1742-0~1737-0-1~1738-0-1~1739-0-1~1740-0-1~1743-0-1~1744-0-1~1745-0-1~1746-0~1747-0-1~1749-0-1~1748-0-1~1754-0-1~1755-0-1~1761-0~1760-0~1757-0~1759-0~1758-0~1756-0-1~1596-0~1556-0~1559-0~1555-0~1558-0-1~&range=42646m45015~42646m2225~43622m97&thread=0&timelineType=cpu-category&v=5) that shows what's going on.
It looks like what happens is that the call to `activateItem` never closes the menu and never fires the command event. This seems to be happening because macOS forgets about our call to `-[NSMenu cancelTrackingWithoutAnimation]` if we enter a nested native event loop between the call to that method and returning to the NSMenu's tracking event loop. The profile shows that we call `-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]` before we return to the NSMenu's event loop because, at the time of the call to `activateItem`, we're in a nested event loop from `nsThread::Shutdown`.

This is pretty bad problem to have, but it only affects tests and it has nothing to do with Fission. So I would say that the `browser_firstPartyIsolation_saveAs.js` failure should not block Fission.

I'm now looking into the `browser_postMessage.js` failure.

Back to Bug 1713897 Comment 7