Bug 11385 - CSS: :last-of-type selector is applied to all elements
Summary: CSS: :last-of-type selector is applied to all elements
Status: RESOLVED DUPLICATE of bug 5468
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 420+
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: Nobody
URL: http://www.css3.info/selectors-test/
Depends on:
Reported: 2006-10-23 02:56 PDT by Niels Leenheer (HTML5test)
Modified: 2007-01-12 09:58 PST (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Niels Leenheer (HTML5test) 2006-10-23 02:56:02 PDT
Current behavoir:
The :last-of-type selector matches every element.

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 ***