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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 RefPtrWillBeRawPtr<CSSValue> src = m_fontFaceRule->properties().getPrope
rtyCSSValue(CSSPropertySrc); | 297 RefPtrWillBeRawPtr<CSSValue> src = m_fontFaceRule->properties().getPrope
rtyCSSValue(CSSPropertySrc); |
298 CSSValueList* srcList = toCSSValueList(src.get()); | 298 CSSValueList* srcList = toCSSValueList(src.get()); |
299 | 299 |
300 unsigned srcLength = srcList ? srcList->length() : 0; | 300 unsigned srcLength = srcList ? srcList->length() : 0; |
301 for (unsigned i = 0; i < srcLength; i++) { | 301 for (unsigned i = 0; i < srcLength; i++) { |
302 if (CSSFontFaceSrcValue* item = toCSSFontFaceSrcValue(srcList->itemW
ithoutBoundsCheck(i))) | 302 if (CSSFontFaceSrcValue* item = toCSSFontFaceSrcValue(srcList->itemW
ithoutBoundsCheck(i))) |
303 item->setSVGFontFaceElement(this); | 303 item->setSVGFontFaceElement(this); |
304 } | 304 } |
305 } | 305 } |
306 | 306 |
307 document().styleResolverChanged(RecalcStyleDeferred); | 307 document().styleResolverChanged(); |
308 } | 308 } |
309 | 309 |
310 Node::InsertionNotificationRequest SVGFontFaceElement::insertedInto(ContainerNod
e* rootParent) | 310 Node::InsertionNotificationRequest SVGFontFaceElement::insertedInto(ContainerNod
e* rootParent) |
311 { | 311 { |
312 SVGElement::insertedInto(rootParent); | 312 SVGElement::insertedInto(rootParent); |
313 if (!rootParent->inDocument()) { | 313 if (!rootParent->inDocument()) { |
314 ASSERT(!m_fontElement); | 314 ASSERT(!m_fontElement); |
315 return InsertionDone; | 315 return InsertionDone; |
316 } | 316 } |
317 document().accessSVGExtensions().registerSVGFontFaceElement(this); | 317 document().accessSVGExtensions().registerSVGFontFaceElement(this); |
(...skipping 11 matching lines...) Expand all Loading... |
329 document().accessSVGExtensions().unregisterSVGFontFaceElement(this); | 329 document().accessSVGExtensions().unregisterSVGFontFaceElement(this); |
330 | 330 |
331 // FIXME: HTMLTemplateElement's document or imported document can be ac
tive? | 331 // FIXME: HTMLTemplateElement's document or imported document can be ac
tive? |
332 // If so, we also need to check whether fontSelector() is nullptr or not
. | 332 // If so, we also need to check whether fontSelector() is nullptr or not
. |
333 // Otherwise, we will use just document().isActive() here. | 333 // Otherwise, we will use just document().isActive() here. |
334 if (document().isActive() && document().styleEngine()->fontSelector()) { | 334 if (document().isActive() && document().styleEngine()->fontSelector()) { |
335 document().styleEngine()->fontSelector()->fontFaceCache()->remove(m_
fontFaceRule.get()); | 335 document().styleEngine()->fontSelector()->fontFaceCache()->remove(m_
fontFaceRule.get()); |
336 document().accessSVGExtensions().registerPendingSVGFontFaceElementsF
orRemoval(this); | 336 document().accessSVGExtensions().registerPendingSVGFontFaceElementsF
orRemoval(this); |
337 } | 337 } |
338 m_fontFaceRule->mutableProperties().clear(); | 338 m_fontFaceRule->mutableProperties().clear(); |
339 document().styleResolverChanged(RecalcStyleDeferred); | 339 document().styleResolverChanged(); |
340 } else | 340 } else |
341 ASSERT(!m_fontElement); | 341 ASSERT(!m_fontElement); |
342 } | 342 } |
343 | 343 |
344 void SVGFontFaceElement::childrenChanged(bool changedByParser, Node* beforeChang
e, Node* afterChange, int childCountDelta) | 344 void SVGFontFaceElement::childrenChanged(bool changedByParser, Node* beforeChang
e, Node* afterChange, int childCountDelta) |
345 { | 345 { |
346 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil
dCountDelta); | 346 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil
dCountDelta); |
347 rebuildFontFace(); | 347 rebuildFontFace(); |
348 } | 348 } |
349 | 349 |
350 void SVGFontFaceElement::trace(Visitor* visitor) | 350 void SVGFontFaceElement::trace(Visitor* visitor) |
351 { | 351 { |
352 visitor->trace(m_fontFaceRule); | 352 visitor->trace(m_fontFaceRule); |
353 SVGElement::trace(visitor); | 353 SVGElement::trace(visitor); |
354 } | 354 } |
355 | 355 |
356 } // namespace WebCore | 356 } // namespace WebCore |
357 | 357 |
358 #endif // ENABLE(SVG_FONTS) | 358 #endif // ENABLE(SVG_FONTS) |
OLD | NEW |