-
-
Notifications
You must be signed in to change notification settings - Fork 66
Fix text align #413
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
Fix text align #413
Conversation
|
The text-align-center test is currently failing due to imperceptible differences in font rendering. There are a few pixels different in the "r" at the end of "inner" in the 4th example and the "r" at the end of outer in the 5th example. This issue also isn't consistent across systems, as the test actually passes for me on some of the devices I've checked. Do you think we should consider this a bug and try to get the font rendering identical, or would it be reasonable to add a small fuzz value to the comparison check? I've found a value of TestReference |
|
Interesting, not sure what is causing those differences. I'm leaving here a magnified picture of the problem: I would be inclined to think that they use floating point numbers internally to store the position of each glyph and there may be some rounding effects moving the Could we reduce the text length (say to one word only) and see if the problem goes away? I would prefer not adding fuzzing as that may conceal other problems. |
|
Changing inner/outer to internal/external seems to have done the trick. Based on some other testing I did it seems like the issue has more to do with specific words than the length of the string. |
rodarima
left a comment
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.
Thanks, this looks great!
Inline elements are now aligned based on the text-align value of their containing element instead of their own text-align value. Block level elements are no longer affected by the text-align property. Fixes: dillo-browser#410



Fix for #410
and a prerequisite for finishing #403Edit: this does have some interactions with #403 but turns out the fixes can be implemented independently.
There are two components to this change:
inlineorinline-block.alignStlyefrom the container instead of from the element being aligned.This PR also expands
test/text-align-center.htmlwith test cases for some other common scenarios