Title: [107185] trunk/Source/WebCore
Revision
107185
Author
kl...@webkit.org
Date
2012-02-08 23:14:55 -0800 (Wed, 08 Feb 2012)

Log Message

Simplify ownership of StyledElement::additionalAttributeStyles().
<http://webkit.org/b/78204>

Reviewed by Anders Carlsson.

Change additionalAttributeStyle() to return a raw pointer rather than a PassRefPtr.

* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::matchAllRules):
(WebCore::CSSStyleSelector::canShareStyleWithElement):
* dom/StyledElement.h:
(WebCore::StyledElement::additionalAttributeStyle):
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::additionalAttributeStyle):
* html/HTMLTableCellElement.h:
(HTMLTableCellElement):
* html/HTMLTableColElement.cpp:
(WebCore::HTMLTableColElement::additionalAttributeStyle):
* html/HTMLTableColElement.h:
(HTMLTableColElement):
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::additionalAttributeStyle):
(WebCore::HTMLTableElement::additionalCellStyle):
(WebCore::HTMLTableElement::additionalGroupStyle):
* html/HTMLTableElement.h:
(HTMLTableElement):
* html/HTMLTableSectionElement.cpp:
(WebCore::HTMLTableSectionElement::additionalAttributeStyle):
* html/HTMLTableSectionElement.h:
(HTMLTableSectionElement):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (107184 => 107185)


--- trunk/Source/WebCore/ChangeLog	2012-02-09 07:14:24 UTC (rev 107184)
+++ trunk/Source/WebCore/ChangeLog	2012-02-09 07:14:55 UTC (rev 107185)
@@ -1,3 +1,36 @@
+2012-02-08  Andreas Kling  <awesomekl...@apple.com>
+
+        Simplify ownership of StyledElement::additionalAttributeStyles().
+        <http://webkit.org/b/78204>
+
+        Reviewed by Anders Carlsson.
+
+        Change additionalAttributeStyle() to return a raw pointer rather than a PassRefPtr.
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::matchAllRules):
+        (WebCore::CSSStyleSelector::canShareStyleWithElement):
+        * dom/StyledElement.h:
+        (WebCore::StyledElement::additionalAttributeStyle):
+        * html/HTMLTableCellElement.cpp:
+        (WebCore::HTMLTableCellElement::additionalAttributeStyle):
+        * html/HTMLTableCellElement.h:
+        (HTMLTableCellElement):
+        * html/HTMLTableColElement.cpp:
+        (WebCore::HTMLTableColElement::additionalAttributeStyle):
+        * html/HTMLTableColElement.h:
+        (HTMLTableColElement):
+        * html/HTMLTableElement.cpp:
+        (WebCore::HTMLTableElement::additionalAttributeStyle):
+        (WebCore::HTMLTableElement::additionalCellStyle):
+        (WebCore::HTMLTableElement::additionalGroupStyle):
+        * html/HTMLTableElement.h:
+        (HTMLTableElement):
+        * html/HTMLTableSectionElement.cpp:
+        (WebCore::HTMLTableSectionElement::additionalAttributeStyle):
+        * html/HTMLTableSectionElement.h:
+        (HTMLTableSectionElement):
+
 2012-02-08  Kentaro Hara  <hara...@chromium.org>
 
         Rename [Optional=CallWithDefalutValue] and [Optional=CallWithNullValue]

Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (107184 => 107185)


--- trunk/Source/WebCore/css/CSSStyleSelector.cpp	2012-02-09 07:14:24 UTC (rev 107184)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp	2012-02-09 07:14:55 UTC (rev 107185)
@@ -1009,11 +1009,11 @@
         // Now we check additional mapped declarations.
         // Tables and table cells share an additional mapped rule that must be applied
         // after all attributes, since their mapped style depends on the values of multiple attributes.
-        if (RefPtr<StylePropertySet> additionalStyle = m_styledElement->additionalAttributeStyle()) {
+        if (StylePropertySet* additionalStyle = m_styledElement->additionalAttributeStyle()) {
             if (result.ranges.firstAuthorRule == -1)
                 result.ranges.firstAuthorRule = m_matchedDecls.size();
             result.ranges.lastAuthorRule = m_matchedDecls.size();
-            addMatchedDeclaration(additionalStyle.get());
+            addMatchedDeclaration(additionalStyle);
             result.isCacheable = false;
         }
 
@@ -1236,8 +1236,8 @@
         return false;
     if (!!element->attributeStyle() != !!m_styledElement->attributeStyle())
         return false;
-    StylePropertySet* additionalAttributeStyleA = element->additionalAttributeStyle().get();
-    StylePropertySet* additionalAttributeStyleB = m_styledElement->additionalAttributeStyle().get();
+    StylePropertySet* additionalAttributeStyleA = element->additionalAttributeStyle();
+    StylePropertySet* additionalAttributeStyleB = m_styledElement->additionalAttributeStyle();
     if (!additionalAttributeStyleA != !additionalAttributeStyleB)
         return false;
     if (element->isLink() != m_element->isLink())

Modified: trunk/Source/WebCore/dom/StyledElement.h (107184 => 107185)


--- trunk/Source/WebCore/dom/StyledElement.h	2012-02-09 07:14:24 UTC (rev 107184)
+++ trunk/Source/WebCore/dom/StyledElement.h	2012-02-09 07:14:55 UTC (rev 107185)
@@ -44,7 +44,7 @@
     void removeCSSProperties(int id1, int id2 = CSSPropertyInvalid, int id3 = CSSPropertyInvalid, int id4 = CSSPropertyInvalid, int id5 = CSSPropertyInvalid, int id6 = CSSPropertyInvalid, int id7 = CSSPropertyInvalid, int id8 = CSSPropertyInvalid);
     void removeCSSProperty(int id) { removeCSSProperties(id); }
 
-    virtual PassRefPtr<StylePropertySet> additionalAttributeStyle() { return 0; }
+    virtual StylePropertySet* additionalAttributeStyle() { return 0; }
     void invalidateStyleAttribute();
 
     StylePropertySet* inlineStyleDecl() const { return attributeData() ? attributeData()->inlineStyleDecl() : 0; }

Modified: trunk/Source/WebCore/html/HTMLTableCellElement.cpp (107184 => 107185)


--- trunk/Source/WebCore/html/HTMLTableCellElement.cpp	2012-02-09 07:14:24 UTC (rev 107184)
+++ trunk/Source/WebCore/html/HTMLTableCellElement.cpp	2012-02-09 07:14:55 UTC (rev 107185)
@@ -107,7 +107,7 @@
         HTMLTablePartElement::parseAttribute(attr);
 }
 
-PassRefPtr<StylePropertySet> HTMLTableCellElement::additionalAttributeStyle()
+StylePropertySet* HTMLTableCellElement::additionalAttributeStyle()
 {
     ContainerNode* p = parentNode();
     while (p && !p->hasTagName(tableTag))

Modified: trunk/Source/WebCore/html/HTMLTableCellElement.h (107184 => 107185)


--- trunk/Source/WebCore/html/HTMLTableCellElement.h	2012-02-09 07:14:24 UTC (rev 107184)
+++ trunk/Source/WebCore/html/HTMLTableCellElement.h	2012-02-09 07:14:55 UTC (rev 107185)
@@ -55,7 +55,7 @@
 
     virtual void parseAttribute(Attribute*) OVERRIDE;
 
-    virtual PassRefPtr<StylePropertySet> additionalAttributeStyle() OVERRIDE;
+    virtual StylePropertySet* additionalAttributeStyle() OVERRIDE;
 
     virtual bool isURLAttribute(Attribute*) const;
 

Modified: trunk/Source/WebCore/html/HTMLTableColElement.cpp (107184 => 107185)


--- trunk/Source/WebCore/html/HTMLTableColElement.cpp	2012-02-09 07:14:24 UTC (rev 107184)
+++ trunk/Source/WebCore/html/HTMLTableColElement.cpp	2012-02-09 07:14:55 UTC (rev 107185)
@@ -68,7 +68,7 @@
         HTMLTablePartElement::parseAttribute(attr);
 }
 
-PassRefPtr<StylePropertySet> HTMLTableColElement::additionalAttributeStyle()
+StylePropertySet* HTMLTableColElement::additionalAttributeStyle()
 {
     if (!hasLocalName(colgroupTag))
         return 0;

Modified: trunk/Source/WebCore/html/HTMLTableColElement.h (107184 => 107185)


--- trunk/Source/WebCore/html/HTMLTableColElement.h	2012-02-09 07:14:24 UTC (rev 107184)
+++ trunk/Source/WebCore/html/HTMLTableColElement.h	2012-02-09 07:14:55 UTC (rev 107185)
@@ -43,7 +43,7 @@
     HTMLTableColElement(const QualifiedName& tagName, Document*);
 
     virtual void parseAttribute(Attribute*) OVERRIDE;
-    virtual PassRefPtr<StylePropertySet> additionalAttributeStyle() OVERRIDE;
+    virtual StylePropertySet* additionalAttributeStyle() OVERRIDE;
 
     int m_span;
 };

Modified: trunk/Source/WebCore/html/HTMLTableElement.cpp (107184 => 107185)


--- trunk/Source/WebCore/html/HTMLTableElement.cpp	2012-02-09 07:14:24 UTC (rev 107184)
+++ trunk/Source/WebCore/html/HTMLTableElement.cpp	2012-02-09 07:14:55 UTC (rev 107185)
@@ -443,7 +443,7 @@
     return style.release().leakRef();
 }
 
-PassRefPtr<StylePropertySet> HTMLTableElement::additionalAttributeStyle()
+StylePropertySet* HTMLTableElement::additionalAttributeStyle()
 {
     if ((!m_borderAttr && !m_borderColorAttr) || m_frameAttr)
         return 0;
@@ -530,11 +530,11 @@
     return style.release();
 }
 
-PassRefPtr<StylePropertySet> HTMLTableElement::additionalCellStyle()
+StylePropertySet* HTMLTableElement::additionalCellStyle()
 {
     if (!m_sharedCellStyle)
         m_sharedCellStyle = createSharedCellStyle();
-    return m_sharedCellStyle;
+    return m_sharedCellStyle.get();
 }
 
 static StylePropertySet* leakGroupBorderStyle(int rows)
@@ -554,7 +554,7 @@
     return style.release().leakRef();
 }
 
-PassRefPtr<StylePropertySet> HTMLTableElement::additionalGroupStyle(bool rows)
+StylePropertySet* HTMLTableElement::additionalGroupStyle(bool rows)
 {
     if (m_rulesAttr != GroupsRules)
         return 0;

Modified: trunk/Source/WebCore/html/HTMLTableElement.h (107184 => 107185)


--- trunk/Source/WebCore/html/HTMLTableElement.h	2012-02-09 07:14:24 UTC (rev 107184)
+++ trunk/Source/WebCore/html/HTMLTableElement.h	2012-02-09 07:14:55 UTC (rev 107185)
@@ -66,8 +66,8 @@
 
     virtual void attach();
 
-    PassRefPtr<StylePropertySet> additionalCellStyle();
-    PassRefPtr<StylePropertySet> additionalGroupStyle(bool rows);
+    StylePropertySet* additionalCellStyle();
+    StylePropertySet* additionalGroupStyle(bool rows);
 
 private:
     HTMLTableElement(const QualifiedName&, Document*);
@@ -76,7 +76,7 @@
     virtual bool isURLAttribute(Attribute*) const;
 
     // Used to obtain either a solid or outset border decl and to deal with the frame and rules attributes.
-    virtual PassRefPtr<StylePropertySet> additionalAttributeStyle() OVERRIDE;
+    virtual StylePropertySet* additionalAttributeStyle() OVERRIDE;
 
     virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
 

Modified: trunk/Source/WebCore/html/HTMLTableSectionElement.cpp (107184 => 107185)


--- trunk/Source/WebCore/html/HTMLTableSectionElement.cpp	2012-02-09 07:14:24 UTC (rev 107184)
+++ trunk/Source/WebCore/html/HTMLTableSectionElement.cpp	2012-02-09 07:14:55 UTC (rev 107185)
@@ -47,7 +47,7 @@
     return adoptRef(new HTMLTableSectionElement(tagName, document));
 }
 
-PassRefPtr<StylePropertySet> HTMLTableSectionElement::additionalAttributeStyle()
+StylePropertySet* HTMLTableSectionElement::additionalAttributeStyle()
 {
     ContainerNode* p = parentNode();
     while (p && !p->hasTagName(tableTag))

Modified: trunk/Source/WebCore/html/HTMLTableSectionElement.h (107184 => 107185)


--- trunk/Source/WebCore/html/HTMLTableSectionElement.h	2012-02-09 07:14:24 UTC (rev 107184)
+++ trunk/Source/WebCore/html/HTMLTableSectionElement.h	2012-02-09 07:14:55 UTC (rev 107185)
@@ -56,7 +56,7 @@
 private:
     HTMLTableSectionElement(const QualifiedName& tagName, Document*);
 
-    virtual PassRefPtr<StylePropertySet> additionalAttributeStyle() OVERRIDE;
+    virtual StylePropertySet* additionalAttributeStyle() OVERRIDE;
 };
 
 } //namespace
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to