Skip to content

Made it so -webkit-margin-before and margin-top are heeded. #155

wants to merge 1 commit into from

2 participants


I made it so margin-top and margin-bottom overlap, as they're supposed to. And made it so margin-top/-webkit-margin-before are read like their bottom counterparts are.

I noticed one difference in the demo Snippets screen which I'm not sure how to fix. Now there are margins on the bottom of the description paragraphs, which seems odd, since I was only touching the top ones... But otherwise it seems good.


I'm not sure if the overlapping of the before and after margins is the standard behavior in CoreText. Did you test that? Make an NSAttributedString hat has both before and after set and see the difference between the _buildLinesWithTypesetter and _buildLinesWithStandardFramesetter. Switch between these in the _buildLines.

I think the overlapping in Safari only works with the -webkit CSS things. The normal margin behavior is to have both margins be added as it was before. We might need to have our own margins attribute to map to the -webkit ones.

Yes I understand, but I need to have the custom-typsetting buildLines to be working the same as CoreText does.

as I said, just switch between the two layouting methods in _buildLines. The legacy one is how CoreText is doing it, make a screenshot. Then just compare how the typesetter-version looks besides it.

@odrobnik odrobnik closed this Apr 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.