Use fastGetAttribute() and fastHasAttribute() where appropriate.
authorandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Sep 2011 16:13:01 +0000 (16:13 +0000)
committerandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Sep 2011 16:13:01 +0000 (16:13 +0000)
commit4c91bed3ca7d8dcce56d9550cbff703c3bc6409e
treebde5e27755a6cd92dfa56cbd708f15da3fd4445d
parent0b176fd69b064f6044026bef318d505c3f9b6454
Use fastGetAttribute() and fastHasAttribute() where appropriate.
https://bugs.webkit.org/show_bug.cgi?id=67394

Reviewed by Darin Adler.

Change call sites that don't check the "style" or SVG animatable
attributes to use fastGetAttribute()/fastHasAttribute() instead
of getAttribute()/hasAttribute().

No new tests, this is a minor performance optimization.

* accessibility/AXObjectCache.cpp:
(WebCore::nodeHasRole):
* accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
(webkit_accessible_get_name):
* dom/Document.cpp:
(WebCore::Document::buildAccessKeyMap):
(WebCore::Document::recalcStyleSelector):
* dom/Element.cpp:
(WebCore::Element::baseURI):
(WebCore::Element::formatForDebugger):
(WebCore::Element::spellcheckAttributeState):
* dom/NameNodeList.cpp:
(WebCore::NameNodeList::nodeMatches):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
* editing/SplitElementCommand.cpp:
(WebCore::SplitElementCommand::doUnapply):
* editing/markup.cpp:
(WebCore::shouldIncludeWrapperForFullySelectedRoot):
(WebCore::createMarkup):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::draggable):
(WebCore::HTMLAnchorElement::href):
(WebCore::HTMLAnchorElement::name):
(WebCore::HTMLAnchorElement::target):
(WebCore::HTMLAnchorElement::sendPings):
(WebCore::HTMLAnchorElement::handleClick):
* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::createRenderer):
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::target):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::aLink):
(WebCore::HTMLBodyElement::bgColor):
(WebCore::HTMLBodyElement::link):
(WebCore::HTMLBodyElement::text):
(WebCore::HTMLBodyElement::vLink):
(WebCore::HTMLBodyElement::addSubresourceAttributeURLs):
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::value):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::reset):
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::checkForNameMatch):
(WebCore::HTMLCollection::updateNameCache):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::dir):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::parseMappedAttribute):
(WebCore::HTMLElement::draggable):
(WebCore::HTMLElement::title):
(WebCore::setHasDirAutoFlagRecursively):
(WebCore::HTMLElement::directionalityIfhasDirAutoAttribute):
(WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged):
(WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::updateWidget):
(WebCore::HTMLEmbedElement::insertedIntoDocument):
(WebCore::HTMLEmbedElement::addSubresourceAttributeURLs):
* html/HTMLFormCollection.cpp:
(WebCore::HTMLFormCollection::getNamedFormItem):
(WebCore::HTMLFormCollection::updateNameCache):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::autofocus):
(WebCore::HTMLFormControlElement::updateVisibleValidationMessage):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::name):
(WebCore::HTMLFormElement::action):
(WebCore::HTMLFormElement::method):
(WebCore::HTMLFormElement::target):
* html/HTMLFrameElement.cpp:
(WebCore::HTMLFrameElement::noResize):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::setNameAndOpenURL):
(WebCore::HTMLFrameElementBase::location):
(WebCore::HTMLFrameElementBase::allowFullScreen):
* html/HTMLHtmlElement.cpp:
(WebCore::HTMLHtmlElement::insertedByParser):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::altText):
(WebCore::HTMLImageElement::width):
(WebCore::HTMLImageElement::height):
(WebCore::HTMLImageElement::alt):
(WebCore::HTMLImageElement::draggable):
(WebCore::HTMLImageElement::src):
(WebCore::HTMLImageElement::addSubresourceAttributeURLs):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::finishParsingChildren):
(WebCore::HTMLInputElement::altText):
(WebCore::HTMLInputElement::reset):
(WebCore::HTMLInputElement::searchEventsShouldBeDispatched):
(WebCore::HTMLInputElement::isSpeechEnabled):
* html/HTMLLabelElement.cpp:
(WebCore::HTMLLabelElement::control):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
(WebCore::HTMLLinkElement::href):
(WebCore::HTMLLinkElement::rel):
(WebCore::HTMLLinkElement::target):
(WebCore::HTMLLinkElement::type):
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::imageElement):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::attributeChanged):
(WebCore::HTMLMediaElement::insertedIntoDocument):
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::content):
(WebCore::HTMLMetaElement::httpEquiv):
(WebCore::HTMLMetaElement::name):
* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::min):
(WebCore::HTMLMeterElement::max):
(WebCore::HTMLMeterElement::value):
(WebCore::HTMLMeterElement::low):
(WebCore::HTMLMeterElement::high):
(WebCore::HTMLMeterElement::optimum):
* html/HTMLNameCollection.cpp:
(WebCore::HTMLNameCollection::itemAfter):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::updateWidget):
(WebCore::HTMLObjectElement::containsJavaApplet):
(WebCore::HTMLObjectElement::addSubresourceAttributeURLs):
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::groupLabelText):
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::max):
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::sourceAttributeValue):
(WebCore::HTMLScriptElement::charsetAttributeValue):
(WebCore::HTMLScriptElement::typeAttributeValue):
(WebCore::HTMLScriptElement::languageAttributeValue):
(WebCore::HTMLScriptElement::forAttributeValue):
(WebCore::HTMLScriptElement::eventAttributeValue):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::media):
(WebCore::HTMLSourceElement::type):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::media):
(WebCore::HTMLStyleElement::type):
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::abbr):
(WebCore::HTMLTableCellElement::axis):
(WebCore::HTMLTableCellElement::headers):
(WebCore::HTMLTableCellElement::scope):
(WebCore::HTMLTableCellElement::addSubresourceAttributeURLs):
* html/HTMLTableColElement.cpp:
(WebCore::HTMLTableColElement::width):
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::rules):
(WebCore::HTMLTableElement::summary):
(WebCore::HTMLTableElement::addSubresourceAttributeURLs):
* html/HTMLTableSectionElement.cpp:
(WebCore::HTMLTableSectionElement::align):
(WebCore::HTMLTableSectionElement::ch):
(WebCore::HTMLTableSectionElement::chOff):
(WebCore::HTMLTableSectionElement::vAlign):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::maxLength):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::strippedPlaceholder):
(WebCore::HTMLTextFormControlElement::isPlaceholderEmpty):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::src):
(WebCore::HTMLTrackElement::kind):
(WebCore::HTMLTrackElement::srclang):
(WebCore::HTMLTrackElement::label):
(WebCore::HTMLTrackElement::isDefault):
(WebCore::HTMLTrackElement::load):
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::width):
(WebCore::HTMLVideoElement::height):
* html/StepRange.cpp:
(WebCore::StepRange::StepRange):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::InputFieldSpeechButtonElement::startSpeechInput):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::buildObjectForFrame):
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::create):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):
* page/Frame.cpp:
(WebCore::Frame::matchLabelsAgainstElement):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::serializeFrame):
* page/mac/FrameMac.mm:
(WebCore::Frame::matchLabelsAgainstElement):
* platform/chromium/ClipboardChromium.cpp:
(WebCore::writeImageToDataObject):
* platform/chromium/PasteboardChromium.cpp:
(WebCore::Pasteboard::writeImage):
* platform/gtk/PasteboardGtk.cpp:
(WebCore::getURLForImageNode):
* platform/mac/HTMLConverter.mm:
(fileWrapperForElement):
* platform/win/ClipboardWin.cpp:
(WebCore::writeImageToDataObject):
(WebCore::ClipboardWin::declareAndWriteDragImage):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::altDisplayString):
(WebCore::HitTestResult::absoluteImageURL):
(WebCore::HitTestResult::absoluteLinkURL):
* rendering/RenderDetails.cpp:
(WebCore::RenderDetails::isOpen):
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::itemAccessibilityText):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::addPDFURLRect):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computePreferredLogicalWidths):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::autosaveName):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::calculateIntrinsicSize):
* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::updateFromElement):
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::updateFromElement):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::updateFromElement):
* svg/SVGFontData.cpp:
(WebCore::SVGFontData::applySVGGlyphSelection):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94421 268f45cc-cd09-0410-ab3c-d52691b4dbfc
72 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/NameNodeList.cpp
Source/WebCore/editing/ApplyStyleCommand.cpp
Source/WebCore/editing/SplitElementCommand.cpp
Source/WebCore/editing/markup.cpp
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/html/HTMLAppletElement.cpp
Source/WebCore/html/HTMLAreaElement.cpp
Source/WebCore/html/HTMLBodyElement.cpp
Source/WebCore/html/HTMLButtonElement.cpp
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/html/HTMLCollection.cpp
Source/WebCore/html/HTMLDocument.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLEmbedElement.cpp
Source/WebCore/html/HTMLFormCollection.cpp
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLFrameElement.cpp
Source/WebCore/html/HTMLFrameElementBase.cpp
Source/WebCore/html/HTMLHtmlElement.cpp
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLLabelElement.cpp
Source/WebCore/html/HTMLLinkElement.cpp
Source/WebCore/html/HTMLMapElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMetaElement.cpp
Source/WebCore/html/HTMLMeterElement.cpp
Source/WebCore/html/HTMLNameCollection.cpp
Source/WebCore/html/HTMLObjectElement.cpp
Source/WebCore/html/HTMLOptGroupElement.cpp
Source/WebCore/html/HTMLProgressElement.cpp
Source/WebCore/html/HTMLScriptElement.cpp
Source/WebCore/html/HTMLSourceElement.cpp
Source/WebCore/html/HTMLStyleElement.cpp
Source/WebCore/html/HTMLTableCellElement.cpp
Source/WebCore/html/HTMLTableColElement.cpp
Source/WebCore/html/HTMLTableElement.cpp
Source/WebCore/html/HTMLTableSectionElement.cpp
Source/WebCore/html/HTMLTextAreaElement.cpp
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/html/HTMLTrackElement.cpp
Source/WebCore/html/HTMLVideoElement.cpp
Source/WebCore/html/StepRange.cpp
Source/WebCore/html/shadow/TextControlInnerElements.cpp
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/loader/FormSubmission.cpp
Source/WebCore/loader/ImageLoader.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/PageSerializer.cpp
Source/WebCore/page/mac/FrameMac.mm
Source/WebCore/platform/chromium/ClipboardChromium.cpp
Source/WebCore/platform/chromium/PasteboardChromium.cpp
Source/WebCore/platform/gtk/PasteboardGtk.cpp
Source/WebCore/platform/mac/HTMLConverter.mm
Source/WebCore/platform/win/ClipboardWin.cpp
Source/WebCore/rendering/HitTestResult.cpp
Source/WebCore/rendering/RenderDetails.cpp
Source/WebCore/rendering/RenderMenuList.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderTableCell.cpp
Source/WebCore/rendering/RenderTextControlSingleLine.cpp
Source/WebCore/rendering/RenderVideo.cpp
Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp
Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
Source/WebCore/svg/SVGFontData.cpp