Bug 74795 - HTMLCollection: Simplify itemAfter().
Summary: HTMLCollection: Simplify itemAfter().
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: 2011-12-17 16:33 PST by Andreas Kling
Modified: 2011-12-17 19:42 PST (History)
0 users

See Also:


Attachments
Patch (10.09 KB, patch)
2011-12-17 16:48 PST, Andreas Kling
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>