[webkit-reviews] review granted: [Bug 122640] Do a bit of optimization and cleanup in the HTMLElement class : [Attachment 213970] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 10 23:47:37 PDT 2013


Andreas Kling <akling at apple.com> has granted Darin Adler <darin at apple.com>'s
request for review:
Bug 122640: Do a bit of optimization and cleanup in the HTMLElement class
https://bugs.webkit.org/show_bug.cgi?id=122640

Attachment 213970: Patch
https://bugs.webkit.org/attachment.cgi?id=213970&action=review

------- Additional Comments from Andreas Kling <akling at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=213970&action=review


r=me

> Source/WebCore/html/HTMLElement.cpp:375
> +    RefPtr<Text> textNode = &node;
>      RefPtr<Text> textNext = toText(next);

These two could be Ref<Text> to skip some null checks.

> Source/WebCore/html/HTMLElement.cpp:740
> -    if (equalIgnoringCase(value, "yes") || equalIgnoringCase(value, ""))
> +    if (equalIgnoringCase(value, "yes") || value.isEmpty())

Looks like we need isEmptyIgnoringCase(). ;)

> Source/WebCore/html/HTMLElement.cpp:752
> +    for (const Element* element = this; element; element =
element->parentElement()) {
> +	   if (!element->isHTMLElement())
> +	       continue;

This would look slightly nicer as a loop over
ancestorsOfType<HTMLElement>(this).


More information about the webkit-reviews mailing list