Commit graph

385 commits

Author SHA1 Message Date
bors-servo
aa011ea275 Auto merge of #13175 - shinglyu:block-margin-patch, r=notriddle
Move collapse through margin to the top of block flow

<!-- Please describe your changes on the following line: -->
Based on the spec, a collapse through box should be put on the top edge of the flow. This fixed ~110 reftests

---
<!-- 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
- [x] These changes fix #12824  (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

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

<!-- 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/13175)
<!-- Reviewable:end -->
2016-09-08 17:43:50 -05:00
Shing Lyu
345923b682 Move collapse through margin to the top of block flow 2016-09-06 15:41:21 +08:00
bors-servo
07b770b829 Auto merge of #13051 - notriddle:root_flow_percent, r=glennw
Fix root flow's size at the browser window's size

When `<body>` needs to calculate its size based on `<html>`'s size, that should be the size of the browser window itself.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12802 (github issue number if applicable).
- [X] There are tests for these changes OR

<!-- 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/13051)
<!-- Reviewable:end -->
2016-08-28 19:16:19 -05:00
Michael Howell
ede4730913 Fix root flow's size at the browser window's size
Fixes #12802
2016-08-26 09:38:39 -07:00
bors-servo
545ae86dff Auto merge of #13050 - notriddle:tlapd, r=emilio
Fix spelling mistake

<!-- 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/13050)
<!-- Reviewable:end -->
2016-08-26 07:19:59 -05:00
Michael Howell
018f948680 Fix spelling mistake
It's not Talk Like a Pirate Day anymore.
2016-08-24 19:04:58 -07:00
Ms2ger
871c207c44 Pass SharedLayoutContext to Flow::compute_absolute_position. 2016-08-24 10:12:38 +02:00
bors-servo
d687f77fef Auto merge of #12873 - shinglyu:abs-margin-patch, r=notriddle,emilio
Fix absolute-flow's auto positioning

<!-- Please describe your changes on the following line: -->
If an absolute positioned flow has no top, bottom, left, right property, its hypothetical box position should be the margin-end of its previous sibling, not the border-end.

---
<!-- 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
- [x] These changes fix #12676 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes

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

<!-- 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/12873)
<!-- Reviewable:end -->
2016-08-15 08:19:04 -05:00
Shing Lyu
332cdd05c8 Absolute positioned flow should be placed at the margin-end of its previous flow 2016-08-15 19:34:37 +08:00
Martin Robinson
6259df5e2d Update to euclid 0.8 2016-08-12 03:12:06 +02:00
bors-servo
15947f8f73 Auto merge of #12330 - stshine:flexitem, r=pcwalton
Implement flexible box layout for row container

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

This pull requests implements basic flexible box layout for row container.
It  has implemented most basic flexbox features, including grow, shrink, multi-line, *reverse properties, and alignment under `justify-content`, `align-items`, `align-self`, `align-content`.

---
<!-- 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
- [X]  There are tests for these changes

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

r? @pcwalton

<!-- 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/12330)
<!-- Reviewable:end -->
2016-08-03 09:24:31 -05:00
Pu Xingyu
60e2f44a19 Add Minor fixes and tests 2016-08-03 21:10:35 +08:00
Ms2ger
247c86f887 Remove unused inline_size_of_preceding_{left,right}_floats fields from BlockFlow. 2016-08-01 13:56:24 +02:00
Pu Xingyu
a70d2bbed8 Flex elements in a row flex container
Iterate over the items, create lines from them, resolve flex lengths
against them, set their inline size and margin lengths, and align them
according to 'justify-content', 'align-content' and 'align-self'.
2016-07-23 01:07:22 +08:00
Pu Xingyu
bc8d22a5e7 Make the width of block customizable by its parent
Add a 'IS_FLEX' flag to bitflags of block flow, and when it is set, the
block will use the inline size and margins set by its parent.
2016-07-22 16:06:59 +08:00
Simon Sapin
6d0e48f6cc Remove some type aliases that are now just re-exports. 2016-07-20 08:42:47 +02:00
Simon Sapin
789807b7b0 Remove the ComputedValue traits and style_struct_traits 2016-07-20 08:42:40 +02:00
Anthony Ramine
51ff916e09 Move util::print_tree to gfx_traits 2016-07-04 15:47:06 +02:00
Ms2ger
ea45e76840 Pass SharedStyleContext to assign_inline_sizes. 2016-06-22 14:50:04 +02:00
Ms2ger
ea15f69404 Pass SharedStyleContext to compute_inline_sizes. 2016-06-22 14:31:05 +02:00
Ms2ger
c33ac876ff Pass SharedStyleContext to propagate_and_compute_used_inline_size. 2016-06-22 14:29:36 +02:00
Ms2ger
21b8d2bd91 Pass SharedStyleContext to propagate_assigned_inline_size_to_children. 2016-06-22 14:28:14 +02:00
Ms2ger
9731a001db Pass SharedStyleContext to compute_used_inline_size. 2016-06-22 14:26:52 +02:00
Ms2ger
018bebe90d Pass SharedStyleContext to compute_inline_size_constraint_inputs. 2016-06-22 14:22:21 +02:00
Ms2ger
5c12755fa6 Pass SharedStyleContext to initial_computed_inline_size. 2016-06-22 14:21:08 +02:00
Ms2ger
2a1e2f491a Pass SharedStyleContext to containing_block_inline_size. 2016-06-22 14:19:56 +02:00
Ms2ger
f20ea08a1b Pass SharedStyleContext to explicit_block_containing_size. 2016-06-22 14:17:33 +02:00
Ms2ger
6f4b8f2505 Store SharedStyleContext in AbsoluteAssignBSizesTraversal. 2016-06-22 14:09:54 +02:00
Ms2ger
e142b78850 Pass SharedStyleContext to calculate_absolute_block_size_and_margins. 2016-06-22 14:08:28 +02:00
Ms2ger
e6435b7ec4 Pass SharedStyleContext to adjust_fragments_for_collapsed_margins_if_root. 2016-06-22 14:07:06 +02:00
bors-servo
47387a5c44 Auto merge of #11752 - mbrubeck:cleanup, r=pcwalton
Minor code cleanup in layout

r? @pcwalton

<!-- 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/11752)
<!-- Reviewable:end -->
2016-06-21 17:51:26 -05:00
Matt Brubeck
25a19343b3 Remove REPAINT damage in Fragment::build_display_list
Previously, the code that called this function was responsible for this.
Some code paths neglected to do it.  This moves the damage removal to one
central location.
2016-06-20 13:39:36 -07:00
Ms2ger
7414edab05 Move DISPLAY_PORT_SIZE_FACTOR to block.rs. 2016-06-20 21:23:43 +02:00
Ms2ger
5c03dd8eb1 Introduce a script_layout_interface crate and move RestyleDamage to it. 2016-06-20 19:02:36 +02:00
Ms2ger
2383cb2eee Remove unused argument to place_float_if_applicable. 2016-06-20 12:37:56 +02:00
Darin Minamoto
4a4be1d7e5 Image with height defined in % resizes properly 2016-06-15 16:39:22 -07:00
Patrick Walton
a86f77e36d script: Keep the DOM-side viewport up to date when scrolling happens in
WebRender.

This happens asynchronously, just as it does in non-WebRender mode.

This functionality is a prerequisite for doing proper display-list-based
hit testing in WebRender, since it moves the scroll offsets into Servo
(and, specifically, into the script thread, enabling iframe event
forwarding) instead of keeping them private to WebRender.

Requires servo/webrender_traits#55 and servo/webrender#277.

Partially addresses #11108.
2016-05-31 14:12:51 -07:00
Cullen Rhodes
40acd24e8f Report use statements that use {} with only one entry 2016-05-27 10:18:44 +01:00
Per Lundberg
2f7ed1d73e Removed unused imports
This fixes #11185.
2016-05-15 22:24:26 +03:00
Patrick Walton
b6bed345f5 layout: Take margins in the inline direction into account when
guessing the inline-size of block formatting contexts.

Fixes the layout on reddit.com.

Partially addresses #10571.
2016-05-10 17:11:28 -07:00
bors-servo
8bc4785bed Auto merge of #10999 - heycam:move-width-height, r=SimonSapin
Move width and height from Box to Position.

This helps with style struct alignment between Servo and Gecko.

<!-- 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/10999)
<!-- Reviewable:end -->
2016-05-04 19:52:25 -07:00
Patrick Walton
4ae6a68e35 layout: Fix non-vertical-align-correct wording in a comment. 2016-05-04 13:20:23 -07:00
Patrick Walton
04f05349b1 layout: Check flow descendants of inline block fragments to find their
baselines when aligning inline fragments per CSS 2.1 § 10.8.1.
2016-05-04 13:20:21 -07:00
Cameron McCormack
550d780e17 Move width and height from Box to Position.
This helps with style struct alignment between Servo and Gecko.
2016-05-04 11:06:42 +10:00
Ben Striegel
08987c6f5a Fix unused mut warning 2016-05-02 21:02:20 -04:00
bors-servo
8db0367301 Auto merge of #10944 - mbrubeck:bitflags-0.6, r=frewsxcv
Upgrade a bunch of dependencies

<!-- 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/10944)
<!-- Reviewable:end -->
2016-04-30 15:21:22 -07:00
Matt Brubeck
1e23d90631 Upgrade to bitflags 0.6.0 and selectors 0.5.6
Types generated by `bitflags!` are now private by default.  This PR marks them
`pub` where necessary.
2016-04-30 10:14:03 -07:00
Samuel Harrington
4691dc0c6e Remove dead code from block.rs 2016-04-29 20:13:42 -07:00
Patrick Walton
6b6587a73b layout: Translate floats flowing out of blocks to compensate for inline
direction margins.

Improves Reddit /r/rust.
2016-04-28 10:25:49 -07:00
Patrick Walton
f69931552b layout: Disallow margins from collapsing through block formatting
contexts per CSS 2.1 § 8.3.1.

Closes #10449.
2016-04-14 17:24:26 -07:00