From b3ca19d299c517e7e09b0cc4611c66b4ac88feb3 Mon Sep 17 00:00:00 2001 From: "kling@webkit.org" Date: Tue, 17 Apr 2012 00:28:11 +0000 Subject: [PATCH] Remove contextStyleSheet argument from CSSValuePool::createFontFaceValue(). Reviewed by Antti Koivisto. Remove the 'context style sheet' argument to value parsing. It was only ever used to grab at the CSSValuePool back when they were per-Document. * css/CSSParser.h: * css/CSSParser.cpp: (WebCore::CSSParser::parseFontFaceValue): * css/CSSValuePool.h: * css/CSSValuePool.cpp: (WebCore::CSSValuePool::createFontFaceValue): * html/HTMLFontElement.cpp: (WebCore::HTMLFontElement::collectStyleForAttribute): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114325 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 19 +++++++++++++++++++ Source/WebCore/css/CSSParser.cpp | 4 ++-- Source/WebCore/css/CSSParser.h | 2 +- Source/WebCore/css/CSSValuePool.cpp | 4 ++-- Source/WebCore/css/CSSValuePool.h | 3 +-- Source/WebCore/html/HTMLFontElement.cpp | 2 +- 6 files changed, 26 insertions(+), 8 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index b8294c6..2e28af6 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,22 @@ +2012-04-16 Andreas Kling + + Remove contextStyleSheet argument from CSSValuePool::createFontFaceValue(). + + + Reviewed by Antti Koivisto. + + Remove the 'context style sheet' argument to value parsing. + It was only ever used to grab at the CSSValuePool back when they were per-Document. + + * css/CSSParser.h: + * css/CSSParser.cpp: + (WebCore::CSSParser::parseFontFaceValue): + * css/CSSValuePool.h: + * css/CSSValuePool.cpp: + (WebCore::CSSValuePool::createFontFaceValue): + * html/HTMLFontElement.cpp: + (WebCore::HTMLFontElement::collectStyleForAttribute): + 2012-04-16 Dana Jansens [chromium] Consistent checking for clipped rects when we need the computed result enclosed within the real result diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp index 4a1fa2c..b83bfdd 100644 --- a/Source/WebCore/css/CSSParser.cpp +++ b/Source/WebCore/css/CSSParser.cpp @@ -940,10 +940,10 @@ static bool parseKeywordValue(StylePropertySet* declaration, CSSPropertyID prope return true; } -PassRefPtr CSSParser::parseFontFaceValue(const AtomicString& string, StyleSheetInternal* contextStyleSheet) +PassRefPtr CSSParser::parseFontFaceValue(const AtomicString& string) { RefPtr dummyStyle = StylePropertySet::create(); - if (!parseValue(dummyStyle.get(), CSSPropertyFontFamily, string, false, CSSQuirksMode, contextStyleSheet)) + if (!parseValue(dummyStyle.get(), CSSPropertyFontFamily, string, false, CSSQuirksMode, 0)) return 0; return static_pointer_cast(dummyStyle->getPropertyCSSValue(CSSPropertyFontFamily)); } diff --git a/Source/WebCore/css/CSSParser.h b/Source/WebCore/css/CSSParser.h index acacf17..393885b 100644 --- a/Source/WebCore/css/CSSParser.h +++ b/Source/WebCore/css/CSSParser.h @@ -76,7 +76,7 @@ public: static bool parseValue(StylePropertySet*, CSSPropertyID, const String&, bool important, CSSParserMode, StyleSheetInternal*); static bool parseColor(RGBA32& color, const String&, bool strict = false); static bool parseSystemColor(RGBA32& color, const String&, Document*); - static PassRefPtr parseFontFaceValue(const AtomicString&, StyleSheetInternal* contextStyleSheet); + static PassRefPtr parseFontFaceValue(const AtomicString&); PassRefPtr parseValidPrimitive(int ident, CSSParserValue*); bool parseDeclaration(StylePropertySet*, const String&, RefPtr*, StyleSheetInternal* contextStyleSheet); PassOwnPtr parseMediaQuery(const String&); diff --git a/Source/WebCore/css/CSSValuePool.cpp b/Source/WebCore/css/CSSValuePool.cpp index abe453e..ea41d37 100644 --- a/Source/WebCore/css/CSSValuePool.cpp +++ b/Source/WebCore/css/CSSValuePool.cpp @@ -134,7 +134,7 @@ PassRefPtr CSSValuePool::createFontFamilyValue(const String& return value; } -PassRefPtr CSSValuePool::createFontFaceValue(const AtomicString& string, StyleSheetInternal* contextStyleSheet) +PassRefPtr CSSValuePool::createFontFaceValue(const AtomicString& string) { // Just wipe out the cache and start rebuilding if it gets too big. const int maximumFontFaceCacheSize = 128; @@ -143,7 +143,7 @@ PassRefPtr CSSValuePool::createFontFaceValue(const AtomicString& s RefPtr& value = m_fontFaceValueCache.add(string, 0).iterator->second; if (!value) - value = CSSParser::parseFontFaceValue(string, contextStyleSheet); + value = CSSParser::parseFontFaceValue(string); return value; } diff --git a/Source/WebCore/css/CSSValuePool.h b/Source/WebCore/css/CSSValuePool.h index d95358f..9c1b386 100644 --- a/Source/WebCore/css/CSSValuePool.h +++ b/Source/WebCore/css/CSSValuePool.h @@ -36,11 +36,10 @@ namespace WebCore { class CSSValueList; -class StyleSheetInternal; class CSSValuePool { public: - PassRefPtr createFontFaceValue(const AtomicString&, StyleSheetInternal* contextStyleSheet); + PassRefPtr createFontFaceValue(const AtomicString&); PassRefPtr createFontFamilyValue(const String&); PassRefPtr createInheritedValue() { return m_inheritedValue; } PassRefPtr createImplicitInitialValue() { return m_implicitInitialValue; } diff --git a/Source/WebCore/html/HTMLFontElement.cpp b/Source/WebCore/html/HTMLFontElement.cpp index fed8bb6..9582fff 100644 --- a/Source/WebCore/html/HTMLFontElement.cpp +++ b/Source/WebCore/html/HTMLFontElement.cpp @@ -177,7 +177,7 @@ void HTMLFontElement::collectStyleForAttribute(Attribute* attr, StylePropertySet } else if (attr->name() == colorAttr) addHTMLColorToStyle(style, CSSPropertyColor, attr->value()); else if (attr->name() == faceAttr) { - if (RefPtr fontFaceValue = cssValuePool().createFontFaceValue(attr->value(), document()->elementSheet()->internal())) + if (RefPtr fontFaceValue = cssValuePool().createFontFaceValue(attr->value())) style->setProperty(CSSProperty(CSSPropertyFontFamily, fontFaceValue.release())); } else HTMLElement::collectStyleForAttribute(attr, style); -- 2.7.4