Bug 87214

Summary: Short-circuit Element::attrIfExists() when the Element has no Attr list.
Product: WebKit Reporter: Andreas Kling <kling>
Component: DOMAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
A patchwork orange rniwa: review+

Description Andreas Kling 2012-05-22 22:31:37 PDT
Lukewarm (0.4%) on Dromaeo/dom-attr.
Comment 1 Andreas Kling 2012-05-22 22:32:43 PDT
Created attachment 143463 [details]
A patchwork orange
Comment 2 Ryosuke Niwa 2012-05-22 22:34:09 PDT
Comment on attachment 143463 [details]
A patchwork orange

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

> Source/WebCore/dom/Element.cpp:2087
> +    if (!hasAttrList())
> +        return 0;
>      if (!attributeData())
>          return 0;

Should we combine these if statements?
Comment 3 Ryosuke Niwa 2012-05-22 22:37:35 PDT
Comment on attachment 143463 [details]
A patchwork orange

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

>> Source/WebCore/dom/Element.cpp:2087
>>          return 0;
> 
> Should we combine these if statements?

Per IRC discussion, please convert the latter condition to an assertion.
Comment 4 Andreas Kling 2012-05-22 23:17:24 PDT
Committed r118127: <http://trac.webkit.org/changeset/118127>