Affecting getComputedStyle() no longer returns null when style can’t be retrieved

Published: | Categories: CSS, DOM

Description

Previously, the window.getComputedStyle method was returning null or throwing an exception when the style of the given element cannot be retrieved. Such edge cases can be seen with a hidden <iframe>, for instance. On Firefox 62 and later, to better align with the CSSOM spec and other browsers’ behaviour, the method will return a CSSStyleDeclaration object which has 0 for the length property and an empty string for every declaration.

Update: This change breaks Zendesk Web Widget where dropdown menus are wrongly positioned.

References