This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 12778 - add "paragraphs" pseudo selector in spec
Summary: add "paragraphs" pseudo selector in spec
Status: NEW
Alias: None
Product: CSS
Classification: Unclassified
Component: Selectors (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: fantasai
QA Contact: This bug has no owner yet - up for the taking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-25 09:54 UTC by Giorgio
Modified: 2011-11-22 02:22 UTC (History)
9 users (show)

See Also:


Attachments

Description Giorgio 2011-05-25 09:54:20 UTC
hi, if we have three paragraphs like here:

<div id="body">
   first paragraph
   <p>second paragraph
   <ul><li>hey</ul>
   third paragraph
</div>

i want to select them as "elements" i always need to surround them with <p>

but a selector like:

div#body > ::paragraphs
{
    margin:20px;
}

would be really nice

contenteditable based editors do not always put <p> around texts, in html5 a text is always a paragraph (if not surrounded by hN tags)

(hope there is the right place for this feature request)

thank you
Comment 1 Tab Atkins Jr. 2011-05-25 16:13:44 UTC
This should be requested in the CSSWG, as it's a CSS feature, not an HTML feature.
Comment 2 Aryeh Gregor 2011-05-25 22:46:15 UTC
So this would do what, add properties to the anonymous block boxes?  Is that feasible?  FWIW, I'm writing a contenteditable spec right now, and by default it looks like I'll require that paragraphs be wrapped in <p> consistently (with options to switch to other modes).
Comment 3 Tab Atkins Jr. 2011-05-25 22:59:34 UTC
Aryeh, it's *potentially* feasible, yes.  But we've kept those sorts of things anonymous so far, so we'd probably not change it now.
Comment 4 Michael[tm] Smith 2011-08-04 05:00:27 UTC
mass-moved component to LC1
Comment 5 Ian 'Hixie' Hickson 2011-08-09 21:47:00 UTC
Is there a way to reassign this to the CSSWG or do I just mark it INVALID? I think the idea makes enough sense to be studied further, but as others have said, it really is a CSS thing, not an HTML thing.
Comment 6 Michael[tm] Smith 2011-11-20 15:39:44 UTC
per comment #1 and comment #5, I'm changing the product on this to "CSS"

Tab, I'm not sure what CSS component it should be assigned to, so if can you please check and assign it to the correct one?
Comment 7 Tab Atkins Jr. 2011-11-22 00:44:42 UTC
(In reply to comment #6)
> per comment #1 and comment #5, I'm changing the product on this to "CSS"
> 
> Tab, I'm not sure what CSS component it should be assigned to, so if can you
> please check and assign it to the correct one?

It should be assigned to Selectors 4, which doesn't yet have a component.
Comment 8 Michael[tm] Smith 2011-11-22 01:10:00 UTC
(In reply to comment #7)
> It should be assigned to Selectors 4, which doesn't yet have a component.

It does now :) Thanks -- I moved it over.
Comment 9 Giorgio 2011-11-22 02:14:09 UTC
another alternative would be adding implicitly the "<p>", as happen for example with the <tr>s added directly to the <table>, firefox automatically wraps them with a <tbody>
Comment 10 Tab Atkins Jr. 2011-11-22 02:15:04 UTC
(In reply to comment #9)
> another alternative would be adding implicitly the "<p>", as happen for example
> with the <tr>s added directly to the <table>, firefox automatically wraps them
> with a <tbody>

That's massively incompatible with web content at this point, so it won't happen.
Comment 11 Giorgio 2011-11-22 02:22:48 UTC
ok, right
another similar alternative


p{margin:20px;}
::adjacent-text-nodes {20px;}
p > ::adjacent-text-nodes {margin:0;}

::adjacent-text-nodes is more generic than "paragraphs" (so applies not only to html) and does the same job

hope this helps