/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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 "mozilla/dom/InspectorUtilsBinding.h" #include "mozilla/UniquePtr.h" #include "nsLayoutUtils.h" class nsAtom; class nsINode; class nsINodeList; class nsRange; namespace mozilla { class StyleSheet; namespace css { class Rule; } // namespace css namespace dom { class CharacterData; class Document; class Element; class InspectorFontFace; } // namespace dom } // namespace mozilla namespace mozilla::dom { class CSSStyleRule; /** * 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 GetCSSStyleRules(GlobalObject& aGlobal, Element& aElement, const nsAString& aPseudo, bool aIncludeVisitedStyle, 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