Bug 23951 - Inserting :last-child items on the fly
Summary: Inserting :last-child items on the fly
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-13 10:05 PST by Alfred Wong
Modified: 2010-03-13 19:14 PST (History)
2 users (show)

See Also:


Attachments
[SAMPLE] Shows Working as Expected (1.58 KB, text/html)
2010-03-13 19:13 PST, Joseph Pecoraro
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alfred Wong 2009-02-13 10:05:15 PST
in css I have this:

last-child: border-bottom none;

in html if you insert a last-child item on the fly, the old last-child's style remains.
Comment 1 Joseph Pecoraro 2010-03-13 19:13:30 PST
Created attachment 50666 [details]
[SAMPLE] Shows Working as Expected

Alfred, this seems to be working just fine for me. I've attached a sample page which shows the expected behavior.

Are you sure you were using the :last-child pseudo class correctly? The rule you commented was missing braces for a block. It should instead look something like this:

  p:last-child {
    border-bottom: none;
  }

Or more generically (not used in the sample attached, but still works)

  /* Affects the last child of anything
  :last-child {
    border-bottom: none;
  }
Comment 2 Joseph Pecoraro 2010-03-13 19:14:41 PST
I am closing this as it works as expected for me. If you have a sample case where it is not working as you'd expect, please attached a test case!