I'm posting this message in the name of Rod McGuire, who got his message rejected apparently.
--- [ I apologize for knowing nothing of current Servo internals ] For precise layout of things like math equations or SVG diagrams a Javascrpt application may need to know the width and height extent of component elements. Currently in browsers the only way to find this information is with .getBoundingClientRect() which only works after an element has been rendered and also returns x and y position information. The current way to kludge around this is by rendering each element twice - on the first pass width and height information is collected to determine the layout in the final render pass. [ MathJax does this though I think they are moving towards an external font table approach ] I've heard that to just get width and height information without rendering would require a major rewrite of the work flow for most current browsers. Has there been any effort in Servo to make available this information for non-rendered elements? I think most developers affected by this would be somewhat happy with width and height just for textual elements. They also might like some exposure of the actual selected font so that font table information can be used in layout. I haven't been able to find any discussion of this issue though there seems to be some on performance of the full blown .getBoundingClientRect(). [1]: https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect [2]: Recent Improvements to Functions like getClientBoundingRect - https://groups.google.com/forum/#!searchin/mozilla.dev.servo/getBoundingClientRect/mozilla.dev.servo/fpY49KCQ_64/0Mq7fnn4OMIJ
signature.asc
Description: PGP signature
_______________________________________________ dev-servo mailing list dev-servo@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-servo