mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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:
parent
1be7d7cced
commit
6943ddb93e
8 changed files with 356 additions and 139 deletions
28
tests/ref/overflow_wrap_ref.html
Normal file
28
tests/ref/overflow_wrap_ref.html
Normal 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>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue