Loading problem…
Implement a DOM traversal utility that searches a given UI subtree and returns all elements that match a specified set of inline CSS styles.
Searching the DOM dynamically by styling is a common requirement in rich text editors, rendering-engines, and layout analysis tools. This problem tests your ability to navigate the DOM tree while handling CSS property normalization and strict matching criteria.
expectedStyles is an object mapping property names to string values (e.g., { color: 'red' }).style object contains all requested properties with identical values.background-color) and camelCase (e.g., backgroundColor) keys in the input object.root element and all its descendants.