Remove contextStyleSheet argument from CSSValuePool::createFontFaceValue().
authorkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Apr 2012 00:28:11 +0000 (00:28 +0000)
committerkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Apr 2012 00:28:11 +0000 (00:28 +0000)
<http://webkit.org/b/83988>

Reviewed by Antti Koivisto.

Remove the 'context style sheet' argument to <font face> 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
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/CSSValuePool.cpp
Source/WebCore/css/CSSValuePool.h
Source/WebCore/html/HTMLFontElement.cpp

index b8294c6..2e28af6 100644 (file)
@@ -1,3 +1,22 @@
+2012-04-16  Andreas Kling  <kling@webkit.org>
+
+        Remove contextStyleSheet argument from CSSValuePool::createFontFaceValue().
+        <http://webkit.org/b/83988>
+
+        Reviewed by Antti Koivisto.
+
+        Remove the 'context style sheet' argument to <font face> 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  <danakj@chromium.org>
 
         [chromium] Consistent checking for clipped rects when we need the computed result enclosed within the real result
index 4a1fa2c..b83bfdd 100644 (file)
@@ -940,10 +940,10 @@ static bool parseKeywordValue(StylePropertySet* declaration, CSSPropertyID prope
     return true;
 }
 
-PassRefPtr<CSSValueList> CSSParser::parseFontFaceValue(const AtomicString& string, StyleSheetInternal* contextStyleSheet)
+PassRefPtr<CSSValueList> CSSParser::parseFontFaceValue(const AtomicString& string)
 {
     RefPtr<StylePropertySet> 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<CSSValueList>(dummyStyle->getPropertyCSSValue(CSSPropertyFontFamily));
 }
index acacf17..393885b 100644 (file)
@@ -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<CSSValueList> parseFontFaceValue(const AtomicString&, StyleSheetInternal* contextStyleSheet);
+    static PassRefPtr<CSSValueList> parseFontFaceValue(const AtomicString&);
     PassRefPtr<CSSPrimitiveValue> parseValidPrimitive(int ident, CSSParserValue*);
     bool parseDeclaration(StylePropertySet*, const String&, RefPtr<CSSStyleSourceData>*, StyleSheetInternal* contextStyleSheet);
     PassOwnPtr<MediaQuery> parseMediaQuery(const String&);
index abe453e..ea41d37 100644 (file)
@@ -134,7 +134,7 @@ PassRefPtr<CSSPrimitiveValue> CSSValuePool::createFontFamilyValue(const String&
     return value;
 }
 
-PassRefPtr<CSSValueList> CSSValuePool::createFontFaceValue(const AtomicString& string, StyleSheetInternal* contextStyleSheet)
+PassRefPtr<CSSValueList> 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<CSSValueList> CSSValuePool::createFontFaceValue(const AtomicString& s
 
     RefPtr<CSSValueList>& value = m_fontFaceValueCache.add(string, 0).iterator->second;
     if (!value)
-        value = CSSParser::parseFontFaceValue(string, contextStyleSheet);
+        value = CSSParser::parseFontFaceValue(string);
     return value;
 }
 
index d95358f..9c1b386 100644 (file)
 namespace WebCore {
 
 class CSSValueList;
-class StyleSheetInternal;
 
 class CSSValuePool {
 public:
-    PassRefPtr<CSSValueList> createFontFaceValue(const AtomicString&, StyleSheetInternal* contextStyleSheet);
+    PassRefPtr<CSSValueList> createFontFaceValue(const AtomicString&);
     PassRefPtr<CSSPrimitiveValue> createFontFamilyValue(const String&);
     PassRefPtr<CSSInheritedValue> createInheritedValue() { return m_inheritedValue; }
     PassRefPtr<CSSInitialValue> createImplicitInitialValue() { return m_implicitInitialValue; }
index fed8bb6..9582fff 100644 (file)
@@ -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<CSSValueList> fontFaceValue = cssValuePool().createFontFaceValue(attr->value(), document()->elementSheet()->internal()))
+        if (RefPtr<CSSValueList> fontFaceValue = cssValuePool().createFontFaceValue(attr->value()))
             style->setProperty(CSSProperty(CSSPropertyFontFamily, fontFaceValue.release()));
     } else
         HTMLElement::collectStyleForAttribute(attr, style);