-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reader: Add fixed table-layout to tables within full post view #1238
Conversation
@@ -217,6 +217,10 @@ | |||
} | |||
} | |||
|
|||
table { | |||
table-layout: fixed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems... dangerous: https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout
Under the "fixed" layout method, the entire table can be rendered once the first table row has been downloaded and analyzed. This can speed up rendering time over the "automatic" layout method, but subsequent cell content may not fit in the column widths provided. Any cell that has content that overflows uses the overflow property to determine whether to clip the overflow content.
Why does setting fixed
fix the issue? Is there another way we could do it without changing how most tables render?
The setting defaults to It should be noted this effect occurs in other environments, not just the Reader. Here's the sample HTML provided in the issue in a post in the Twenty Fourteen theme: The Twenty Fifteen theme handles this issue by using Setting table-layout to To produce the same effect without using I'll attempt a solution that at least accounts for the image case, and test out how other elements react to see if fixing more than images is necessary. |
The odd thing is that is only does it in firefox. I wonder if this is a vague bit of the spec, or if Firefox is getting it wrong.. |
I was hoping I could figure out what it is that Chrome and Firefox handle differently by using the same table setup without all the other styles already in Calypso, including normalize/reset styles that are in play. So I started working with this HTML on its own: https://gist.github.com/alexjgustafson/cf3fe38df0d15e52a675 When viewing that HTML alone, the images overflow the table in both Chrome and Firefox, regardless of |
@alexjgustafson Have you had a chance to look at this again? |
@blowery a couple times I've attempted to find other solutions but I'm afraid I'm stumped beyond my original PR. |
Closing this one as no movement in several months — feel free to re-open if it's actionable and can be pushed in. |
Fixes #986 , to keep tables from overflowing within Reader's full post view in firefox
Testing instructions:
Result: the table is not constrained to the content area when the post is viewed in the Reader using Firefox.
Before:
After:
cc: @blowery @designsimply