This source file includes following definitions.
- resetZoomAndPan
- isKnownAttribute
- addSupportedAttributes
- parseZoomAndPanInternal
- parseZoomAndPan
- parseZoomAndPan
- setZoomAndPan
#include "config.h"
#include "core/svg/SVGZoomAndPan.h"
#include "bindings/v8/ExceptionMessages.h"
#include "bindings/v8/ExceptionState.h"
#include "core/dom/ExceptionCode.h"
#include "core/svg/SVGParserUtilities.h"
namespace WebCore {
SVGZoomAndPan::SVGZoomAndPan()
: m_zoomAndPan(SVGZoomAndPanMagnify)
{
}
void SVGZoomAndPan::resetZoomAndPan()
{
m_zoomAndPan = SVGZoomAndPanMagnify;
}
bool SVGZoomAndPan::isKnownAttribute(const QualifiedName& attrName)
{
return attrName == SVGNames::zoomAndPanAttr;
}
void SVGZoomAndPan::addSupportedAttributes(HashSet<QualifiedName>& supportedAttributes)
{
supportedAttributes.add(SVGNames::zoomAndPanAttr);
}
static const LChar disable[] = {'d', 'i', 's', 'a', 'b', 'l', 'e'};
static const LChar magnify[] = {'m', 'a', 'g', 'n', 'i', 'f', 'y'};
template<typename CharType>
static bool parseZoomAndPanInternal(const CharType*& start, const CharType* end, SVGZoomAndPanType& zoomAndPan)
{
if (skipString(start, end, disable, WTF_ARRAY_LENGTH(disable))) {
zoomAndPan = SVGZoomAndPanDisable;
return true;
}
if (skipString(start, end, magnify, WTF_ARRAY_LENGTH(magnify))) {
zoomAndPan = SVGZoomAndPanMagnify;
return true;
}
return false;
}
bool SVGZoomAndPan::parseZoomAndPan(const LChar*& start, const LChar* end)
{
return parseZoomAndPanInternal(start, end, m_zoomAndPan);
}
bool SVGZoomAndPan::parseZoomAndPan(const UChar*& start, const UChar* end)
{
return parseZoomAndPanInternal(start, end, m_zoomAndPan);
}
void SVGZoomAndPan::setZoomAndPan(SVGViewSpec&, unsigned short, ExceptionState& exceptionState)
{
exceptionState.throwDOMException(NoModificationAllowedError, ExceptionMessages::readOnly());
}
}