haikuwebkit/LayoutTests/fast/text/simple-line-layout-hyphenat...

28 lines
1.2 KiB
HTML
Raw Permalink Normal View History

Simple line layout: Extend webkit-hyphenate-limit-lines to cover subsequent words. https://bugs.webkit.org/show_bug.cgi?id=169631 Reviewed by Antti Koivisto. Source/WebCore: This patch extends webkit-hyphenate-limit-lines to cover separate words across multiple lines. Example: webkit-hyphenate-limit-lines: 1; "if this line wraps at foo- bar, the next line should not hyphenate at all. How- ever the line after that could." Test: fast/text/simple-line-layout-hyphenation-limit-lines-accross-words.html * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::LineState::setHyphenationDisabled): (WebCore::SimpleLineLayout::LineState::isHyphenationDisabled): (WebCore::SimpleLineLayout::updateLineConstrains): (WebCore::SimpleLineLayout::hyphenPositionForFragment): (WebCore::SimpleLineLayout::splitFragmentToFitLine): (WebCore::SimpleLineLayout::createLineRuns): (WebCore::SimpleLineLayout::createTextRuns): * rendering/SimpleLineLayoutTextFragmentIterator.h: (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::hasHyphen): (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen): (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::wrappingWithHyphenCounter): Deleted. LayoutTests: * fast/text/simple-line-layout-hyphenation-limit-lines-accross-words-expected.html: Added. * fast/text/simple-line-layout-hyphenation-limit-lines-accross-words.html: Added. Canonical link: https://commits.webkit.org/186737@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-16 22:14:30 +00:00
<!DOCTYPE html>
<html>
<head>
<title>This tests that simple and normal line layout produce the same lines with webkit-hyphenate-limit-lines</title>
<style>
div {
display: inline-block;
-webkit-hyphens: auto;
width: 235px;
margin-right: 150px;
vertical-align: top;
font-size: 30px;
}
</style>
<script>
if (window.internals)
internals.settings.setSimpleLineLayoutEnabled(false);
</script>
</head>
<body>
<div style="-webkit-hyphenate-limit-lines: 0">some text here foobar some text foobar some text foobar some text foobar</div>
<div style="-webkit-hyphenate-limit-lines: 1">some text here foobar some text foobar some text foobar some text foobar</div>
<div style="-webkit-hyphenate-limit-lines: 2">some text here foobar some text foobar some text foobar some text foobar</div>
<div style="-webkit-hyphenate-limit-lines: 3">some text here foobar some text foobar some text foobar some text foobar</div>
<div style="-webkit-hyphenate-limit-lines: 4">some text here foobar some text foobar some text foobar some text foobar some text foobar</div>
<div style="-webkit-hyphenate-limit-lines: -1">some text here foobar some text foobar some text foobar some text foobar some text some text foobar</div>
</body>
</html>