servo: Merge #16123 - Fix writing-mode display fixup to check the right condition (from bzbarsky:writing-mode-confusion); r=emilio

It should be checking the value of the 'writing-mode' property, not the value of
the "writing mode" concept.  The latter is influenced by other properties like
'direction' and whatnot.  That was causing this code to convert inlines to
inline-blocks if they just had a different direction from their parent, which is
not correct

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because there are tons of tests on the Gecko side.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: d93151e8a3c6309205f46335128dea9b936f15ad

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 6ce98c3e1ff881b649f30ccde249eef10b4bd139
This commit is contained in:
Boris Zbarsky 2017-03-24 11:39:30 -07:00
Родитель 8c0d2f06fd
Коммит e3ceb872b6
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -2178,7 +2178,9 @@ pub fn apply_declarations<'a, F, I>(device: &Device,
//
// www-style mail regarding above spec: https://lists.w3.org/Archives/Public/www-style/2017Mar/0045.html
// See https://github.com/servo/servo/issues/15754
if context.layout_parent_style.writing_mode != style.writing_mode &&
let our_writing_mode = style.get_inheritedbox().clone_writing_mode();
let parent_writing_mode = context.layout_parent_style.get_inheritedbox().clone_writing_mode();
if our_writing_mode != parent_writing_mode &&
style.get_box().clone_display() == display::inline {
style.mutate_box().set_display(display::inline_block);
}