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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 RefPtr<CSSValue> src = m_fontFaceRule->properties()->getPropertyCSSValue
(CSSPropertySrc); | 309 RefPtr<CSSValue> src = m_fontFaceRule->properties()->getPropertyCSSValue
(CSSPropertySrc); |
310 CSSValueList* srcList = toCSSValueList(src.get()); | 310 CSSValueList* srcList = toCSSValueList(src.get()); |
311 | 311 |
312 unsigned srcLength = srcList ? srcList->length() : 0; | 312 unsigned srcLength = srcList ? srcList->length() : 0; |
313 for (unsigned i = 0; i < srcLength; i++) { | 313 for (unsigned i = 0; i < srcLength; i++) { |
314 if (CSSFontFaceSrcValue* item = static_cast<CSSFontFaceSrcValue*>(sr
cList->itemWithoutBoundsCheck(i))) | 314 if (CSSFontFaceSrcValue* item = static_cast<CSSFontFaceSrcValue*>(sr
cList->itemWithoutBoundsCheck(i))) |
315 item->setSVGFontFaceElement(this); | 315 item->setSVGFontFaceElement(this); |
316 } | 316 } |
317 } | 317 } |
318 | 318 |
319 document()->styleResolverChanged(RecalcStyleDeferred); | 319 document().styleResolverChanged(RecalcStyleDeferred); |
320 } | 320 } |
321 | 321 |
322 Node::InsertionNotificationRequest SVGFontFaceElement::insertedInto(ContainerNod
e* rootParent) | 322 Node::InsertionNotificationRequest SVGFontFaceElement::insertedInto(ContainerNod
e* rootParent) |
323 { | 323 { |
324 SVGElement::insertedInto(rootParent); | 324 SVGElement::insertedInto(rootParent); |
325 if (!rootParent->inDocument()) { | 325 if (!rootParent->inDocument()) { |
326 ASSERT(!m_fontElement); | 326 ASSERT(!m_fontElement); |
327 return InsertionDone; | 327 return InsertionDone; |
328 } | 328 } |
329 document()->accessSVGExtensions()->registerSVGFontFaceElement(this); | 329 document().accessSVGExtensions()->registerSVGFontFaceElement(this); |
330 | 330 |
331 rebuildFontFace(); | 331 rebuildFontFace(); |
332 return InsertionDone; | 332 return InsertionDone; |
333 } | 333 } |
334 | 334 |
335 void SVGFontFaceElement::removedFrom(ContainerNode* rootParent) | 335 void SVGFontFaceElement::removedFrom(ContainerNode* rootParent) |
336 { | 336 { |
337 SVGElement::removedFrom(rootParent); | 337 SVGElement::removedFrom(rootParent); |
338 | 338 |
339 if (rootParent->inDocument()) { | 339 if (rootParent->inDocument()) { |
340 m_fontElement = 0; | 340 m_fontElement = 0; |
341 document()->accessSVGExtensions()->unregisterSVGFontFaceElement(this); | 341 document().accessSVGExtensions()->unregisterSVGFontFaceElement(this); |
342 m_fontFaceRule->mutableProperties()->clear(); | 342 m_fontFaceRule->mutableProperties()->clear(); |
343 | 343 |
344 document()->styleResolverChanged(RecalcStyleDeferred); | 344 document().styleResolverChanged(RecalcStyleDeferred); |
345 } else | 345 } else |
346 ASSERT(!m_fontElement); | 346 ASSERT(!m_fontElement); |
347 } | 347 } |
348 | 348 |
349 void SVGFontFaceElement::childrenChanged(bool changedByParser, Node* beforeChang
e, Node* afterChange, int childCountDelta) | 349 void SVGFontFaceElement::childrenChanged(bool changedByParser, Node* beforeChang
e, Node* afterChange, int childCountDelta) |
350 { | 350 { |
351 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil
dCountDelta); | 351 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil
dCountDelta); |
352 rebuildFontFace(); | 352 rebuildFontFace(); |
353 } | 353 } |
354 | 354 |
355 } // namespace WebCore | 355 } // namespace WebCore |
356 | 356 |
357 #endif // ENABLE(SVG_FONTS) | 357 #endif // ENABLE(SVG_FONTS) |
OLD | NEW |