[LFC][IFC] Add generic inline line breaker
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Oct 2018 16:31:19 +0000 (16:31 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Oct 2018 16:31:19 +0000 (16:31 +0000)
commit053cfb678b836befa4873d85848ff887e0d3ca4f
tree7655857ea61a10138a1298eeb88f83d11810567f
parent338712ba4a0137c2e4362720d43d9ad74f52e6d2
[LFC][IFC] Add generic inline line breaker
https://bugs.webkit.org/show_bug.cgi?id=190698

Reviewed by Antti Koivisto.

InlineLineBreaker takes the inline runs and applies the appropriate line breaking rules on them.
InlineRunProvider::Run objects ->

    <foobar><image box><hello>< ><world>

InlineLineBreaker::Run ->

    <foobar><image box><hello world>

InlineLineBreaker::Run also contains information whether the run is at the beginning or at the end of the line.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/LayoutContext.h:
(WebCore::Layout::LayoutContext::hasDisplayBox const):
* layout/inlineformatting/InlineLineBreaker.cpp: Added.
(WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
(WebCore::Layout::InlineLineBreaker::nextLayoutRun):
(WebCore::Layout::InlineLineBreaker::isAtContentEnd const):
(WebCore::Layout::InlineLineBreaker::lineBreakingBehavior):
(WebCore::Layout::InlineLineBreaker::runWidth const):
(WebCore::Layout::InlineLineBreaker::splitRun):
(WebCore::Layout::InlineLineBreaker::adjustSplitPositionWithHyphenation const):
* layout/inlineformatting/InlineLineBreaker.h: Added.
* layout/inlineformatting/textlayout/TextUtil.cpp: Added.
(WebCore::Layout::TextUtil::TextUtil):
(WebCore::Layout::TextUtil::width const):
(WebCore::Layout::TextUtil::hyphenPositionBefore const):
(WebCore::Layout::TextUtil::textWidth const):
(WebCore::Layout::TextUtil::fixedPitchWidth const):
* layout/inlineformatting/textlayout/TextUtil.h: Added.
* layout/layouttree/LayoutBox.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237287 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/layout/LayoutContext.h
Source/WebCore/layout/inlineformatting/InlineLineBreaker.cpp [new file with mode: 0644]
Source/WebCore/layout/inlineformatting/InlineLineBreaker.h [new file with mode: 0644]
Source/WebCore/layout/inlineformatting/textlayout/TextUtil.cpp [new file with mode: 0644]
Source/WebCore/layout/inlineformatting/textlayout/TextUtil.h [new file with mode: 0644]
Source/WebCore/layout/layouttree/LayoutBox.cpp