Gecko:Frame Destruction: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created page with '== Gecko frame destruction invariants == * nsIFrame::RemoveFrame deletes a frame, all its descendants, and all their continuations * Before a placeholder frame is destroyed, its...')
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Gecko frame destruction invariants ==
== Gecko frame destruction invariants ==


* nsIFrame::RemoveFrame deletes a frame, all its descendants, and all their
* nsIFrame::RemoveFrame deletes a frame, all its descendants, and all their continuations
continuations
* Before a placeholder frame is destroyed, its out-of-flow frame is removed. Sometimes the placeholder has a dangling reference to the out-of-flow, though!
* Before a placeholder frame is destroyed, its out-of-flow frame is removed.
Sometimes the placeholder has a dangling reference to the out-of-flow,
though!


To remove the frames for an element, we
To remove the frames for an element, we
# Find the primary frame P
# Find the primary frame P
# DeletingFrameSubtree: For all in-flow frames under P or its continuations,
# DeletingFrameSubtree: For all in-flow frames under P or its continuations, if the frame is a placeholder whose out-of-flow is not under the placeholder's P continuation ancestor, remove the mapping from the out-of-flow to the placeholder and remove the frame subtree via RemoveFrame. RemoveFrame breaks the mapping from placeholders to outOfFlows for floats, but not for abs-pos frames.
if the frame is a placeholder whose out-of-flow is not under the placeholder's
# RemoveFrame implementations usually start by removing the next continuation if there is one via DeleteNextInFlowChild, and then removing the frame and calling Destroy on it, which recursively destroys children.
P continuation ancestor, remove the mapping from the out-of-flow to the
# nsBlockFrame::RemoveFrame for in-flow frames finds the first frame to remove in the line list, then removes the frames in flow order.
placeholder and remove the frame subtree via RemoveFrame. RemoveFrame
breaks the mapping from placeholders to outOfFlows for floats, but not
for abs-pos frames.
# RemoveFrame implementations usually start by removing the next continuation
if there is one via DeleteNextInFlowChild, and then removing the frame and calling Destroy on it, which recursively destroys children.
# nsBlockFrame::RemoveFrame for in-flow frames finds the first frame to
remove in the line list, then removes the frames in flow order.

Latest revision as of 23:13, 1 May 2009

Gecko frame destruction invariants

  • nsIFrame::RemoveFrame deletes a frame, all its descendants, and all their continuations
  • Before a placeholder frame is destroyed, its out-of-flow frame is removed. Sometimes the placeholder has a dangling reference to the out-of-flow, though!

To remove the frames for an element, we

  1. Find the primary frame P
  2. DeletingFrameSubtree: For all in-flow frames under P or its continuations, if the frame is a placeholder whose out-of-flow is not under the placeholder's P continuation ancestor, remove the mapping from the out-of-flow to the placeholder and remove the frame subtree via RemoveFrame. RemoveFrame breaks the mapping from placeholders to outOfFlows for floats, but not for abs-pos frames.
  3. RemoveFrame implementations usually start by removing the next continuation if there is one via DeleteNextInFlowChild, and then removing the frame and calling Destroy on it, which recursively destroys children.
  4. nsBlockFrame::RemoveFrame for in-flow frames finds the first frame to remove in the line list, then removes the frames in flow order.