I was just thinking... would it make sense to somehow flag content nodes that do not yet have a frame? Basically, we could have a bit that starts off 0, gets set to 1 when the content node gets a frame, and stays 1 thereafter (even if the frame goes away). The goal here is to minimize the amount of time required by GetPrimaryFrameFor calls on content that's in the process of being inserted into the DOM (at parse time). I bet Text nodes don't have any extra space for this, but Element nodes should have something sitting about that could hold this info....

Alternately, we could even have a pointer to the primary frame in presshell 0 on Element nodes (if we are willing to pay the memory cost). The pointer could be easily maintained from layout and used by GPFF to optimize itself:

  if (content->GetFrame() &&
      content->GetFrame()->PresContext() == mPresShell->PresContext()){
    return content->GetFrame();
  }

Or even just used by the Element nodes to avoid calling GPFF (since they always call it on PresShell 0).

Thoughts?
_______________________________________________
mozilla-layout mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-layout

Reply via email to