[LFC][IFC] Add center/right/justify line alignment support.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 Jul 2018 19:48:21 +0000 (19:48 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 Jul 2018 19:48:21 +0000 (19:48 +0000)
commit76cbc95bede918b6bb5a24bc8f77a6ae44383fa6
tree17921ab98ff079dbb181bc5dd816f219fca197e1
parent23d7fd3ced340b7d3bd61dadf3323ed78fd9f672
[LFC][IFC] Add center/right/justify line alignment support.
https://bugs.webkit.org/show_bug.cgi?id=187890

Reviewed by Antti Koivisto.

Move over some more code from simple line layout.
(though text-align: justify is more preformant as now expansion opportunities are added as we process the text runs
-as opposed to iterting through the runs again when we reach the end of the line.)

* layout/inlineformatting/textlayout/Runs.h:
(WebCore::Layout::LayoutRun::setLeft):
(WebCore::Layout::LayoutRun::setExpansion):
* layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp:
(WebCore::Layout::SimpleLineBreaker::Line::Line):
(WebCore::Layout::SimpleLineBreaker::Line::setTextAlign):
(WebCore::Layout::SimpleLineBreaker::Line::adjustedLeftForTextAlign const):
(WebCore::Layout::SimpleLineBreaker::Line::justifyRuns):
(WebCore::Layout::SimpleLineBreaker::Line::adjustRunsForTextAlign):
(WebCore::Layout::expansionOpportunity):
(WebCore::Layout::expansionBehavior):
(WebCore::Layout::SimpleLineBreaker::Line::collectExpansionOpportunities):
(WebCore::Layout::SimpleLineBreaker::Line::closeLastRun):
(WebCore::Layout::SimpleLineBreaker::Line::append):
(WebCore::Layout::SimpleLineBreaker::Line::collapseTrailingWhitespace):
(WebCore::Layout::SimpleLineBreaker::Line::reset):
(WebCore::Layout::SimpleLineBreaker::Style::Style):
(WebCore::Layout::SimpleLineBreaker::handleLineEnd):
(WebCore::Layout::SimpleLineBreaker::handleLineStart):
(WebCore::Layout::isTextAlignRight):
(WebCore::Layout::SimpleLineBreaker::createRunsForLine):
* layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h:
(WebCore::Layout::SimpleLineBreaker::Line::setAvailableWidth):
(WebCore::Layout::SimpleLineBreaker::Line::setCollapseWhitespace):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/layout/inlineformatting/textlayout/Runs.h
Source/WebCore/layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp
Source/WebCore/layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h