diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-03-29 14:30:40 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-03-29 14:30:40 +0530 |
commit | 159be44193ef7d60a5c35629d791323e5357e7db (patch) | |
tree | a0011acba76f5266e01daa7a3b11aae53d002265 /components/layout/inline.rs | |
parent | df73a18a61e57f62e2e17541d45dcd3818b35b7c (diff) | |
parent | 99885b1950695c2da0a62b418cbc2f35ca04150b (diff) | |
download | servo-159be44193ef7d60a5c35629d791323e5357e7db.tar.gz servo-159be44193ef7d60a5c35629d791323e5357e7db.zip |
Auto merge of #10246 - mbrubeck:strip-leading, r=pcwalton
Restore stripped whitespace before reflowing text fragments
Fixes #10200. r? @pcwalton
Note: The reftest uses a transition of non-zero duration, because I couldn't find any other way to reproduce the bug. Unfortunately this makes it unreliable in debug builds. I tried to fix this using reftest-wait with setTimeout and requestAnimationFrame, but it still wouldn't complete the animation consistently. To make the test work in debug builds we may need `transitionend` events (#10245) or a different way to reproduce the bug.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10246)
<!-- Reviewable:end -->
Diffstat (limited to 'components/layout/inline.rs')
-rw-r--r-- | components/layout/inline.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/components/layout/inline.rs b/components/layout/inline.rs index cd2a822f317..228ef6c9f20 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -527,6 +527,9 @@ impl LineBreaker { mut fragment: Fragment, flow: &InlineFlow, layout_context: &LayoutContext) { + // Undo any whitespace stripping from previous reflows. + fragment.reset_text_range_and_inline_size(); + // Determine initial placement for the fragment if we need to. // // Also, determine whether we can legally break the line before, or inside, this fragment. |