author Razvan Caliman <>
Fri, 03 May 2019 13:01:27 +0000
changeset 531287 835c16acd375943236bcac8d6d2ac6ff0925725b
parent 525768 7601da9b8556eeb8b0353d5d5b85fe35f1cd9ce5
permissions -rw-r--r--
Bug 1093953 - (Part 1) Make CSS warnings expandable to show affected DOM elements. r=Honza This patch builds on [Bug 1537876]( which associates CSS selectors with error messages where applicable. This patch introduces a new React component, `CSSWarning`, for messages of type CSS. It forks the`PageError` component which was shared for `LOG` messages of type `JAVASCRIPT` and type `CSS`. The `CSSWarning` component is expandable when the message has an associated CSS selector. When expanded, it runs a `document.querySelectorAll()` command to list all elements matching the selector. Clicking on any of the elements in the result jumps to the Inspector and select the corresponding node in the markup view. Not all errors have associated CSS selectors. Not all selectors match elements. The errors/warnings are a result of the CSS Parser; there is no guarantee that the CSS rule is used anywhere on the document. The query may return an empty `NodeList`. Differential Revision:

# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at