On Sun, Nov 07, 2010 at 12:43:42AM +0000, corvid wrote:
Johannes wrote:
On Sat, Nov 06, 2010 at 03:04:16PM +0000, corvid wrote:
"Percentage values: refer to parent element's width"
So a Textblock wants to decide how big it is, and it asks its children how big they are, and the child has, say, text-indent: 50%, and so it gets to wordWrap and asks "So, ah...how big are _you_?". And the parent doesn't know yet.
Ah interesting....
What about using something like availWidth in Textblock::wordWrap() as an aproximation of the future width of the Textblock? Maybe this would be good enough. In which cases would this be way off?
That's a good idea! It seems to work pretty well in general...
From looking at the specs I think it should use the whole width of
Wow nice! the block including margin and padding, like this: indent = misc::roundInt(this->availWidth * core::style::perLengthVal (getStyle()->textIndent)); As far as I can tell firefox is also doing it that way in: <div style="text-indent: 50%; border: 1px solid; padding: 2cm; margin: 2cm"> foo bar </div> Cheers, Johannes PS: Feel free to commit your patch!