On 9/6/13 5:57 PM, [email protected] wrote:
1. Where is DOM tree -> render tree conversion logic is located?
layout/base/nsCSSFrameConstructor.cpp
2. Is it possible to output extra frame when processing HTMLAnchorElement?
There is no special processing for HTMLAnchorElement right now. It just falls into the "construct frames by display type" bucket. You could add special processing and output extra frames (or rather extra frame construction items) pretty easily.
But whether it's possible to properly remove those when the HTMLAnchorElement is removed from the DOM is a much more interesting question. Also interesting are interactions with line-wrapping and block-inside-inline splits and so forth. And if you have <a style="display: table-row"> and you try to create more than a single nsTableRowFrame for it, things will very quickly go sour. And if you have <a style="display: block"> inside a flexbox you'd get extra flex items. And so forth.
3. What's best way to draw border around link? Create custom frame class and draw it using Cairo API or there's existing frame I can use?
The best way, imo, is to not mess with the frame tree at all and instead add the hackery to nsFrame::DisplayBorderBackgroundOutline: create an nsDisplayItem that does what you want and add it in there as needed.
On a side note - no, I don't want to use CSS to draw border, I really want to output "marker" frame using Gecko layout engine.
Do you really want to output a frame (and change layout in the process in cases like tables), or do you just want to draw something but not have it affect the CSSOM?
-Boris _______________________________________________ dev-tech-layout mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-layout

