OLD | NEW |
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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 return InsertionDone; | 328 return InsertionDone; |
329 } | 329 } |
330 | 330 |
331 void SVGFontFaceElement::removedFrom(ContainerNode* rootParent) | 331 void SVGFontFaceElement::removedFrom(ContainerNode* rootParent) |
332 { | 332 { |
333 SVGElement::removedFrom(rootParent); | 333 SVGElement::removedFrom(rootParent); |
334 | 334 |
335 if (rootParent->inDocument()) { | 335 if (rootParent->inDocument()) { |
336 m_fontElement = 0; | 336 m_fontElement = 0; |
337 document().accessSVGExtensions().unregisterSVGFontFaceElement(this); | 337 document().accessSVGExtensions().unregisterSVGFontFaceElement(this); |
338 document().styleEngine()->fontSelector()->fontFaceCache()->remove(m_font
FaceRule.get()); | 338 // FIXME: HTMLTemplateElement's document or imported document can be ac
tive? |
| 339 // If so, we also need to check whether fontSelector() is nullptr or not
. |
| 340 // Otherwise, we will use just document().isActive() here. |
| 341 if (document().isActive() && document().styleEngine()->fontSelector()) |
| 342 document().styleEngine()->fontSelector()->fontFaceCache()->remove(m_
fontFaceRule.get()); |
339 m_fontFaceRule->mutableProperties().clear(); | 343 m_fontFaceRule->mutableProperties().clear(); |
340 | 344 |
341 document().styleResolverChanged(RecalcStyleDeferred); | 345 document().styleResolverChanged(RecalcStyleDeferred); |
342 } else | 346 } else |
343 ASSERT(!m_fontElement); | 347 ASSERT(!m_fontElement); |
344 } | 348 } |
345 | 349 |
346 void SVGFontFaceElement::childrenChanged(bool changedByParser, Node* beforeChang
e, Node* afterChange, int childCountDelta) | 350 void SVGFontFaceElement::childrenChanged(bool changedByParser, Node* beforeChang
e, Node* afterChange, int childCountDelta) |
347 { | 351 { |
348 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil
dCountDelta); | 352 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil
dCountDelta); |
349 rebuildFontFace(); | 353 rebuildFontFace(); |
350 } | 354 } |
351 | 355 |
352 } // namespace WebCore | 356 } // namespace WebCore |
353 | 357 |
354 #endif // ENABLE(SVG_FONTS) | 358 #endif // ENABLE(SVG_FONTS) |
OLD | NEW |