Commit 79d31dbb authored by jschuh@chromium.org's avatar jschuh@chromium.org

2011-01-28 Justin Schuh <jschuh@chromium.org>

        Reviewed by Eric Seidel.

        We should hold RefPtrs to SVG font faces
        https://bugs.webkit.org/show_bug.cgi?id=53270

        * svg/custom/use-multiple-on-nested-disallowed-font-expected.txt: Added.
        * svg/custom/use-multiple-on-nested-disallowed-font.html: Added.
2011-01-28  Justin Schuh  <jschuh@chromium.org>

        Reviewed by Eric Seidel.

        We should hold RefPtrs to SVG font faces
        https://bugs.webkit.org/show_bug.cgi?id=53270

        Test: svg/custom/use-multiple-on-nested-disallowed-font.html

        * css/CSSFontFaceSource.cpp:
        (WebCore::CSSFontFaceSource::getFontData):
        * css/CSSFontFaceSource.h:
        * svg/SVGFontFaceElement.cpp:
        (WebCore::SVGFontFaceElement::associatedFontElement):
        * svg/SVGFontFaceElement.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76990 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 157f0282
2011-01-28 Justin Schuh <jschuh@chromium.org>
Reviewed by Eric Seidel.
We should hold RefPtrs to SVG font faces
https://bugs.webkit.org/show_bug.cgi?id=53270
* svg/custom/use-multiple-on-nested-disallowed-font-expected.txt: Added.
* svg/custom/use-multiple-on-nested-disallowed-font.html: Added.
2011-01-28 Zhenyao Mo <zmo@google.com>
Reviewed by Kenneth Russell.
<svg height="1" width="1">
<defs>
<use id="B">
<linearGradient>
<animateTransform attributeName="z"/>
<text font-family="x">
<textPath>
<font>
<font-face font-family="x">
</font>
</textPath>x
</text>
</animateTransform>
</linearGradient>
</use>
</defs>
<use xlink:href="#B"></use>
<use xlink:href="#B"></use>
</svg>
<script>
if (window.layoutTestController) {
layoutTestController.waitUntilDone();
layoutTestController.dumpAsText();
}
setTimeout(function() {
document.body.innerHTML += "PASS: This file should not crash.";
if (window.layoutTestController)
layoutTestController.notifyDone();
}, 0);
</script>
2011-01-28 Justin Schuh <jschuh@chromium.org>
Reviewed by Eric Seidel.
We should hold RefPtrs to SVG font faces
https://bugs.webkit.org/show_bug.cgi?id=53270
Test: svg/custom/use-multiple-on-nested-disallowed-font.html
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::getFontData):
* css/CSSFontFaceSource.h:
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::associatedFontElement):
* svg/SVGFontFaceElement.h:
2011-01-28 Zhenyao Mo <zmo@google.com>
Reviewed by Kenneth Russell.
......@@ -168,7 +168,7 @@ SimpleFontData* CSSFontFaceSource::getFontData(const FontDescription& fontDescri
#if ENABLE(SVG_FONTS)
// In-Document SVG Fonts
if (m_svgFontFaceElement)
fontData.set(new SimpleFontData(adoptPtr(new SVGFontData(m_svgFontFaceElement)), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic));
fontData.set(new SimpleFontData(adoptPtr(new SVGFontData(m_svgFontFaceElement.get())), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic));
#endif
}
} else {
......@@ -190,6 +190,16 @@ SimpleFontData* CSSFontFaceSource::getFontData(const FontDescription& fontDescri
}
#if ENABLE(SVG_FONTS)
SVGFontFaceElement* CSSFontFaceSource::svgFontFaceElement() const
{
return m_svgFontFaceElement.get();
}
void CSSFontFaceSource::setSVGFontFaceElement(PassRefPtr<SVGFontFaceElement> element)
{
m_svgFontFaceElement = element;
}
bool CSSFontFaceSource::isSVGFontFaceSource() const
{
return m_svgFontFaceElement || (m_font && m_font->isSVGFont());
......
......@@ -63,8 +63,8 @@ public:
void pruneTable();
#if ENABLE(SVG_FONTS)
SVGFontFaceElement* svgFontFaceElement() const { return m_svgFontFaceElement; }
void setSVGFontFaceElement(SVGFontFaceElement* element) { m_svgFontFaceElement = element; }
SVGFontFaceElement* svgFontFaceElement() const;
void setSVGFontFaceElement(PassRefPtr<SVGFontFaceElement>);
bool isSVGFontFaceSource() const;
#endif
......@@ -75,7 +75,7 @@ private:
HashMap<unsigned, SimpleFontData*> m_fontDataTable; // The hash key is composed of size synthetic styles.
#if ENABLE(SVG_FONTS)
SVGFontFaceElement* m_svgFontFaceElement;
RefPtr<SVGFontFaceElement> m_svgFontFaceElement;
RefPtr<SVGFontElement> m_externalSVGFontElement;
#endif
};
......
......@@ -261,6 +261,11 @@ String SVGFontFaceElement::fontFamily() const
return m_styleDeclaration->getPropertyValue(CSSPropertyFontFamily);
}
SVGFontElement* SVGFontFaceElement::associatedFontElement() const
{
return m_fontElement.get();
}
void SVGFontFaceElement::rebuildFontFace()
{
if (!inDocument())
......
......@@ -47,7 +47,7 @@ public:
int descent() const;
String fontFamily() const;
SVGFontElement* associatedFontElement() const { return m_fontElement; }
SVGFontElement* associatedFontElement() const;
void rebuildFontFace();
void removeFromMappedElementSheet();
......@@ -63,7 +63,7 @@ private:
RefPtr<CSSFontFaceRule> m_fontFaceRule;
RefPtr<CSSMutableStyleDeclaration> m_styleDeclaration;
SVGFontElement* m_fontElement;
RefPtr<SVGFontElement> m_fontElement;
};
} // namespace WebCore
......
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