Bug 77697

Summary: Simplify SelectorChecker::checkSelector and checkOneSelector
Product: WebKit Reporter: Roland Steiner <rolandsteiner>
Component: CSSAssignee: Roland Steiner <rolandsteiner>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, koivisto, macpherson, menard, morrita, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch kling: review+, webkit.review.bot: commit-queue-

Description Roland Steiner 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.
Comment 1 Roland Steiner 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())" (?).
Comment 2 Roland Steiner 2012-02-02 18:04:16 PST
Created attachment 125222 [details]
Patch
Comment 3 Andreas Kling 2012-02-02 18:14:19 PST
Comment on attachment 125222 [details]
Patch

Looks great!
Comment 4 WebKit Review Bot 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
Comment 5 Roland Steiner 2012-02-02 21:29:47 PST
Committed r106626: <http://trac.webkit.org/changeset/106626>