Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: Source/core/svg/SVGFontFaceElement.cpp

Issue 176853009: Fix crash in SVGFontFaceElement::associatedFontElement crash when removing SVGFontFaceElement. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed patch conflict Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/svg/RenderSVGText.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2008 Apple Inc. All rights reserved. 4 * Copyright (C) 2008 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 10 matching lines...) Expand all
21 21
22 #include "config.h" 22 #include "config.h"
23 23
24 #if ENABLE(SVG_FONTS) 24 #if ENABLE(SVG_FONTS)
25 #include "core/svg/SVGFontFaceElement.h" 25 #include "core/svg/SVGFontFaceElement.h"
26 26
27 #include <math.h> 27 #include <math.h>
28 #include "CSSPropertyNames.h" 28 #include "CSSPropertyNames.h"
29 #include "CSSValueKeywords.h" 29 #include "CSSValueKeywords.h"
30 #include "core/css/CSSFontFaceSrcValue.h" 30 #include "core/css/CSSFontFaceSrcValue.h"
31 #include "core/css/CSSFontSelector.h"
31 #include "core/css/CSSStyleSheet.h" 32 #include "core/css/CSSStyleSheet.h"
32 #include "core/css/CSSValueList.h" 33 #include "core/css/CSSValueList.h"
33 #include "core/css/StylePropertySet.h" 34 #include "core/css/StylePropertySet.h"
34 #include "core/css/StyleRule.h" 35 #include "core/css/StyleRule.h"
35 #include "core/dom/Attribute.h" 36 #include "core/dom/Attribute.h"
36 #include "core/dom/Document.h" 37 #include "core/dom/Document.h"
38 #include "core/dom/StyleEngine.h"
37 #include "core/svg/SVGDocumentExtensions.h" 39 #include "core/svg/SVGDocumentExtensions.h"
38 #include "core/svg/SVGFontElement.h" 40 #include "core/svg/SVGFontElement.h"
39 #include "core/svg/SVGFontFaceSrcElement.h" 41 #include "core/svg/SVGFontFaceSrcElement.h"
40 #include "core/svg/SVGGlyphElement.h" 42 #include "core/svg/SVGGlyphElement.h"
41 #include "platform/fonts/Font.h" 43 #include "platform/fonts/Font.h"
42 44
43 namespace WebCore { 45 namespace WebCore {
44 46
45 using namespace SVGNames; 47 using namespace SVGNames;
46 48
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 return InsertionDone; 328 return InsertionDone;
327 } 329 }
328 330
329 void SVGFontFaceElement::removedFrom(ContainerNode* rootParent) 331 void SVGFontFaceElement::removedFrom(ContainerNode* rootParent)
330 { 332 {
331 SVGElement::removedFrom(rootParent); 333 SVGElement::removedFrom(rootParent);
332 334
333 if (rootParent->inDocument()) { 335 if (rootParent->inDocument()) {
334 m_fontElement = 0; 336 m_fontElement = 0;
335 document().accessSVGExtensions().unregisterSVGFontFaceElement(this); 337 document().accessSVGExtensions().unregisterSVGFontFaceElement(this);
338 document().styleEngine()->fontSelector()->fontFaceCache()->remove(m_font FaceRule.get());
336 m_fontFaceRule->mutableProperties()->clear(); 339 m_fontFaceRule->mutableProperties()->clear();
337 340
338 document().styleResolverChanged(RecalcStyleDeferred); 341 document().styleResolverChanged(RecalcStyleDeferred);
339 } else 342 } else
340 ASSERT(!m_fontElement); 343 ASSERT(!m_fontElement);
341 } 344 }
342 345
343 void SVGFontFaceElement::childrenChanged(bool changedByParser, Node* beforeChang e, Node* afterChange, int childCountDelta) 346 void SVGFontFaceElement::childrenChanged(bool changedByParser, Node* beforeChang e, Node* afterChange, int childCountDelta)
344 { 347 {
345 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil dCountDelta); 348 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil dCountDelta);
346 rebuildFontFace(); 349 rebuildFontFace();
347 } 350 }
348 351
349 } // namespace WebCore 352 } // namespace WebCore
350 353
351 #endif // ENABLE(SVG_FONTS) 354 #endif // ENABLE(SVG_FONTS)
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGText.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698