9229f989d7
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 |
||
---|---|---|
.. | ||
DisplayTree | ||
FormattingContext | ||
FormattingState | ||
LayoutReloaded.xcworkspace | ||
LayoutTree | ||
misc | ||
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
- recursive layout
- layout logic lives in the renderers mixing block with inline etc.
- No clear separation of logic and state.
LayoutReloaded
- Iterative layout within a formatting context, recursive across nested formatting contexts
- 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
- Layout state is stored in dedicated FormattingState objects.
- Initial containing block creates the top level (initial) block formatting context
- Floats are resitriced to their formatting contexts.
- Boxes, including inline tree are generated while laying out the content. LayoutTree -> BoxTree.
Instructions:
- apply ./misc/LayoutReloadedWebKit.patch
- compile WebKit
- 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