CSSLexer.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef CSSLexer_h___
  6. #define CSSLexer_h___
  7. #include "mozilla/UniquePtr.h"
  8. #include "nsCSSScanner.h"
  9. #include "mozilla/dom/CSSLexerBinding.h"
  10. #include "mozilla/dom/NonRefcountedDOMObject.h"
  11. namespace mozilla {
  12. namespace dom {
  13. class CSSLexer : public NonRefcountedDOMObject
  14. {
  15. public:
  16. explicit CSSLexer(const nsAString&);
  17. ~CSSLexer();
  18. bool WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto,
  19. JS::MutableHandle<JSObject*> aReflector);
  20. uint32_t LineNumber();
  21. uint32_t ColumnNumber();
  22. void PerformEOFFixup(const nsAString& aInputString, bool aPreserveBackslash,
  23. nsAString& aResult);
  24. void NextToken(Nullable<CSSToken>& aResult);
  25. private:
  26. nsString mInput;
  27. nsCSSScanner mScanner;
  28. };
  29. } // namespace dom
  30. } // namespace mozilla
  31. #endif /* CSSLexer_h___ */