layout: Implement overflow-wrap/word-wrap per CSS-TEXT § 6.2.

This property is used by approximately 55% of page loads.

To implement the line breaking behavior, the "breaking strategy" has
been cleaned up and abstracted. This should allow us to easily support
other similar properties in the future, such as `text-overflow` and
`word-break`.
This commit is contained in:
Patrick Walton 2014-12-12 22:03:00 -08:00
parent 1be7d7cced
commit 6943ddb93e
8 changed files with 356 additions and 139 deletions

View file

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<!-- Tests that `overflow-wrap: break-word` breaks words if it needs to, but only when
necessary. -->
<style>
section, nav {
background: purple;
position: absolute;
left: 0;
}
section {
width: 100px;
top: 0;
height: 100px;
}
nav {
top: 100px;
width: 300px;
height: 200px;
}
</style>
</head>
<body>
<section></section><nav></nav>
</body>
</html>