Bug 144930 - Modernize ContainerNode::childElementCount
Summary: Modernize ContainerNode::childElementCount
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-12 14:42 PDT by Sam Weinig
Modified: 2015-05-13 15:08 PDT (History)
3 users (show)

See Also:


Attachments
Patch (2.97 KB, patch)
2015-05-12 14:45 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2015-05-12 14:42:02 PDT
Modernize ContainerNode::childElementCount
Comment 1 Sam Weinig 2015-05-12 14:45:52 PDT
Created attachment 252986 [details]
Patch
Comment 2 WebKit Commit Bot 2015-05-12 14:48:05 PDT
Attachment 252986 [details] did not pass style-queue:


ERROR: Source/WebCore/dom/ElementChildIterator.h:36:  value_type is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/dom/ElementChildIterator.h:37:  difference_type is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/dom/ElementChildIterator.h:40:  iterator_category is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/dom/ElementChildIterator.h:50:  value_type is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/dom/ElementChildIterator.h:51:  difference_type is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/dom/ElementChildIterator.h:54:  iterator_category is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 6 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Darin Adler 2015-05-12 21:46:00 PDT
Comment on attachment 252986 [details]
Patch

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

> Source/WebCore/dom/ElementChildIterator.h:40
> +    typedef ElementType value_type;
> +    typedef ptrdiff_t difference_type;
> +    typedef ElementType* pointer;
> +    typedef ElementType& reference;
> +    typedef std::forward_iterator_tag iterator_category;

The modern way to do this is to derive from std::iterator<std::forward_iterator_tag, ElementType>; std::iterator handles the rest by default.

> Source/WebCore/dom/ElementChildIterator.h:54
> +    typedef const ElementType value_type;
> +    typedef ptrdiff_t difference_type;
> +    typedef const ElementType* pointer;
> +    typedef const ElementType& reference;
> +    typedef std::forward_iterator_tag iterator_category;

The modern way to do this is to derive from std::iterator<std::forward_iterator_tag, const ElementType>; std::iterator handles the rest by default.
Comment 4 WebKit Commit Bot 2015-05-13 15:08:13 PDT
Comment on attachment 252986 [details]
Patch

Clearing flags on attachment: 252986

Committed r184309: <http://trac.webkit.org/changeset/184309>
Comment 5 WebKit Commit Bot 2015-05-13 15:08:18 PDT
All reviewed patches have been landed.  Closing bug.