Bug 54269 - Convert ContainerNode::firstElementChild() to a free function.
Summary: Convert ContainerNode::firstElementChild() to a free function.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Andy Estes
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-10 20:56 PST by Andy Estes
Modified: 2011-02-10 23:22 PST (History)
4 users (show)

See Also:


Attachments
Patch (4.98 KB, patch)
2011-02-10 21:15 PST, Andy Estes
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Estes 2011-02-10 20:56:54 PST
Convert ContainerNode::firstElementChild() to a free function.
Comment 1 Andy Estes 2011-02-10 21:15:39 PST
Created attachment 82097 [details]
Patch
Comment 2 Eric Seidel (no email) 2011-02-10 21:21:35 PST
Comment on attachment 82097 [details]
Patch

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

> Source/WebCore/dom/Element.cpp:1657
> +    return WebCore::firstElementChild(this);

We don't generally use WebCore::

> Source/WebCore/dom/Element.h:518
> +inline Element* firstElementChild(const ContainerNode* container)

Shouldn't Element::firstElementChild() call this?

Wow, this is also one of the rare cases where a const Node* might actually be correct! (Normally such a wrong since it makes little sense to have a const* to a RefCounted object.)
Comment 3 Andy Estes 2011-02-10 21:23:41 PST
Comment on attachment 82097 [details]
Patch

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

>> Source/WebCore/dom/Element.cpp:1657
>> +    return WebCore::firstElementChild(this);
> 
> We don't generally use WebCore::

I have to do that since the name in the class scope shadows the name in the namespace scope. I guess I could name the free function something else to avoid this.

>> Source/WebCore/dom/Element.h:518
>> +inline Element* firstElementChild(const ContainerNode* container)
> 
> Shouldn't Element::firstElementChild() call this?
> 
> Wow, this is also one of the rare cases where a const Node* might actually be correct! (Normally such a wrong since it makes little sense to have a const* to a RefCounted object.)

It does call it :)
Comment 4 Eric Seidel (no email) 2011-02-10 21:29:06 PST
Comment on attachment 82097 [details]
Patch

Andy, you're just so far ahead of me I can't even see you!
Comment 5 WebKit Commit Bot 2011-02-10 23:22:09 PST
Comment on attachment 82097 [details]
Patch

Clearing flags on attachment: 82097

Committed r78317: <http://trac.webkit.org/changeset/78317>
Comment 6 WebKit Commit Bot 2011-02-10 23:22:14 PST
All reviewed patches have been landed.  Closing bug.