[LFC][IFC] Add generic inline content handling.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Oct 2018 16:41:58 +0000 (16:41 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Oct 2018 16:41:58 +0000 (16:41 +0000)
commitf72a3f18368cde265c91ba18974384a61f8b8633
tree4a174256aad53229a1d20b3952987fc1745630cd
parent053cfb678b836befa4873d85848ff887e0d3ca4f
[LFC][IFC] Add generic inline content handling.
https://bugs.webkit.org/show_bug.cgi?id=190713

Reviewed by Antti Koivisto.

layoutInlineContent turns InlineLineBreaker::Run objects into final inline runs by
resolving heading/trailing whitespace, aligment, expansion opportunities etc.
These inline runs are input to the display tree construction.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/displaytree/DisplayBox.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::trimLeadingRun):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::Line::hasContent const):
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const):
(WebCore::Layout::InlineFormattingContext::Line::availableWidth const):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::inlineRuns):
(WebCore::Layout::InlineFormattingState::appendInlineRun):
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::nextRun):
(WebCore::Layout::InlineLineBreaker::nextLayoutRun): Deleted.
* layout/inlineformatting/InlineLineBreaker.h:
* layout/inlineformatting/InlineRun.h: Added.
(WebCore::Layout::InlineRun::logicalLeft const):
(WebCore::Layout::InlineRun::logicalRight const):
(WebCore::Layout::InlineRun::width const):
(WebCore::Layout::InlineRun::setWidth):
(WebCore::Layout::InlineRun::setLogicalRight):
(WebCore::Layout::InlineRun::TextContext::position const):
(WebCore::Layout::InlineRun::TextContext::length const):
(WebCore::Layout::InlineRun::TextContext::setLength):
(WebCore::Layout::InlineRun::textContext):
(WebCore::Layout::InlineRun::inlineItem const):
(WebCore::Layout::InlineRun::InlineRun):
(WebCore::Layout::InlineRun::TextContext::TextContext):
* layout/inlineformatting/Line.cpp: Added.
(WebCore::Layout::InlineFormattingContext::Line::Line):
(WebCore::Layout::InlineFormattingContext::Line::setConstraints):
(WebCore::Layout::isNonCollapsedText):
(WebCore::Layout::isTrimmableContent):
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::Line::close):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237288 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/layout/displaytree/DisplayBox.h
Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp
Source/WebCore/layout/inlineformatting/InlineFormattingContext.h
Source/WebCore/layout/inlineformatting/InlineFormattingState.h
Source/WebCore/layout/inlineformatting/InlineLineBreaker.cpp
Source/WebCore/layout/inlineformatting/InlineLineBreaker.h
Source/WebCore/layout/inlineformatting/InlineRun.h [new file with mode: 0644]
Source/WebCore/layout/inlineformatting/Line.cpp [new file with mode: 0644]