2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
2006-06-16 21:20:25 +04:00
|
|
|
|
2018-12-21 23:19:15 +03:00
|
|
|
#include "SVGDataParser.h"
|
2018-03-18 10:14:32 +03:00
|
|
|
#include "nsContentUtils.h"
|
2013-10-29 21:15:39 +04:00
|
|
|
#include "SVGContentUtils.h"
|
2006-06-16 21:20:25 +04:00
|
|
|
|
2018-12-21 23:19:15 +03:00
|
|
|
namespace mozilla {
|
|
|
|
|
2024-10-21 15:01:01 +03:00
|
|
|
SVGDataParser::SVGDataParser(const nsAString& aValue) {
|
|
|
|
aValue.BeginReading(mIter);
|
|
|
|
aValue.EndReading(mEnd);
|
|
|
|
}
|
2006-06-16 21:20:25 +04:00
|
|
|
|
2018-12-21 23:19:15 +03:00
|
|
|
bool SVGDataParser::SkipCommaWsp() {
|
2013-10-29 21:15:39 +04:00
|
|
|
if (!SkipWsp()) {
|
|
|
|
// end of string
|
|
|
|
return false;
|
2006-06-16 21:20:25 +04:00
|
|
|
}
|
2013-10-29 21:15:39 +04:00
|
|
|
if (*mIter != ',') {
|
|
|
|
return true;
|
2006-06-16 21:20:25 +04:00
|
|
|
}
|
2013-10-29 21:15:39 +04:00
|
|
|
++mIter;
|
|
|
|
return SkipWsp();
|
2006-06-16 21:20:25 +04:00
|
|
|
}
|
|
|
|
|
2018-12-21 23:19:15 +03:00
|
|
|
bool SVGDataParser::SkipWsp() {
|
2013-10-29 21:15:39 +04:00
|
|
|
while (mIter != mEnd) {
|
2018-03-18 10:14:32 +03:00
|
|
|
if (!nsContentUtils::IsHTMLWhitespace(*mIter)) {
|
2013-10-29 21:15:39 +04:00
|
|
|
return true;
|
2006-06-16 21:20:25 +04:00
|
|
|
}
|
2013-10-29 21:15:39 +04:00
|
|
|
++mIter;
|
2006-06-16 21:20:25 +04:00
|
|
|
}
|
2013-10-29 21:15:39 +04:00
|
|
|
return false;
|
2006-06-16 21:20:25 +04:00
|
|
|
}
|
2018-12-21 23:19:15 +03:00
|
|
|
|
|
|
|
} // namespace mozilla
|