RESOLVED FIXED 77697
Simplify SelectorChecker::checkSelector and checkOneSelector
https://bugs.webkit.org/show_bug.cgi?id=77697
Summary Simplify SelectorChecker::checkSelector and checkOneSelector
Roland Steiner
Reported 2012-02-02 17:52:58 PST
These 2 methods go back and forth between element siblings a lot. Their implementation could be simplified by using Element::previous/nextElementSibling, which would also improve readability.
Attachments
Patch (15.29 KB, patch)
2012-02-02 18:04 PST, Roland Steiner
kling: review+
webkit.review.bot: commit-queue-
Roland Steiner
Comment 1 2012-02-02 18:00:16 PST
Incidentally, while looking at those functions: there are several places in the pseudo-class implementation code, where the code is allowed to break out, fall all the way through and return the default 'true' if some initial criterion is not met. Some of those cases seem questionable to me, such as with "if (!sel->parseNth())" (?).
Roland Steiner
Comment 2 2012-02-02 18:04:16 PST
Andreas Kling
Comment 3 2012-02-02 18:14:19 PST
Comment on attachment 125222 [details] Patch Looks great!
WebKit Review Bot
Comment 4 2012-02-02 20:38:28 PST
Comment on attachment 125222 [details] Patch Rejecting attachment 125222 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2 Last 500 characters of output: angeLog Hunk #1 succeeded at 1 with fuzz 3. patching file Source/WebCore/css/SelectorChecker.cpp patching file Source/WebCore/dom/Element.cpp Hunk #1 succeeded at 1740 (offset 6 lines). patching file Source/WebCore/dom/Element.h Hunk #1 FAILED at 499. 1 out of 1 hunk FAILED -- saving rejects to file Source/WebCore/dom/Element.h.rej Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'Andreas Kl..." exit_code: 1 cwd: /mnt/git/webkit-commit-queue/ Full output: http://queues.webkit.org/results/11420113
Roland Steiner
Comment 5 2012-02-02 21:29:47 PST
Note You need to log in before you can comment on or make changes to this bug.