gh-14843: Prevent quick audio tracks from creating a new controller (gh-14871)

This commit is contained in:
mr. m
2026-08-07 02:01:57 +02:00
committed by GitHub
parent e7a3e1ee29
commit 73ed322695
7 changed files with 117 additions and 48 deletions

View File

@@ -4,9 +4,13 @@
#include "nsZenWindowDragUtils.h"
#include "Units.h"
#include "mozilla/PresShell.h"
#include "mozilla/ServoStyleConsts.h"
#include "mozilla/dom/Element.h"
#include "nsContentUtils.h"
#include "nsIContent.h"
#include "nsIFrame.h"
namespace zen {
@@ -30,4 +34,57 @@ nsZenWindowDragUtils::IsInteractiveContent(nsINode* aNode, bool* aResult) {
return NS_OK;
}
NS_IMETHODIMP
nsZenWindowDragUtils::IsInteractiveCursor(nsINode* aNode, float aClientX,
float aClientY, bool* aResult) {
using mozilla::StyleCursorKind;
*aResult = false;
NS_ENSURE_ARG_POINTER(aNode);
nsIContent* content = nsIContent::FromNode(aNode);
nsIFrame* frame = content ? content->GetPrimaryFrame() : nullptr;
if (!frame) {
return NS_OK;
}
nsIFrame* rootFrame = frame->PresShell()->GetRootFrame();
if (!rootFrame) {
return NS_OK;
}
nsPoint point(mozilla::CSSPixel::ToAppUnits(aClientX),
mozilla::CSSPixel::ToAppUnits(aClientY));
point -= frame->GetOffsetTo(rootFrame);
switch (frame->GetCursor(point).mCursor) {
case StyleCursorKind::Pointer:
case StyleCursorKind::Cell:
case StyleCursorKind::Crosshair:
case StyleCursorKind::Text:
case StyleCursorKind::VerticalText:
case StyleCursorKind::Move:
case StyleCursorKind::Grab:
case StyleCursorKind::Grabbing:
case StyleCursorKind::EResize:
case StyleCursorKind::NResize:
case StyleCursorKind::NeResize:
case StyleCursorKind::NwResize:
case StyleCursorKind::SResize:
case StyleCursorKind::SeResize:
case StyleCursorKind::SwResize:
case StyleCursorKind::WResize:
case StyleCursorKind::EwResize:
case StyleCursorKind::NsResize:
case StyleCursorKind::NeswResize:
case StyleCursorKind::NwseResize:
case StyleCursorKind::ColResize:
case StyleCursorKind::RowResize:
case StyleCursorKind::AllScroll:
*aResult = true;
break;
default:
break;
}
return NS_OK;
}
} // namespace zen