Commit 86098880 authored by rob.buis@samsung.com's avatar rob.buis@samsung.com

Fix some SVGFonts compilation errors

Fix some SVGFonts compilation errors that are seen when turning off the compile time flag SVG_FONTS.

BUG=

Review URL: https://codereview.chromium.org/329143007

git-svn-id: svn://svn.chromium.org/blink/trunk@175985 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 20565b78
......@@ -67,9 +67,11 @@ void CSSFontFace::fontLoaded(RemoteFontFaceSource* source)
if (loadStatus() == FontFace::Loading) {
if (source->ensureFontData()) {
setLoadStatus(FontFace::Loaded);
#if ENABLE(SVG_FONTS)
Document* document = m_segmentedFontFace ? m_segmentedFontFace->fontSelector()->document() : 0;
if (document && source->isSVGFontFaceSource())
UseCounter::count(*document, UseCounter::SVGFontInCSS);
#endif
} else {
m_sources.removeFirst();
load();
......
......@@ -68,12 +68,14 @@ bool CustomElement::isValidName(const AtomicString& name, NameSet validNames)
DEFINE_STATIC_LOCAL(Vector<AtomicString>, reservedNames, ());
if (reservedNames.isEmpty()) {
reservedNames.append(MathMLNames::annotation_xmlTag.localName());
#if ENABLE(SVG_FONTS)
reservedNames.append(SVGNames::font_faceTag.localName());
reservedNames.append(SVGNames::font_face_srcTag.localName());
reservedNames.append(SVGNames::font_face_uriTag.localName());
reservedNames.append(SVGNames::font_face_formatTag.localName());
reservedNames.append(SVGNames::font_face_nameTag.localName());
reservedNames.append(SVGNames::missing_glyphTag.localName());
#endif
}
if (kNotFound == reservedNames.find(name))
......
......@@ -52,13 +52,17 @@ static HashSet<AtomicString>& clipperFilterMaskerTags()
s_tagList.add(SVGNames::aTag.localName());
s_tagList.add(SVGNames::circleTag.localName());
s_tagList.add(SVGNames::ellipseTag.localName());
#if ENABLE(SVG_FONTS)
s_tagList.add(SVGNames::glyphTag.localName());
#endif
s_tagList.add(SVGNames::gTag.localName());
s_tagList.add(SVGNames::imageTag.localName());
s_tagList.add(SVGNames::lineTag.localName());
s_tagList.add(SVGNames::markerTag.localName());
s_tagList.add(SVGNames::maskTag.localName());
#if ENABLE(SVG_FONTS)
s_tagList.add(SVGNames::missing_glyphTag.localName());
#endif
s_tagList.add(SVGNames::pathTag.localName());
s_tagList.add(SVGNames::polygonTag.localName());
s_tagList.add(SVGNames::polylineTag.localName());
......@@ -75,7 +79,9 @@ static HashSet<AtomicString>& clipperFilterMaskerTags()
// Not listed in the definitions are the text content elements, though filter/clipper/masker on tspan/text/.. is allowed.
// (Already mailed SVG WG, waiting for a solution)
#if ENABLE(SVG_FONTS)
s_tagList.add(SVGNames::altGlyphTag.localName());
#endif
s_tagList.add(SVGNames::textPathTag.localName());
s_tagList.add(SVGNames::tspanTag.localName());
......@@ -108,7 +114,9 @@ static HashSet<AtomicString>& fillAndStrokeTags()
{
DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ());
if (s_tagList.isEmpty()) {
#if ENABLE(SVG_FONTS)
s_tagList.add(SVGNames::altGlyphTag.localName());
#endif
s_tagList.add(SVGNames::circleTag.localName());
s_tagList.add(SVGNames::ellipseTag.localName());
s_tagList.add(SVGNames::lineTag.localName());
......
......@@ -45,6 +45,10 @@ public:
virtual GlyphData glyphDataForCharacter(const Font&, const TextRun&, WidthIterator&, UChar32 character, bool mirror, int currentCharacter, unsigned& advanceLength) OVERRIDE;
virtual void drawSVGGlyphs(GraphicsContext*, const TextRun&, const SimpleFontData*, const GlyphBuffer&, int from, int to, const FloatPoint&) const OVERRIDE;
virtual float floatWidthUsingSVGFont(const Font&, const TextRun&, int& charsConsumed, Glyph& glyphId) const OVERRIDE;
#else
virtual GlyphData glyphDataForCharacter(const Font&, const TextRun&, WidthIterator&, UChar32 character, bool mirror, int currentCharacter, unsigned& advanceLength) OVERRIDE { return 0; }
virtual void drawSVGGlyphs(GraphicsContext*, const TextRun&, const SimpleFontData*, const GlyphBuffer&, int from, int to, const FloatPoint&) const OVERRIDE { }
virtual float floatWidthUsingSVGFont(const Font&, const TextRun&, int& charsConsumed, Glyph& glyphId) const OVERRIDE { return 0; }
#endif
private:
......
......@@ -480,8 +480,10 @@ void SVGDocumentExtensions::trace(Visitor* visitor)
{
visitor->trace(m_document);
visitor->trace(m_timeContainers);
#if ENABLE(SVG_FONTS)
visitor->trace(m_svgFontFaceElements);
visitor->trace(m_pendingSVGFontFaceElementsForRemoval);
#endif
visitor->trace(m_elementDependencies);
visitor->trace(m_relativeLengthSVGRoots);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment