Title: [107579] trunk/Source/WebCore
Revision
107579
Author
[email protected]
Date
2012-02-13 09:37:48 -0800 (Mon, 13 Feb 2012)

Log Message

HTMLMarqueeElement: Don't cache presence of truespeed attribute.
<http://webkit.org/b/78483>

Reviewed by Antti Koivisto.

Out-of-line minimumDelay() and look up the "truespeed" attribute there instead
of caching the minimum delay in parseAttribute().
Remove HTMLMarqueeElement::parseAttribute() as it's no longer needed.

* html/HTMLMarqueeElement.cpp:
(WebCore::HTMLMarqueeElement::HTMLMarqueeElement):
(WebCore::HTMLMarqueeElement::minimumDelay):
* html/HTMLMarqueeElement.h:
(HTMLMarqueeElement):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (107578 => 107579)


--- trunk/Source/WebCore/ChangeLog	2012-02-13 17:21:06 UTC (rev 107578)
+++ trunk/Source/WebCore/ChangeLog	2012-02-13 17:37:48 UTC (rev 107579)
@@ -1,3 +1,20 @@
+2012-02-13  Andreas Kling  <[email protected]>
+
+        HTMLMarqueeElement: Don't cache presence of truespeed attribute.
+        <http://webkit.org/b/78483>
+
+        Reviewed by Antti Koivisto.
+
+        Out-of-line minimumDelay() and look up the "truespeed" attribute there instead
+        of caching the minimum delay in parseAttribute().
+        Remove HTMLMarqueeElement::parseAttribute() as it's no longer needed.
+
+        * html/HTMLMarqueeElement.cpp:
+        (WebCore::HTMLMarqueeElement::HTMLMarqueeElement):
+        (WebCore::HTMLMarqueeElement::minimumDelay):
+        * html/HTMLMarqueeElement.h:
+        (HTMLMarqueeElement):
+
 2012-02-13  Andrey Kosyakov  <[email protected]>
 
         Web Inspector: [refactoring] factor common timeline UI state into TimelinePresentationModel

Modified: trunk/Source/WebCore/html/HTMLMarqueeElement.cpp (107578 => 107579)


--- trunk/Source/WebCore/html/HTMLMarqueeElement.cpp	2012-02-13 17:21:06 UTC (rev 107578)
+++ trunk/Source/WebCore/html/HTMLMarqueeElement.cpp	2012-02-13 17:37:48 UTC (rev 107579)
@@ -35,13 +35,9 @@
 
 using namespace HTMLNames;
 
-// WinIE uses 60ms as the minimum delay by default.
-const int defaultMinimumDelay = 60;
-
 inline HTMLMarqueeElement::HTMLMarqueeElement(const QualifiedName& tagName, Document* document)
     : HTMLElement(tagName, document)
     , ActiveDOMObject(document, this)
-    , m_minimumDelay(defaultMinimumDelay)
 {
     ASSERT(hasTagName(marqueeTag));
 }
@@ -53,6 +49,15 @@
     return marqueeElement.release();
 }
 
+int HTMLMarqueeElement::minimumDelay() const
+{
+    if (fastGetAttribute(truespeedAttr).isEmpty()) {
+        // WinIE uses 60ms as the minimum delay by default.
+        return 60;
+    }
+    return 0;
+}
+
 bool HTMLMarqueeElement::isPresentationAttribute(Attribute* attr) const
 {
     if (attr->name() == widthAttr || attr->name() == heightAttr || attr->name() == bgcolorAttr || attr->name() == vspaceAttr || attr->name() == hspaceAttr || attr->name() == scrollamountAttr || attr->name() == scrolldelayAttr || attr->name() == loopAttr || attr->name() == behaviorAttr || attr->name() == directionAttr)
@@ -104,15 +109,6 @@
         HTMLElement::collectStyleForAttribute(attr, style);
 }
 
-void HTMLMarqueeElement::parseAttribute(Attribute* attr)
-{
-    if (attr->name() == truespeedAttr) {
-        // FIXME: Factor this out and remove HTMLMarqueeElement::parseAttribute().
-        m_minimumDelay = !attr->isEmpty() ? 0 : defaultMinimumDelay;
-    } else
-        HTMLElement::parseAttribute(attr);
-}
-
 void HTMLMarqueeElement::start()
 {
     if (RenderMarquee* marqueeRenderer = renderMarquee())

Modified: trunk/Source/WebCore/html/HTMLMarqueeElement.h (107578 => 107579)


--- trunk/Source/WebCore/html/HTMLMarqueeElement.h	2012-02-13 17:21:06 UTC (rev 107578)
+++ trunk/Source/WebCore/html/HTMLMarqueeElement.h	2012-02-13 17:37:48 UTC (rev 107579)
@@ -34,7 +34,7 @@
 public:
     static PassRefPtr<HTMLMarqueeElement> create(const QualifiedName&, Document*);
 
-    int minimumDelay() const { return m_minimumDelay; }
+    int minimumDelay() const;
 
     // DOM Functions
 
@@ -53,7 +53,6 @@
 private:
     HTMLMarqueeElement(const QualifiedName&, Document*);
 
-    virtual void parseAttribute(Attribute*) OVERRIDE;
     virtual bool isPresentationAttribute(Attribute*) const OVERRIDE;
     virtual void collectStyleForAttribute(Attribute*, StylePropertySet*) OVERRIDE;
 
@@ -63,8 +62,6 @@
     virtual void resume();
 
     RenderMarquee* renderMarquee() const;
-
-    int m_minimumDelay;
 };
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to