https://bugs.webkit.org/show_bug.cgi?id=77475
Reviewed by Anders Carlsson
CSSStyleRule::style() and some other places return CSSMutableStyleDeclaration.
They should return the plain CSSOM type instead.
CSSMutableStyleDeclaration* should be available through non-CSSOM function.
* css/CSSFontFaceRule.h:
(WebCore::CSSFontFaceRule::style):
(WebCore::CSSFontFaceRule::declaration):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* css/CSSStyleRule.h:
(WebCore::CSSStyleRule::style):
(WebCore::CSSStyleRule::declaration):
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::styleForKeyframe):
* css/WebKitCSSKeyframeRule.h:
(WebCore):
(WebCore::WebKitCSSKeyframeRule::style):
(WebCore::WebKitCSSKeyframeRule::declaration):
(WebKitCSSKeyframeRule):
* editing/EditingStyle.cpp:
(WebCore::styleFromMatchedRulesForElement):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::revalidateStyle):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::retrieveResourcesForCSSRule):
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::parseMappedAttribute):
(WebCore::SVGFontFaceElement::fontFamily):
(WebCore::SVGFontFaceElement::rebuildFontFace):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106393
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-01-31 Antti Koivisto <antti@apple.com>
+
+ Make CSSOM style() return CSSStyleDeclaration*
+ https://bugs.webkit.org/show_bug.cgi?id=77475
+
+ Reviewed by Anders Carlsson
+
+ CSSStyleRule::style() and some other places return CSSMutableStyleDeclaration.
+ They should return the plain CSSOM type instead.
+
+ CSSMutableStyleDeclaration* should be available through non-CSSOM function.
+
+ * css/CSSFontFaceRule.h:
+ (WebCore::CSSFontFaceRule::style):
+ (WebCore::CSSFontFaceRule::declaration):
+ * css/CSSFontSelector.cpp:
+ (WebCore::CSSFontSelector::addFontFaceRule):
+ * css/CSSStyleRule.h:
+ (WebCore::CSSStyleRule::style):
+ (WebCore::CSSStyleRule::declaration):
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::styleForKeyframe):
+ * css/WebKitCSSKeyframeRule.h:
+ (WebCore):
+ (WebCore::WebKitCSSKeyframeRule::style):
+ (WebCore::WebKitCSSKeyframeRule::declaration):
+ (WebKitCSSKeyframeRule):
+ * editing/EditingStyle.cpp:
+ (WebCore::styleFromMatchedRulesForElement):
+ * inspector/InspectorStyleSheet.cpp:
+ (WebCore::InspectorStyleSheet::revalidateStyle):
+ * page/PageSerializer.cpp:
+ (WebCore::PageSerializer::retrieveResourcesForCSSRule):
+ * svg/SVGFontFaceElement.cpp:
+ (WebCore::SVGFontFaceElement::parseMappedAttribute):
+ (WebCore::SVGFontFaceElement::fontFamily):
+ (WebCore::SVGFontFaceElement::rebuildFontFace):
+
2012-01-31 Scott Graham <scottmg@chromium.org>
[Chromium] Remove references to gyp cygwin build target
~CSSFontFaceRule();
- CSSMutableStyleDeclaration* style() const { return m_style.get(); }
+ CSSStyleDeclaration* style() const { return m_style.get(); }
String cssText() const;
+ CSSMutableStyleDeclaration* declaration() const { return m_style.get(); }
void setDeclaration(PassRefPtr<CSSMutableStyleDeclaration> style) { m_style = style; }
void addSubresourceStyleURLs(ListHashSet<KURL>& urls);
void CSSFontSelector::addFontFaceRule(const CSSFontFaceRule* fontFaceRule)
{
// Obtain the font-family property and the src property. Both must be defined.
- const CSSMutableStyleDeclaration* style = fontFaceRule->style();
+ const CSSMutableStyleDeclaration* style = fontFaceRule->declaration();
RefPtr<CSSValue> fontFamily = style->getPropertyCSSValue(CSSPropertyFontFamily);
RefPtr<CSSValue> src = style->getPropertyCSSValue(CSSPropertySrc);
RefPtr<CSSValue> unicodeRange = style->getPropertyCSSValue(CSSPropertyUnicodeRange);
String selectorText() const;
void setSelectorText(const String&);
- CSSMutableStyleDeclaration* style() const { return m_style.get(); }
+ CSSStyleDeclaration* style() const { return m_style.get(); }
String cssText() const;
void setDeclaration(PassRefPtr<CSSMutableStyleDeclaration> style) { ASSERT(style->parentRule() == this); m_style = style; }
const CSSSelectorList& selectorList() const { return m_selectorList; }
- CSSMutableStyleDeclaration* declaration() { return m_style.get(); }
+ CSSMutableStyleDeclaration* declaration() const { return m_style.get(); }
void addSubresourceStyleURLs(ListHashSet<KURL>& urls);
PassRefPtr<RenderStyle> CSSStyleSelector::styleForKeyframe(const RenderStyle* elementStyle, const WebKitCSSKeyframeRule* keyframeRule, KeyframeValue& keyframe)
{
if (keyframeRule->style())
- addMatchedDeclaration(keyframeRule->style());
+ addMatchedDeclaration(keyframeRule->declaration());
ASSERT(!m_style);
#endif
// Add all the animating properties to the keyframe.
- if (CSSMutableStyleDeclaration* styleDeclaration = keyframeRule->style()) {
+ if (CSSMutableStyleDeclaration* styleDeclaration = keyframeRule->declaration()) {
unsigned propertyCount = styleDeclaration->propertyCount();
for (unsigned i = 0; i < propertyCount; ++i) {
int property = styleDeclaration->propertyAt(i).id();
#ifndef WebKitCSSKeyframeRule_h
#define WebKitCSSKeyframeRule_h
+#include "CSSMutableStyleDeclaration.h"
#include "CSSRule.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
namespace WebCore {
-class CSSMutableStyleDeclaration;
-
typedef int ExceptionCode;
class WebKitCSSKeyframeRule : public CSSRule {
void getKeys(Vector<float>& keys) const { parseKeyString(m_key, keys); }
- CSSMutableStyleDeclaration* style() const { return m_style.get(); }
+ CSSStyleDeclaration* style() const { return m_style.get(); }
String cssText() const;
+ CSSMutableStyleDeclaration* declaration() const { return m_style.get(); }
void setDeclaration(PassRefPtr<CSSMutableStyleDeclaration>);
- CSSMutableStyleDeclaration* declaration() { return m_style.get(); }
- const CSSMutableStyleDeclaration* declaration() const { return m_style.get(); }
-
private:
static void parseKeyString(const String& s, Vector<float>& keys);
if (matchedRules) {
for (unsigned i = 0; i < matchedRules->length(); i++) {
if (matchedRules->item(i)->type() == CSSRule::STYLE_RULE) {
- RefPtr<CSSMutableStyleDeclaration> s = static_cast<CSSStyleRule*>(matchedRules->item(i))->style();
+ RefPtr<CSSMutableStyleDeclaration> s = static_cast<CSSStyleRule*>(matchedRules->item(i))->declaration();
style->merge(s.get(), true);
}
}
for (unsigned i = 0, size = m_flatRules.size(); i < size; ++i) {
CSSStyleRule* parsedRule = m_flatRules.at(i);
if (parsedRule->style() == pageStyle) {
- if (parsedRule->style()->asText() != pageStyle->cssText()) {
+ if (parsedRule->declaration()->asText() != pageStyle->cssText()) {
// Clear the disabled properties for the invalid style here.
m_inspectorStyles.remove(pageStyle);
setStyleText(pageStyle, pageStyle->cssText());
void PageSerializer::retrieveResourcesForCSSRule(CSSStyleRule* rule)
{
- retrieveResourcesForCSSDeclaration(rule->style());
+ retrieveResourcesForCSSDeclaration(rule->declaration());
}
void PageSerializer::retrieveResourcesForCSSDeclaration(CSSMutableStyleDeclaration* styleDeclaration)
{
int propId = cssPropertyIdForSVGAttributeName(attr->name());
if (propId > 0) {
- m_fontFaceRule->style()->setProperty(propId, attr->value(), false);
+ m_fontFaceRule->declaration()->setProperty(propId, attr->value(), false);
rebuildFontFace();
return;
}
String SVGFontFaceElement::fontFamily() const
{
- return m_fontFaceRule->style()->getPropertyValue(CSSPropertyFontFamily);
+ return m_fontFaceRule->declaration()->getPropertyValue(CSSPropertyFontFamily);
}
SVGFontElement* SVGFontFaceElement::associatedFontElement() const
// Parse in-memory CSS rules
CSSProperty srcProperty(CSSPropertySrc, list);
const CSSProperty* srcPropertyRef = &srcProperty;
- m_fontFaceRule->style()->addParsedProperties(&srcPropertyRef, 1);
+ m_fontFaceRule->declaration()->addParsedProperties(&srcPropertyRef, 1);
if (describesParentFont) {
// Traverse parsed CSS values and associate CSSFontFaceSrcValue elements with ourselves.
- RefPtr<CSSValue> src = m_fontFaceRule->style()->getPropertyCSSValue(CSSPropertySrc);
+ RefPtr<CSSValue> src = m_fontFaceRule->declaration()->getPropertyCSSValue(CSSPropertySrc);
CSSValueList* srcList = static_cast<CSSValueList*>(src.get());
unsigned srcLength = srcList ? srcList->length() : 0;