tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

InspectorCSSParser.h (1439B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef InspectorCSSParser_h___
      8 #define InspectorCSSParser_h___
      9 
     10 #include "mozilla/dom/InspectorUtilsBinding.h"
     11 #include "mozilla/dom/NonRefcountedDOMObject.h"
     12 
     13 namespace mozilla {
     14 
     15 class StyleParserState;
     16 
     17 namespace dom {
     18 
     19 class InspectorCSSParser final : public NonRefcountedDOMObject {
     20 public:
     21  explicit InspectorCSSParser(const nsACString&);
     22  // The WebIDL constructor.
     23  static UniquePtr<InspectorCSSParser> Constructor(const GlobalObject& aGlobal,
     24                                                   const nsACString& aText);
     25 
     26  ~InspectorCSSParser();
     27 
     28  bool WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto,
     29                  JS::MutableHandle<JSObject*> aReflector) {
     30    return InspectorCSSParser_Binding::Wrap(aCx, this, aGivenProto, aReflector);
     31  }
     32 
     33  uint32_t LineNumber() const;
     34  uint32_t ColumnNumber() const;
     35  void NextToken(Nullable<InspectorCSSToken>& aResult);
     36 
     37 private:
     38  const nsCString mInput;
     39  StyleParserState* mParserState;
     40  uint32_t mLineNumber = 0;
     41  uint32_t mColumnNumber = 0;
     42 };
     43 
     44 }  // namespace dom
     45 }  // namespace mozilla
     46 
     47 #endif /* InspectorCSSParser_h___ */