Bug 119578 - Element: Modernize attribute storage accessor functions.
Summary: Element: Modernize attribute storage accessor functions.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-08 09:26 PDT by Andreas Kling
Modified: 2013-08-08 10:25 PDT (History)
4 users (show)

See Also:


Attachments
Patch (63.78 KB, patch)
2013-08-08 09:34 PDT, Andreas Kling
koivisto: review+
webkit-ews: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2013-08-08 09:26:03 PDT
I should have done this a year ago.

const Attribute* attributeItem(index) => const Attribute& attributeAt(index)
const Attribute* getAttributeItem(name) => const Attribute* findAttributeByName(name)
unsigned getAttributeItemIndex(name) => unsigned findAttributeIndexByName(name)
Comment 1 Andreas Kling 2013-08-08 09:34:23 PDT
Created attachment 208352 [details]
Patch
Comment 2 WebKit Commit Bot 2013-08-08 09:37:36 PDT
Attachment 208352 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/css/SelectorChecker.cpp', u'Source/WebCore/css/SelectorChecker.h', u'Source/WebCore/dom/Attr.cpp', u'Source/WebCore/dom/DatasetDOMStringMap.cpp', u'Source/WebCore/dom/Element.cpp', u'Source/WebCore/dom/Element.h', u'Source/WebCore/dom/NamedNodeMap.cpp', u'Source/WebCore/dom/Node.cpp', u'Source/WebCore/dom/StyledElement.cpp', u'Source/WebCore/editing/MarkupAccumulator.cpp', u'Source/WebCore/editing/markup.cpp', u'Source/WebCore/html/HTMLEmbedElement.cpp', u'Source/WebCore/html/HTMLInputElement.cpp', u'Source/WebCore/html/HTMLObjectElement.cpp', u'Source/WebCore/html/HTMLSelectElement.cpp', u'Source/WebCore/html/parser/HTMLConstructionSite.cpp', u'Source/WebCore/inspector/DOMPatchSupport.cpp', u'Source/WebCore/inspector/InspectorDOMAgent.cpp', u'Source/WebCore/page/PageSerializer.cpp', u'Source/WebCore/svg/SVGStyledElement.cpp', u'Source/WebCore/xml/XPathFunctions.cpp', u'Source/WebCore/xml/XPathNodeSet.cpp', u'Source/WebCore/xml/XPathStep.cpp', u'Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp', u'Source/WebCore/xml/parser/XMLDocumentParserQt.cpp', u'Source/WebKit/blackberry/Api/WebPage.cpp', u'Source/WebKit/blackberry/ChangeLog', u'Source/WebKit/qt/Api/qwebelement.cpp', u'Source/WebKit/qt/ChangeLog']" exit_code: 1
Source/WebCore/dom/Node.cpp:1395:  An else if statement should be written as an if statement when the prior "if" concludes with a return, break, continue or goto statement.  [readability/control_flow] [4]
Source/WebCore/dom/Node.cpp:1451:  When wrapping a line, only indent 4 spaces.  [whitespace/indent] [3]
Total errors found: 2 in 30 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Early Warning System Bot 2013-08-08 09:45:33 PDT
Comment on attachment 208352 [details]
Patch

Attachment 208352 [details] did not pass qt-ews (qt):
Output: http://webkit-queues.appspot.com/results/1365284
Comment 4 Antti Koivisto 2013-08-08 09:47:24 PDT
Comment on attachment 208352 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=208352&action=review

Looks great, r=me

> Source/WebCore/dom/Element.cpp:1899
> -    return elementData()->getAttributeItem(shouldIgnoreAttributeCase(this) ? localName.lower() : localName, false);
> +    return elementData()->findAttributeByName(shouldIgnoreAttributeCase(this) ? localName.lower() : localName, false);

Not your fault but this probably should be findAttributeByName(localName, shouldIgnoreAttributeCase(this))
Comment 5 Antti Koivisto 2013-08-08 09:47:44 PDT
Have fun with the bots!
Comment 6 Early Warning System Bot 2013-08-08 09:48:20 PDT
Comment on attachment 208352 [details]
Patch

Attachment 208352 [details] did not pass qt-wk2-ews (qt-wk2):
Output: http://webkit-queues.appspot.com/results/1438051
Comment 7 Andreas Kling 2013-08-08 10:25:18 PDT
Committed r153826: <http://trac.webkit.org/changeset/153826>