haikuwebkit/Tools/LayoutReloaded
Zalan Bujtas 9229f989d7 [LFC][IFC] Move trailing trimming logic to LineBuilder::TrimmableContent
https://bugs.webkit.org/show_bug.cgi?id=204872
<rdar://problem/57652365>

Reviewed by Antti Koivisto.

Source/WebCore:

Move trimming logic from LineBuilder::removeTrailingTrimmableContent to inside TrimmableContent.
This is also in preparation for adding partial trimming at inline container boundary.

* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::LineBreaker::breakingContextForInlineContent):
* layout/inlineformatting/InlineLineBreaker.h:
* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::LineBuilder):
(WebCore::Layout::LineBuilder::initialize):
(WebCore::Layout::LineBuilder::removeTrailingTrimmableContent):
(WebCore::Layout::LineBuilder::appendTextContent):
(WebCore::Layout::LineBuilder::appendNonReplacedInlineBox):
(WebCore::Layout::LineBuilder::TrimmableContent::TrimmableContent):
(WebCore::Layout::LineBuilder::TrimmableContent::append):
(WebCore::Layout::LineBuilder::TrimmableContent::trim):
* layout/inlineformatting/InlineLineBuilder.h:
(WebCore::Layout::LineBuilder::isTrailingRunFullyTrimmable const):
(WebCore::Layout::LineBuilder::TrimmableContent::isTrailingRunFullyTrimmable const):
(WebCore::Layout::LineBuilder::TrimmableContent::reset):
(WebCore::Layout::LineBuilder::isTrailingContentFullyTrimmable const): Deleted.
(WebCore::Layout::LineBuilder::TrimmableContent::isTrailingContentFullyTrimmable const): Deleted.
(WebCore::Layout::LineBuilder::TrimmableContent::clear): Deleted.
* layout/inlineformatting/LineLayoutContext.cpp:
(WebCore::Layout::LineLayoutContext::processUncommittedContent):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

Canonical link: https://commits.webkit.org/218103@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-12-05 14:11:05 +00:00
..
DisplayTree
FormattingContext
FormattingState
LayoutReloaded.xcworkspace
LayoutTree
misc [LFC][IFC] Move trailing trimming logic to LineBuilder::TrimmableContent 2019-12-05 14:11:05 +00:00
test
Layout.js
LayoutState.js
README.md
TreeBuilder.js
Utils.js

README.md

Visual formatting model implementation. See https://www.w3.org/TR/CSS22/visuren.html for more information.

WebCore

  1. recursive layout
  2. layout logic lives in the renderers mixing block with inline etc.
  3. No clear separation of logic and state.

LayoutReloaded

  1. Iterative layout within a formatting context, recursive across nested formatting contexts
  2. Formatting context is responsible for computing size/positions for all the boxes that live in the context including in/out-of-flow and floating boxes
  3. Layout state is stored in dedicated FormattingState objects.
  4. Initial containing block creates the top level (initial) block formatting context
  5. Floats are resitriced to their formatting contexts.
  6. Boxes, including inline tree are generated while laying out the content. LayoutTree -> BoxTree.

Instructions:

  1. apply ./misc/LayoutReloadedWebKit.patch
  2. compile WebKit
  3. load ./test/index.html

Partially done: Block formatting context:

  • static, relative and out of flow positioning
  • margin collapsing
  • floats

Missing:

  • Inline formatting context
  • Everything else