Closed
Bug 241985
Opened 21 years ago
Closed 20 years ago
CSS generated content does not work on replaced elements (img, form controls, etc.)
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
VERIFIED
INVALID
People
(Reporter: mkmelin, Assigned: dbaron)
References
Details
Attachments
(1 file)
649 bytes,
application/xhtml+xml
|
Details |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040421 MultiZilla/1.6.3.0e
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040421 MultiZilla/1.6.3.0e
When using e.g.
<style type="text/css">
input:before {
content: "" attr(name) ": ";
}
</style>
no content is generated
Reproducible: Always
Steps to Reproduce:
1. See testcase
2.
Actual Results:
In 1.7rc1, you see only input fields, no text
Expected Results:
Should output
cast: [input field] category: [input field] [submit]
This worked in 1.6
Reporter | ||
Comment 1•21 years ago
|
||
Comment 2•21 years ago
|
||
Generated content on "replaced elements" has been disabled (per CSS 2.1).
(FORM elemetns aren't really replaced like IMG, but they behave the same.)
Whiteboard: DUPEME
Comment 3•21 years ago
|
||
No CSSOM involved.
David, are we just marking these invalid, or what?
Assignee: general → dbaron
Component: DOM: CSSOM → Style System (CSS)
Comment 4•20 years ago
|
||
Marking invalid. This is as-designed.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Whiteboard: DUPEME
Reporter | ||
Comment 5•20 years ago
|
||
Ok. For reference, functionality was obviously changed by the patch for bug 169334.
Status: RESOLVED → VERIFIED
Comment 6•20 years ago
|
||
*** Bug 283808 has been marked as a duplicate of this bug. ***
Comment 7•19 years ago
|
||
*** Bug 304279 has been marked as a duplicate of this bug. ***
Comment 8•18 years ago
|
||
*** Bug 351758 has been marked as a duplicate of this bug. ***
Assignee | ||
Updated•15 years ago
|
Summary: CSS input:after generated content broken in 1.7rc1 → CSS generated content does not work on replaced elements (img, form controls, etc.)
Assignee | ||
Updated•15 years ago
|
OS: Linux → All
Hardware: x86 → All
Comment 13•11 years ago
|
||
This works with Chrome (blink), since their form controls are implemented by Shadow DOM (thus having a DOM subtree to insert the pseudo elements).
Comment 14•11 years ago
|
||
Shadow DOM shouldn't matter here. Per spec, ::before and ::after are supposed to act exactly like normal DOM children. If an actual DOM child wouldn't appear in the rendering, neither should ::before and ::after. If Blink is implementing something else, then it's just not following the spec.
Comment 15•11 years ago
|
||
That said, I just tried this in Chrome with an <input type="button"> and the ::before doesn't show up there, as expected. So I have no idea what comment 13 is talking about.
Comment 17•10 years ago
|
||
I'm using input[type=checkbox]:before to re-style checkboxes (make the checkbox visibility:hidden and use :before to create the box) and it works fine in Chrome 37, but nothing shows up in Firefox 32.
Comment 18•10 years ago
|
||
That's a bug in Chrome, afaict, since it doesn't allow rendering normal kids of a checkbox.
Comment 20•8 years ago
|
||
I came here with the same issue as Jason. Works in Chrome, but not in Firefox.
https://bugzilla.mozilla.org/show_bug.cgi?id=241985#c17
Comment 21•8 years ago
|
||
Here's an example: https://s.codepen.io/kevinSuttle/debug/OXybrJ
Comment 22•8 years ago
|
||
The example URL from comment 21 doesn't show the quote character in Chrome, either in dev channel or release.
Comment 23•8 years ago
|
||
@Boris Zbarsky I'm not sure what you mean. Are you referring to the `content: close-quote` property? https://developer.mozilla.org/en-US/docs/Web/CSS/content#Values
Comment 24•8 years ago
|
||
Yes, the actual thing that uses generated content there.
Comment 25•8 years ago
|
||
Good observation. I have actually never seen it rendered.
You need to log in
before you can comment on or make changes to this bug.
Description
•