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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 if (describesParentFont) { | 279 if (describesParentFont) { |
280 m_fontElement = toSVGFontElement(parentNode()); | 280 m_fontElement = toSVGFontElement(parentNode()); |
281 | 281 |
282 list = CSSValueList::createCommaSeparated(); | 282 list = CSSValueList::createCommaSeparated(); |
283 list->append(CSSFontFaceSrcValue::createLocal(fontFamily())); | 283 list->append(CSSFontFaceSrcValue::createLocal(fontFamily())); |
284 } else { | 284 } else { |
285 m_fontElement = 0; | 285 m_fontElement = 0; |
286 // we currently ignore all but the last src element, alternatively we co
uld concat them | 286 // we currently ignore all but the last src element, alternatively we co
uld concat them |
287 for (Node* child = lastChild(); child && !list; child = child->previousS
ibling()) { | 287 for (Node* child = lastChild(); child && !list; child = child->previousS
ibling()) { |
288 if (child->hasTagName(font_face_srcTag)) { | 288 if (child->hasTagName(font_face_srcTag)) { |
289 list = static_cast<SVGFontFaceSrcElement*>(child)->srcValue(); | 289 list = toSVGFontFaceSrcElement(child)->srcValue(); |
290 break; | 290 break; |
291 } | 291 } |
292 } | 292 } |
293 } | 293 } |
294 | 294 |
295 if (!list || !list->length()) | 295 if (!list || !list->length()) |
296 return; | 296 return; |
297 | 297 |
298 // Parse in-memory CSS rules | 298 // Parse in-memory CSS rules |
299 m_fontFaceRule->mutableProperties()->addParsedProperty(CSSProperty(CSSProper
tySrc, list)); | 299 m_fontFaceRule->mutableProperties()->addParsedProperty(CSSProperty(CSSProper
tySrc, list)); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 | 342 |
343 void SVGFontFaceElement::childrenChanged(bool changedByParser, Node* beforeChang
e, Node* afterChange, int childCountDelta) | 343 void SVGFontFaceElement::childrenChanged(bool changedByParser, Node* beforeChang
e, Node* afterChange, int childCountDelta) |
344 { | 344 { |
345 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil
dCountDelta); | 345 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil
dCountDelta); |
346 rebuildFontFace(); | 346 rebuildFontFace(); |
347 } | 347 } |
348 | 348 |
349 } // namespace WebCore | 349 } // namespace WebCore |
350 | 350 |
351 #endif // ENABLE(SVG_FONTS) | 351 #endif // ENABLE(SVG_FONTS) |
OLD | NEW |