This source file includes following definitions.
- m_dy
- create
- hasValidGlyphElement
- parseAttributeInternal
- parseAttribute
- glyphRef
- setGlyphRef
- setX
- setY
- setDx
- setDy
#include "config.h"
#if ENABLE(SVG_FONTS)
#include "core/svg/SVGGlyphRefElement.h"
#include "XLinkNames.h"
#include "core/svg/SVGParserUtilities.h"
#include "wtf/text/AtomicString.h"
namespace WebCore {
inline SVGGlyphRefElement::SVGGlyphRefElement(Document& document)
: SVGElement(SVGNames::glyphRefTag, document)
, SVGURIReference(this)
, m_x(0)
, m_y(0)
, m_dx(0)
, m_dy(0)
{
ScriptWrappable::init(this);
}
PassRefPtr<SVGGlyphRefElement> SVGGlyphRefElement::create(Document& document)
{
return adoptRef(new SVGGlyphRefElement(document));
}
bool SVGGlyphRefElement::hasValidGlyphElement(AtomicString& glyphName) const
{
Element* element = targetElementFromIRIString(getAttribute(XLinkNames::hrefAttr), document(), &glyphName);
return isSVGGlyphElement(element);
}
template<typename CharType>
void SVGGlyphRefElement::parseAttributeInternal(const QualifiedName& name, const AtomicString& value)
{
const CharType* ptr = value.isEmpty() ? 0 : value.string().getCharacters<CharType>();
const CharType* end = ptr + value.length();
SVGParsingError parseError = NoError;
if (name == SVGNames::xAttr) {
parseNumber(ptr, end, m_x);
} else if (name == SVGNames::yAttr) {
parseNumber(ptr, end, m_y);
} else if (name == SVGNames::dxAttr) {
parseNumber(ptr, end, m_dx);
} else if (name == SVGNames::dyAttr) {
parseNumber(ptr, end, m_dy);
} else if (SVGURIReference::parseAttribute(name, value, parseError)) {
} else {
SVGElement::parseAttribute(name, value);
}
reportAttributeParsingError(parseError, name, value);
}
void SVGGlyphRefElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (value.isEmpty() || value.is8Bit())
parseAttributeInternal<LChar>(name, value);
else
parseAttributeInternal<UChar>(name, value);
}
const AtomicString& SVGGlyphRefElement::glyphRef() const
{
return fastGetAttribute(SVGNames::glyphRefAttr);
}
void SVGGlyphRefElement::setGlyphRef(const AtomicString&)
{
}
void SVGGlyphRefElement::setX(float x)
{
m_x = x;
}
void SVGGlyphRefElement::setY(float y)
{
m_y = y;
}
void SVGGlyphRefElement::setDx(float dx)
{
m_dx = dx;
}
void SVGGlyphRefElement::setDy(float dy)
{
m_dy = dy;
}
}
#endif