Auto merge of #7024 - pcwalton:whitespace-stripping, r=mbrubeck

layout: Rewrite whitespace stripping.

This patch makes Servo unconditionally strip whitespace before text run
scanning (assuming that the `white-space` property allows it). Whitespace
stripping during reflow is now only used for handling whitespace at the ends of
lines; reflow now never attempts to handle ignorable whitespace.

Many CSS tests pass now. There are some new failures, however.

The following reference tests now fail due to a pre-existing bug whereby
whitespace is used to calculate the position of inline hypothetical boxes for
elements with `display: inline; position: absolute`:

* `absolute-replaced-height-036.htm`
* `vertical-align-sub-001.htm`
* `vertical-align-super-001.htm`

The following reference tests fail due to a pre-existing bug whereby we don't
handle `font-size: 0` properly in inline reflow:

* `font-size-zero-1.htm`
* `font-size-zero-2.htm`

The following reference test fails due to the fact that it relied on our
incorrect insertion of whitespace to make room for the black background:

* `inline-formatting-context-007.htm`

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7024)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-08-11 12:57:02 -06:00
commit 7dc83e7820
34 changed files with 216 additions and 181 deletions

View file

@ -0,0 +1,3 @@
[absolute-replaced-height-036.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[bidi-breaking-001.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[block-in-inline-007.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +1,4 @@
[c5502-imrgn-r-003.htm]
type: reftest
expected: FAIL
expected:
if os == "mac": FAIL

View file

@ -1,3 +0,0 @@
[c5525-fltwidth-003.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[content-175.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[floats-143.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[font-weight-applies-to-017.htm]
type: reftest
expected: FAIL

View file

@ -1,4 +1,3 @@
[inline-formatting-context-007.htm]
type: reftest
expected:
if os == "mac": FAIL
expected: FAIL

View file

@ -1,3 +0,0 @@
[insert-inline-in-blocks-n-inlines-begin-003.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[insert-inline-in-blocks-n-inlines-middle-003.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[ltr-basic.htm]
type: reftest
expected: FAIL

View file

@ -1,4 +0,0 @@
[margin-collapse-137.htm]
type: reftest
expected:
if os == "linux": FAIL

View file

@ -1,4 +0,0 @@
[margin-collapse-138.htm]
type: reftest
expected:
if os == "linux": FAIL

View file

@ -1,3 +0,0 @@
[max-width-percentage-001.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[min-width-percentage-001.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[rtl-basic.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[text-transform-capitalize-001.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[text-transform-lowercase-001.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[text-transform-uppercase-001.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +1,3 @@
[abspos-008.htm]
[vertical-align-sub-001.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +1,3 @@
[abspos-width-005.htm]
[vertical-align-super-001.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[white-space-collapsing-bidi-003.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[white-space-normal-003.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[white-space-normal-004.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[white-space-pre-001.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[white-space-pre-002.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[width-percentage-001.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[width-percentage-002.htm]
type: reftest
expected: FAIL