On Thu, Sep 9, 2010 at 1:46 AM, Maciej Stachowiak <mjs@apple.com> wrote:
On Sep 9, 2010, at 1:29 AM, Eric Seidel wrote:
On Thu, Sep 9, 2010 at 12:43 AM, Maciej Stachowiak <mjs@apple.com> wrote:
On Sep 9, 2010, at 12:00 AM, Eric Seidel wrote:
Instead, we could change all elements to mark themselves (and their parents) as needing style recalc during insertedIntoDocument(), effectively "attaching/lazyAttaching".
Presumably they should mark their parents as "child needs style recalc", not needing recalc themselves.
Turns out they also have to mark themselves as needing recalc. I tried only marking the parents in this latest patch and failed. :) http://trac.webkit.org/browser/trunk/WebCore/dom/Node.cpp#L759
Then I somewhat suspect the patch may be buggy buggy and may cause performance regressions. In cases where you insert elements into an attached tree. It very much seems like this would cause unnecessary style recalcs.
I'm not sure what you mean. You mean that the change in my patch to run the lazyAttach logic from insertedIntoDocument may cause additional style recalcs? The new element needs style calculated regardless. Marking an element with childNeedsStyleRecalc doesn't recalculate the style for that object to my knowledge.