https://bugs.webkit.org/show_bug.cgi?id=77621
Reviewed by Andreas Kling.
This leaves CSSStyleDeclaration a near-pure CSSOM interface.
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::isCSSPropertyName):
(WebCore::JSCSSStyleDeclaration::putDelegate):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::parentRule):
(WebCore):
* css/CSSComputedStyleDeclaration.h:
(CSSComputedStyleDeclaration):
* css/CSSMutableStyleDeclaration.cpp:
(WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration):
(WebCore::CSSMutableStyleDeclaration::contextStyleSheet):
(WebCore):
(WebCore::CSSMutableStyleDeclaration::parentRule):
* css/CSSMutableStyleDeclaration.h:
(WebCore::CSSMutableStyleDeclaration::isInlineStyleDeclaration):
(WebCore::CSSMutableStyleDeclaration::parentRuleInternal):
(WebCore::CSSMutableStyleDeclaration::clearParentRule):
(CSSMutableStyleDeclaration):
(WebCore::CSSMutableStyleDeclaration::parentElement):
(WebCore::CSSMutableStyleDeclaration::clearParentElement):
(WebCore::CSSMutableStyleDeclaration::parentStyleSheet):
* css/CSSParser.cpp:
(WebCore::parseColorValue):
(WebCore::parseSimpleLengthValue):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseDeclaration):
* css/CSSStyleDeclaration.cpp:
(WebCore):
* css/CSSStyleDeclaration.h:
(CSSStyleDeclaration):
(WebCore::CSSStyleDeclaration::parentStyleSheet):
(WebCore::CSSStyleDeclaration::CSSStyleDeclaration):
* css/CSSStyleRule.cpp:
(WebCore::CSSStyleRule::setSelectorText):
Eliminate unnecessary call to CSSMutableStyleDeclaration::parentStyleSheet()
* css/CSSStyleRule.h:
(WebCore::CSSStyleRule::setDeclaration):
* css/CSSStyleSelector.cpp:
(WebCore::isInsideRegionRule):
(WebCore::CSSStyleSelector::applyDeclaration):
* css/WebKitCSSKeyframeRule.cpp:
(WebCore::WebKitCSSKeyframeRule::setDeclaration):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::serializeFrame):
(WebCore::PageSerializer::serializeCSSStyleSheet):
(WebCore::PageSerializer::retrieveResourcesForCSSRule):
(WebCore::PageSerializer::retrieveResourcesForCSSDeclaration):
* page/PageSerializer.h:
Eliminate unnecessary call to CSSMutableStyleDeclaration::parentStyleSheet()
(WebCore):
(PageSerializer):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106568
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-02 Antti Koivisto <antti@apple.com>
+
+ Move remaining implementation from CSSStyleDeclaration to subclasses
+ https://bugs.webkit.org/show_bug.cgi?id=77621
+
+ Reviewed by Andreas Kling.
+
+ This leaves CSSStyleDeclaration a near-pure CSSOM interface.
+
+ * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+ (WebCore::isCSSPropertyName):
+ (WebCore::JSCSSStyleDeclaration::putDelegate):
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::parentRule):
+ (WebCore):
+ * css/CSSComputedStyleDeclaration.h:
+ (CSSComputedStyleDeclaration):
+ * css/CSSMutableStyleDeclaration.cpp:
+ (WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration):
+ (WebCore::CSSMutableStyleDeclaration::contextStyleSheet):
+ (WebCore):
+ (WebCore::CSSMutableStyleDeclaration::parentRule):
+ * css/CSSMutableStyleDeclaration.h:
+ (WebCore::CSSMutableStyleDeclaration::isInlineStyleDeclaration):
+ (WebCore::CSSMutableStyleDeclaration::parentRuleInternal):
+ (WebCore::CSSMutableStyleDeclaration::clearParentRule):
+ (CSSMutableStyleDeclaration):
+ (WebCore::CSSMutableStyleDeclaration::parentElement):
+ (WebCore::CSSMutableStyleDeclaration::clearParentElement):
+ (WebCore::CSSMutableStyleDeclaration::parentStyleSheet):
+ * css/CSSParser.cpp:
+ (WebCore::parseColorValue):
+ (WebCore::parseSimpleLengthValue):
+ (WebCore::CSSParser::parseValue):
+ (WebCore::CSSParser::parseDeclaration):
+ * css/CSSStyleDeclaration.cpp:
+ (WebCore):
+ * css/CSSStyleDeclaration.h:
+ (CSSStyleDeclaration):
+ (WebCore::CSSStyleDeclaration::parentStyleSheet):
+ (WebCore::CSSStyleDeclaration::CSSStyleDeclaration):
+ * css/CSSStyleRule.cpp:
+ (WebCore::CSSStyleRule::setSelectorText):
+
+ Eliminate unnecessary call to CSSMutableStyleDeclaration::parentStyleSheet()
+
+ * css/CSSStyleRule.h:
+ (WebCore::CSSStyleRule::setDeclaration):
+ * css/CSSStyleSelector.cpp:
+ (WebCore::isInsideRegionRule):
+ (WebCore::CSSStyleSelector::applyDeclaration):
+ * css/WebKitCSSKeyframeRule.cpp:
+ (WebCore::WebKitCSSKeyframeRule::setDeclaration):
+ * page/PageSerializer.cpp:
+ (WebCore::PageSerializer::serializeFrame):
+ (WebCore::PageSerializer::serializeCSSStyleSheet):
+ (WebCore::PageSerializer::retrieveResourcesForCSSRule):
+ (WebCore::PageSerializer::retrieveResourcesForCSSDeclaration):
+ * page/PageSerializer.h:
+
+ Eliminate unnecessary call to CSSMutableStyleDeclaration::parentStyleSheet()
+
+ (WebCore):
+ (PageSerializer):
+
2012-02-02 Chris Marrin <cmarrin@apple.com>
Turn on CSS Filters on Windows
#include "JSCSSStyleDeclarationCustom.h"
#include "CSSMutableStyleDeclaration.h"
+#include "CSSParser.h"
#include "CSSPrimitiveValue.h"
#include "CSSPropertyNames.h"
#include "CSSValue.h"
{
// FIXME: This mallocs a string for the property name and then throws it
// away. This shows up on peacekeeper's domDynamicCreationCreateElement.
- return CSSStyleDeclaration::isPropertyName(cssPropertyName(propertyIdentifier));
+ return cssPropertyID(cssPropertyName(propertyIdentifier));
}
bool JSCSSStyleDeclaration::canGetItemsForName(ExecState*, CSSStyleDeclaration*, const Identifier& propertyName)
{
bool pixelOrPos;
String prop = cssPropertyName(propertyName, &pixelOrPos);
- if (!CSSStyleDeclaration::isPropertyName(prop))
+ if (!cssPropertyID(prop))
return false;
String propValue = valueToStringWithNullCheck(exec, value);
/*
* Copyright (C) 2004 Zack Rusin <zack@kde.org>
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
* Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
* Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
* Copyright (C) 2011 Sencha, Inc. All rights reserved.
return CSSMutableStyleDeclaration::create(list);
}
+CSSRule* CSSComputedStyleDeclaration::parentRule() const
+{
+ return 0;
+}
+
PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(const String& propertyName)
{
int propertyID = cssPropertyID(propertyName);
/*
* Copyright (C) 2004 Zack Rusin <zack@kde.org>
- * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
CSSComputedStyleDeclaration(PassRefPtr<Node>, bool allowVisitedStyle, const String&);
// CSSOM functions. Don't make these public.
+ virtual CSSRule* parentRule() const;
virtual unsigned length() const;
virtual String item(unsigned index) const;
virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName);
/*
* (C) 1999-2003 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All rights reserved.
* Copyright (C) 2011 Research In Motion Limited. All rights reserved.
*
* This library is free software; you can redistribute it and/or
} // namespace
CSSMutableStyleDeclaration::CSSMutableStyleDeclaration()
+ : m_strictParsing(false)
+ , m_isInlineStyleDeclaration(false)
+ , m_parent(static_cast<CSSRule*>(0))
{
- // This constructor is used for various inline style declarations, so disable strict parsing.
- m_strictParsing = false;
}
-CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(CSSRule* parent)
- : CSSStyleDeclaration(parent)
+CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(CSSRule* parentRule)
+ : m_strictParsing(!parentRule || parentRule->useStrictParsing())
+ , m_isInlineStyleDeclaration(false)
+ , m_parent(parentRule)
{
}
-CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(CSSRule* parent, const Vector<CSSProperty>& properties)
- : CSSStyleDeclaration(parent)
- , m_properties(properties)
+CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(CSSRule* parentRule, const Vector<CSSProperty>& properties)
+ : m_properties(properties)
+ , m_strictParsing(!parentRule || parentRule->useStrictParsing())
+ , m_isInlineStyleDeclaration(false)
+ , m_parent(parentRule)
{
m_properties.shrinkToFit();
// FIXME: This allows duplicate properties.
}
-CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(CSSRule* parent, const CSSProperty* const * properties, int numProperties)
- : CSSStyleDeclaration(parent)
+CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(CSSRule* parentRule, const CSSProperty* const * properties, int numProperties)
+ : m_strictParsing(!parentRule || parentRule->useStrictParsing())
+ , m_isInlineStyleDeclaration(false)
+ , m_parent(parentRule)
{
m_properties.reserveInitialCapacity(numProperties);
HashMap<int, bool> candidates;
}
}
-CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(StyledElement* element)
- : CSSStyleDeclaration(element)
+CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(StyledElement* parentElement)
+ : m_strictParsing(false)
+ , m_isInlineStyleDeclaration(true)
+ , m_parent(parentElement)
{
}
{
}
+CSSStyleSheet* CSSMutableStyleDeclaration::contextStyleSheet() const
+{
+ if (m_isInlineStyleDeclaration) {
+ Document* document = m_parent.element ? m_parent.element->document() : 0;
+ return document ? document->elementSheet() : 0;
+ }
+ return m_parent.rule ? m_parent.rule->parentStyleSheet() : 0;
+}
+
void CSSMutableStyleDeclaration::copyPropertiesFrom(const CSSMutableStyleDeclaration& other)
{
m_properties = other.m_properties;
return 0;
}
+CSSRule* CSSMutableStyleDeclaration::parentRule() const
+{
+ return parentRuleInternal();
+}
+
String CSSMutableStyleDeclaration::cssText() const
{
return asText();
/*
* (C) 1999-2003 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
void setStrictParsing(bool b) { m_strictParsing = b; }
bool useStrictParsing() const { return m_strictParsing; }
+ bool isInlineStyleDeclaration() const { return m_isInlineStyleDeclaration; }
void addSubresourceStyleURLs(ListHashSet<KURL>&);
PassRefPtr<CSSMutableStyleDeclaration> copyPropertiesInSet(const int* set, unsigned length) const;
+ CSSRule* parentRuleInternal() const { return m_isInlineStyleDeclaration ? 0 : m_parent.rule; }
+ void clearParentRule() { ASSERT(!m_isInlineStyleDeclaration); m_parent.rule = 0; }
+
+ StyledElement* parentElement() const { ASSERT(m_isInlineStyleDeclaration); return m_parent.element; }
+ void clearParentElement() { ASSERT(m_isInlineStyleDeclaration); m_parent.element = 0; }
+
+ CSSStyleSheet* contextStyleSheet() const;
+
String asText() const;
private:
virtual PassRefPtr<CSSMutableStyleDeclaration> makeMutable();
// CSSOM functions. Don't make these public.
+ virtual CSSRule* parentRule() const;
virtual unsigned length() const;
virtual String item(unsigned index) const;
virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName);
bool removePropertiesInSet(const int* set, unsigned length, bool notifyChanged);
virtual bool cssPropertyMatches(const CSSProperty*) const;
+ virtual CSSStyleSheet* parentStyleSheet() const { return contextStyleSheet(); }
const CSSProperty* findPropertyWithId(int propertyId) const;
CSSProperty* findPropertyWithId(int propertyId);
Vector<CSSProperty, 4> m_properties;
+
+ bool m_strictParsing : 1;
+ bool m_isInlineStyleDeclaration : 1;
+
+ union Parent {
+ Parent(CSSRule* rule) : rule(rule) { }
+ Parent(StyledElement* element) : element(element) { }
+ CSSRule* rule;
+ StyledElement* element;
+ } m_parent;
};
} // namespace WebCore
validPrimitive = true;
}
- CSSStyleSheet* styleSheet = contextStyleSheet ? contextStyleSheet : declaration->parentStyleSheet();
+ CSSStyleSheet* styleSheet = contextStyleSheet ? contextStyleSheet : declaration->contextStyleSheet();
if (!styleSheet)
return false;
Document* document = styleSheet->findDocument();
if (number < 0 && !acceptsNegativeNumbers)
return false;
- CSSStyleSheet* styleSheet = contextStyleSheet ? contextStyleSheet : declaration->parentStyleSheet();
+ CSSStyleSheet* styleSheet = contextStyleSheet ? contextStyleSheet : declaration->contextStyleSheet();
if (!styleSheet)
return false;
Document* document = styleSheet->findDocument();
if (contextStyleSheet)
setStyleSheet(contextStyleSheet);
else
- setStyleSheet(declaration->parentStyleSheet());
+ setStyleSheet(declaration->contextStyleSheet());
setupParser("@-webkit-value{", string, "} ");
if (contextStyleSheet)
setStyleSheet(contextStyleSheet);
else
- setStyleSheet(declaration->parentStyleSheet());
+ setStyleSheet(declaration->contextStyleSheet());
if (styleSourceData) {
m_currentRuleData = CSSRuleSourceData::create();
m_currentRuleData->styleSourceData = CSSStyleSourceData::create();
/*
* (C) 1999-2003 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
#include "config.h"
#include "CSSStyleDeclaration.h"
-#include "CSSMutableStyleDeclaration.h"
-#include "CSSParser.h"
-#include "CSSProperty.h"
-#include "CSSPropertyNames.h"
-#include "CSSRule.h"
-#include "Node.h"
-#include "SVGElement.h"
-#include "StyledElement.h"
+#ifndef NDEBUG
#include <wtf/ASCIICType.h>
#include <wtf/text/CString.h>
-#ifndef NDEBUG
#include <stdio.h>
#endif
namespace WebCore {
-CSSStyleDeclaration::CSSStyleDeclaration(CSSRule* parentRule)
- : m_strictParsing(!parentRule || parentRule->useStrictParsing())
- , m_isInlineStyleDeclaration(false)
- , m_parent(parentRule)
-{
-}
-
-CSSStyleDeclaration::CSSStyleDeclaration(StyledElement* parentElement)
- : m_strictParsing(false)
- , m_isInlineStyleDeclaration(true)
- , m_parent(parentElement)
-{
-}
-
-CSSStyleSheet* CSSStyleDeclaration::parentStyleSheet() const
-{
- if (m_isInlineStyleDeclaration) {
- Document* document = m_parent.element ? m_parent.element->document() : 0;
- return document ? document->elementSheet() : 0;
- }
- return m_parent.rule ? m_parent.rule->parentStyleSheet() : 0;
-}
-
-bool CSSStyleDeclaration::isPropertyName(const String& propertyName)
-{
- return cssPropertyID(propertyName);
-}
-
#ifndef NDEBUG
void CSSStyleDeclaration::showStyle()
{
/*
* (C) 1999-2003 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
public:
virtual ~CSSStyleDeclaration() { }
- static bool isPropertyName(const String&);
-
- CSSRule* parentRule() const { return m_isInlineStyleDeclaration ? 0 : m_parent.rule; }
- void clearParentRule() { ASSERT(!m_isInlineStyleDeclaration); m_parent.rule = 0; }
-
- StyledElement* parentElement() const { ASSERT(m_isInlineStyleDeclaration); return m_parent.element; }
- void clearParentElement() { ASSERT(m_isInlineStyleDeclaration); m_parent.element = 0; }
-
- CSSStyleSheet* parentStyleSheet() const;
-
+ virtual CSSRule* parentRule() const = 0;
virtual String cssText() const = 0;
virtual void setCssText(const String&, ExceptionCode&) = 0;
virtual unsigned length() const = 0;
virtual PassRefPtr<CSSMutableStyleDeclaration> makeMutable() = 0;
virtual bool cssPropertyMatches(const CSSProperty*) const = 0;
-
+ virtual CSSStyleSheet* parentStyleSheet() const { return 0; }
+
#ifndef NDEBUG
void showStyle();
#endif
- bool isInlineStyleDeclaration() const { return m_isInlineStyleDeclaration; }
-
protected:
- CSSStyleDeclaration(CSSRule* parentRule = 0);
- CSSStyleDeclaration(StyledElement* parentElement);
-
- // The bits in this section are only used by specific subclasses but kept here
- // to maximize struct packing.
-
- // CSSMutableStyleDeclaration bits:
- bool m_strictParsing : 1;
- bool m_isInlineStyleDeclaration : 1;
-
-private:
- union Parent {
- Parent(CSSRule* rule) : rule(rule) { }
- Parent(StyledElement* element) : element(element) { }
- CSSRule* rule;
- StyledElement* element;
- } m_parent;
+ CSSStyleDeclaration() { }
};
} // namespace WebCore
void CSSStyleRule::setSelectorText(const String& selectorText)
{
Document* doc = 0;
- if (CSSStyleSheet* styleSheet = m_style->parentStyleSheet())
+ if (CSSStyleSheet* styleSheet = parentStyleSheet())
doc = styleSheet->findDocument();
if (!doc)
return;
String cssText() const;
void adoptSelectorVector(Vector<OwnPtr<CSSParserSelector> >& selectors) { m_selectorList.adoptSelectorVector(selectors); }
- void setDeclaration(PassRefPtr<CSSMutableStyleDeclaration> style) { ASSERT(style->parentRule() == this); m_style = style; }
+ void setDeclaration(PassRefPtr<CSSMutableStyleDeclaration> style) { ASSERT(style->parentRuleInternal() == this); m_style = style; }
const CSSSelectorList& selectorList() const { return m_selectorList; }
CSSMutableStyleDeclaration* declaration() const { return m_style.get(); }
{
ASSERT(styleDeclaration);
- CSSRule* parentRule = styleDeclaration->parentRule();
+ CSSRule* parentRule = styleDeclaration->parentRuleInternal();
while (parentRule) {
if (parentRule->isRegionRule())
return true;
template <bool applyFirst>
void CSSStyleSelector::applyDeclaration(CSSMutableStyleDeclaration* styleDeclaration, bool isImportant, bool inheritedOnly)
{
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::willProcessRule(document(), styleDeclaration->parentRule());
+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::willProcessRule(document(), styleDeclaration->parentRuleInternal());
bool styleDeclarationInsideRegionRule = m_regionForStyling ? isInsideRegionRule(styleDeclaration) : false;
unsigned propertyCount = styleDeclaration->propertyCount();
void WebKitCSSKeyframeRule::setDeclaration(PassRefPtr<CSSMutableStyleDeclaration> style)
{
- ASSERT(style->parentRule() == this);
+ ASSERT(style->parentRuleInternal() == this);
m_style = style;
}
Element* element = toElement(node);
// We have to process in-line style as it might contain some resources (typically background images).
if (element->isStyledElement())
- retrieveResourcesForCSSDeclaration(static_cast<StyledElement*>(element)->inlineStyleDecl());
+ retrieveResourcesForCSSDeclaration(static_cast<StyledElement*>(element)->inlineStyleDecl(), document);
if (element->hasTagName(HTMLNames::imgTag)) {
HTMLImageElement* imageElement = static_cast<HTMLImageElement*>(element);
if (i < styleSheet->length() - 1)
cssText.append("\n\n");
}
+ Document* document = styleSheet->findDocument();
// Some rules have resources associated with them that we need to retrieve.
if (rule->isImportRule()) {
- CSSImportRule* importRule = static_cast<CSSImportRule*>(rule);
- Document* document = styleSheet->findDocument();
+ CSSImportRule* importRule = static_cast<CSSImportRule*>(rule);
KURL importURL = document->completeURL(importRule->href());
if (m_resourceURLs.contains(importURL))
continue;
// FIXME: Add support for font face rule. It is not clear to me at this point if the actual otf/eot file can
// be retrieved from the CSSFontFaceRule object.
} else if (rule->isStyleRule())
- retrieveResourcesForCSSRule(static_cast<CSSStyleRule*>(rule));
+ retrieveResourcesForCSSRule(static_cast<CSSStyleRule*>(rule), document);
}
if (url.isValid() && !m_resourceURLs.contains(url)) {
m_resourceURLs.add(url);
}
-void PageSerializer::retrieveResourcesForCSSRule(CSSStyleRule* rule)
+void PageSerializer::retrieveResourcesForCSSRule(CSSStyleRule* rule, Document* document)
{
- retrieveResourcesForCSSDeclaration(rule->declaration());
+ retrieveResourcesForCSSDeclaration(rule->declaration(), document);
}
-void PageSerializer::retrieveResourcesForCSSDeclaration(CSSMutableStyleDeclaration* styleDeclaration)
+void PageSerializer::retrieveResourcesForCSSDeclaration(CSSMutableStyleDeclaration* styleDeclaration, Document* document)
{
if (!styleDeclaration)
return;
- CSSStyleSheet* cssStyleSheet = styleDeclaration->parentStyleSheet();
- ASSERT(cssStyleSheet);
-
// The background-image and list-style-image (for ul or ol) are the CSS properties
// that make use of images. We iterate to make sure we include any other
// image properties there might be.
CachedImage* image = static_cast<StyleCachedImage*>(styleImage)->cachedImage();
- Document* document = cssStyleSheet->findDocument();
KURL url = document->completeURL(image->url());
addImageToResources(image, 0, url);
}
class CSSMutableStyleDeclaration;
class CSSStyleRule;
class CSSStyleSheet;
+class Document;
class Frame;
class Page;
class RenderObject;
void serializeCSSStyleSheet(CSSStyleSheet*, const KURL&);
void addImageToResources(CachedImage*, RenderObject*, const KURL&);
- void retrieveResourcesForCSSDeclaration(CSSMutableStyleDeclaration*);
- void retrieveResourcesForCSSRule(CSSStyleRule*);
+ void retrieveResourcesForCSSDeclaration(CSSMutableStyleDeclaration*, Document*);
+ void retrieveResourcesForCSSRule(CSSStyleRule*, Document*);
Vector<Resource>* m_resources;
ListHashSet<KURL> m_resourceURLs;