selectors matching :before/:after images

RESOLVED WORKSFORME

Status

()

P2
major
RESOLVED WORKSFORME
17 years ago
4 years ago

People

(Reporter: mkamelma, Assigned: dbaron)

Tracking

({regression})

Trunk
Future
x86
All
regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [Hixie-P2][CSS2-12.1], URL)

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
See url and page source (small test page only). 
After you hover over the link with the mouse cursor, the image (made with
a:before) gets a border. That was not the case in the mozilla 0.9.5 release and
is a bug as far as i can tell.
Build ID is 2001110803.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 98 → All
(Reporter)

Updated

17 years ago
Keywords: regression
(Reporter)

Comment 1

17 years ago
Aw come on. No one cares? I know the before: element is still widely unused, but
this really is a bug and should be fixed before mozilla1.0...
Seems like we're giving the generated content image a style context that thinks
it's an "img" element or something like that.

Comment 3

17 years ago
Created attachment 71703 [details]
Hack to remove unwanted border. And other problems

Comment 4

17 years ago
with img {border:0;} you can remove the border around the image. But if you set
any other definition in addition (I said border-right: 10px), it doesn't get
taken into consideration until the link is hovered.

By the way, if I say a:before doesn't that mean the element should be inserted
before the a element? I'm expecting something like <img><a></a> instead of
<a><img></a> which is what happens now...

<rant>And yes, there are some people who use before:
And yes this bug is annoying...</rant>
> By the way, if I say a:before doesn't that mean the element should be inserted
> before the a element?

No, it does not.  See
http://www.w3.org/TR/REC-CSS2/generate.html#before-after-content:

    The formatting objects (e.g., boxes) generated by an element include
    generated content. So, for example, changing the above style sheet to:

      P.note:before { content: "Note: " }
      P.note        { border: solid green }

    would cause a solid green border to be rendered around the entire paragraph,
    including the initial string. 

So we do _that_ part correctly. The incorrect part is that the image content
matches the "img" rule in the UA sheet and the "a img" rule in your author sheet
at all.
Wow, this is a dodgy bug! There really shouldn't be a way to select the content
of :before pseudo-elements like this...
Whiteboard: [Hixie-P2]
Whiteboard: [Hixie-P2] → [Hixie-P2][CSS2-12.1]
Status: NEW → ASSIGNED
Priority: -- → P2
Summary: unwanted border with :before pseudo selector and image → selectors matching :before/:after images
Target Milestone: --- → Future
Severity: normal → major

Comment 7

17 years ago
cc'ing myself
can people still reproduce this?  I have not been able to...

Comment 9

16 years ago
Yep, WFM on Mozilla 1.0
Status: ASSIGNED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.