Bug 122640 - Do a bit of optimization and cleanup in the HTMLElement class
Summary: Do a bit of optimization and cleanup in the HTMLElement class
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-10 23:30 PDT by Darin Adler
Modified: 2013-10-11 08:05 PDT (History)
10 users (show)

See Also:


Attachments
Patch (21.94 KB, patch)
2013-10-10 23:36 PDT, Darin Adler
kling: review+
kling: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2013-10-10 23:30:32 PDT
Do a bit of optimization and cleanup in the HTMLElement class
Comment 1 Darin Adler 2013-10-10 23:36:57 PDT
Created attachment 213970 [details]
Patch
Comment 2 Andreas Kling 2013-10-10 23:46:27 PDT
Comment on attachment 213970 [details]
Patch

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).
Comment 3 EFL EWS Bot 2013-10-10 23:46:56 PDT
Comment on attachment 213970 [details]
Patch

Attachment 213970 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/3953027
Comment 4 Andreas Kling 2013-10-10 23:48:18 PDT
Dang, I didn't spot the bogus "string->parsedLength()" calls.
Comment 5 EFL EWS Bot 2013-10-10 23:50:22 PDT
Comment on attachment 213970 [details]
Patch

Attachment 213970 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/3953029
Comment 6 Build Bot 2013-10-11 00:03:44 PDT
Comment on attachment 213970 [details]
Patch

Attachment 213970 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/3403112
Comment 7 Build Bot 2013-10-11 00:14:22 PDT
Comment on attachment 213970 [details]
Patch

Attachment 213970 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/3889011
Comment 8 Build Bot 2013-10-11 00:22:08 PDT
Comment on attachment 213970 [details]
Patch

Attachment 213970 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/3867103
Comment 9 kov's GTK+ EWS bot 2013-10-11 00:34:05 PDT
Comment on attachment 213970 [details]
Patch

Attachment 213970 [details] did not pass gtk-ews (gtk):
Output: http://webkit-queues.appspot.com/results/3952018
Comment 10 Darin Adler 2013-10-11 08:05:38 PDT
Committed r157300: <http://trac.webkit.org/changeset/157300>