2020-03-07 10:27:02 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
|
|
* list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
* and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Web {
|
|
|
|
|
2020-03-19 19:07:56 +01:00
|
|
|
class CanvasRenderingContext2D;
|
2020-03-07 10:27:02 +01:00
|
|
|
class Document;
|
|
|
|
class Element;
|
2020-03-21 18:17:18 +01:00
|
|
|
class Event;
|
2020-06-07 14:40:38 +02:00
|
|
|
class EventHandler;
|
2020-03-18 15:22:31 +01:00
|
|
|
class EventListener;
|
|
|
|
class EventTarget;
|
2020-03-07 10:27:02 +01:00
|
|
|
class Frame;
|
2020-04-01 18:53:28 +02:00
|
|
|
class HTMLBodyElement;
|
2020-03-19 19:07:56 +01:00
|
|
|
class HTMLCanvasElement;
|
2020-05-24 20:24:43 +02:00
|
|
|
class HTMLDocumentParser;
|
2020-03-29 22:24:23 +02:00
|
|
|
class HTMLElement;
|
2020-05-24 00:12:27 +02:00
|
|
|
class HTMLFormElement;
|
2020-04-01 18:53:28 +02:00
|
|
|
class HTMLHeadElement;
|
|
|
|
class HTMLHtmlElement;
|
2020-04-14 20:37:01 +02:00
|
|
|
class HTMLImageElement;
|
2020-05-24 22:00:10 +02:00
|
|
|
class HTMLScriptElement;
|
2020-05-28 18:21:22 +02:00
|
|
|
class PageView;
|
2020-04-21 23:49:51 +02:00
|
|
|
class ImageData;
|
2020-06-10 10:42:29 +02:00
|
|
|
class LineBox;
|
|
|
|
class LineBoxFragment;
|
2020-06-09 20:42:11 +02:00
|
|
|
class LayoutBlock;
|
2020-04-01 18:53:28 +02:00
|
|
|
class LayoutDocument;
|
2020-03-29 22:24:23 +02:00
|
|
|
class LayoutNode;
|
2020-06-09 20:42:11 +02:00
|
|
|
class LayoutNodeWithStyle;
|
LibWeb: Reorganize layout algorithm
Previously, layout recursively performed these steps (roughly):
1. Compute own width
2. Compute own position
3. Layout in-flow children
4. Compute own height
5. Layout absolutely positioned descendants
However, step (2) was pretty inconsistent. Some things computed their
own position, others had their parent do it for them, etc.
To get closer to CSS spec language, and make things easier in general,
this patch reorganizes the algorithm into:
1. Compute own width & height
2. Compute width & height of in-flow managed descendants
3. Move in-flow managed descendants to their final position
4. Layout absolutely positioned descendants
Block layout is now driven by the containing block, which will iterate
the descendants it's responsible for. There are a lot of inefficient
patterns in this logic right now, but they can easily be replaced with
better iteration functions once we settle on a long-term architecture.
Since the ICB (LayoutDocument) is at (0, 0), it doesn't rely on a
containing block to move it into place.
This code is still evolving along with my understanding of CSS layout,
so it's likely that we'll reorganize this again sooner or later. :^)
2020-06-14 18:48:10 +02:00
|
|
|
class LayoutReplaced;
|
2020-06-01 21:58:29 +02:00
|
|
|
class LoadRequest;
|
2020-03-21 18:17:18 +01:00
|
|
|
class MouseEvent;
|
2020-03-07 10:27:02 +01:00
|
|
|
class Node;
|
2020-04-07 22:56:13 +02:00
|
|
|
class Origin;
|
2020-06-08 20:31:49 +02:00
|
|
|
class Page;
|
|
|
|
class PageClient;
|
2020-06-18 21:35:44 +02:00
|
|
|
class PaintContext;
|
2020-06-01 21:33:23 +02:00
|
|
|
class Resource;
|
|
|
|
class ResourceLoader;
|
2020-03-29 22:24:23 +02:00
|
|
|
class Selector;
|
2020-06-15 17:29:35 +02:00
|
|
|
class StackingContext;
|
2020-04-01 18:53:28 +02:00
|
|
|
class StyleResolver;
|
2020-03-29 22:24:23 +02:00
|
|
|
class StyleRule;
|
|
|
|
class StyleSheet;
|
2020-05-10 20:43:29 +02:00
|
|
|
class Text;
|
2020-06-27 18:30:29 +02:00
|
|
|
class Timer;
|
2020-04-01 18:53:28 +02:00
|
|
|
class Window;
|
2020-04-08 21:11:51 +02:00
|
|
|
class XMLHttpRequest;
|
2020-03-07 10:27:02 +01:00
|
|
|
|
2020-03-14 13:15:11 +01:00
|
|
|
namespace Bindings {
|
|
|
|
|
2020-03-19 19:07:56 +01:00
|
|
|
class CanvasRenderingContext2DWrapper;
|
2020-03-14 13:15:11 +01:00
|
|
|
class DocumentWrapper;
|
2020-03-25 18:53:20 +01:00
|
|
|
class ElementWrapper;
|
2020-03-21 18:17:18 +01:00
|
|
|
class EventWrapper;
|
2020-03-18 15:22:31 +01:00
|
|
|
class EventListenerWrapper;
|
|
|
|
class EventTargetWrapper;
|
2020-03-19 19:07:56 +01:00
|
|
|
class HTMLCanvasElementWrapper;
|
2020-06-21 14:35:00 +02:00
|
|
|
class HTMLElementWrapper;
|
2020-04-14 20:37:01 +02:00
|
|
|
class HTMLImageElementWrapper;
|
2020-04-21 23:49:51 +02:00
|
|
|
class ImageDataWrapper;
|
2020-05-18 21:52:50 +02:00
|
|
|
class LocationObject;
|
2020-03-21 18:17:18 +01:00
|
|
|
class MouseEventWrapper;
|
2020-03-14 13:15:11 +01:00
|
|
|
class NodeWrapper;
|
2020-04-01 18:53:28 +02:00
|
|
|
class WindowObject;
|
2020-03-14 13:15:11 +01:00
|
|
|
class Wrappable;
|
|
|
|
class Wrapper;
|
2020-04-08 21:11:51 +02:00
|
|
|
class XMLHttpRequestConstructor;
|
|
|
|
class XMLHttpRequestPrototype;
|
|
|
|
class XMLHttpRequestWrapper;
|
2020-03-14 13:15:11 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-03-07 10:27:02 +01:00
|
|
|
}
|