Bug 138650 - Implement the matching for :nth-last-child(An+B of selector-list)
Summary: Implement the matching for :nth-last-child(An+B of selector-list)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-11 19:45 PST by Benjamin Poulain
Modified: 2014-11-13 13:07 PST (History)
3 users (show)

See Also:


Attachments
Patch (62.10 KB, patch)
2014-11-11 19:55 PST, Benjamin Poulain
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2014-11-11 19:45:36 PST
Implement the matching for :nth-last-child(An+B of selector-list)
Comment 1 Benjamin Poulain 2014-11-11 19:55:53 PST
Created attachment 241411 [details]
Patch
Comment 2 Andreas Kling 2014-11-13 12:39:44 PST
Comment on attachment 241411 [details]
Patch

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

r=me

> Source/WebCore/dom/Node.cpp:678
> +        if (is<Element>(ancestor) && downcast<Element>(ancestor)->childrenAffectedByPropertyBasedBackwardPositionalRules()) {

is<Element>(ancestor) will do an unnecessary null check here; you probably want is<Element>(*ancestor)
Comment 3 Benjamin Poulain 2014-11-13 13:00:29 PST
Committed r176084: <http://trac.webkit.org/changeset/176084>
Comment 4 Chris Dumez 2014-11-13 13:07:10 PST
Comment on attachment 241411 [details]
Patch

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

>> Source/WebCore/dom/Node.cpp:678
>> +        if (is<Element>(ancestor) && downcast<Element>(ancestor)->childrenAffectedByPropertyBasedBackwardPositionalRules()) {
> 
> is<Element>(ancestor) will do an unnecessary null check here; you probably want is<Element>(*ancestor)

yes, and we usually do downcast<Element>(*ancestor).xxx() as well.