Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We should include this in system.base.css. All core themes will need it and modules may as well.
Comment | File | Size | Author |
---|---|---|---|
#1 | html5-display-1321678-01.patch | 602 bytes | Jacine |
Comments
Comment #1
JacineHere's a patch.
Comment #2
JohnAlbinNote that "block-level" is only defined in HTML4 and is not defined for HTML5. The best description of what "block-level" roughly means for HTML5 is here: https://developer.mozilla.org/en/HTML/Block-level_elements
That page shows that these are the new HTML5 elements that need CSS block styling:
article
,aside
,audio
,canvas
,figcaption
,figure
,footer
,header
,hgroup
,output
,section
,video
It took me a little digging, but it looks like Jacine's patch is based on the elements at http://html5doctor.com/html-5-reset-stylesheet/ Which is a 2009 article.
I'm also looking at the internals of the html5 shim to see what elements it inserts, but it does so for block and inline elements, so I haven't whittled it down to a list of block-level elements yet.
Comment #3
JacineI did find references to "block-level" elements in the spec when I was looking into this, but maybe I was looking at an older version because I cannot find them anymore. I didn't get the list from a 2009 article though. ;)
The idea here is to reset the default UA styles. The list is the same as what is currently defined in both Compass and Normalize.css, which is used in the HTML5 Boilerplate project. I'll pull the pages from the spec to confirm this and post.
One thing I didn't add, which I wanted to talk about is the inline-block elements. I'm not sure whether we should add those or not.
Comment #4
JacineHere's the source of the display: block recommendations. It's in the rendering section of the spec: http://dev.w3.org/html5/spec/Overview.html#rendering
The entire list of new elements is here:
section, article, aside, hgroup, header, footer, menu, nav, figure, figcaption, video, audio, source, track, mark, progress, meter, time, ruby, rt, rp, bdi, wbr, canvas, command, details, summary, datalist, keygen, output
This patch covers:
section, article, aside, hgroup, header, footer, menu, nav, figure, figcaption, details, summary
That leaves:
video, audio, source, track, mark, progress, meter, time, ruby, rt, rp, bdi, wbr, canvas, command, datalist, keygen, output.
Of the remaining list, the only ones in question are canvas, video and audio IMO, and those are the ones that normalize.css sets as inline-block. I'm still looking into this, but my initial thought was to just leave this part out for now because we will likely not deal with these in core.
Still not sure what to call this instead of block-level elements though. Maybe I should just remove the heading in the comment?
Comment #5
JohnAlbinOk. Here's what I found. This is a list of all elements in HTML5: http://developers.whatwg.org/section-index.html#index Anything on that list that is "phrasing" means that tag can be used to markup intra-paragraph content”, i.e. its an inline element.
So if you look at the remaining list and whittle it down to only those new HTML5 elements, you end up with the exact list that Jacine has in her patch in #1. Nice job!
Actually, no it doesn't. Those are all phrasing elements or are elements that can only appear inside specific elements that also happen to be phrasing elements.
Comment #6
JacineSweet, thank you for looking into it too, John! :D
Comment #7
catchStraightforward change. Committed/pushed to 8.x, thanks!