Bug 11385
Summary: | CSS: :last-of-type selector is applied to all elements | ||
---|---|---|---|
Product: | WebKit | Reporter: | Niels Leenheer (HTML5test) <info> |
Component: | CSS | Assignee: | 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/ |
Niels Leenheer (HTML5test)
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Nicholas Shanks
*** This bug has been marked as a duplicate of 5468 ***