Bug 116926 - Node::lazyAttach shouldn't lie about being attached
Summary: Node::lazyAttach shouldn't lie about being attached
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BlinkMergeCandidate
Depends on:
Blocks: 111494
  Show dependency treegraph
 
Reported: 2013-05-29 00:42 PDT by Ryosuke Niwa
Modified: 2022-09-28 15:39 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-05-29 00:42:02 PDT
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().
Comment 2 Ahmad Saleem 2022-09-28 15:39:08 PDT
lazyAttach is not something Webkit has and removed long time ago.

Hence, this is not required.