2020-03-07 12:27:02 +03: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
|
|
|
|
|
2020-07-26 21:01:35 +03:00
|
|
|
namespace Web::CSS {
|
|
|
|
class Selector;
|
|
|
|
class StyleProperties;
|
|
|
|
class StyleResolver;
|
|
|
|
class StyleRule;
|
|
|
|
class StyleSheet;
|
|
|
|
}
|
|
|
|
|
2020-07-26 20:37:56 +03:00
|
|
|
namespace Web::DOM {
|
2020-08-17 21:14:30 +03:00
|
|
|
class CharacterData;
|
|
|
|
class Comment;
|
2020-03-07 12:27:02 +03:00
|
|
|
class Document;
|
2020-08-17 21:14:30 +03:00
|
|
|
class DocumentFragment;
|
2020-07-18 23:17:17 +03:00
|
|
|
class DocumentType;
|
2020-03-07 12:27:02 +03:00
|
|
|
class Element;
|
2020-03-21 20:17:18 +03:00
|
|
|
class Event;
|
2020-06-07 15:40:38 +03:00
|
|
|
class EventHandler;
|
2020-03-18 17:22:31 +03:00
|
|
|
class EventListener;
|
|
|
|
class EventTarget;
|
2020-07-26 20:37:56 +03:00
|
|
|
class MouseEvent;
|
|
|
|
class Node;
|
|
|
|
class ParentNode;
|
2020-08-02 12:47:27 +03:00
|
|
|
class Position;
|
2020-07-26 20:37:56 +03:00
|
|
|
class Text;
|
|
|
|
class Timer;
|
|
|
|
class Window;
|
|
|
|
enum class QuirksMode;
|
|
|
|
}
|
|
|
|
|
2020-07-28 19:20:36 +03:00
|
|
|
namespace Web::HTML {
|
2020-07-26 20:37:56 +03:00
|
|
|
class CanvasRenderingContext2D;
|
|
|
|
class HTMLAnchorElement;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLAreaElement;
|
|
|
|
class HTMLAudioElement;
|
|
|
|
class HTMLBaseElement;
|
|
|
|
class HTMLBlinkElement;
|
2020-04-01 19:53:28 +03:00
|
|
|
class HTMLBodyElement;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLBRElement;
|
|
|
|
class HTMLButtonElement;
|
2020-03-19 21:07:56 +03:00
|
|
|
class HTMLCanvasElement;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLDataElement;
|
|
|
|
class HTMLDataListElement;
|
|
|
|
class HTMLDetailsElement;
|
|
|
|
class HTMLDialogElement;
|
|
|
|
class HTMLDivElement;
|
|
|
|
class HTMLDListElement;
|
2020-05-24 21:24:43 +03:00
|
|
|
class HTMLDocumentParser;
|
2020-03-29 23:24:23 +03:00
|
|
|
class HTMLElement;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLEmbedElement;
|
|
|
|
class HTMLFieldSetElement;
|
|
|
|
class HTMLFontElement;
|
2020-05-24 01:12:27 +03:00
|
|
|
class HTMLFormElement;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLFrameElement;
|
|
|
|
class HTMLFrameSetElement;
|
2020-04-01 19:53:28 +03:00
|
|
|
class HTMLHeadElement;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLHeadingElement;
|
|
|
|
class HTMLHRElement;
|
2020-04-01 19:53:28 +03:00
|
|
|
class HTMLHtmlElement;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLIFrameElement;
|
2020-04-14 21:37:01 +03:00
|
|
|
class HTMLImageElement;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLInputElement;
|
|
|
|
class HTMLLabelElement;
|
|
|
|
class HTMLLegendElement;
|
|
|
|
class HTMLLIElement;
|
|
|
|
class HTMLLinkElement;
|
|
|
|
class HTMLMapElement;
|
|
|
|
class HTMLMarqueeElement;
|
|
|
|
class HTMLMediaElement;
|
|
|
|
class HTMLMenuElement;
|
|
|
|
class HTMLMetaElement;
|
|
|
|
class HTMLMeterElement;
|
|
|
|
class HTMLModElement;
|
|
|
|
class HTMLObjectElement;
|
|
|
|
class HTMLOListElement;
|
|
|
|
class HTMLOptGroupElement;
|
|
|
|
class HTMLOptionElement;
|
|
|
|
class HTMLOutputElement;
|
|
|
|
class HTMLParagraphElement;
|
|
|
|
class HTMLParamElement;
|
|
|
|
class HTMLPictureElement;
|
|
|
|
class HTMLPreElement;
|
|
|
|
class HTMLProgressElement;
|
|
|
|
class HTMLQuoteElement;
|
2020-05-24 23:00:10 +03:00
|
|
|
class HTMLScriptElement;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLSelectElement;
|
|
|
|
class HTMLSlotElement;
|
|
|
|
class HTMLSourceElement;
|
|
|
|
class HTMLSpanElement;
|
|
|
|
class HTMLStyleElement;
|
|
|
|
class HTMLTableCaptionElement;
|
|
|
|
class HTMLTableCellElement;
|
|
|
|
class HTMLTableColElement;
|
|
|
|
class HTMLTableElement;
|
|
|
|
class HTMLTableRowElement;
|
|
|
|
class HTMLTableSectionElement;
|
|
|
|
class HTMLTemplateElement;
|
|
|
|
class HTMLTextAreaElement;
|
|
|
|
class HTMLTimeElement;
|
|
|
|
class HTMLTitleElement;
|
|
|
|
class HTMLTrackElement;
|
|
|
|
class HTMLUListElement;
|
|
|
|
class HTMLUnknownElement;
|
|
|
|
class HTMLVideoElement;
|
2020-04-22 00:49:51 +03:00
|
|
|
class ImageData;
|
2020-07-28 19:20:36 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace Web {
|
2020-08-14 12:33:20 +03:00
|
|
|
class EventHandler;
|
2020-07-28 19:20:36 +03:00
|
|
|
class Frame;
|
2020-09-22 18:53:40 +03:00
|
|
|
class FrameLoader;
|
2020-06-09 21:42:11 +03:00
|
|
|
class LayoutBlock;
|
2020-09-12 18:56:11 +03:00
|
|
|
class LayoutButton;
|
|
|
|
class LayoutCheckBox;
|
2020-04-01 19:53:28 +03:00
|
|
|
class LayoutDocument;
|
2020-03-29 23:24:23 +03:00
|
|
|
class LayoutNode;
|
2020-06-09 21:42:11 +03: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 19:48:10 +03:00
|
|
|
class LayoutReplaced;
|
2020-07-26 20:37:56 +03:00
|
|
|
class LineBox;
|
|
|
|
class LineBoxFragment;
|
2020-06-01 22:58:29 +03:00
|
|
|
class LoadRequest;
|
2020-04-07 23:56:13 +03:00
|
|
|
class Origin;
|
2020-06-08 21:31:49 +03:00
|
|
|
class Page;
|
|
|
|
class PageClient;
|
2020-08-17 16:58:29 +03:00
|
|
|
class InProcessWebView;
|
2020-06-18 22:35:44 +03:00
|
|
|
class PaintContext;
|
2020-06-01 22:33:23 +03:00
|
|
|
class Resource;
|
|
|
|
class ResourceLoader;
|
2020-06-15 18:29:35 +03:00
|
|
|
class StackingContext;
|
2020-04-08 22:11:51 +03:00
|
|
|
class XMLHttpRequest;
|
2020-07-21 17:23:08 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace Web::Bindings {
|
2020-03-14 15:15:11 +03:00
|
|
|
|
2020-03-19 21:07:56 +03:00
|
|
|
class CanvasRenderingContext2DWrapper;
|
2020-08-03 21:50:45 +03:00
|
|
|
class CharacterDataWrapper;
|
2020-08-17 21:14:30 +03:00
|
|
|
class CommentWrapper;
|
2020-08-20 00:30:33 +03:00
|
|
|
class DocumentFragmentWrapper;
|
2020-07-18 23:17:17 +03:00
|
|
|
class DocumentTypeWrapper;
|
2020-07-28 20:40:11 +03:00
|
|
|
class DocumentWrapper;
|
2020-03-25 20:53:20 +03:00
|
|
|
class ElementWrapper;
|
2020-03-18 17:22:31 +03:00
|
|
|
class EventListenerWrapper;
|
|
|
|
class EventTargetWrapper;
|
2020-07-28 20:40:11 +03:00
|
|
|
class EventWrapper;
|
2020-07-27 07:04:26 +03:00
|
|
|
class HTMLAnchorElementWrapper;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLAreaElementWrapper;
|
|
|
|
class HTMLAudioElementWrapper;
|
|
|
|
class HTMLBaseElementWrapper;
|
2020-07-28 20:40:11 +03:00
|
|
|
class HTMLBodyElementWrapper;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLBRElementWrapper;
|
|
|
|
class HTMLButtonElementWrapper;
|
2020-03-19 21:07:56 +03:00
|
|
|
class HTMLCanvasElementWrapper;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLDataElementWrapper;
|
|
|
|
class HTMLDataListElementWrapper;
|
|
|
|
class HTMLDetailsElementWrapper;
|
|
|
|
class HTMLDialogElementWrapper;
|
|
|
|
class HTMLDivElementWrapper;
|
|
|
|
class HTMLDListElementWrapper;
|
2020-06-21 15:35:00 +03:00
|
|
|
class HTMLElementWrapper;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLEmbedElementWrapper;
|
|
|
|
class HTMLFieldSetElementWrapper;
|
2020-07-27 07:04:26 +03:00
|
|
|
class HTMLFormElementWrapper;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLFrameElementWrapper;
|
|
|
|
class HTMLFrameSetElementWrapper;
|
2020-07-28 20:40:11 +03:00
|
|
|
class HTMLHRElementWrapper;
|
2020-07-27 07:04:26 +03:00
|
|
|
class HTMLHeadElementWrapper;
|
|
|
|
class HTMLHeadingElementWrapper;
|
|
|
|
class HTMLHtmlElementWrapper;
|
|
|
|
class HTMLIFrameElementWrapper;
|
2020-04-14 21:37:01 +03:00
|
|
|
class HTMLImageElementWrapper;
|
2020-07-27 07:04:26 +03:00
|
|
|
class HTMLInputElementWrapper;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLLabelElementWrapper;
|
|
|
|
class HTMLLegendElementWrapper;
|
|
|
|
class HTMLLIElementWrapper;
|
2020-07-27 07:04:26 +03:00
|
|
|
class HTMLLinkElementWrapper;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLMapElementWrapper;
|
|
|
|
class HTMLMarqueeElementWrapper;
|
|
|
|
class HTMLMediaElementWrapper;
|
|
|
|
class HTMLMenuElementWrapper;
|
|
|
|
class HTMLMetaElementWrapper;
|
|
|
|
class HTMLMeterElementWrapper;
|
|
|
|
class HTMLModElementWrapper;
|
2020-07-27 07:04:26 +03:00
|
|
|
class HTMLObjectElementWrapper;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLOListElementWrapper;
|
|
|
|
class HTMLOptGroupElementWrapper;
|
|
|
|
class HTMLOptionElementWrapper;
|
|
|
|
class HTMLOutputElementWrapper;
|
|
|
|
class HTMLParagraphElementWrapper;
|
|
|
|
class HTMLParamElementWrapper;
|
|
|
|
class HTMLPictureElementWrapper;
|
|
|
|
class HTMLPreElementWrapper;
|
|
|
|
class HTMLProgressElementWrapper;
|
|
|
|
class HTMLQuoteElementWrapper;
|
2020-07-27 07:04:26 +03:00
|
|
|
class HTMLScriptElementWrapper;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLSelectElementWrapper;
|
|
|
|
class HTMLSlotElementWrapper;
|
|
|
|
class HTMLSourceElementWrapper;
|
|
|
|
class HTMLSpanElementWrapper;
|
2020-07-27 07:04:26 +03:00
|
|
|
class HTMLStyleElementWrapper;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLTableCaptionElementWrapper;
|
2020-07-27 07:04:26 +03:00
|
|
|
class HTMLTableCellElementWrapper;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLTableColElementWrapper;
|
2020-07-27 07:04:26 +03:00
|
|
|
class HTMLTableElementWrapper;
|
|
|
|
class HTMLTableRowElementWrapper;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLTableSectionElementWrapper;
|
|
|
|
class HTMLTemplateElementWrapper;
|
|
|
|
class HTMLTextAreaElementWrapper;
|
|
|
|
class HTMLTimeElementWrapper;
|
2020-07-27 07:04:26 +03:00
|
|
|
class HTMLTitleElementWrapper;
|
2020-08-09 19:10:41 +03:00
|
|
|
class HTMLTrackElementWrapper;
|
|
|
|
class HTMLUListElementWrapper;
|
|
|
|
class HTMLUnknownElementWrapper;
|
|
|
|
class HTMLVideoElementWrapper;
|
2020-04-22 00:49:51 +03:00
|
|
|
class ImageDataWrapper;
|
2020-05-18 22:52:50 +03:00
|
|
|
class LocationObject;
|
2020-03-21 20:17:18 +03:00
|
|
|
class MouseEventWrapper;
|
2020-03-14 15:15:11 +03:00
|
|
|
class NodeWrapper;
|
2020-09-20 20:22:44 +03:00
|
|
|
class ScriptExecutionContext;
|
2020-08-03 21:50:45 +03:00
|
|
|
class TextWrapper;
|
2020-07-28 20:40:11 +03:00
|
|
|
class UIEventWrapper;
|
2020-04-01 19:53:28 +03:00
|
|
|
class WindowObject;
|
2020-03-14 15:15:11 +03:00
|
|
|
class Wrappable;
|
|
|
|
class Wrapper;
|
2020-04-08 22:11:51 +03:00
|
|
|
class XMLHttpRequestConstructor;
|
|
|
|
class XMLHttpRequestPrototype;
|
|
|
|
class XMLHttpRequestWrapper;
|
2020-03-14 15:15:11 +03:00
|
|
|
|
|
|
|
}
|