Add WTF::move()
[WebKit-https.git] / Source / WebCore / html / HTMLBRElement.cpp
index 57253af..6173730 100644 (file)
 #include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
 #include "HTMLNames.h"
-#include "RenderBR.h"
+#include "RenderLineBreak.h"
 
 namespace WebCore {
 
 using namespace HTMLNames;
 
-HTMLBRElement::HTMLBRElement(const QualifiedName& tagName, Document* document)
+HTMLBRElement::HTMLBRElement(const QualifiedName& tagName, Document& document)
     : HTMLElement(tagName, document)
 {
     ASSERT(hasTagName(brTag));
 }
 
-PassRefPtr<HTMLBRElement> HTMLBRElement::create(Document* document)
+PassRefPtr<HTMLBRElement> HTMLBRElement::create(Document& document)
 {
     return adoptRef(new HTMLBRElement(brTag, document));
 }
 
-PassRefPtr<HTMLBRElement> HTMLBRElement::create(const QualifiedName& tagName, Document* document)
+PassRefPtr<HTMLBRElement> HTMLBRElement::create(const QualifiedName& tagName, Document& document)
 {
     return adoptRef(new HTMLBRElement(tagName, document));
 }
@@ -56,27 +56,27 @@ bool HTMLBRElement::isPresentationAttribute(const QualifiedName& name) const
     return HTMLElement::isPresentationAttribute(name);
 }
 
-void HTMLBRElement::collectStyleForAttribute(Attribute* attr, StylePropertySet* style)
+void HTMLBRElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStyleProperties& style)
 {
-    if (attr->name() == clearAttr) {
+    if (name == clearAttr) {
         // If the string is empty, then don't add the clear property.
         // <br clear> and <br clear=""> are just treated like <br> by Gecko, Mac IE, etc. -dwh
-        if (!attr->isEmpty()) {
-            if (equalIgnoringCase(attr->value(), "all"))
-                addPropertyToAttributeStyle(style, CSSPropertyClear, CSSValueBoth);
+        if (!value.isEmpty()) {
+            if (equalIgnoringCase(value, "all"))
+                addPropertyToPresentationAttributeStyle(style, CSSPropertyClear, CSSValueBoth);
             else
-                addPropertyToAttributeStyle(style, CSSPropertyClear, attr->value());
+                addPropertyToPresentationAttributeStyle(style, CSSPropertyClear, value);
         }
     } else
-        HTMLElement::collectStyleForAttribute(attr, style);
+        HTMLElement::collectStyleForPresentationAttribute(name, value, style);
 }
 
-RenderObject* HTMLBRElement::createRenderer(RenderArena* arena, RenderStyle* style)
+RenderPtr<RenderElement> HTMLBRElement::createElementRenderer(PassRef<RenderStyle> style)
 {
-     if (style->hasContent())
-        return RenderObject::createObject(this, style);
+    if (style.get().hasContent())
+        return RenderElement::createFor(*this, WTF::move(style));
 
-     return new (arena) RenderBR(this);
+    return createRenderer<RenderLineBreak>(*this, WTF::move(style));
 }
 
 }