From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- layout/doc/HLD-SpaceManager.html | 245 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 layout/doc/HLD-SpaceManager.html (limited to 'layout/doc/HLD-SpaceManager.html') diff --git a/layout/doc/HLD-SpaceManager.html b/layout/doc/HLD-SpaceManager.html new file mode 100644 index 000000000..b67d8d5ef --- /dev/null +++ b/layout/doc/HLD-SpaceManager.html @@ -0,0 +1,245 @@ + + + + + + + + Space Manager High Level Design + + + + +

Gecko Layout High Level Design Document

+ +

Space Manager High Level Design

+
+ +

Overview

+ The Space Manager and associated classes and strructures are used by Block +and Line layout to manage rectangular regions that are occupied and available, +for correct handling of floated elements and the elements that flow around +them.  When elements are floated to the left or right in a layout, they +take up space and influence where other elements can be placed.  The +Space Manager is responsible for keeping track of where space is taken up +and where it is available. This information is used by block layout to correctly +compute where other floated elements should be placed, and how much space +is available to normal in-flow elements that flow around the floated bits.
+
+ The Space Manager works in concert with several other classes to do its +job. The classes that are considered part of the Space Manager are:
+ + + Outside of the Space Manager itself, the clients of the Space Manager also + play an inportant part in the management of he available and used space. + The primary classes that interact with the Space Manager are:
+ + + The general interaction model is to create a Space Manager for a block +frame in the context of a Reflow, and to associate it with the BlockReflowState + so it is passed down to child frames' reflow methods. After reflow, the +Space Manager is destroyed.  During reflow, the space manager stores +the space taken up by floats (UpdateSpaceManager in nsBlockFrame) and +provides information about the space available for other elements (GetAvailableSpace +in nsBlockReflowState).  
+
+ Additionally, there is a need to manage impacts to lines caused by +changes to floated elements.  This is referred to as Propagation +of Float Damage and is handled by the Block Frame, making use of the +Space Manager. When a float is incrementally reflowed, the Space +Manager is notified if the float's region has changed. If so, the +vertical space that has been affected (including both the float's old +region and the float's new region) is noted in the internal +nsIntervalSet as potential float damage (the method is +IncludeInDamage). During the incremental reflow of dirty lines the +block frame may encounter lines that are NOT dirty. In this case the +Space Manager is also asked if  there is any float damage, and +if there is then the block further checks to see if that damage +intersects the area of the non-dirty line, marking it dirty if there +is intersection.  Thus, changes to floats on other lines may +cause impact to otherwise clean lines, and the Space Manager +facilitates the detection of this.

Data Model

+ +

Class/Component Diagram

+ +
+
SpaceManager Class Diagram +
+
+
+ + + +

Use Case

+ +

Use Case 1: Space Manager is Created / Destroyed

+ Space Manager instances are created in the nsBlockFrame's Reflow method. +  
+ + + If the BlockReflowState already had a Space Manager instance associated +with it, it is stored off before being replaced, and the returned to the +BlockReflowState instance after the new one has been destroyed.  Thus, +Space Managers are effectively 'nested' during reflow, with each new block +introducing its own Space Manager. + +

Use Case 2: Float is added to the Space Manager

After a Space Manager is created for a block context's reflow chain, a +floated block may be added to it.  This happens in the method nsBlockReflowState::RecoverFloats and +nsBlockReflowState::FlowAndPlaceFloat (formerly this was done in nsBlockFrame::UpdateSpaceManager).  
+
+The general algorightm in nsBlockReflowState::RecoverFloats is:
+ +
+ +The general algorightm in nsBlockReflowState::FlowAndPlaceFloat is:
+ +

Use Case 3: Space Manager is used to find available space to reflow + into

+ The nsBlockFrame makes use of the Space Manager indirectly to get the available + space to reflow a child block or inline frame into. The block frame uses +a helper method on the nsBlockReflowState class to do the actual computation + of available space based on the data in the Space Manager. Here is how it +works for reflowing an inline frame within a block (this also occurs for +reflowing a block frame and, partially, for preparing for a resize reflow).
+ + + +

Use Case 4: Propagation of Float Damage: detecting and handling float +damage

+ This process is driven by the Block Frame.
+ + +
+ +

+ +

Problems / bugs found during documentation:

+ + +
+
+ + + -- cgit v1.2.3