Closed Bug 1556135 Opened 5 years ago Closed 5 years ago

getClosestBackgroundImage inspector actor utility throws an exception when working with a node from Shadow DOM.

Categories

(DevTools :: Inspector, defect, P1)

defect

Tracking

(firefox-esr60 unaffected, firefox67 unaffected, firefox68 fixed, firefox69 fixed)

RESOLVED FIXED
Firefox 69
Tracking Status
firefox-esr60 --- unaffected
firefox67 --- unaffected
firefox68 --- fixed
firefox69 --- fixed

People

(Reporter: yzen, Assigned: yzen)

References

Details

Attachments

(1 file)

When a node is passed to the function (happens in a11y panel where the platform a11y stitches together the tree and includes the shadow DOM) that belongs to a shadow DOM, there will be a case when we iterate to the shadow root that will have an ownerDocument (e.g. host's owner document) but no parentNode (null) and thus throwing a type error when checking current.ownerDocument when current is null.

This failure is seen when we try to run an audit in a11y panel on nytimes.com and it fails.

Summary: getClosestBackgroundImage inspector actor utility can throws an exception when working with a node from Shadow DOM. → getClosestBackgroundImage inspector actor utility throws an exception when working with a node from Shadow DOM.
Pushed by yura.zenevich@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/096dd8162ff9
only check if the current node is null in getClosestBackgroundImage. r=gl

Comment on attachment 9069156 [details]
Bug 1556135 - only check if the current node is null in getClosestBackgroundImage. r=gl

Beta/Release Uplift Approval Request

  • User impact if declined: Accessibility panel full page colour contrast (ships in 68) will fail on any page that contains a video because we now include picture-in-picture controls that use shadow DOM for video elements.
  • Is this code covered by automated tests?: No (not explicitly, the tests that already exist would catch possible regression).
  • Has the fix been verified in Nightly?: No (did not land on Nightly yet)
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Not risky because the original bug happened because of a check that was incorrectly specified and was also more strict (did not consider shadow DOM).
  • String changes made/needed: None
Attachment #9069156 - Flags: approval-mozilla-beta?
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 69

(In reply to Yura Zenevich [:yzen] from comment #4)

  • User impact if declined: Accessibility panel full page colour contrast (ships in 68) will fail on any page that contains a video because we now include picture-in-picture controls that use shadow DOM for video elements.

Is this also an issue on beta where PiP is disabled?

Flags: needinfo?(yzenevich)

If PiP is disabled on beta it will not happen (this is more of an example of obvious failure). However, if there is a chance that Firefox front end or any website uses shadow DOM, and we try to calculate contrast inside, it will fail.

Flags: needinfo?(yzenevich)

Comment on attachment 9069156 [details]
Bug 1556135 - only check if the current node is null in getClosestBackgroundImage. r=gl

small devtools fix, approved for 68.0b8

Attachment #9069156 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: