Gecko:Frame Destruction: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(One intermediate revision 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, 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. | # 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. | ||
# RemoveFrame implementations usually start by removing the next continuation | # 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. | ||
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. | # 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
- Find the primary frame P
- 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.
- 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.