On 4月29日, 上午6时52分, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Apr 29, 4:34 am, Boris Zbarsky <[EMAIL PROTECTED]> wrote: > > > byang wrote: > > > For CSS selector is evaluated based on the DOM tree, and the > > > inheritance of CSS properties is also based on the DOM tree > > > Note that selector evaluation is based not only on the DOM tree but also on > > the > > presentation. See @media rules, for example. So you can in fact have > > multiple > > style contexts for a single DOM node while printing. > > We should get rid of the separate presentation for printing by cloning > the document.
So, do Gecko use different rendering tree for different media? If so, we can just use the same document without any clone. If not, I think we can also use the some document, too. Any media type has no relation with DOM structure. > But we'd still need a separate style context tree to handle pseudo- > styles for wrapper frames etc, right? pseudo-class such as visited, link, hover and etc. can be dealt on the DOM tree, I think. But, pseudo-element indeed cause some problems because they are not presented in the DOM tree directly like other real elements. But, I think the nsStyleContext can be placed on the FrameTree for these pseudo-elements. Since, the frame tree node has a reference of the DoM node, so only the pseudo-elements have the nsStyleContext on the frame node and other element can put it on the content node. Regards! Bo
_______________________________________________ dev-tech-layout mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-layout

