Chromium Code Reviews| Index: Source/core/svg/SVGFontFaceElement.cpp |
| diff --git a/Source/core/svg/SVGFontFaceElement.cpp b/Source/core/svg/SVGFontFaceElement.cpp |
| index 73402cb64b750f9febc1894f39c571360b7d9cfb..07fa6dd213a4afa49d9856d7a45af5c3a86c8fba 100644 |
| --- a/Source/core/svg/SVGFontFaceElement.cpp |
| +++ b/Source/core/svg/SVGFontFaceElement.cpp |
| @@ -273,14 +273,6 @@ void SVGFontFaceElement::rebuildFontFace() |
| return; |
| } |
| - // we currently ignore all but the first src element, alternatively we could concat them |
| - SVGFontFaceSrcElement* srcElement = 0; |
| - |
| - for (Node* child = firstChild(); child && !srcElement; child = child->nextSibling()) { |
| - if (child->hasTagName(font_face_srcTag)) |
| - srcElement = static_cast<SVGFontFaceSrcElement*>(child); |
| - } |
| - |
| bool describesParentFont = parentNode()->hasTagName(SVGNames::fontTag); |
| RefPtr<CSSValueList> list; |
| @@ -291,6 +283,16 @@ void SVGFontFaceElement::rebuildFontFace() |
| list->append(CSSFontFaceSrcValue::createLocal(fontFamily())); |
| } else { |
| m_fontElement = 0; |
| + // we currently ignore all but the first src element, alternatively we could concat them |
|
Stephen Chennney
2014/01/10 12:22:34
The comment was wrong before and it's still wrong
gyuyoung-inactive
2014/01/10 15:46:23
Fixed. Thanks.
fs
2014/01/10 17:43:00
Friendly note: The comment was actually correct -
|
| + SVGFontFaceSrcElement* srcElement = 0; |
| + |
| + for (Node* child = lastChild(); child && !srcElement; child = child->previousSibling()) { |
| + if (child->hasTagName(font_face_srcTag)) { |
| + srcElement = static_cast<SVGFontFaceSrcElement*>(child); |
| + break; |
| + } |
| + } |
| + |
| if (srcElement) |
| list = srcElement->srcValue(); |
|
Stephen Chennney
2014/01/10 12:22:34
This can be moved up inside the if. You don't need
gyuyoung-inactive
2014/01/10 15:46:23
Yes, right. Moved it into inside the if.
|
| } |