http://trac.webkit.org/changeset/111751
https://bugs.webkit.org/show_bug.cgi?id=82060
caused 15% page cycler regression for chromium-linux
(Requested by eae on #webkit).
Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-03-23
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::collectMatchingRulesForList):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111867
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-03-23 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r111751.
+ http://trac.webkit.org/changeset/111751
+ https://bugs.webkit.org/show_bug.cgi?id=82060
+
+ caused 15% page cycler regression for chromium-linux
+ (Requested by eae on #webkit).
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::collectMatchingRulesForList):
+
2012-03-23 Kentaro Hara <haraken@chromium.org>
Support [ImplementedAs] for attributes
2012-03-23 Kentaro Hara <haraken@chromium.org>
Support [ImplementedAs] for attributes
return 0;
#endif
StyledElement* p = static_cast<StyledElement*>(parent);
return 0;
#endif
StyledElement* p = static_cast<StyledElement*>(parent);
+ if (p->inlineStyle())
+ return 0;
#if ENABLE(SVG)
if (p->isSVGElement() && static_cast<SVGElement*>(p)->animatedSMILStyleProperties())
return 0;
#if ENABLE(SVG)
if (p->isSVGElement() && static_cast<SVGElement*>(p)->animatedSMILStyleProperties())
return 0;
-static inline bool stylesEqual(const StylePropertySet* a, const StylePropertySet* b)
+// This function makes some assumptions that only make sense for attribute styles (we only compare CSSProperty::id() and CSSProperty::value().)
+static inline bool attributeStylesEqual(StylePropertySet* a, StylePropertySet* b)
{
if (a == b)
return true;
{
if (a == b)
return true;
const CSSProperty& bProperty = b->propertyAt(j);
if (aProperty.id() != bProperty.id())
continue;
const CSSProperty& bProperty = b->propertyAt(j);
if (aProperty.id() != bProperty.id())
continue;
-
- // We don't check the short-hand property because long-hand vs short-hand is handled by checking the property set's count above.
- if (aProperty.isImportant() != bProperty.isImportant()
- || aProperty.isInherited() != bProperty.isInherited() || aProperty.isImplicit() != bProperty.isImplicit())
- return false;
-
// We could get a few more hits by comparing cssText() here, but that gets expensive quickly.
if (aProperty.value() != bProperty.value())
return false;
// We could get a few more hits by comparing cssText() here, but that gets expensive quickly.
if (aProperty.value() != bProperty.value())
return false;
break;
}
if (j == propertyCount)
break;
}
if (j == propertyCount)
return false;
if (element->hasClass() != m_element->hasClass())
return false;
return false;
if (element->hasClass() != m_element->hasClass())
return false;
+ if (element->inlineStyle())
+ return false;
#if ENABLE(SVG)
if (element->isSVGElement() && static_cast<SVGElement*>(element)->animatedSMILStyleProperties())
return false;
#endif
if (!!element->attributeStyle() != !!m_styledElement->attributeStyle())
return false;
#if ENABLE(SVG)
if (element->isSVGElement() && static_cast<SVGElement*>(element)->animatedSMILStyleProperties())
return false;
#endif
if (!!element->attributeStyle() != !!m_styledElement->attributeStyle())
return false;
- if (!!element->inlineStyle() != !!m_styledElement->inlineStyle())
- return false;
-
StylePropertySet* additionalAttributeStyleA = element->additionalAttributeStyle();
StylePropertySet* additionalAttributeStyleB = m_styledElement->additionalAttributeStyle();
if (!additionalAttributeStyleA != !additionalAttributeStyleB)
StylePropertySet* additionalAttributeStyleA = element->additionalAttributeStyle();
StylePropertySet* additionalAttributeStyleB = m_styledElement->additionalAttributeStyle();
if (!additionalAttributeStyleA != !additionalAttributeStyleB)
if (element->hasClass() && m_element->getAttribute(classAttr) != element->getAttribute(classAttr))
return false;
if (element->hasClass() && m_element->getAttribute(classAttr) != element->getAttribute(classAttr))
return false;
- if (element->attributeStyle() && !stylesEqual(element->attributeStyle(), m_styledElement->attributeStyle()))
- return false;
-
- if (additionalAttributeStyleA && !stylesEqual(additionalAttributeStyleA, additionalAttributeStyleB))
+ if (element->attributeStyle() && !attributeStylesEqual(element->attributeStyle(), m_styledElement->attributeStyle()))
- if (element->inlineStyle() && !stylesEqual(element->inlineStyle(), m_styledElement->inlineStyle()))
+ if (additionalAttributeStyleA && !attributeStylesEqual(additionalAttributeStyleA, additionalAttributeStyleB))
return false;
if (element->isLink() && m_elementLinkState != style->insideLink())
return false;
if (element->isLink() && m_elementLinkState != style->insideLink())
{
if (!m_styledElement || !m_parentStyle)
return 0;
{
if (!m_styledElement || !m_parentStyle)
return 0;
+ // If the element has inline style it is probably unique.
+ if (m_styledElement->inlineStyle())
+ return 0;
#if ENABLE(SVG)
if (m_styledElement->isSVGElement() && static_cast<SVGElement*>(m_styledElement)->animatedSMILStyleProperties())
return 0;
#if ENABLE(SVG)
if (m_styledElement->isSVGElement() && static_cast<SVGElement*>(m_styledElement)->animatedSMILStyleProperties())
return 0;