Changeset 106358 in webkit
- Timestamp:
- Jan 31, 2012 6:58:37 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r106357 r106358 1 2012-01-31 Antti Koivisto <antti@apple.com> 2 3 Parent SVGFontFaceElements style declaration to the rule 4 https://bugs.webkit.org/show_bug.cgi?id=77421 5 6 Reviewed by Adam Roben. 7 8 For some reason the declaration is parented to the element which adds a bunch of unnecessary special case code. 9 The invalidation on mutation is done explicitly by SVGFontFaceElement so that is not affected. The declaration 10 is not exposed so the change is not observable with a test. 11 12 * css/CSSFontFaceRule.cpp: 13 (WebCore::CSSFontFaceRule::~CSSFontFaceRule): 14 * css/CSSMutableStyleDeclaration.h: 15 (WebCore::CSSMutableStyleDeclaration::createInline): 16 * svg/SVGFontFaceElement.cpp: 17 (WebCore::SVGFontFaceElement::SVGFontFaceElement): 18 (WebCore::SVGFontFaceElement::parseMappedAttribute): 19 (WebCore::SVGFontFaceElement::fontFamily): 20 (WebCore::SVGFontFaceElement::rebuildFontFace): 21 * svg/SVGFontFaceElement.h: 22 23 Remove the unnecessary m_styleDeclaration field, access through m_fontFaceRule instead. 24 1 25 2012-01-31 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 26 -
trunk/Source/WebCore/css/CSSFontFaceRule.cpp
r106247 r106358 34 34 CSSFontFaceRule::~CSSFontFaceRule() 35 35 { 36 // FIXME: SVGFontFaceElement's style declaration should probably be parented to the rule too. 37 if (m_style && !m_style->isElementStyleDeclaration()) 36 if (m_style) 38 37 m_style->clearParentRule(); 39 38 } -
trunk/Source/WebCore/css/CSSMutableStyleDeclaration.h
r106258 r106358 57 57 { 58 58 return adoptRef(new CSSMutableStyleDeclaration(element, true)); 59 }60 static PassRefPtr<CSSMutableStyleDeclaration> createForSVGFontFaceElement(StyledElement* element)61 {62 return adoptRef(new CSSMutableStyleDeclaration(element, false));63 59 } 64 60 -
trunk/Source/WebCore/svg/SVGFontFaceElement.cpp
r105642 r106358 50 50 : SVGElement(tagName, document) 51 51 , m_fontFaceRule(CSSFontFaceRule::create()) 52 , m_styleDeclaration(CSSMutableStyleDeclaration::createForSVGFontFaceElement(this))53 52 { 54 53 ASSERT(hasTagName(font_faceTag)); 55 m_styleDeclaration->setStrictParsing(true); 56 m_fontFaceRule->setDeclaration(m_styleDeclaration.get()); 54 RefPtr<CSSMutableStyleDeclaration> styleDeclaration = CSSMutableStyleDeclaration::create(m_fontFaceRule.get()); 55 styleDeclaration->setStrictParsing(true); 56 m_fontFaceRule->setDeclaration(styleDeclaration.release()); 57 57 } 58 58 … … 114 114 int propId = cssPropertyIdForSVGAttributeName(attr->name()); 115 115 if (propId > 0) { 116 m_ styleDeclaration->setProperty(propId, attr->value(), false);116 m_fontFaceRule->style()->setProperty(propId, attr->value(), false); 117 117 rebuildFontFace(); 118 118 return; … … 259 259 String SVGFontFaceElement::fontFamily() const 260 260 { 261 return m_ styleDeclaration->getPropertyValue(CSSPropertyFontFamily);261 return m_fontFaceRule->style()->getPropertyValue(CSSPropertyFontFamily); 262 262 } 263 263 … … 300 300 CSSProperty srcProperty(CSSPropertySrc, list); 301 301 const CSSProperty* srcPropertyRef = &srcProperty; 302 m_ styleDeclaration->addParsedProperties(&srcPropertyRef, 1);302 m_fontFaceRule->style()->addParsedProperties(&srcPropertyRef, 1); 303 303 304 304 if (describesParentFont) { 305 305 // Traverse parsed CSS values and associate CSSFontFaceSrcValue elements with ourselves. 306 RefPtr<CSSValue> src = m_ styleDeclaration->getPropertyCSSValue(CSSPropertySrc);306 RefPtr<CSSValue> src = m_fontFaceRule->style()->getPropertyCSSValue(CSSPropertySrc); 307 307 CSSValueList* srcList = static_cast<CSSValueList*>(src.get()); 308 308 -
trunk/Source/WebCore/svg/SVGFontFaceElement.h
r76990 r106358 62 62 63 63 RefPtr<CSSFontFaceRule> m_fontFaceRule; 64 RefPtr<CSSMutableStyleDeclaration> m_styleDeclaration;65 66 64 RefPtr<SVGFontElement> m_fontElement; 67 65 };
Note: See TracChangeset
for help on using the changeset viewer.