Auto merge of #14136 - stshine:orthogonal-symmetry, r=SimonSapin

style: Add a "start_end()" method to LogicalMargin

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

Add a `LogicalMargin::start_end()` method that receives a `Direction' parameter. This is useful for some layout that is symmetric in inline and block directions, like flexbox.

Part of #14123.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./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 refactoring

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

r? @SimonSapin

<!-- Reviewable:start -->

---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14136)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-11-10 11:53:05 -06:00 committed by GitHub
commit d16f312464
5 changed files with 22 additions and 12 deletions

View file

@ -34,7 +34,6 @@ use inline::{FIRST_FRAGMENT_OF_ELEMENT, InlineFlow};
use inline::{InlineFragmentNodeInfo, LAST_FRAGMENT_OF_ELEMENT};
use linked_list::prepend_from;
use list_item::{ListItemFlow, ListStyleTypeContent};
use model::Direction;
use multicol::{MulticolColumnFlow, MulticolFlow};
use parallel;
use script_layout_interface::{LayoutElementType, LayoutNodeType, is_image_data};
@ -49,6 +48,7 @@ use style::computed_values::{caption_side, display, empty_cells, float, list_sty
use style::computed_values::content::ContentItem;
use style::computed_values::position;
use style::context::SharedStyleContext;
use style::logical_geometry::Direction;
use style::properties::{self, ServoComputedValues};
use style::selector_impl::{PseudoElement, RestyleDamage};
use style::selector_matching::Stylist;