Bug 116926
Summary: | Node::lazyAttach shouldn't lie about being attached | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> |
Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | ahmad.saleem792, hyatt, kling, koivisto, simon.fraser |
Priority: | P2 | Keywords: | BlinkMergeCandidate |
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | |||
Bug Blocks: | 111494 |
Ryosuke Niwa
Consider merging https://chromium.googlesource.com/chromium/blink/+/727ede4b077539383452ab020184714e45a3f5a2
lazyAttach just needs to mark the node as needing a style recalc, there's no reason
to mark the node as attached, or mark all the descendants as being attached. We also
don't need to mark all descendants as needing a style recalc since Element::recalcStyle
is going to transform the StyleChange into a Force when it goes to descendants.
Now lazyAttach just marks you as needing a FullStyleChange and the later recalcStyle
will mark you as attached. This means that after this patch attached() is equivalent to
"ever had style recalc". In a future patch we should rename that flag.
A benefit of this patch is that doing appendChild(divWithLotsOfDescendants); now does 2
fewer walks of the descendants because we don't need to mark them all as attached in
lazyAttach, and we don't need to run detach() in recalcStyle() when it calls reattach.
Another benefit is that Node::attach is no longer n^2 when you append many elements
without any whitespace between them because the loop to fix up whitespace can bail
out early when it sees !next->attached().
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ryosuke Niwa
Reverted in https://chromium.googlesource.com/chromium/blink/+/5dcf89e40eccdc2d1ce6bd363a1affb056022822
Ahmad Saleem
lazyAttach is not something Webkit has and removed long time ago.
Hence, this is not required.