Implementing text-overflow: ellipsis property on Servo
What’s this blog about? This is an explanation to a PR I submitted on the Servo community to implement basic support for text-overflow: ellipsis property on Servo. Scope & Limitations I would like to emphasize that this PR attempts to add basic support for text-overflow property, not a full-fledged feature. Specifically, some limitations include: This PR only adds support for single-valued text-overflow, so anything involving first value, such as text-overflow: ellipsis ellipsis, is not supported yet. No RTL support. According to the CSS specification, if there isn’t enough space for the ellipsis glyph, then the ellipsis glyph must be clipped. This has not been supported yet. Instead, what will happen is one or more characters (except for the first one) will be clipped to make more room for the ellipsis glyph. the CSS specification also mentioned that if the ellipsis glyph is not available for a particular font, then we should fallback to three dots .... This fallback hasn’t been implemented yet. No support for float yet. I’m not sure how to best explain it now, but this will be elaborated in a later section. Despite this, the code in this PR will be written (at least I’ll attempt it to the best of my ability) in a way that makes it possible for future contributors to extend text-overflow property without significantly changing the logic. ...