Bug 138617 - Avoid looking up the type attribute twice in HTMLInputElement::ensureInputType()
Summary: Avoid looking up the type attribute twice in HTMLInputElement::ensureInputType()
Status: RESOLVED DUPLICATE of bug 138524
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-11 11:15 PST by Chris Dumez
Modified: 2014-11-11 15:49 PST (History)
3 users (show)

See Also:


Attachments
Patch (1.97 KB, patch)
2014-11-11 11:19 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (1.98 KB, patch)
2014-11-11 12:46 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2014-11-11 11:15:57 PST
We currently call hasAttribute(typeAttr) then if it returns true, we call fastGetAttribute(typeAttr).
First of all, fastHasAttribute() would have been better as it would have avoided attribute synchronization. Secondly, We could call fastGetAttribute(typeAttr) directly and check if the returned value is nullAtom, instead of calling hasAttribute(). This way, we only do the linear attribute search once.
Comment 1 Chris Dumez 2014-11-11 11:19:35 PST
Created attachment 241365 [details]
Patch
Comment 2 Geoffrey Garen 2014-11-11 11:59:52 PST
Comment on attachment 241365 [details]
Patch

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

r=me

> Source/WebCore/ChangeLog:9
> +        calling directly fastGetAttribute(typeAttr) and check if its returns

Should be "call" and "it" instead of "calling" and "its".
Comment 3 Chris Dumez 2014-11-11 12:46:04 PST
Created attachment 241371 [details]
Patch
Comment 4 Chris Dumez 2014-11-11 15:49:26 PST
Merging into Bug 138524.

*** This bug has been marked as a duplicate of bug 138524 ***