WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
another possible patch
cacheable-inline-style.patch (text/plain), 31.74 KB, created by
Antti Koivisto
on 2012-03-06 09:42:21 PST
(
hide
)
Description:
another possible patch
Filename:
MIME Type:
Creator:
Antti Koivisto
Created:
2012-03-06 09:42:21 PST
Size:
31.74 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 109925) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,87 @@ >+2012-03-06 Antti Koivisto <antti@apple.com> >+ >+ https://bugs.webkit.org/show_bug.cgi?id=80370 >+ Re-enable matched declaration caching for elements with a style attribute >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Make the property set for style attribute immutable as long as there is no CSSOM >+ wrapper for it. If the style attribute changes we create a new property set instead >+ of recycling the old one. This way the property sets can be made cacheable as long >+ as there is no CSSOM wrapper that would allow uncontrolled modifications. Constructing >+ the wrapper disables caching. >+ >+ Made StyledElement::inlineStyle() and StyledElement::ensureInlineStyle() return a const >+ StylePropertySet so making accidental modifications difficult. Also dropped *Decl from >+ the names. >+ >+ * css/CSSStyleSelector.cpp: >+ (WebCore::CSSStyleSelector::collectMatchingRulesForList): >+ * css/StylePropertySet.h: >+ (StylePropertySet): >+ (WebCore::StylePropertySet::hasCSSOMWrapper): >+ * dom/ElementAttributeData.cpp: >+ (WebCore): >+ (WebCore::ElementAttributeData::ensureInlineStyle): >+ (WebCore::ElementAttributeData::ensureMutableInlineStyle): >+ (WebCore::ElementAttributeData::destroyInlineStyle): >+ * dom/ElementAttributeData.h: >+ (WebCore::ElementAttributeData::inlineStyle): >+ (ElementAttributeData): >+ * dom/StyledElement.cpp: >+ (WebCore::StyledElement::updateStyleAttribute): >+ (WebCore::StyledElement::~StyledElement): >+ (WebCore): >+ (WebCore::StyledElement::style): >+ (WebCore::StyledElement::parseAttribute): >+ (WebCore::StyledElement::setInlineStyleProperty): >+ (WebCore::StyledElement::removeInlineStyleProperty): >+ (WebCore::StyledElement::addSubresourceAttributeURLs): >+ * dom/StyledElement.h: >+ (WebCore::StyledElement::inlineStyle): >+ (WebCore::StyledElement::ensureInlineStyle): >+ (StyledElement): >+ (WebCore::StyledElement::destroyInlineStyle): >+ * editing/ApplyStyleCommand.cpp: >+ (WebCore::hasNoAttributeOrOnlyStyleAttribute): >+ (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): >+ (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock): >+ (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange): >+ (WebCore::ApplyStyleCommand::removeCSSStyle): >+ (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown): >+ (WebCore::ApplyStyleCommand::addBlockStyle): >+ (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded): >+ * editing/EditingStyle.cpp: >+ (WebCore::HTMLElementEquivalent::propertyExistsInStyle): >+ (HTMLTextDecorationEquivalent): >+ (WebCore::HTMLTextDecorationEquivalent::propertyExistsInStyle): >+ (WebCore::EditingStyle::conflictsWithInlineStyleOfElement): >+ (WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent): >+ (WebCore::EditingStyle::mergeInlineStyleOfElement): >+ (WebCore::elementMatchesAndPropertyIsNotInInlineStyleDecl): >+ (WebCore::EditingStyle::mergeStyle): >+ * editing/EditingStyle.h: >+ (EditingStyle): >+ * editing/RemoveCSSPropertyCommand.cpp: >+ (WebCore::RemoveCSSPropertyCommand::doApply): >+ * editing/ReplaceSelectionCommand.cpp: >+ (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline): >+ (WebCore::ReplaceSelectionCommand::handleStyleSpans): >+ * editing/markup.cpp: >+ (WebCore::StyledMarkupAccumulator::appendElement): >+ (WebCore::styleFromMatchedRulesAndInlineDecl): >+ * html/HTMLElement.cpp: >+ (WebCore::StyledElement::copyNonAttributeProperties): >+ * html/canvas/CanvasStyle.cpp: >+ (WebCore::currentColor): >+ * page/PageSerializer.cpp: >+ (WebCore::PageSerializer::serializeFrame): >+ (WebCore::PageSerializer::retrieveResourcesForProperties): >+ * page/PageSerializer.h: >+ (PageSerializer): >+ * rendering/RenderTreeAsText.cpp: >+ (WebCore::isEmptyOrUnstyledAppleStyleSpan): >+ > 2012-03-06 Vsevolod Vlasov <vsevik@chromium.org> > > Web Inspector: Open link in resources panel only works the second time >Index: Source/WebCore/css/CSSStyleSelector.cpp >=================================================================== >--- Source/WebCore/css/CSSStyleSelector.cpp (revision 109814) >+++ Source/WebCore/css/CSSStyleSelector.cpp (working copy) >@@ -1083,8 +1083,12 @@ void CSSStyleSelector::matchAllRules(Mat > matchAuthorRules(result, false); > > // Now check our inline style attribute. >- if (m_matchAuthorAndUserStyles && m_styledElement) >- addElementStyleProperties(result, m_styledElement->inlineStyleDecl(), false /* isCacheable */); >+ if (m_matchAuthorAndUserStyles && m_styledElement && m_styledElement->inlineStyle()) { >+ // Inline style is immutable as long as there is no CSSOM wrapper. >+ bool isCacheable = !m_styledElement->inlineStyle()->hasCSSOMWrapper(); >+ // FIXME: Constify. >+ addElementStyleProperties(result, const_cast<StylePropertySet*>(m_styledElement->inlineStyle()), isCacheable); >+ } > > #if ENABLE(SVG) > // Now check SMIL animation override style. >@@ -1144,7 +1148,7 @@ Node* CSSStyleSelector::locateCousinList > return 0; > #endif > StyledElement* p = static_cast<StyledElement*>(parent); >- if (p->inlineStyleDecl()) >+ if (p->inlineStyle()) > return 0; > #if ENABLE(SVG) > if (p->isSVGElement() && static_cast<SVGElement*>(p)->animatedSMILStyleProperties()) >@@ -1289,7 +1293,7 @@ bool CSSStyleSelector::canShareStyleWith > return false; > if (element->hasClass() != m_element->hasClass()) > return false; >- if (element->inlineStyleDecl()) >+ if (element->inlineStyle()) > return false; > #if ENABLE(SVG) > if (element->isSVGElement() && static_cast<SVGElement*>(element)->animatedSMILStyleProperties()) >@@ -1403,7 +1407,7 @@ RenderStyle* CSSStyleSelector::locateSha > if (!m_styledElement || !m_parentStyle) > return 0; > // If the element has inline style it is probably unique. >- if (m_styledElement->inlineStyleDecl()) >+ if (m_styledElement->inlineStyle()) > return 0; > #if ENABLE(SVG) > if (m_styledElement->isSVGElement() && static_cast<SVGElement*>(m_styledElement)->animatedSMILStyleProperties()) >Index: Source/WebCore/css/StylePropertySet.h >=================================================================== >--- Source/WebCore/css/StylePropertySet.h (revision 109814) >+++ Source/WebCore/css/StylePropertySet.h (working copy) >@@ -107,6 +107,8 @@ public: > CSSStyleDeclaration* ensureCSSStyleDeclaration() const; > CSSStyleDeclaration* ensureRuleCSSStyleDeclaration(const CSSRule* parentRule) const; > CSSStyleDeclaration* ensureInlineCSSStyleDeclaration(const StyledElement* parentElement) const; >+ >+ bool hasCSSOMWrapper() const { return m_hasCSSOMWrapper; } > > private: > StylePropertySet(); >Index: Source/WebCore/dom/ElementAttributeData.cpp >=================================================================== >--- Source/WebCore/dom/ElementAttributeData.cpp (revision 109814) >+++ Source/WebCore/dom/ElementAttributeData.cpp (working copy) >@@ -52,8 +52,8 @@ void ElementAttributeData::setClass(cons > { > m_classNames.set(className, shouldFoldCase); > } >- >-StylePropertySet* ElementAttributeData::ensureInlineStyleDecl(StyledElement* element) >+ >+StylePropertySet* ElementAttributeData::ensureInlineStyle(StyledElement* element) > { > if (!m_inlineStyleDecl) { > ASSERT(element->isStyledElement()); >@@ -63,7 +63,17 @@ StylePropertySet* ElementAttributeData:: > return m_inlineStyleDecl.get(); > } > >-void ElementAttributeData::destroyInlineStyleDecl(StyledElement* element) >+StylePropertySet* ElementAttributeData::ensureMutableInlineStyle(StyledElement* element) >+{ >+ if (m_inlineStyleDecl && !m_inlineStyleDecl->hasCSSOMWrapper()) { >+ m_inlineStyleDecl = m_inlineStyleDecl->copy(); >+ m_inlineStyleDecl->setStrictParsing(element->isHTMLElement() && !element->document()->inQuirksMode()); >+ return m_inlineStyleDecl.get(); >+ } >+ return ensureInlineStyle(element); >+} >+ >+void ElementAttributeData::destroyInlineStyle(StyledElement* element) > { > if (!m_inlineStyleDecl) > return; >Index: Source/WebCore/dom/ElementAttributeData.h >=================================================================== >--- Source/WebCore/dom/ElementAttributeData.h (revision 109814) >+++ Source/WebCore/dom/ElementAttributeData.h (working copy) >@@ -90,9 +90,10 @@ public: > const AtomicString& idForStyleResolution() const { return m_idForStyleResolution; } > void setIdForStyleResolution(const AtomicString& newId) { m_idForStyleResolution = newId; } > >- StylePropertySet* inlineStyleDecl() { return m_inlineStyleDecl.get(); } >- StylePropertySet* ensureInlineStyleDecl(StyledElement*); >- void destroyInlineStyleDecl(StyledElement* element); >+ StylePropertySet* inlineStyle() { return m_inlineStyleDecl.get(); } >+ StylePropertySet* ensureInlineStyle(StyledElement*); >+ StylePropertySet* ensureMutableInlineStyle(StyledElement*); >+ void destroyInlineStyle(StyledElement* element); > > StylePropertySet* attributeStyle() const { return m_attributeStyle.get(); } > void setAttributeStyle(PassRefPtr<StylePropertySet> style) { m_attributeStyle = style; } >Index: Source/WebCore/dom/StyledElement.cpp >=================================================================== >--- Source/WebCore/dom/StyledElement.cpp (revision 109814) >+++ Source/WebCore/dom/StyledElement.cpp (working copy) >@@ -50,13 +50,18 @@ void StyledElement::updateStyleAttribute > { > ASSERT(!isStyleAttributeValid()); > setIsStyleAttributeValid(); >- if (StylePropertySet* inlineStyle = inlineStyleDecl()) >+ if (const StylePropertySet* inlineStyle = this->inlineStyle()) > const_cast<StyledElement*>(this)->setAttribute(styleAttr, inlineStyle->asText(), /*notifyChanged*/ false); > } > > StyledElement::~StyledElement() > { >- destroyInlineStyleDecl(); >+ destroyInlineStyle(); >+} >+ >+CSSStyleDeclaration* StyledElement::style() >+{ >+ return ensureAttributeData()->ensureMutableInlineStyle(this)->ensureInlineCSSStyleDeclaration(this); > } > > void StyledElement::attributeChanged(Attribute* attr) >@@ -97,9 +102,15 @@ void StyledElement::parseAttribute(Attri > classAttributeChanged(attr->value()); > else if (attr->name() == styleAttr) { > if (attr->isNull()) >- destroyInlineStyleDecl(); >- else if (document()->contentSecurityPolicy()->allowInlineStyle()) >- ensureInlineStyleDecl()->parseDeclaration(attr->value(), document()->elementSheet()); >+ destroyInlineStyle(); >+ else if (document()->contentSecurityPolicy()->allowInlineStyle()) { >+ if (const StylePropertySet* inlineStyle = this->inlineStyle()) { >+ // Keep inline style property sets without CSSOM wrappers immutable. This way they can be cached. >+ if (!inlineStyle->hasCSSOMWrapper()) >+ destroyInlineStyle(); >+ } >+ ensureAttributeData()->ensureInlineStyle(this)->parseDeclaration(attr->value(), document()->elementSheet()); >+ } > setIsStyleAttributeValid(); > setNeedsStyleRecalc(); > InspectorInstrumentation::didInvalidateStyleAttr(document(), this); >@@ -115,21 +126,21 @@ void StyledElement::inlineStyleChanged() > > bool StyledElement::setInlineStyleProperty(int propertyID, int identifier, bool important) > { >- ensureInlineStyleDecl()->setProperty(propertyID, document()->cssValuePool()->createIdentifierValue(identifier), important); >+ ensureAttributeData()->ensureMutableInlineStyle(this)->setProperty(propertyID, document()->cssValuePool()->createIdentifierValue(identifier), important); > inlineStyleChanged(); > return true; > } > > bool StyledElement::setInlineStyleProperty(int propertyID, double value, CSSPrimitiveValue::UnitTypes unit, bool important) > { >- ensureInlineStyleDecl()->setProperty(propertyID, document()->cssValuePool()->createValue(value, unit), important); >+ ensureAttributeData()->ensureMutableInlineStyle(this)->setProperty(propertyID, document()->cssValuePool()->createValue(value, unit), important); > inlineStyleChanged(); > return true; > } > > bool StyledElement::setInlineStyleProperty(int propertyID, const String& value, bool important) > { >- bool changes = ensureInlineStyleDecl()->setProperty(propertyID, value, important, document()->elementSheet()); >+ bool changes = ensureAttributeData()->ensureMutableInlineStyle(this)->setProperty(propertyID, value, important, document()->elementSheet()); > if (changes) > inlineStyleChanged(); > return changes; >@@ -137,7 +148,7 @@ bool StyledElement::setInlineStyleProper > > bool StyledElement::removeInlineStyleProperty(int propertyID) > { >- bool changes = ensureInlineStyleDecl()->removeProperty(propertyID); >+ bool changes = ensureAttributeData()->ensureMutableInlineStyle(this)->removeProperty(propertyID); > if (changes) > inlineStyleChanged(); > return changes; >@@ -145,7 +156,7 @@ bool StyledElement::removeInlineStylePro > > void StyledElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const > { >- if (StylePropertySet* inlineStyle = inlineStyleDecl()) >+ if (StylePropertySet* inlineStyle = attributeData() ? attributeData()->inlineStyle() : 0) > inlineStyle->addSubresourceStyleURLs(urls, document()->elementSheet()); > } > >Index: Source/WebCore/dom/StyledElement.h >=================================================================== >--- Source/WebCore/dom/StyledElement.h (revision 109814) >+++ Source/WebCore/dom/StyledElement.h (working copy) >@@ -39,8 +39,8 @@ public: > virtual StylePropertySet* additionalAttributeStyle() { return 0; } > void invalidateStyleAttribute(); > >- StylePropertySet* inlineStyleDecl() const { return attributeData() ? attributeData()->inlineStyleDecl() : 0; } >- StylePropertySet* ensureInlineStyleDecl() { return ensureAttributeData()->ensureInlineStyleDecl(this); } >+ const StylePropertySet* inlineStyle() const { return attributeData() ? attributeData()->inlineStyle() : 0; } >+ const StylePropertySet* ensureInlineStyle() { return ensureAttributeData()->ensureInlineStyle(this); } > > // Unlike StylePropertySet setters, these implement invalidation. > bool setInlineStyleProperty(int propertyID, int identifier, bool important = false); >@@ -48,7 +48,7 @@ public: > bool setInlineStyleProperty(int propertyID, const String& value, bool important = false); > bool removeInlineStyleProperty(int propertyID); > >- virtual CSSStyleDeclaration* style() OVERRIDE { return ensureInlineStyleDecl()->ensureInlineCSSStyleDeclaration(this); } >+ virtual CSSStyleDeclaration* style() OVERRIDE; > > StylePropertySet* attributeStyle(); > >@@ -84,10 +84,10 @@ private: > > void updateAttributeStyle(); > >- void destroyInlineStyleDecl() >+ void destroyInlineStyle() > { > if (attributeData()) >- attributeData()->destroyInlineStyleDecl(this); >+ attributeData()->destroyInlineStyle(this); > } > }; > >Index: Source/WebCore/editing/ApplyStyleCommand.cpp >=================================================================== >--- Source/WebCore/editing/ApplyStyleCommand.cpp (revision 109814) >+++ Source/WebCore/editing/ApplyStyleCommand.cpp (working copy) >@@ -80,7 +80,7 @@ static bool hasNoAttributeOrOnlyStyleAtt > if (element->getAttribute(classAttr) == styleSpanClassString()) > matchedAttributes++; > if (element->hasAttribute(styleAttr) && (shouldStyleAttributeBeEmpty == AllowNonEmptyStyleAttribute >- || !element->inlineStyleDecl() || element->inlineStyleDecl()->isEmpty())) >+ || !element->inlineStyle() || element->inlineStyle()->isEmpty())) > matchedAttributes++; > > ASSERT(matchedAttributes <= element->attributeCount()); >@@ -382,7 +382,7 @@ void ApplyStyleCommand::applyRelativeFon > } > lastStyledNode = node; > >- StylePropertySet* inlineStyleDecl = element->ensureInlineStyleDecl(); >+ RefPtr<StylePropertySet> inlineStyleDecl = element->ensureInlineStyle()->copy(); > float currentFontSize = computedFontSize(node); > float desiredFontSize = max(MinimumFontSize, startingFontSizes.get(node) + style->fontSizeDelta()); > RefPtr<CSSValue> value = inlineStyleDecl->getPropertyCSSValue(CSSPropertyFontSize); >@@ -509,7 +509,7 @@ void ApplyStyleCommand::removeEmbeddingU > // other attributes, like we (should) do with B and I elements. > removeNodeAttribute(element, dirAttr); > } else { >- RefPtr<StylePropertySet> inlineStyle = element->ensureInlineStyleDecl()->copy(); >+ RefPtr<StylePropertySet> inlineStyle = element-> ensureInlineStyle()->copy(); > inlineStyle->setProperty(CSSPropertyUnicodeBidi, CSSValueNormal); > inlineStyle->removeProperty(CSSPropertyDirection); > setNodeAttribute(element, styleAttr, inlineStyle->asText()); >@@ -723,7 +723,7 @@ void ApplyStyleCommand::applyInlineStyle > break; > // Add to this element's inline style and skip over its contents. > HTMLElement* element = toHTMLElement(node); >- RefPtr<StylePropertySet> inlineStyle = element->ensureInlineStyleDecl()->copy(); >+ RefPtr<StylePropertySet> inlineStyle = element-> ensureInlineStyle()->copy(); > inlineStyle->merge(style->style()); > setNodeAttribute(element, styleAttr, inlineStyle->asText()); > next = node->traverseNextSibling(); >@@ -888,7 +888,7 @@ bool ApplyStyleCommand::removeCSSStyle(E > if (!style->conflictsWithInlineStyleOfElement(element, extractedStyle, properties)) > return false; > >- StylePropertySet* inlineStyle = element->inlineStyleDecl(); >+ const StylePropertySet* inlineStyle = element->inlineStyle(); > ASSERT(inlineStyle); > // FIXME: We should use a mass-removal function here but we don't have an undoable one yet. > for (size_t i = 0; i < properties.size(); i++) >@@ -932,7 +932,7 @@ void ApplyStyleCommand::applyInlineStyle > return; > > RefPtr<EditingStyle> newInlineStyle = style; >- if (node->isHTMLElement() && toHTMLElement(node)->inlineStyleDecl()) { >+ if (node->isHTMLElement() && toHTMLElement(node)->inlineStyle()) { > newInlineStyle = style->copy(); > newInlineStyle->mergeInlineStyleOfElement(toHTMLElement(node), EditingStyle::OverrideValues); > } >@@ -1308,7 +1308,7 @@ void ApplyStyleCommand::addBlockStyle(co > return; > > String cssText = styleChange.cssStyle(); >- if (StylePropertySet* decl = block->inlineStyleDecl()) >+ if (const StylePropertySet* decl = block->inlineStyle()) > cssText += decl->asText(); > setNodeAttribute(block, styleAttr, cssText); > } >@@ -1373,7 +1373,7 @@ void ApplyStyleCommand::addInlineStyleIf > > if (styleChange.cssStyle().length()) { > if (styleContainer) { >- if (StylePropertySet* existingStyle = styleContainer->inlineStyleDecl()) >+ if (const StylePropertySet* existingStyle = styleContainer->inlineStyle()) > setNodeAttribute(styleContainer, styleAttr, existingStyle->asText() + styleChange.cssStyle()); > else > setNodeAttribute(styleContainer, styleAttr, styleChange.cssStyle()); >Index: Source/WebCore/editing/EditingStyle.cpp >=================================================================== >--- Source/WebCore/editing/EditingStyle.cpp (revision 109814) >+++ Source/WebCore/editing/EditingStyle.cpp (working copy) >@@ -125,7 +125,7 @@ public: > virtual ~HTMLElementEquivalent() { } > virtual bool matches(const Element* element) const { return !m_tagName || element->hasTagName(*m_tagName); } > virtual bool hasAttribute() const { return false; } >- virtual bool propertyExistsInStyle(StylePropertySet* style) const { return style && style->getPropertyCSSValue(m_propertyID); } >+ virtual bool propertyExistsInStyle(const StylePropertySet* style) const { return style && style->getPropertyCSSValue(m_propertyID); } > virtual bool valueIsPresentInStyle(Element*, StylePropertySet*) const; > virtual void addToStyle(Element*, EditingStyle*) const; > >@@ -175,7 +175,7 @@ public: > { > return adoptPtr(new HTMLTextDecorationEquivalent(primitiveValue, tagName)); > } >- virtual bool propertyExistsInStyle(StylePropertySet*) const; >+ virtual bool propertyExistsInStyle(const StylePropertySet*) const; > virtual bool valueIsPresentInStyle(Element*, StylePropertySet*) const; > > private: >@@ -188,7 +188,7 @@ HTMLTextDecorationEquivalent::HTMLTextDe > { > } > >-bool HTMLTextDecorationEquivalent::propertyExistsInStyle(StylePropertySet* style) const >+bool HTMLTextDecorationEquivalent::propertyExistsInStyle(const StylePropertySet* style) const > { > return style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect) || style->getPropertyCSSValue(CSSPropertyTextDecoration); > } >@@ -664,7 +664,7 @@ bool EditingStyle::conflictsWithInlineSt > ASSERT(element); > ASSERT(!conflictingProperties || conflictingProperties->isEmpty()); > >- StylePropertySet* inlineStyle = element->inlineStyleDecl(); >+ const StylePropertySet* inlineStyle = element->inlineStyle(); > if (!m_mutableStyle || !inlineStyle) > return false; > >@@ -850,7 +850,7 @@ bool EditingStyle::elementIsStyledSpanOr > matchedAttributes++; > > if (element->hasAttribute(HTMLNames::styleAttr)) { >- if (StylePropertySet* style = element->inlineStyleDecl()) { >+ if (const StylePropertySet* style = element->inlineStyle()) { > unsigned propertyCount = style->propertyCount(); > for (unsigned i = 0; i < propertyCount; ++i) { > if (!isEditingProperty(style->propertyAt(i).id())) >@@ -912,18 +912,18 @@ void EditingStyle::mergeTypingStyle(Docu > void EditingStyle::mergeInlineStyleOfElement(StyledElement* element, CSSPropertyOverrideMode mode, PropertiesToInclude propertiesToInclude) > { > ASSERT(element); >- if (!element->inlineStyleDecl()) >+ if (!element->inlineStyle()) > return; > > switch (propertiesToInclude) { > case AllProperties: >- mergeStyle(element->inlineStyleDecl(), mode); >+ mergeStyle(element->inlineStyle(), mode); > return; > case OnlyEditingInheritableProperties: >- mergeStyle(copyEditingProperties(element->inlineStyleDecl(), OnlyInheritableEditingProperties).get(), mode); >+ mergeStyle(copyEditingProperties(element->inlineStyle(), OnlyInheritableEditingProperties).get(), mode); > return; > case EditingPropertiesInEffect: >- mergeStyle(copyEditingProperties(element->inlineStyleDecl(), AllEditingProperties).get(), mode); >+ mergeStyle(copyEditingProperties(element->inlineStyle(), AllEditingProperties).get(), mode); > return; > } > } >@@ -931,7 +931,7 @@ void EditingStyle::mergeInlineStyleOfEle > static inline bool elementMatchesAndPropertyIsNotInInlineStyleDecl(const HTMLElementEquivalent* equivalent, const StyledElement* element, > EditingStyle::CSSPropertyOverrideMode mode, StylePropertySet* style) > { >- return equivalent->matches(element) && !equivalent->propertyExistsInStyle(element->inlineStyleDecl()) >+ return equivalent->matches(element) && !equivalent->propertyExistsInStyle(element->inlineStyle()) > && (mode == EditingStyle::OverrideValues || !equivalent->propertyExistsInStyle(style)); > } > >@@ -997,7 +997,7 @@ static void mergeTextDecorationValues(CS > mergedValue->append(lineThrough.get()); > } > >-void EditingStyle::mergeStyle(StylePropertySet* style, CSSPropertyOverrideMode mode) >+void EditingStyle::mergeStyle(const StylePropertySet* style, CSSPropertyOverrideMode mode) > { > if (!style) > return; >Index: Source/WebCore/editing/EditingStyle.h >=================================================================== >--- Source/WebCore/editing/EditingStyle.h (revision 109814) >+++ Source/WebCore/editing/EditingStyle.h (working copy) >@@ -161,7 +161,7 @@ private: > TriState triStateOfStyle(CSSStyleDeclaration* styleToCompare, ShouldIgnoreTextOnlyProperties) const; > bool conflictsWithInlineStyleOfElement(StyledElement*, EditingStyle* extractedStyle, Vector<CSSPropertyID>* conflictingProperties) const; > void mergeInlineAndImplicitStyleOfElement(StyledElement*, CSSPropertyOverrideMode, PropertiesToInclude); >- void mergeStyle(StylePropertySet*, CSSPropertyOverrideMode); >+ void mergeStyle(const StylePropertySet*, CSSPropertyOverrideMode); > > RefPtr<StylePropertySet> m_mutableStyle; > bool m_shouldUseFixedDefaultFontSize; >Index: Source/WebCore/editing/RemoveCSSPropertyCommand.cpp >=================================================================== >--- Source/WebCore/editing/RemoveCSSPropertyCommand.cpp (revision 109814) >+++ Source/WebCore/editing/RemoveCSSPropertyCommand.cpp (working copy) >@@ -43,7 +43,7 @@ RemoveCSSPropertyCommand::RemoveCSSPrope > > void RemoveCSSPropertyCommand::doApply() > { >- StylePropertySet* style = m_element->inlineStyleDecl(); >+ const StylePropertySet* style = m_element->inlineStyle(); > m_oldValue = style->getPropertyValue(m_property); > m_important = style->propertyIsImportant(m_property); > >Index: Source/WebCore/editing/ReplaceSelectionCommand.cpp >=================================================================== >--- Source/WebCore/editing/ReplaceSelectionCommand.cpp (revision 109814) >+++ Source/WebCore/editing/ReplaceSelectionCommand.cpp (working copy) >@@ -484,7 +484,7 @@ void ReplaceSelectionCommand::removeRedu > > StyledElement* element = static_cast<StyledElement*>(node.get()); > >- StylePropertySet* inlineStyle = element->inlineStyleDecl(); >+ const StylePropertySet* inlineStyle = element->inlineStyle(); > RefPtr<EditingStyle> newInlineStyle = EditingStyle::create(inlineStyle); > if (inlineStyle) { > ContainerNode* context = element->parentNode(); >@@ -703,7 +703,7 @@ void ReplaceSelectionCommand::handleStyl > if (!wrappingStyleSpan) > return; > >- RefPtr<EditingStyle> style = EditingStyle::create(wrappingStyleSpan->ensureInlineStyleDecl()); >+ RefPtr<EditingStyle> style = EditingStyle::create(wrappingStyleSpan->ensureInlineStyle()); > ContainerNode* context = wrappingStyleSpan->parentNode(); > > // If Mail wraps the fragment with a Paste as Quotation blockquote, or if you're pasting into a quoted region, >Index: Source/WebCore/editing/markup.cpp >=================================================================== >--- Source/WebCore/editing/markup.cpp (revision 109814) >+++ Source/WebCore/editing/markup.cpp (working copy) >@@ -310,8 +310,8 @@ void StyledMarkupAccumulator::appendElem > } else > newInlineStyle = EditingStyle::create(); > >- if (element->isStyledElement() && static_cast<StyledElement*>(element)->inlineStyleDecl()) >- newInlineStyle->overrideWithStyle(static_cast<StyledElement*>(element)->inlineStyleDecl()); >+ if (element->isStyledElement() && static_cast<StyledElement*>(element)->inlineStyle()) >+ newInlineStyle->overrideWithStyle(static_cast<StyledElement*>(element)->inlineStyle()); > > if (shouldAnnotateOrForceInline) { > if (shouldAnnotate()) >@@ -495,7 +495,7 @@ static PassRefPtr<EditingStyle> styleFro > // FIXME: Having to const_cast here is ugly, but it is quite a bit of work to untangle > // the non-const-ness of styleFromMatchedRulesForElement. > HTMLElement* element = const_cast<HTMLElement*>(static_cast<const HTMLElement*>(node)); >- RefPtr<EditingStyle> style = EditingStyle::create(element->inlineStyleDecl()); >+ RefPtr<EditingStyle> style = EditingStyle::create(element->inlineStyle()); > style->mergeStyleFromRules(element); > return style.release(); > } >Index: Source/WebCore/html/HTMLElement.cpp >=================================================================== >--- Source/WebCore/html/HTMLElement.cpp (revision 109814) >+++ Source/WebCore/html/HTMLElement.cpp (working copy) >@@ -1106,12 +1106,12 @@ void StyledElement::copyNonAttributeProp > ASSERT(sourceElement->isStyledElement()); > > const StyledElement* source = static_cast<const StyledElement*>(sourceElement); >- if (!source->inlineStyleDecl()) >+ if (!source->inlineStyle()) > return; > >- StylePropertySet* inlineStyle = ensureInlineStyleDecl(); >- inlineStyle->copyPropertiesFrom(*source->inlineStyleDecl()); >- inlineStyle->setStrictParsing(source->inlineStyleDecl()->useStrictParsing()); >+ StylePropertySet* inlineStyle = ensureAttributeData()->ensureMutableInlineStyle(this); >+ inlineStyle->copyPropertiesFrom(*source->inlineStyle()); >+ inlineStyle->setStrictParsing(source->inlineStyle()->useStrictParsing()); > > setIsStyleAttributeValid(source->isStyleAttributeValid()); > >Index: Source/WebCore/html/canvas/CanvasStyle.cpp >=================================================================== >--- Source/WebCore/html/canvas/CanvasStyle.cpp (revision 109814) >+++ Source/WebCore/html/canvas/CanvasStyle.cpp (working copy) >@@ -69,7 +69,7 @@ RGBA32 currentColor(HTMLCanvasElement* c > if (!canvas || !canvas->inDocument()) > return Color::black; > RGBA32 rgba = Color::black; >- CSSParser::parseColor(rgba, canvas->ensureInlineStyleDecl()->getPropertyValue(CSSPropertyColor)); >+ CSSParser::parseColor(rgba, canvas->ensureInlineStyle()->getPropertyValue(CSSPropertyColor)); > return rgba; > } > >Index: Source/WebCore/page/PageSerializer.cpp >=================================================================== >--- Source/WebCore/page/PageSerializer.cpp (revision 109814) >+++ Source/WebCore/page/PageSerializer.cpp (working copy) >@@ -228,7 +228,7 @@ void PageSerializer::serializeFrame(Fram > Element* element = toElement(node); > // We have to process in-line style as it might contain some resources (typically background images). > if (element->isStyledElement()) >- retrieveResourcesForProperties(static_cast<StyledElement*>(element)->inlineStyleDecl(), document); >+ retrieveResourcesForProperties(static_cast<StyledElement*>(element)->inlineStyle(), document); > > if (element->hasTagName(HTMLNames::imgTag)) { > HTMLImageElement* imageElement = static_cast<HTMLImageElement*>(element); >@@ -308,7 +308,7 @@ void PageSerializer::retrieveResourcesFo > retrieveResourcesForProperties(rule->properties(), document); > } > >-void PageSerializer::retrieveResourcesForProperties(StylePropertySet* styleDeclaration, Document* document) >+void PageSerializer::retrieveResourcesForProperties(const StylePropertySet* styleDeclaration, Document* document) > { > if (!styleDeclaration) > return; >Index: Source/WebCore/page/PageSerializer.h >=================================================================== >--- Source/WebCore/page/PageSerializer.h (revision 109814) >+++ Source/WebCore/page/PageSerializer.h (working copy) >@@ -78,7 +78,7 @@ private: > void serializeCSSStyleSheet(CSSStyleSheet*, const KURL&); > > void addImageToResources(CachedImage*, RenderObject*, const KURL&); >- void retrieveResourcesForProperties(StylePropertySet*, Document*); >+ void retrieveResourcesForProperties(const StylePropertySet*, Document*); > void retrieveResourcesForRule(StyleRule*, Document*); > > Vector<Resource>* m_resources; >Index: Source/WebCore/rendering/RenderTreeAsText.cpp >=================================================================== >--- Source/WebCore/rendering/RenderTreeAsText.cpp (revision 109814) >+++ Source/WebCore/rendering/RenderTreeAsText.cpp (working copy) >@@ -183,7 +183,7 @@ static bool isEmptyOrUnstyledAppleStyleS > if (!node->hasChildNodes()) > return true; > >- StylePropertySet* inlineStyleDecl = elem->inlineStyleDecl(); >+ const StylePropertySet* inlineStyleDecl = elem->inlineStyle(); > return (!inlineStyleDecl || inlineStyleDecl->isEmpty()); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
webkit-ews
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 80370
:
130273
|
130395
|
130590
|
130609