Bug 74795

Summary: HTMLCollection: Simplify itemAfter().
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
Patch koivisto: review+

Description Andreas Kling 2011-12-17 16:33:29 PST
SSIA
Comment 1 Andreas Kling 2011-12-17 16:48:58 PST
Created attachment 119740 [details]
Patch
Comment 2 Antti Koivisto 2011-12-17 19:04:06 PST
Comment on attachment 119740 [details]
Patch

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

> Source/WebCore/html/HTMLCollection.cpp:129
> +inline bool HTMLCollection::isAcceptableElement(Element* element) const
> +{
> +    switch (m_type) {

Since m_type is not changing, I think this could be refactored to avoid repeated switching on type entirely.
Comment 3 Antti Koivisto 2011-12-17 19:32:02 PST
Comment on attachment 119740 [details]
Patch

r=me anyway as that's what the old code did too and the patch is an improvement. Refactoring can be done later too.
Comment 4 Andreas Kling 2011-12-17 19:42:00 PST
Committed r103165: <http://trac.webkit.org/changeset/103165>