On Sat, Dec 12, 2009 at 09:38:20PM +0000, corvid wrote:
Johannes wrote:
Ok, I understand your concerns now. It might be better to simply not create dw-widgets in the display:none case. At least we should try that option to see if it's simpler. My reasons are:
* we would not pollute dw/* which is complex already. dw/* would not look at style.display at all. * as Tim mentioned, you can always switch off remote CSS to see display:none stuff. * it does not mean that elements with display:none would not be part of the DOM tree, as the DOM tree will be separate from the widget tree.
I also understand now your's and Tim's concerns about the style pointer in struct Word. As soon as we start to modify styles in an existing widget tree we will get into trouble with all those pointers as we can't modify style objects in place.
So I would propose to do display handling in html.cc.
Your suggestion seems quite sensible to me now :)
Let's see :)
Then we can convert Doctree to a real DOM tree. With that in place we can come back to the style in struct Word issue. We might simply have a pointer to the corresponding DoctreeNode, which could hold the style. We might even drop the style sharing code then - but let's see.
Would dw/ understand the contents of DocTreeNodes?
Sorry, what I said was misleading. dw/ would not include doctree.hh. However we could have one style object per DocTreeNode and then all objects in the widget tree (widgets or struct Words) that correspond to that DocTreeNode could point to that single style object - which we could then modify in place. The main link between DocTree and widget tree would be the other way round. Each DocTreeNode would have a pointer to the widget that is responsible for displaying it - we might need further information like the word indices if a single widget displays multiple DocTreeNodes.