Commit f8bc3579 authored by arv@chromium.org's avatar arv@chromium.org

2010-12-08 Erik Arvidsson <arv@chromium.org>

        Reviewed by Darin Adler.

        Replace getAttribute().isNull() with fastHasAttribute()
        https://bugs.webkit.org/show_bug.cgi?id=50719

        Covered by existing tests.

        * dom/SelectElement.cpp:
        (WebCore::SelectElement::reset):
        * html/HTMLAppletElement.cpp:
        (WebCore::HTMLAppletElement::rendererIsNeeded):
        * html/HTMLCollection.cpp:
        (WebCore::HTMLCollection::itemAfter):
        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::formNoValidate):
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::noValidate):
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::defaultChecked):
        (WebCore::HTMLInputElement::multiple):
        (WebCore::HTMLInputElement::webkitdirectory):
        * html/HTMLOptionElement.cpp:
        (WebCore::HTMLOptionElement::defaultSelected):
        * html/HTMLScriptElement.cpp:
        (WebCore::HTMLScriptElement::asyncAttributeValue):
        (WebCore::HTMLScriptElement::deferAttributeValue):
        * rendering/RenderFileUploadControl.cpp:
        (WebCore::RenderFileUploadControl::allowsMultipleFiles):
        (WebCore::RenderFileUploadControl::allowsDirectoryUpload):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0e991f12
2010-12-08 Erik Arvidsson <arv@chromium.org>
Reviewed by Darin Adler.
Replace getAttribute().isNull() with fastHasAttribute()
https://bugs.webkit.org/show_bug.cgi?id=50719
Covered by existing tests.
* dom/SelectElement.cpp:
(WebCore::SelectElement::reset):
* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::rendererIsNeeded):
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::itemAfter):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::formNoValidate):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::noValidate):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::defaultChecked):
(WebCore::HTMLInputElement::multiple):
(WebCore::HTMLInputElement::webkitdirectory):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::defaultSelected):
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::asyncAttributeValue):
(WebCore::HTMLScriptElement::deferAttributeValue):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::allowsMultipleFiles):
(WebCore::RenderFileUploadControl::allowsDirectoryUpload):
2010-12-08 Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
Reviewed by Martin Robinson.
......
......@@ -493,7 +493,7 @@ void SelectElement::reset(SelectElementData& data, Element* element)
if (!optionElement)
continue;
if (!items[i]->getAttribute(HTMLNames::selectedAttr).isNull()) {
if (items[i]->fastHasAttribute(HTMLNames::selectedAttr)) {
if (selectedOption && !data.multiple())
selectedOption->setSelectedState(false);
optionElement->setSelectedState(true);
......
......@@ -101,7 +101,7 @@ void HTMLAppletElement::removedFromDocument()
bool HTMLAppletElement::rendererIsNeeded(RenderStyle* style)
{
if (getAttribute(codeAttr).isNull())
if (!fastHasAttribute(codeAttr))
return false;
return HTMLPlugInElement::rendererIsNeeded(style);
......
......@@ -181,11 +181,11 @@ Element* HTMLCollection::itemAfter(Element* previous) const
return e;
break;
case DocLinks: // all <a> and <area> elements with a value for href
if ((e->hasLocalName(aTag) || e->hasLocalName(areaTag)) && (!e->getAttribute(hrefAttr).isNull()))
if ((e->hasLocalName(aTag) || e->hasLocalName(areaTag)) && e->fastHasAttribute(hrefAttr))
return e;
break;
case DocAnchors: // all <a> elements with a value for name
if (e->hasLocalName(aTag) && !e->getAttribute(nameAttr).isNull())
if (e->hasLocalName(aTag) && e->fastHasAttribute(nameAttr))
return e;
break;
case DocAll:
......
......@@ -86,7 +86,7 @@ void HTMLFormControlElement::detach()
bool HTMLFormControlElement::formNoValidate() const
{
return !getAttribute(formnovalidateAttr).isNull();
return fastHasAttribute(formnovalidateAttr);
}
void HTMLFormControlElement::parseMappedAttribute(Attribute* attr)
......
......@@ -530,7 +530,7 @@ String HTMLFormElement::name() const
bool HTMLFormElement::noValidate() const
{
return !getAttribute(novalidateAttr).isNull();
return fastHasAttribute(novalidateAttr);
}
// FIXME: This function should be removed because it does not do the same thing as the
......
......@@ -1439,7 +1439,7 @@ void HTMLInputElement::setDefaultValue(const String &value)
bool HTMLInputElement::defaultChecked() const
{
return !getAttribute(checkedAttr).isNull();
return fastHasAttribute(checkedAttr);
}
void HTMLInputElement::setDefaultName(const AtomicString& name)
......@@ -1472,13 +1472,13 @@ void HTMLInputElement::setMaxLength(int maxLength, ExceptionCode& ec)
bool HTMLInputElement::multiple() const
{
return !getAttribute(multipleAttr).isNull();
return fastHasAttribute(multipleAttr);
}
#if ENABLE(DIRECTORY_UPLOAD)
bool HTMLInputElement::webkitdirectory() const
{
return !getAttribute(webkitdirectoryAttr).isNull();
return fastHasAttribute(webkitdirectoryAttr);
}
#endif
......
......@@ -205,7 +205,7 @@ HTMLSelectElement* HTMLOptionElement::ownerSelectElement() const
bool HTMLOptionElement::defaultSelected() const
{
return !getAttribute(selectedAttr).isNull();
return fastHasAttribute(selectedAttr);
}
void HTMLOptionElement::setDefaultSelected(bool b)
......
......@@ -152,12 +152,12 @@ String HTMLScriptElement::eventAttributeValue() const
bool HTMLScriptElement::asyncAttributeValue() const
{
return !getAttribute(asyncAttr).isNull();
return fastHasAttribute(asyncAttr);
}
bool HTMLScriptElement::deferAttributeValue() const
{
return !getAttribute(deferAttr).isNull();
return fastHasAttribute(deferAttr);
}
void HTMLScriptElement::dispatchLoadEvent()
......
......@@ -100,14 +100,14 @@ bool RenderFileUploadControl::allowsMultipleFiles()
#endif
HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
return !input->getAttribute(multipleAttr).isNull();
return input->fastHasAttribute(multipleAttr);
}
#if ENABLE(DIRECTORY_UPLOAD)
bool RenderFileUploadControl::allowsDirectoryUpload()
{
HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
return !input->getAttribute(webkitdirectoryAttr).isNull();
return input->fastHasAttribute(webkitdirectoryAttr);
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment