Closed Bug 91208 Opened 23 years ago Closed 23 years ago

:First-line pseudo-element rule is not applied properly

Categories

(Core :: XML, defect, P3)

defect

Tracking

()

VERIFIED WORKSFORME
mozilla0.9.9

People

(Reporter: chrispetersen, Assigned: hjtoi-bugzilla)

References

()

Details

Attachments

(2 files)

Build: 2001071703
Platform: All
Expected results: :First-line pseudo-element rule should only be applied to
first line of sentence.

What I got: Rule is applied to entire sentence

Steps to reproduce:

1) Download both the css and xml test case.


2) In the CSS file, 
the :first-line rule has been declared

:first-line 
{ 
font-variant: small-caps;
color: maroon
}



3)Open the xml test case in N6.

4) At this point, all of text is "maroon". Resize window smaller to force text
to wrap down.

5) Notice, the second line remains "maroon" 


6) Now look at the XML file:

<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="css_pseudo_element.css"?>
<doc xmlns:html="http://www.w3.org/TR/REC-html40">
<test>
<html:p>The first line of this paragraph should be maroon and should be in small
caps. The line(s) following the first line should display in black and in
regular case.
</html:p>
</test>
</doc>

The root element declares the xmlns attribute. It contains a child element
"test" which surrounds the actual xmlns elements. If you remove this child
element from the document, :first-line will be correctly displayed when causing
the text to wrap down in browser window.
Attached file :first-line rule
Here's a Mozilla Quality URL that shows the problem as well. In this case, 
first-line styles are being applied to everything.

http://mozilla.org/quality/browser/standards/xml/css_pseudo_element.xml
Perhaps the problem is that RuleHash::AppendToTable needs to check to see if the
selector is a pseudo-element, and, if so, add it to mTagTable without checking
whether there's a class or id selector in the selector.

But actually, I thought the CSS parser constructed a rather unusual structure so
that a pseudo-element had its own selector separate from the rest of the
selector, and that that structure would never have a id or class part.  Did that
change recently?
I don't see the assertion in PseduoEnumFunc, but I do see:

frame: Block(p)(1) (0x42db95b8) style: 0x42db9520 {}
Wrong parent style context:  style: 0x42db93c8 {}
should be using:  style: 0x42db9628 :-moz-anonymous-block {}

frame: Text(2) (0x42db965c) style: 0x42db9434 :-moz-text {}
Wrong parent style context:  style: 0x42db93c8 {}
should be using:  style: 0x42db9628 :-moz-anonymous-block {}

frame: Block(p)(3) (0x42db97c8) style: 0x42db9520 {}
Wrong parent style context:  style: 0x42db93c8 {}
should be using:  style: 0x42db9628 :-moz-anonymous-block {}
ccing hyatt.

Basic problem:

using class~="foo" instead of .foo in that css makes everything work
correctly... so the problem is with .foo
Priority: -- → P3
Target Milestone: --- → mozilla1.0
Target Milestone: mozilla1.0 → mozilla0.9.9
WFM, w2k Mozilla trunk build from a couple of days ago.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
Verified WFM in the Feb 12th 0S X (2002-02-12-03) and Windows ME (2002-02-12-03)
builds.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: