Mozilla - dynamic first-line/letter bug

When seting class names dynamically through JavaScript, Mozilla doesn't apply the first-letter and first-line styles.

Test

At first this paragraph has id="test", and not class. The JavaScript link below allows you to set this class name, though.

The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog.

Set the class name of the test paragraph to test. This should cause the following styles to be applied:

p.test {
	color: #AD007B;
}

p.test:first-line {
	font-weight: 600;
}

p.test:first-letter {
	font-size: 250%;
	float: left;
	margin-right: 5px;
}

p.test a {
	font-weight: 600;
}

p.test a:hover {
	background-color: #AD007B;
	color: #DEE7F7;
}

Mozilla doesn't apply the first-line and first-letter styles. It does apply the a:hover, so it's not a general pseudo-class bug.