Open Bug 1515709 Opened 5 years ago Updated 2 years ago

nsINode::GetOwnerGlobalForBindings has a bogus-looking cast

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

enhancement

Tracking

()

Tracking Status
firefox66 --- affected

People

(Reporter: bzbarsky, Unassigned)

Details

It's doing:

  auto* window = static_cast<nsGlobalWindowInner*>(
      OwnerDoc()->GetScriptHandlingObject(dummy));

In theory, GetScriptHandlingObject() could return a non-window global.  In practice, the only things that are nsIScriptGlobalObject are inner and outer windows, and GetScriptHandlingObject can't return an outer window, so it kinda works out.

It would be good to make this saner, though.  Maybe GetScriptHandlingObject should just return an inner window directly?
Priority: -- → P3
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.