Skip to content
Permalink
Browse files
Reviewed by Sam Weinig.
        https://bugs.webkit.org/show_bug.cgi?id=20324
        A change in SVG Glyph wont show up

        Invalidate the glyph cache when the d attribute is set.

        Test: svg/custom/glyph-setting-d-attribute.svg



Canonical link: https://commits.webkit.org/28311@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@35905 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Rob Buis committed Aug 24, 2008
1 parent aec74ca commit b90bf056ea7b21c9ac721fff55f68efb2b453350
Showing 8 changed files with 78 additions and 6 deletions.
@@ -1,3 +1,16 @@
2008-08-24 Rob Buis <buis@kde.org>

Reviewed by Sam Weinig.

Test for:
https://bugs.webkit.org/show_bug.cgi?id=20324
A change in SVG Glyph wont show up

* svg/custom/glyph-setting-d-attribute-expected.checksum: Added.
* svg/custom/glyph-setting-d-attribute-expected.png: Added.
* svg/custom/glyph-setting-d-attribute-expected.txt: Added.
* svg/custom/glyph-setting-d-attribute.svg: Added.

2008-08-23 Dan Bernstein <mitz@apple.com>

Reviewed by Dave Hyatt.
@@ -0,0 +1 @@
92b550a545a2c8bdfe035871c235ed13
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,8 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderSVGRoot {svg} at (10,40) size 75x150
RenderSVGHiddenContainer {defs} at (0,0) size 0x0
RenderSVGText {text} at (10,160) size 75x150 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,-120) size 75x150
chunk 1 text run 1 at (10.00,160.00) startOffset 0 endOffset 1 width 75.00: "a"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -1,3 +1,21 @@
2008-08-24 Rob Buis <buis@kde.org>

Reviewed by Sam Weinig.

https://bugs.webkit.org/show_bug.cgi?id=20324
A change in SVG Glyph wont show up

Invalidate the glyph cache when the d attribute is set.

Test: svg/custom/glyph-setting-d-attribute.svg

* svg/SVGGlyphElement.cpp:
(WebCore::SVGGlyphElement::invalidateGlyphCache):
(WebCore::SVGGlyphElement::parseMappedAttribute):
(WebCore::SVGGlyphElement::insertedIntoDocument):
(WebCore::SVGGlyphElement::removedFromDocument):
* svg/SVGGlyphElement.h:

2008-08-24 Dan Bernstein <mitz@apple.com>

Reviewed by Sam Weinig.
@@ -1,6 +1,7 @@
/*
Copyright (C) 2007 Eric Seidel <eric@webkit.org>
Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
Copyright (C) 2008 Rob Buis <buis@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -44,23 +45,32 @@ SVGGlyphElement::~SVGGlyphElement()
{
}

void SVGGlyphElement::insertedIntoDocument()
void SVGGlyphElement::invalidateGlyphCache()
{
Node* fontNode = parentNode();
if (fontNode && fontNode->hasTagName(fontTag)) {
if (SVGFontElement* element = static_cast<SVGFontElement*>(fontNode))
element->invalidateGlyphCache();
}
}

void SVGGlyphElement::parseMappedAttribute(MappedAttribute* attr)
{
if (attr->name() == SVGNames::dAttr)
invalidateGlyphCache();
else
SVGStyledElement::parseMappedAttribute(attr);
}

void SVGGlyphElement::insertedIntoDocument()
{
invalidateGlyphCache();
SVGStyledElement::insertedIntoDocument();
}

void SVGGlyphElement::removedFromDocument()
{
Node* fontNode = parentNode();
if (fontNode && fontNode->hasTagName(fontTag)) {
if (SVGFontElement* element = static_cast<SVGFontElement*>(fontNode))
element->invalidateGlyphCache();
}
invalidateGlyphCache();
SVGStyledElement::removedFromDocument();
}

@@ -1,6 +1,7 @@
/*
Copyright (C) 2007 Eric Seidel <eric@webkit.org>
Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
Copyright (C) 2008 Rob Buis <buis@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -105,6 +106,8 @@ namespace WebCore {
SVGGlyphElement(const QualifiedName&, Document*);
virtual ~SVGGlyphElement();

virtual void parseMappedAttribute(MappedAttribute*);

virtual void insertedIntoDocument();
virtual void removedFromDocument();

@@ -118,6 +121,8 @@ namespace WebCore {

// Helper function shared between SVGGlyphElement & SVGMissingGlyphElement
static SVGGlyphIdentifier buildGenericGlyphIdentifier(const SVGElement*);
private:
void invalidateGlyphCache();
};

} // namespace WebCore

0 comments on commit b90bf05

Please sign in to comment.