Updated: Comment #37
Problem/Motivation
- The comment itself is rendered outside instead of inside the bubble.
Proposed resolution
- Fix regression so that comment is rendered the same as Drupal 7 bartik:
- Comment body and comment admin links rendered within the bubble.
Improve HTML 5 semantic markup.Comment #36 suggests that no additional changes other than fixing the regression be made in this issue, and issue set to "needs work" from RTBC.
Remaining tasks
Patch that does not cause any regressions (#24 with fix in #17)- Create a follow-up issue for HTML 5 markup changes.
User interface changes
HTML 5 semantic markup: header, footer, address, time elements.
Related Issues
- Move improving HTML 5 semantic markup work to #2031883: Markup for: comment.html.twig?
Original report by Wim Leers
Discovered locally (ab4418e65f46a1032b77a6aa497f02f009352379).
Fresh D8 HEAD (e97a786c05203b6827bdd7dfd9ec309c308f44e4) install on simplytest.me, same problem:

The subject is rendered too low, the comment itself is rendered outside instead of inside the bubble (like it is in D7). I cannot imagine this is a conscious change.
| Comment | File | Size | Author |
|---|---|---|---|
| #44 | drupal-bartik-comment-outside-bubble-1965650-44.patch | 2.43 KB | manningpete |
| #44 | interdiff.txt | 326 bytes | manningpete |
| #42 | drupal-bartik-comment-outside-bubble-1965650-42.patch | 2.43 KB | manningpete |
| #42 | interdiff.txt | 345 bytes | manningpete |
| #39 | 1965650aftercomment2.png | 73.92 KB | andymartha |
Comments
Comment #1
swentel commentedI can confirm the behavior.
What's even more weird, and I think even more critical than that rendering imo, I can't even submit a comment in when the comment box has an editor ..
Getting following errors in console too:
An invalid form control with name='comment_body[und][0][value]' is not focusable.Comment #2
wim leersTo your secondary problem: that's a known problem, due to HTML5 validation + WYSIWYG editor, see #1954968: Required CKEditor fields always fail HTML5 validation.
Comment #3
webchickJess says this might be easy to fix. :D Tagging novice.
Also, this probably doesn't need to be *critical*. It's very dumb, but we could certainly ship D8 with dumb styling. Reducing to major.
Comment #4
alexpottJust looking at the markup not sure that this is a novice issue. In D8 the
<header>markup contains the attribution. I might be wrong (css and markup is not my area of expertise) but I think that in order to make this look like d7 options are:OR
OR
D8 comment markup
What this comment looks like...
D7 comment markup
What this comment looks like...
Comment #5
jenlamptonThis issue is blocking Twig conversion. Does that make it critical?
See #1898054: comment.module - Convert PHPTemplate templates to Twig
Comment #6
jenlamptonwhoopsie, didn't mean to remove the tag.
Comment #7
adam clarey commentedI've attached a path that fixes the problem.
I felt it was semanticly wrong to have the header element there at all so i removed it, placed the comment body after the title and added a small css change.
Now looks as it did in 7.
Adam
Comment #8
adam clarey commentedComment #10
adam clarey commentedThere must be some other problem with the test that failed, all the patch does is re-arrange some markup. There's absolutley no change to logic/php/database and the tests that failed were:
Base table or view not found: 1146 Table 'drupaltestbotmysql.simpletest845479semaphore' doesn't exist:
This is a lot deeper than a simple change of markup and css.
Comment #11
amateescu commented#7: core-bartek_comment_template-1965650-0.patch queued for re-testing.
Comment #12
andymartha commentedAfter applying the patch core-bartek_comment_template-1965650-0.patch by rabbit_media in #7 to a Drupal 8 fresh install, I confirm the comment subject and body are within the bubble in Bartik. See screenshots for the markup produced.
Comment #13
alexpottAs this was introduced in #1179764: Convert Bartik to HTML5 I'd like JohnAlbin to +1 this before committing. Completely changing the semantic markup to fix a visual defect needs oversight...
Comment #14
alexpottPostponing this on #1938840: bartik.theme - Convert PHPTemplate templates to Twig.
We can fix this bug once twig is in!
Comment #15
brightboldTwig is in!
Comment #16
DeeLay commentedAdapted patch from #7 for twig
Comment #17
mradcliffeLooking at another issue I ran into this, tried to apply the patch, and it no longer applies as of Today. I re-rolled patch.
I also noticed that the footer links are outside of the bubble in the previous patch, but in Drupal 7 the links are inside the bubble. I have fixed this regression as well in the patch.
Comment #19
star-szr#17: drupal-bartik-comment-outside-bubble-1965650-17.patch queued for re-testing.
Comment #20
yoroy commentedI tested this. Without the patch I see the bug as described and the latest patch fixes things. I can't review the code quality but seems to me this is rtbc.
Comment #21
alexpottHmmm are we sure that we want to remove the html5 header tag here?
We still input from someone on the new markup as per #13
Comment #22
panchoNo we definitely don't want to remove
<header>- it would degrade our semantical markup, see HTML5 specs.Actually we should use more, not less HTML5 semantics, such as
<time>,<link>and<address>elements, here, but this doesn't have to be in this patch.Also, not critical per #3 and in spite of #5.
[edit:] escaped markup
Comment #23
panchoHere's a new patch that fixes the
<header>rather than removing it.Screenshot after patch:

Comment #24
panchoImplemented
<address>and<time>instead of divs.Also removed classes that are unnecessary now that we can address .comment time, .comment address, .comment header and .comment footer.
Screenshot:

Didn't manage it to avoid a tiny little difference that I couldn't track down. Needs some work, possibly in a followup issue.
Sending it to the testbot, but primarily #23 remains to be reviewed.
Comment #25
mradcliffeIs it a conscious decision to move the comment moderation links outside of the bubble?
I don't see that documented anywhere in the issue other than my comment about it being a regression. I searched for other issues, and I could not find any information regarding this change. I'm not against it, but I would like to confirm that is the intent.
Comment #26
yoroy commentedNot supposed to happen. This was fixed with the patch in #17, apparently that got lost again.
Comment #27
mradcliffeThank you, yoroy. I updated the issue summary to help clarify things.
Comment #28
wim leers#24: is the
<address>thing according to the HTML5 specs?Comment #29
mradcliffeI actually looked that up a bit ago. There is no format for address. It must only be the relevant contact information for the parent article or body element. The only question would be if a user link is a relevant contact link. I think it is.
I am a bit more concerned about the time element, which does have a specific syntax and a more confusing specification. If the datetime attribute is specified, then that needs to have the specific syntax and the content of the time element is the human-readable meaning for that date/time.
I think this is what the specification is trying to say... But it's confusing.
Comment #30
panchoYes, you're both right. The whole footer belongs into the box.
Here's another patch. Output looks really good now.
Screenshot:

Two things have changed against D7:
The text content has become a bit larger. However this is also the case without the patch so should be on purpose or unrelated (either way it's better than in D7)Can only be a browser issue or something. Opened in another tab, now it looks exactly the same as in D7.Re #29:
While I, IMHO properly, introduced the
<address>and<time>elements, I omitted the datetime attribute for now. Can be a followup or rolled in. Didn't want to hold up the bug fix longer for that.Comment #31
panchoTags seem to have become a tiny little bit larger. This might also affect other fields.
I wasn't able to track it down though because the inspector on Chromium gave me exactly the same Computed Style with exactly the same CSS rules matching. Might try it in Firefox later.
D7:

D8 with patch #30:

Comment #32
yoroy commentedDon't worry too much about font size of the tags. See #1218640: Bartik displays all taxonomy term fields in a smaller font than other fields for that.
Comment #33
pancho#30: drupal-bartik-comment-outside-bubble-1965650-30.patch queued for re-testing.
Comment #34
andymartha commentedAfter applying the patch drupal-bartik-comment-outside-bubble-1965650-30.patch by Pancho in #30 to a Drupal 8 fresh install 8/9 , I confirm the comment subject and body are within the bubble in Bartik and the markup contains the html5 elements. See screenshots for the markup produced. Hope someone can look at this and move it forward, thanks!
Comment #35
andymartha commentedAfter applying the patch drupal-bartik-comment-outside-bubble-1965650-30.patch by Pancho in #30 to a Drupal 8 fresh install 8/9 , I confirm the comment subject and body are within the bubble in Bartik and the markup contains the html5 elements. See screenshots for the markup produced. Hope someone can look at this and move it forward, thanks!
Comment #36
webchickWhile I am excited beyond belief to see this issue RTBC (yayyyy!!) the changes here look like they're expanding way beyond the scope of fixing just this one bug. :\ Adding elements like
<time>and<footer>and whatnot seem like a good idea, but this is taking Bartik's comment.html.twig file quite far away from Comment module's comment.html.twig file. If some of these are good ideas for better semantic markup in all themes (which it seems like they are), then they should be proposed instead to the "upstream" template and then updated in Bartik only after a patch to change Comment module's markup is approved (or actually, as a part of that patch most likely).Could we please slim this patch down to only the changes required to fix this one bug?
Comment #37
mradcliffeThis patch is a re-roll of #23 with the fix from #30 for the node links without any of the extra element changes in #24.
I have added a combined diff for follow-up issues. Note that bartik's comment.html.twig doesn't even have the HTML 5 mark element that core comment.html.twig has now.
Comment #37.0
mradcliffeAdded issue summary.
Comment #37.1
mradcliffeUpdated issue summary based on RTBC -> needs work comments
Comment #38
mradcliffeIf someone can give the patch in #37 a review comparing #30 just to make sure I didn't forget or regress anything, then I think this can be set back to RTBC.
Comment #39
andymartha commentedAfter applying the patch drupal-bartik-comment-outside-bubble-1965650-37.patch by mradcliffe in #38 to a Drupal 8 fresh install 8/12 , I confirm the comment subject and body are within the bubble in Bartik and the markup removes the html5 elements address and time, using p and div instead. See screenshots for the markup produced.

Comment #40
manningpete commentedThis patch fully complies with coding standards, doesn't need tests, and actually solves the problem of the comment printing outside the bubble, without introducing any HTML5 elements unrelated to this particular issue.
Comment #41
wim leersMissing space after colon.
Sorry :(
Once fixed, I'll RTBC again!
Comment #42
manningpete commentedI added a space after display and rerolled the patch from 37. Attached interdiff with patch from 37.
Comment #43
star-szrAnd add a space before {?
Edit: referencing https://drupal.org/node/1887862.
Comment #44
manningpete commentedAdded a space before the bracket.
Comment #45
mradcliffeYay, back to RTBC.
Comment #46
webchickGreat work!!
Committed and pushed to 8.x. Thanks!
SO glad to have this one fixed. :)
Comment #47
wim leersYes :) Now let's fix the fact the comment subject is below the comment body on the comment form!
Comment #48
amateescu commentedThat would be #2044863: EntityFromController doesn't assign weights for extra fields that are not yet saved in a EntityFormDisplay. Beware, the title is misleading because the fix will probably be something else entirely :/
Comment #49.0
(not verified) commentedAdded related issue in comment.module