Bug 11385

Summary: CSS: :last-of-type selector is applied to all elements
Product: WebKit Reporter: Niels Leenheer (HTML5test) <info>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal    
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
URL: http://www.css3.info/selectors-test/

Description Niels Leenheer (HTML5test) 2006-10-23 02:56:02 PDT
Current behavoir:
The :last-of-type selector matches every element.

Reason:
The reason for this is that every time a new element is added to the DOM, it is checked to see if it matches one of the CSS selectors. Because the DOM is build one element at a time, every element is at least once the last element of a certain type. 

Proper behavoir:
The selector should only match elements that are *really* the last of a certain type. Once an element is no longer the last of a certain type, it should no longer match the :last-of-type selector.
Comment 1 Nicholas Shanks 2006-11-20 16:17:42 PST

*** This bug has been marked as a duplicate of 5468 ***