Bug 138617

Summary: Avoid looking up the type attribute twice in HTMLInputElement::ensureInputType()
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: commit-queue, darin, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Chris Dumez
Reported 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.
Attachments
Patch (1.97 KB, patch)
2014-11-11 11:19 PST, Chris Dumez
no flags
Patch (1.98 KB, patch)
2014-11-11 12:46 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2014-11-11 11:19:35 PST
Geoffrey Garen
Comment 2 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".
Chris Dumez
Comment 3 2014-11-11 12:46:04 PST
Chris Dumez
Comment 4 2014-11-11 15:49:26 PST
Merging into Bug 138524. *** This bug has been marked as a duplicate of bug 138524 ***
Note You need to log in before you can comment on or make changes to this bug.