/* 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 http://mozilla.org/MPL/2.0/. */ #ifndef mozilla_dom_InspectorUtils_h #define mozilla_dom_InspectorUtils_h #include "Units.h" #include "mozilla/RefPtr.h" #include "mozilla/dom/InspectorUtilsBindingFwd.h" #include "nsTArray.h" class nsAtom; class nsINode; class nsINodeList; class nsRange; namespace mozilla { class ErrorResult; class StyleSheet; namespace css { class Rule; } // namespace css namespace dom { class BrowsingContext; enum class InspectorPropertyType : uint8_t; class CharacterData; class Document; class Element; class GlobalObject; class InspectorFontFace; class OwningCSSRuleOrInspectorDeclaration; } // namespace dom } // namespace mozilla namespace mozilla::dom { /** * A collection of utility methods for use by devtools. */ class InspectorUtils { public: static void GetAllStyleSheets(GlobalObject& aGlobal, Document& aDocument, bool aDocumentOnly, nsTArray>& aResult); static void GetMatchingCSSRules( GlobalObject& aGlobal, Element& aElement, const nsAString& aPseudo, bool aIncludeVisitedStyle, bool aWithStartingStyle, nsTArray& aResult); /** * Get the line number of a rule. * * @param aRule The rule. * @return The rule's line number. Line numbers are 1-based. */ static uint32_t GetRuleLine(GlobalObject& aGlobal, css::Rule& aRule); /** * Get the column number of a rule. * * @param aRule The rule. * @return The rule's column number. Column numbers are 1-based. */ static uint32_t GetRuleColumn(GlobalObject& aGlobal, css::Rule& aRule); /** * Like getRuleLine, but if the rule is in a