Changeset 40278 in webkit
- Timestamp:
- Jan 26, 2009 4:45:36 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r40276 r40278 1 2009-01-26 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Dan Bernstein. 4 5 Test for https://bugs.webkit.org/show_bug.cgi?id=18141 6 Acid3 tests 77 and 78 fail on reload due to SVG font race 7 <rdar://problem/6504899> 8 9 * http/tests/misc/SVGFont-delayed-load-expected.txt: Added. 10 * http/tests/misc/SVGFont-delayed-load.html: Added. 11 * http/tests/misc/resources/SVGFont-delayed-loader.svg: Added. 12 * svg/custom/acid3-test-77.html: 13 * svg/custom/resources/Acid3Font-loader.svg: 14 1 15 2009-01-26 Pierre-Olivier Latour <pol@apple.com> 2 16 -
trunk/LayoutTests/svg/custom/acid3-test-77.html
r35146 r40278 52 52 text.setAttribute("y", "1em"); 53 53 text.setAttribute("font-size", "4000"); 54 window.setTimeout("executeTest()", 150);54 executeTest(); 55 55 } 56 56 -
trunk/LayoutTests/svg/custom/resources/Acid3Font-loader.svg
r30767 r40278 11 11 </defs> 12 12 <text>X</text> 13 14 <!-- Adding this possibly fixes the problem that acid3-test-77.html is timing dependa though it currently crashes us15 <script>document.documentElement.offsetWidth;</script> -->16 13 </svg> -
trunk/WebCore/ChangeLog
r40275 r40278 1 2009-01-26 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Dan Bernstein. 4 5 Fix for https://bugs.webkit.org/show_bug.cgi?id=18141 6 Acid3 tests 77 and 78 fail on reload due to SVG font race 7 <rdar://problem/6504899> 8 9 Match Opera's behavior of loading SVGFonts as soon as <font-face-uri> 10 tag is inserted into the document and not at the first use of the font 11 as is done for CSS web fonts. 12 13 This fixes a race condition noticeable by some in the Acid3 test that 14 happened because the onload event handler for an iframe containing a 15 <font-face-uri> with an external reference was not delayed by the pending 16 load of the font. 17 18 Test: http/tests/misc/SVGFont-delayed-load.html 19 20 * svg/SVGFontFaceUriElement.cpp: 21 (WebCore::SVGFontFaceUriElement::~SVGFontFaceUriElement): 22 (WebCore::SVGFontFaceUriElement::parseMappedAttribute): Call loadFont if 23 the href attribute changes. 24 (WebCore::SVGFontFaceUriElement::insertedIntoDocument): Call loadFont. 25 (WebCore::SVGFontFaceUriElement::loadFont): Force a load of the 26 font specified in href attribute. 27 * svg/SVGFontFaceUriElement.h: 28 1 29 2009-01-26 Timothy Hatcher <timothy@apple.com> 2 30 -
trunk/WebCore/svg/SVGFontFaceUriElement.cpp
r34627 r40278 1 1 /* 2 2 Copyright (C) 2007 Eric Seidel <eric@webkit.org> 3 Copyright (C) 2009 Apple Inc. All rights reserved. 3 4 4 5 This library is free software; you can redistribute it and/or … … 24 25 25 26 #include "CSSFontFaceSrcValue.h" 27 #include "CachedFont.h" 28 #include "DocLoader.h" 29 #include "Document.h" 26 30 #include "SVGFontFaceElement.h" 27 31 #include "SVGNames.h" … … 37 41 } 38 42 43 SVGFontFaceUriElement::~SVGFontFaceUriElement() 44 { 45 if (m_cachedFont) 46 m_cachedFont->removeClient(this); 47 } 48 39 49 PassRefPtr<CSSFontFaceSrcValue> SVGFontFaceUriElement::srcValue() const 40 50 { … … 43 53 src->setFormat(value.isEmpty() ? "svg" : value); // Default format 44 54 return src.release(); 55 } 56 57 void SVGFontFaceUriElement::parseMappedAttribute(MappedAttribute* attr) 58 { 59 const QualifiedName& attrName = attr->name(); 60 if (attrName == XLinkNames::hrefAttr) 61 loadFont(); 62 else 63 SVGElement::parseMappedAttribute(attr); 45 64 } 46 65 … … 57 76 } 58 77 78 void SVGFontFaceUriElement::insertedIntoDocument() 79 { 80 loadFont(); 81 SVGElement::insertedIntoDocument(); 82 } 83 84 void SVGFontFaceUriElement::loadFont() 85 { 86 if (m_cachedFont) 87 m_cachedFont->removeClient(this); 88 89 String href = getAttribute(XLinkNames::hrefAttr); 90 if (!href.isNull()) { 91 DocLoader* docLoader = document()->docLoader(); 92 m_cachedFont = docLoader->requestFont(href); 93 m_cachedFont->setSVGFont(true); 94 m_cachedFont->addClient(this); 95 m_cachedFont->beginLoadIfNeeded(docLoader); 96 } else 97 m_cachedFont = 0; 98 } 99 59 100 } 60 101 -
trunk/WebCore/svg/SVGFontFaceUriElement.h
r30633 r40278 22 22 23 23 #if ENABLE(SVG_FONTS) 24 #include "CachedResourceClient.h" 25 #include "CachedResourceHandle.h" 24 26 #include "SVGElement.h" 25 27 26 28 namespace WebCore { 29 27 30 class CSSFontFaceSrcValue; 28 class SVGFontFaceUriElement : public SVGElement { 31 class CachedFont; 32 33 class SVGFontFaceUriElement : public SVGElement, public CachedResourceClient { 29 34 public: 30 35 SVGFontFaceUriElement(const QualifiedName&, Document*); 36 ~SVGFontFaceUriElement(); 31 37 32 38 PassRefPtr<CSSFontFaceSrcValue> srcValue() const; 33 39 40 virtual void parseMappedAttribute(MappedAttribute*); 34 41 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); 42 virtual void insertedIntoDocument(); 43 44 private: 45 void loadFont(); 46 47 CachedResourceHandle<CachedFont> m_cachedFont; 35 48 }; 36 49
Note: See TracChangeset
for help on using the changeset viewer.