Commit 1290708b authored by akling@apple.com's avatar akling@apple.com

Move create() methods from StylePropertySet to MutableStylePropertySet.

<http://webkit.org/b/114574>

Reviewed by Antti Koivisto.

Move the two create() methods that create MutableStylePropertySets from StylePropertySet
to MutableStylePropertySet, and make them actually return MutableStylePropertySets.
Switch to using {Pass,}RefPtr<MutableStylePropertySet> where appropriate to keep things building.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::copyPropertiesInSet):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseFontFaceValue):
* css/DOMWindowCSS.cpp:
(WebCore::DOMWindowCSS::supports):
* css/ElementRuleCollector.cpp:
(WebCore::leftToRightDeclaration):
(WebCore::rightToLeftDeclaration):
* css/FontLoader.cpp:
(WebCore::FontLoader::resolveFontStyle):
* css/StylePropertySet.cpp:
(WebCore::StylePropertySet::copyPropertiesInSet):
(WebCore::MutableStylePropertySet::create):
* css/StylePropertySet.h:
(StylePropertySet):
(MutableStylePropertySet):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::resolveVariables):
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::setMatrixValue):
* dom/Attr.cpp:
(WebCore::Attr::style):
* dom/Document.cpp:
(WebCore::Document::createCSSStyleDeclaration):
* dom/StyledElement.cpp:
(WebCore::StyledElement::ensureMutableInlineStyle):
(WebCore::StyledElement::rebuildPresentationAttributeStyle):
* editing/ApplyStyleCommand.cpp:
(WebCore::copyStyleOrCreateEmpty):
* editing/EditingStyle.cpp:
(WebCore::editingStyleFromComputedStyle):
(WebCore::HTMLAttributeEquivalent::attributeValueAsCSSValue):
(WebCore::EditingStyle::setProperty):
(WebCore::EditingStyle::extractAndRemoveTextDirection):
(WebCore::styleFromMatchedRulesForElement):
(WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
(WebCore::EditingStyle::forceInline):
* editing/Editor.cpp:
(WebCore::Editor::setBaseWritingDirection):
* editing/EditorCommand.cpp:
(WebCore::executeApplyStyle):
(WebCore::executeToggleStyleInList):
(WebCore::executeApplyParagraphStyle):
(WebCore::executeMakeTextWritingDirectionLeftToRight):
(WebCore::executeMakeTextWritingDirectionNatural):
(WebCore::executeMakeTextWritingDirectionRightToLeft):
* html/HTMLTableElement.cpp:
(WebCore::leakBorderStyle):
(WebCore::HTMLTableElement::createSharedCellStyle):
(WebCore::leakGroupBorderStyle):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setFont):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::setPropertyText):
(WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges):
* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag):
* svg/SVGElementRareData.h:
(WebCore::SVGElementRareData::ensureAnimatedSMILStyleProperties):
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::SVGFontFaceElement):
* svg/SVGStyledElement.cpp:
(WebCore::SVGStyledElement::getPresentationAttribute):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2dcd5305
2013-04-14 Andreas Kling <akling@apple.com>
Move create() methods from StylePropertySet to MutableStylePropertySet.
<http://webkit.org/b/114574>
Reviewed by Antti Koivisto.
Move the two create() methods that create MutableStylePropertySets from StylePropertySet
to MutableStylePropertySet, and make them actually return MutableStylePropertySets.
Switch to using {Pass,}RefPtr<MutableStylePropertySet> where appropriate to keep things building.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::copyPropertiesInSet):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseFontFaceValue):
* css/DOMWindowCSS.cpp:
(WebCore::DOMWindowCSS::supports):
* css/ElementRuleCollector.cpp:
(WebCore::leftToRightDeclaration):
(WebCore::rightToLeftDeclaration):
* css/FontLoader.cpp:
(WebCore::FontLoader::resolveFontStyle):
* css/StylePropertySet.cpp:
(WebCore::StylePropertySet::copyPropertiesInSet):
(WebCore::MutableStylePropertySet::create):
* css/StylePropertySet.h:
(StylePropertySet):
(MutableStylePropertySet):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::resolveVariables):
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::setMatrixValue):
* dom/Attr.cpp:
(WebCore::Attr::style):
* dom/Document.cpp:
(WebCore::Document::createCSSStyleDeclaration):
* dom/StyledElement.cpp:
(WebCore::StyledElement::ensureMutableInlineStyle):
(WebCore::StyledElement::rebuildPresentationAttributeStyle):
* editing/ApplyStyleCommand.cpp:
(WebCore::copyStyleOrCreateEmpty):
* editing/EditingStyle.cpp:
(WebCore::editingStyleFromComputedStyle):
(WebCore::HTMLAttributeEquivalent::attributeValueAsCSSValue):
(WebCore::EditingStyle::setProperty):
(WebCore::EditingStyle::extractAndRemoveTextDirection):
(WebCore::styleFromMatchedRulesForElement):
(WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
(WebCore::EditingStyle::forceInline):
* editing/Editor.cpp:
(WebCore::Editor::setBaseWritingDirection):
* editing/EditorCommand.cpp:
(WebCore::executeApplyStyle):
(WebCore::executeToggleStyleInList):
(WebCore::executeApplyParagraphStyle):
(WebCore::executeMakeTextWritingDirectionLeftToRight):
(WebCore::executeMakeTextWritingDirectionNatural):
(WebCore::executeMakeTextWritingDirectionRightToLeft):
* html/HTMLTableElement.cpp:
(WebCore::leakBorderStyle):
(WebCore::HTMLTableElement::createSharedCellStyle):
(WebCore::leakGroupBorderStyle):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setFont):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::setPropertyText):
(WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges):
* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag):
* svg/SVGElementRareData.h:
(WebCore::SVGElementRareData::ensureAnimatedSMILStyleProperties):
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::SVGFontFaceElement):
* svg/SVGStyledElement.cpp:
(WebCore::SVGStyledElement::getPresentationAttribute):
2013-04-13 Sam Weinig <sam@webkit.org>
Fix three crashes seen on the bots after "Make Frame's ScriptController an OwnPtr and remove the #include"
......@@ -2990,7 +2990,7 @@ PassRefPtr<MutableStylePropertySet> CSSComputedStyleDeclaration::copyPropertiesI
if (value)
list.append(CSSProperty(set[i], value.release(), false));
}
return static_pointer_cast<MutableStylePropertySet>(StylePropertySet::create(list.data(), list.size()));
return MutableStylePropertySet::create(list.data(), list.size());
}
void CSSComputedStyleDeclaration::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
......
......@@ -1297,7 +1297,7 @@ PassRefPtr<CSSValueList> CSSParser::parseFontFaceValue(const AtomicString& strin
{
if (string.isEmpty())
return 0;
RefPtr<StylePropertySet> dummyStyle = StylePropertySet::create();
RefPtr<MutableStylePropertySet> dummyStyle = MutableStylePropertySet::create();
if (!parseValue(dummyStyle.get(), CSSPropertyFontFamily, string, false, CSSQuirksMode, 0))
return 0;
return static_pointer_cast<CSSValueList>(dummyStyle->getPropertyCSSValue(CSSPropertyFontFamily));
......
......@@ -73,7 +73,7 @@ bool DOMWindowCSS::supports(const String& property, const String& value) const
if (normalizedValue.isEmpty())
return false;
RefPtr<StylePropertySet> dummyStyle = StylePropertySet::create();
RefPtr<MutableStylePropertySet> dummyStyle = MutableStylePropertySet::create();
return CSSParser::parseValue(dummyStyle.get(), propertyID, normalizedValue, false, CSSStrictMode, 0);
}
......
......@@ -49,7 +49,7 @@ namespace WebCore {
static StylePropertySet* leftToRightDeclaration()
{
DEFINE_STATIC_LOCAL(RefPtr<StylePropertySet>, leftToRightDecl, (StylePropertySet::create()));
DEFINE_STATIC_LOCAL(RefPtr<MutableStylePropertySet>, leftToRightDecl, (MutableStylePropertySet::create()));
if (leftToRightDecl->isEmpty())
leftToRightDecl->setProperty(CSSPropertyDirection, CSSValueLtr);
return leftToRightDecl.get();
......@@ -57,7 +57,7 @@ static StylePropertySet* leftToRightDeclaration()
static StylePropertySet* rightToLeftDeclaration()
{
DEFINE_STATIC_LOCAL(RefPtr<StylePropertySet>, rightToLeftDecl, (StylePropertySet::create()));
DEFINE_STATIC_LOCAL(RefPtr<MutableStylePropertySet>, rightToLeftDecl, (MutableStylePropertySet::create()));
if (rightToLeftDecl->isEmpty())
rightToLeftDecl->setProperty(CSSPropertyDirection, CSSValueRtl);
return rightToLeftDecl.get();
......
......@@ -269,7 +269,7 @@ static void applyPropertyToCurrentStyle(StyleResolver* styleResolver, CSSPropert
bool FontLoader::resolveFontStyle(const String& fontString, Font& font)
{
// Interpret fontString in the same way as the 'font' attribute of CanvasRenderingContext2D.
RefPtr<StylePropertySet> parsedStyle = StylePropertySet::create();
RefPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::create();
CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, true, CSSStrictMode, 0);
if (parsedStyle->isEmpty())
return false;
......
......@@ -1221,7 +1221,7 @@ PassRefPtr<MutableStylePropertySet> StylePropertySet::copyPropertiesInSet(const
if (value)
list.append(CSSProperty(set[i], value.release(), false));
}
return static_pointer_cast<MutableStylePropertySet>(StylePropertySet::create(list.data(), list.size()));
return MutableStylePropertySet::create(list.data(), list.size());
}
PropertySetCSSStyleDeclaration* StylePropertySet::cssStyleDeclaration()
......@@ -1292,12 +1292,12 @@ void StylePropertySet::showStyle()
}
#endif
PassRefPtr<StylePropertySet> StylePropertySet::create(CSSParserMode cssParserMode)
PassRefPtr<MutableStylePropertySet> MutableStylePropertySet::create(CSSParserMode cssParserMode)
{
return adoptRef(new MutableStylePropertySet(cssParserMode));
}
PassRefPtr<StylePropertySet> StylePropertySet::create(const CSSProperty* properties, unsigned count)
PassRefPtr<MutableStylePropertySet> MutableStylePropertySet::create(const CSSProperty* properties, unsigned count)
{
return adoptRef(new MutableStylePropertySet(properties, count));
}
......
......@@ -50,8 +50,6 @@ public:
// the appropriate subclass type.
void deref();
static PassRefPtr<StylePropertySet> create(CSSParserMode = CSSQuirksMode);
static PassRefPtr<StylePropertySet> create(const CSSProperty* properties, unsigned count);
static PassRefPtr<StylePropertySet> createImmutable(const CSSProperty* properties, unsigned count, CSSParserMode);
class PropertyReference {
......@@ -233,13 +231,18 @@ inline const StylePropertyMetadata* StylePropertySet::immutableMetadataArray() c
class MutableStylePropertySet : public StylePropertySet {
public:
static PassRefPtr<MutableStylePropertySet> create(CSSParserMode = CSSQuirksMode);
static PassRefPtr<MutableStylePropertySet> create(const CSSProperty* properties, unsigned count);
MutableStylePropertySet(const StylePropertySet&);
Vector<CSSProperty, 4> m_propertyVector;
private:
MutableStylePropertySet(CSSParserMode cssParserMode)
: StylePropertySet(cssParserMode)
{ }
MutableStylePropertySet(const CSSProperty* properties, unsigned count);
MutableStylePropertySet(const StylePropertySet&);
Vector<CSSProperty, 4> m_propertyVector;
};
inline Vector<CSSProperty, 4>& StylePropertySet::mutablePropertyVector()
......
......@@ -2194,7 +2194,7 @@ void StyleResolver::resolveVariables(CSSPropertyID id, CSSValue* value, Vector<s
knownExpressions.append(expression);
// FIXME: It would be faster not to re-parse from strings, but for now CSS property validation lives inside the parser so we do it there.
RefPtr<StylePropertySet> resultSet = StylePropertySet::create();
RefPtr<MutableStylePropertySet> resultSet = MutableStylePropertySet::create();
if (!CSSParser::parseValue(resultSet.get(), id, expression.second, false, document()))
return; // expression failed to parse.
......
......@@ -56,7 +56,7 @@ void WebKitCSSMatrix::setMatrixValue(const String& string, ExceptionCode& ec)
if (string.isEmpty())
return;
RefPtr<StylePropertySet> styleDeclaration = StylePropertySet::create();
RefPtr<MutableStylePropertySet> styleDeclaration = MutableStylePropertySet::create();
if (CSSParser::parseValue(styleDeclaration.get(), CSSPropertyWebkitTransform, string, true, CSSStrictMode, 0)) {
// Convert to TransformOperations. This can fail if a property
// requires style (i.e., param uses 'ems' or 'exs')
......
......@@ -196,7 +196,7 @@ CSSStyleDeclaration* Attr::style()
// This function only exists to support the Obj-C bindings.
if (!m_element || !m_element->isStyledElement())
return 0;
m_style = StylePropertySet::create();
m_style = MutableStylePropertySet::create();
static_cast<StyledElement*>(m_element)->collectStyleForPresentationAttribute(qualifiedName(), value(), static_cast<MutableStylePropertySet*>(m_style.get()));
return m_style->ensureCSSStyleDeclaration();
}
......
......@@ -957,7 +957,7 @@ PassRefPtr<Text> Document::createEditingTextNode(const String& text)
PassRefPtr<CSSStyleDeclaration> Document::createCSSStyleDeclaration()
{
return StylePropertySet::create()->ensureCSSStyleDeclaration();
return MutableStylePropertySet::create()->ensureCSSStyleDeclaration();
}
PassRefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionCode& ec)
......
......@@ -150,7 +150,7 @@ MutableStylePropertySet* StyledElement::ensureMutableInlineStyle()
{
RefPtr<StylePropertySet>& inlineStyle = ensureUniqueElementData()->m_inlineStyle;
if (!inlineStyle)
inlineStyle = StylePropertySet::create(strictToCSSParserMode(isHTMLElement() && !document()->inQuirksMode()));
inlineStyle = MutableStylePropertySet::create(strictToCSSParserMode(isHTMLElement() && !document()->inQuirksMode()));
else if (!inlineStyle->isMutable())
inlineStyle = inlineStyle->mutableCopy();
ASSERT(inlineStyle->isMutable());
......@@ -333,7 +333,7 @@ void StyledElement::rebuildPresentationAttributeStyle()
style = cacheIterator->value->value;
presentationAttributeCacheCleaner().didHitPresentationAttributeCache();
} else {
style = StylePropertySet::create(isSVGElement() ? SVGAttributeMode : CSSQuirksMode);
style = MutableStylePropertySet::create(isSVGElement() ? SVGAttributeMode : CSSQuirksMode);
unsigned size = attributeCount();
for (unsigned i = 0; i < size; ++i) {
const Attribute* attribute = attributeItem(i);
......
......@@ -297,10 +297,10 @@ void ApplyStyleCommand::applyBlockStyle(EditingStyle *style)
updateStartEnd(startRange->startPosition(), endRange->startPosition());
}
static PassRefPtr<StylePropertySet> copyStyleOrCreateEmpty(const StylePropertySet* style)
static PassRefPtr<MutableStylePropertySet> copyStyleOrCreateEmpty(const StylePropertySet* style)
{
if (!style)
return StylePropertySet::create();
return MutableStylePropertySet::create();
return style->mutableCopy();
}
......
......@@ -104,7 +104,7 @@ static inline bool isEditingProperty(int id)
static PassRefPtr<MutableStylePropertySet> editingStyleFromComputedStyle(PassRefPtr<CSSComputedStyleDeclaration> style, EditingPropertiesType type = OnlyInheritableEditingProperties)
{
if (!style)
return static_pointer_cast<MutableStylePropertySet>(StylePropertySet::create());
return MutableStylePropertySet::create();
return copyEditingProperties(style.get(), type);
}
......@@ -259,8 +259,8 @@ PassRefPtr<CSSValue> HTMLAttributeEquivalent::attributeValueAsCSSValue(Element*
if (!element->hasAttribute(m_attrName))
return 0;
RefPtr<StylePropertySet> dummyStyle;
dummyStyle = StylePropertySet::create();
RefPtr<MutableStylePropertySet> dummyStyle;
dummyStyle = MutableStylePropertySet::create();
dummyStyle->setProperty(m_propertyID, element->getAttribute(m_attrName));
return dummyStyle->getPropertyCSSValue(m_propertyID);
}
......@@ -451,7 +451,7 @@ void EditingStyle::removeTextFillAndStrokeColorsIfNeeded(RenderStyle* renderStyl
void EditingStyle::setProperty(CSSPropertyID propertyID, const String& value, bool important)
{
if (!m_mutableStyle)
m_mutableStyle = StylePropertySet::create();
m_mutableStyle = MutableStylePropertySet::create();
m_mutableStyle->setProperty(propertyID, value, important);
}
......@@ -569,7 +569,7 @@ PassRefPtr<EditingStyle> EditingStyle::extractAndRemoveBlockProperties()
PassRefPtr<EditingStyle> EditingStyle::extractAndRemoveTextDirection()
{
RefPtr<EditingStyle> textDirection = EditingStyle::create();
textDirection->m_mutableStyle = StylePropertySet::create();
textDirection->m_mutableStyle = MutableStylePropertySet::create();
textDirection->m_mutableStyle->setProperty(CSSPropertyUnicodeBidi, CSSValueEmbed, m_mutableStyle->propertyIsImportant(CSSPropertyUnicodeBidi));
textDirection->m_mutableStyle->setProperty(CSSPropertyDirection, m_mutableStyle->getPropertyValue(CSSPropertyDirection),
m_mutableStyle->propertyIsImportant(CSSPropertyDirection));
......@@ -1074,7 +1074,7 @@ void EditingStyle::mergeStyle(const StylePropertySet* style, CSSPropertyOverride
static PassRefPtr<StylePropertySet> styleFromMatchedRulesForElement(Element* element, unsigned rulesToInclude)
{
RefPtr<StylePropertySet> style = StylePropertySet::create();
RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
RefPtr<CSSRuleList> matchedRules = element->document()->styleResolver()->styleRulesForElement(element, rulesToInclude);
if (matchedRules) {
for (unsigned i = 0; i < matchedRules->length(); i++) {
......@@ -1107,7 +1107,7 @@ void EditingStyle::mergeStyleFromRulesForSerialization(StyledElement* element)
// For example: style="height: 1%; overflow: visible;" in quirksmode
// FIXME: There are others like this, see <rdar://problem/5195123> Slashdot copy/paste fidelity problem
RefPtr<CSSComputedStyleDeclaration> computedStyleForElement = CSSComputedStyleDeclaration::create(element);
RefPtr<StylePropertySet> fromComputedStyle = StylePropertySet::create();
RefPtr<MutableStylePropertySet> fromComputedStyle = MutableStylePropertySet::create();
{
unsigned propertyCount = m_mutableStyle->propertyCount();
for (unsigned i = 0; i < propertyCount; ++i) {
......@@ -1178,7 +1178,7 @@ void EditingStyle::removePropertiesInElementDefaultStyle(Element* element)
void EditingStyle::forceInline()
{
if (!m_mutableStyle)
m_mutableStyle = StylePropertySet::create();
m_mutableStyle = MutableStylePropertySet::create();
const bool propertyIsImportant = true;
m_mutableStyle->setProperty(CSSPropertyDisplay, CSSValueInline, propertyIsImportant);
}
......
......@@ -1369,7 +1369,7 @@ void Editor::setBaseWritingDirection(WritingDirection direction)
return;
}
RefPtr<StylePropertySet> style = StylePropertySet::create();
RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
style->setProperty(CSSPropertyDirection, direction == LeftToRightWritingDirection ? "ltr" : direction == RightToLeftWritingDirection ? "rtl" : "inherit", false);
applyParagraphStyleToSelection(style.get(), EditActionSetWritingDirection);
}
......
......@@ -118,14 +118,14 @@ static bool applyCommandToFrame(Frame* frame, EditorCommandSource source, EditAc
static bool executeApplyStyle(Frame* frame, EditorCommandSource source, EditAction action, CSSPropertyID propertyID, const String& propertyValue)
{
RefPtr<StylePropertySet> style = StylePropertySet::create();
RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
style->setProperty(propertyID, propertyValue);
return applyCommandToFrame(frame, source, action, style.get());
}
static bool executeApplyStyle(Frame* frame, EditorCommandSource source, EditAction action, CSSPropertyID propertyID, int propertyValue)
{
RefPtr<StylePropertySet> style = StylePropertySet::create();
RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
style->setProperty(propertyID, propertyValue);
return applyCommandToFrame(frame, source, action, style.get());
}
......@@ -152,7 +152,7 @@ static bool executeToggleStyleInList(Frame* frame, EditorCommandSource source, E
newStyle = value->cssText();
// FIXME: We shouldn't be having to convert new style into text. We should have setPropertyCSSValue.
RefPtr<StylePropertySet> newMutableStyle = StylePropertySet::create();
RefPtr<MutableStylePropertySet> newMutableStyle = MutableStylePropertySet::create();
newMutableStyle->setProperty(propertyID, newStyle);
return applyCommandToFrame(frame, source, action, newMutableStyle.get());
}
......@@ -175,7 +175,7 @@ static bool executeToggleStyle(Frame* frame, EditorCommandSource source, EditAct
static bool executeApplyParagraphStyle(Frame* frame, EditorCommandSource source, EditAction action, CSSPropertyID propertyID, const String& propertyValue)
{
RefPtr<StylePropertySet> style = StylePropertySet::create();
RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
style->setProperty(propertyID, propertyValue);
// FIXME: We don't call shouldApplyStyle when the source is DOM; is there a good reason for that?
switch (source) {
......@@ -588,7 +588,7 @@ static bool executeJustifyRight(Frame* frame, Event*, EditorCommandSource source
static bool executeMakeTextWritingDirectionLeftToRight(Frame* frame, Event*, EditorCommandSource, const String&)
{
RefPtr<StylePropertySet> style = StylePropertySet::create();
RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
style->setProperty(CSSPropertyUnicodeBidi, CSSValueEmbed);
style->setProperty(CSSPropertyDirection, CSSValueLtr);
frame->editor()->applyStyle(style.get(), EditActionSetWritingDirection);
......@@ -597,7 +597,7 @@ static bool executeMakeTextWritingDirectionLeftToRight(Frame* frame, Event*, Edi
static bool executeMakeTextWritingDirectionNatural(Frame* frame, Event*, EditorCommandSource, const String&)
{
RefPtr<StylePropertySet> style = StylePropertySet::create();
RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
style->setProperty(CSSPropertyUnicodeBidi, CSSValueNormal);
frame->editor()->applyStyle(style.get(), EditActionSetWritingDirection);
return true;
......@@ -605,7 +605,7 @@ static bool executeMakeTextWritingDirectionNatural(Frame* frame, Event*, EditorC
static bool executeMakeTextWritingDirectionRightToLeft(Frame* frame, Event*, EditorCommandSource, const String&)
{
RefPtr<StylePropertySet> style = StylePropertySet::create();
RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
style->setProperty(CSSPropertyUnicodeBidi, CSSValueEmbed);
style->setProperty(CSSPropertyDirection, CSSValueRtl);
frame->editor()->applyStyle(style.get(), EditActionSetWritingDirection);
......
......@@ -415,7 +415,7 @@ void HTMLTableElement::parseAttribute(const QualifiedName& name, const AtomicStr
static StylePropertySet* leakBorderStyle(int value)
{
RefPtr<StylePropertySet> style = StylePropertySet::create();
RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
style->setProperty(CSSPropertyBorderTopStyle, value);
style->setProperty(CSSPropertyBorderBottomStyle, value);
style->setProperty(CSSPropertyBorderLeftStyle, value);
......@@ -471,7 +471,7 @@ HTMLTableElement::CellBorders HTMLTableElement::cellBorders() const
PassRefPtr<StylePropertySet> HTMLTableElement::createSharedCellStyle()
{
RefPtr<StylePropertySet> style = StylePropertySet::create();
RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
switch (cellBorders()) {
case SolidBordersColsOnly:
......@@ -518,7 +518,7 @@ const StylePropertySet* HTMLTableElement::additionalCellStyle()
static StylePropertySet* leakGroupBorderStyle(int rows)
{
RefPtr<StylePropertySet> style = StylePropertySet::create();
RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
if (rows) {
style->setProperty(CSSPropertyBorderTopWidth, CSSValueThin);
style->setProperty(CSSPropertyBorderBottomWidth, CSSValueThin);
......
......@@ -2026,7 +2026,7 @@ void CanvasRenderingContext2D::setFont(const String& newFont)
if (newFont == state().m_unparsedFont && state().m_realizedFont)
return;
RefPtr<StylePropertySet> parsedStyle = StylePropertySet::create();
RefPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::create();
CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, newFont, true, strictToCSSParserMode(!m_usesCSSCompatibilityParseMode), 0);
if (parsedStyle->isEmpty())
return;
......
......@@ -372,7 +372,7 @@ bool InspectorStyle::setPropertyText(unsigned index, const String& propertyText,
populateAllProperties(&allProperties);
if (propertyText.stripWhiteSpace().length()) {
RefPtr<StylePropertySet> tempMutableStyle = StylePropertySet::create();
RefPtr<MutableStylePropertySet> tempMutableStyle = MutableStylePropertySet::create();
RefPtr<CSSRuleSourceData> sourceData = CSSRuleSourceData::create(CSSRuleSourceData::STYLE_RULE);
Document* ownerDocument = m_parentStyleSheet->pageStyleSheet() ? m_parentStyleSheet->pageStyleSheet()->ownerDocument() : 0;
createCSSParser(ownerDocument)->parseDeclaration(tempMutableStyle.get(), propertyText + " " + bogusPropertyName + ": none", sourceData, m_style->parentStyleSheet()->contents());
......@@ -1534,7 +1534,7 @@ bool InspectorStyleSheetForInlineStyle::getStyleAttributeRanges(CSSRuleSourceDat
return true;
}
RefPtr<StylePropertySet> tempDeclaration = StylePropertySet::create();
RefPtr<MutableStylePropertySet> tempDeclaration = MutableStylePropertySet::create();
createCSSParser(m_element->document())->parseDeclaration(tempDeclaration.get(), m_styleText, result, m_element->document()->elementSheet()->contents());
return true;
}
......
......@@ -473,7 +473,7 @@ bool DragController::concludeEditDrag(DragData* dragData)
if (!color.isValid())
return false;
RefPtr<Range> innerRange = innerFrame->selection()->toNormalizedRange();
RefPtr<StylePropertySet> style = StylePropertySet::create();
RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
style->setProperty(CSSPropertyColor, color.serialized(), false);
if (!innerFrame->editor()->shouldApplyStyle(style.get(), innerRange.get()))
return false;
......
......@@ -79,7 +79,7 @@ public:
StylePropertySet* ensureAnimatedSMILStyleProperties()
{
if (!m_animatedSMILStyleProperties)
m_animatedSMILStyleProperties = StylePropertySet::create(SVGAttributeMode);
m_animatedSMILStyleProperties = MutableStylePropertySet::create(SVGAttributeMode);
return m_animatedSMILStyleProperties.get();
}
......
......@@ -53,7 +53,7 @@ inline SVGFontFaceElement::SVGFontFaceElement(const QualifiedName& tagName, Docu
, m_fontElement(0)
{
ASSERT(hasTagName(font_faceTag));
RefPtr<StylePropertySet> styleDeclaration = StylePropertySet::create(CSSStrictMode);
RefPtr<MutableStylePropertySet> styleDeclaration = MutableStylePropertySet::create(CSSStrictMode);
m_fontFaceRule->setProperties(styleDeclaration.release());
}
......
......@@ -406,7 +406,7 @@ PassRefPtr<CSSValue> SVGStyledElement::getPresentationAttribute(const String& na
if (!attr)
return 0;
RefPtr<StylePropertySet> style = StylePropertySet::create(SVGAttributeMode);
RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(SVGAttributeMode);
CSSPropertyID propertyID = SVGStyledElement::cssPropertyIdForSVGAttributeName(attr->name());
style->setProperty(propertyID, attr->value());
RefPtr<CSSValue> cssValue = style->getPropertyCSSValue(propertyID);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment