You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However: According to the W3C spec, when an element is misparented an anonymous element should be generated around it with the proper display type. Therefore there should be no issue. And this is, in fact, the case in Internet Explorer and Firefox (did not test Safari or Opera)
A bug or race condition in Chrome causes it to improperly generate these anonymous elements when the page takes too long to render (many DOM elements on the page). The net effect looks like so:
Repro
Operating system: Windows 10
Browser: Chrome 55
In order to create this effect I had a page with many elements above the media item:
A responsive navbar
A carousel
A collapsible form with multiple form-groups and inputs
Images, text, etc
At the bottom of the page I had a card with a media inside of it:
<divclass="row"><divclass="col-sm-6"><!-- Repeated element --><divclass="card mx-auto"><imgclass="card-img-top w-100" src="..."><divclass="card-block px-0 py-0"><divclass="media"><aclass="media-left pr-0" href="..."><imgclass="media-object" src="..."></a><divclass="media-body"><h4class="media-heading>...</h4> <div class="pl-1"><pclass="small my-0">...</p><!-- Repeated element --></div></div><ahref="..." class="btn">...</a></div></div></div></div>
Fix
By setting display: table on .media it generates properly every time:
.media {
display: table;
}
Fixed:
The text was updated successfully, but these errors were encountered:
@stevendesu Please post the URL of your example webpage or a link to a CodePen/JSBin/etc. example that demonstrates the problem, so that we can file a Chrome bug.
Note: On my personal server I only had the bug occur intermittently (about 50% of the time) so it was obviously a race condition. On JSBin the bug is happening consistently (100% of the time across 30 page loads) so I think that JSBin has a sufficient number of elements and scripts on the page that it's triggering the race condition every time. To really see the intermittent nature of the bug you may need to save the HTML locally and load it from disk or something (to avoid the overhead of loading JSBin around it)
Edit: I just tested with https://jsbin.com/ruhoqocumo/1/ (doesn't load the JSBin overhead) and the issue did not occur once over 10 page loads, so I may need more trash elements to trigger it. On my personal server I also had a carousel, some cards, a few buttons, and an image above the media components. Tweak the number of trash elements as necessary to trigger the issue on your own computer. Since it seems to be a race condition CPU performance probably factors in to how many elements are necessary to trigger it.
Issue
A strange race condition in Chrome for Windows causes
<div class="media">
components to display incorrectly sometimesDetails
Having a
display: table-cell
element whose immediate parent is not adisplay: table-row
ordisplay: table
is invalid according to the W3C table spec:https://www.w3.org/TR/CSS2/tables.html#table-display
However: According to the W3C spec, when an element is misparented an anonymous element should be generated around it with the proper display type. Therefore there should be no issue. And this is, in fact, the case in Internet Explorer and Firefox (did not test Safari or Opera)
A bug or race condition in Chrome causes it to improperly generate these anonymous elements when the page takes too long to render (many DOM elements on the page). The net effect looks like so:
Repro
In order to create this effect I had a page with many elements above the media item:
At the bottom of the page I had a card with a media inside of it:
Fix
By setting
display: table
on.media
it generates properly every time:Fixed:
The text was updated successfully, but these errors were encountered: