tor-browser

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

SVGDataParser.cpp (924B)


      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 #include "SVGDataParser.h"
      8 
      9 #include "SVGContentUtils.h"
     10 #include "nsContentUtils.h"
     11 
     12 namespace mozilla {
     13 
     14 SVGDataParser::SVGDataParser(const nsAString& aValue) {
     15  aValue.BeginReading(mIter);
     16  aValue.EndReading(mEnd);
     17 }
     18 
     19 bool SVGDataParser::SkipCommaWsp() {
     20  if (!SkipWsp()) {
     21    // end of string
     22    return false;
     23  }
     24  if (*mIter != ',') {
     25    return true;
     26  }
     27  ++mIter;
     28  return SkipWsp();
     29 }
     30 
     31 bool SVGDataParser::SkipWsp() {
     32  while (mIter != mEnd) {
     33    if (!nsContentUtils::IsHTMLWhitespace(*mIter)) {
     34      return true;
     35    }
     36    ++mIter;
     37  }
     38  return false;
     39 }
     40 
     41 }  // namespace mozilla