Commit graph

2752 commits

Author SHA1 Message Date
Pyfisch
5697171ed6 Use Rect::inner_rect from euclid
Update euclid.
2018-02-08 16:45:27 +01:00
bors-servo
03a1a014ae
Auto merge of #19931 - pyfisch:float-bounds, r=mrobinson
Use LayoutRects for bounds and overflow in display lists

Convert text runs to glyphs in display list builder.
Remove ComplexClippingRegion and use the WebRender type.

<!-- 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/19931)
<!-- Reviewable:end -->
2018-02-07 07:11:41 -05:00
Pyfisch
931f0fcd1d Use rect shorthand constructor in display list builder 2018-02-07 12:21:08 +01:00
Pyfisch
46ada747b0 Use LayoutRects for bounds and overflow in display lists
Convert text runs to glyphs in display list builder.
Remove ComplexClippingRegion and use the WebRender type.
2018-02-07 12:21:08 +01:00
bors-servo
5d209a70ab
Auto merge of #19970 - janczer:change_debug_assertions, r=emilio
Change debug assertions to specific ones

<!-- 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: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #19962 (github issue number if applicable).

<!-- 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. -->

<!-- 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/19970)
<!-- Reviewable:end -->
2018-02-07 06:20:36 -05:00
janczer
661d234c3c Change debug assertions to specific ones 2018-02-07 09:21:24 +01:00
bors-servo
804b4b3db6
Auto merge of #19957 - gootorov:move-counter-from-mako, r=emilio
style: Move content property out of mako.

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

---
<!-- 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 build-geckolib` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #19936 (github issue number if applicable).

<!-- Either: -->
- [x] These changes do not require tests

<!-- 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. -->

<!-- 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/19957)
<!-- Reviewable:end -->
2018-02-06 17:39:03 -05:00
Igor Gutorov
7a00066477 style: Move content property out of mako. 2018-02-07 00:11:57 +02:00
Martin Robinson
99eb457fc7 Update WebRender
This allows servo to use the ExternalScrollId API from WebRender fixing
some issues related to duplicate scroll root ids.

Fixes #17176.
Fixes #19287.
Fixes #19648.
2018-02-06 15:10:35 +01:00
Anthony Ramine
df11a7fec7 Simplify counter CSS properties 2018-02-04 14:52:38 +01:00
bors-servo
38ef515463
Auto merge of #19529 - DonatJR:counter-reset-out-of-mako, r=emilio
style: moved css longhand counter-reset out of mako

<!-- Please describe your changes on the following line: -->
This is a sub-PR of #19015
Code does not yet compile with `build-geckolib`.
r? emilio

---
<!-- 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 #19387

<!-- Either: -->
- [x] These changes do not require tests

<!-- 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. -->

<!-- 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/19529)
<!-- Reviewable:end -->
2018-02-01 09:42:40 -06:00
Jonas Reinwald
d24301b7a0
moved css longhand counter-reset out of mako 2018-02-01 15:43:40 +01:00
Mauricio Collares
8e411105ce
style: Rename background::RepeatKeyword and border::RepeatKeyword. 2018-02-01 15:23:41 +01:00
chansuke
50b517d0db
style: Move border-image-repeat outside of mako. 2018-02-01 13:59:10 +01:00
Pyfisch
8bb50ac0b9 Use more WebRender types in gfx
Removes ImageBorder details from gfx.
Use WebRender BorderRadius in BoxShadow.
Stores cursors as integer.
Use FilterOp, BorderWidths from WebRender.
Store content_rect as LayoutRect.
2018-01-30 11:37:20 +01:00
Jon Leighton
fe583fc5d0 Add layout RPC query for getting an element's style
This enables us to implement Element::has_css_layout_box() in a more
direct way, and also enables us to remove some of the existing more
specific queries.

Fixes #19811.
2018-01-28 10:59:45 +01:00
CYBAI
baccc4eda2 Use specific negative assertion for layout floats 2018-01-26 01:55:24 +08:00
CYBAI
bb7964a4bb Use specific assertion for layout multicol 2018-01-26 01:01:01 +08:00
CYBAI
da4a4475de Use specific assertion for layout layout_debug 2018-01-26 01:01:01 +08:00
bors-servo
9c13073075 Auto merge of #19688 - Manishearth:linebreak, r=mbrubeck
Detect adjoining text fragments with no line break opportunity between them

First attempt at https://github.com/servo/servo/issues/874

<!-- 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/19688)
<!-- Reviewable:end -->
2018-01-24 22:42:59 -06:00
Jon Leighton
84713df622 Allow floats to impact list item marker position
Although not required by the specification, this matches the rendering
of Gecko and Blink.

Fixes #19796.
2018-01-24 12:26:32 +01:00
Manish Goregaokar
fc97f0b464 do not preserve suppress flag on second half of split 2018-01-24 14:31:07 +05:30
Manish Goregaokar
f3c81fcda8 Share line breaking state across text runs
Fixes #874
2018-01-24 12:51:33 +05:30
Emilio Cobos Álvarez
5ac12b5df4
style: Make the TElement type arrive to the cascade function.
Not super-proud of this one, but it's the easiest way I could think of.

The changeset looks bigger than what it is, because while at it I've rewrapped a
fair amount of functions around to use proper block indentation.

Alternatives are parameterizing Stylist by <E>, which is not fun, or moving the
concrete element from layout_thread to layout, but that implies layout depending
on script, which isn't fun either.

Other alternative is implementing an empty enum and making anon boxes work on
it. It has the advantage of removing the annoying type parameter, but the
disadvantage of instantiating `cascade` twice, which isn't great, and having to
maintain all the boilerplate of a `TElement` implementation that just does
nothing.
2018-01-23 00:57:54 +01:00
bors-servo
c1ed4bb2d5 Auto merge of #19829 - servo:rustup, r=nox
Update Rust and use the newly-stable std::ptr::NonNull

<!-- 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/19829)
<!-- Reviewable:end -->
2018-01-22 11:11:44 -06:00
Simon Sapin
10ec5a2bb0 Replace NonZero<*{const,mut} _> with std::ptr::NonNull 2018-01-22 17:41:25 +01:00
Simon Sapin
897a5b39c5 Fix some "unnecessary parentheses" warnings 2018-01-22 17:41:25 +01:00
bors-servo
ec8975b18d Auto merge of #19789 - ferjm:issue-18831-fb-layout, r=mbrubeck
Do not leave space below baseline when it is not needed (i.e.there is…

… no text)

This is my first layout fix and a naive approach to fix #18831.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #18831

<!-- 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/19789)
<!-- Reviewable:end -->
2018-01-22 08:14:29 -06:00
Fernando Jiménez Moreno
a241bed53c Do not leave space below baseline when it is not needed (i.e.there is no text) 2018-01-22 11:38:39 +01:00
bors-servo
59033e6970 Auto merge of #19798 - gootorov:move_cursor_from_mako, r=emilio
style: Move cursor property out of mako

<!-- Please describe your changes on the following line: -->
Sub-PR of #19015

r? emilio

---
<!-- 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 build-geckolib` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #19775 (github issue number if applicable).

<!-- Either: -->
- [x] These changes do not require tests

<!-- 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. -->

<!-- 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/19798)
<!-- Reviewable:end -->
2018-01-20 12:10:58 -06:00
Igor Gutorov
4ee9eb8563 style: Move cursor property out of mako 2018-01-20 19:06:29 +02:00
Anthony Ramine
a311e0f569 Merge layout and layout_tests 2018-01-20 15:33:39 +01:00
Pyfisch
af52233ae5 Introduce MaxRect trait
It is implemented for LayoutRect and Rect<Au>.
Replaces the max_rect() function from servo_geometry.
2018-01-17 23:29:57 +01:00
Pyfisch
8c7c5f6e79 Use more WebRender types in gfx/display_list
This uses floating-point (Layout) coordinates in where possible.
Replace NormalBorder struct with WebRender equivalent.
Remove ToPointF and ToRectF traits.
Convert border RepeatKeyword with ToLayout.
Add some definitions to malloc_size_of for WebRender types.
2018-01-17 23:29:57 +01:00
Glenn Watson
cad21f1c0b Update WR (persistent box-shadow render task cache) 2018-01-18 06:06:03 +10:00
bors-servo
f2036e7661 Auto merge of #19757 - emilio:bye-custom-cascade, r=nox
style: Remove -servo-text-decorations-in-effect

It is bogus, because it depends on the display property as it's cascaded, but
the display property can change afterwards, for example, if we get blockified
because we're the root element or a flex item.

Replace it with a normal field instead.

Also, it carries some weight, because it's the last property that uses this
concept of "derived" property, and "custom cascade". So we can remove some code
after this.

Compute it after the cascade process in StyleAdjuster.

<!-- 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/19757)
<!-- Reviewable:end -->
2018-01-15 05:14:49 -06:00
Emilio Cobos Álvarez
95edda93c4
layout: Add a FIXME for #19771. 2018-01-15 03:12:22 +01:00
Emilio Cobos Álvarez
ecf538ff04
layout: Avoid doing stupid calls to Node::style. 2018-01-15 03:09:13 +01:00
Emilio Cobos Álvarez
bc29a16285
layout: Deduplicate Node::fragment_type and FragmentDisplayListBuilding::fragment_type. 2018-01-14 21:45:39 +01:00
Emilio Cobos Álvarez
e32d6f6adf
layout: Remove type parameter from PseudoElementType.
Everyone uses () now.
2018-01-14 21:45:39 +01:00
Emilio Cobos Álvarez
cb2bba8777
style: Remove unused optional display from PseudoElementType definition.
Everyone passes None now.
2018-01-14 21:45:38 +01:00
Emilio Cobos Álvarez
8732a1d7de
style: Remove -servo-text-decorations-in-effect.
It is bogus, because it depends on the display property as it's cascaded, but
the display property can change afterwards, for example, if we get blockified
because we're the root element or a flex item.

Replace it with a normal field instead.

Also, it carries some weight, because it's the last property that uses this
concept of "derived" property, and "custom cascade". So we can remove some code
after this.

Compute it after the cascade process in StyleAdjuster.
2018-01-14 17:10:44 +01:00
CYBAI
0291a75b3c style: Remove -servo-display-for-hypothetical-box from longhand 2018-01-13 20:54:50 +08:00
Pyfisch
a74688b992 Remove BoxShadowClipMode from gfx 2018-01-07 23:13:41 +01:00
Pyfisch
246b54507a Use the new WebRender conversion functions.
Remove the old ones.
2018-01-07 22:53:51 +01:00
Pyfisch
71e542c424 Create a file for WebRender conversions 2018-01-07 22:29:23 +01:00
Pyfisch
ea062e6e47 Create own file for background calculations in layout
Move display_list_builder.rs and webrender_helpers.rs
along with the new file to components/layout/display_list/

Remove apparently unused IdType enum.
Only variant used was OverflowClip.

See #19676
2018-01-06 20:19:32 +01:00
bors-servo
12a74de5a1 Auto merge of #19699 - pyfisch:background-position-fix, r=emilio
Correctly place images with background-position: center

Add a regression ref test.
See also #19680.

<!-- 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: -->
- [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

<!-- 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. -->

<!-- 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/19699)
<!-- Reviewable:end -->
2018-01-05 06:37:38 -06:00
bors-servo
83a8891bd4 Auto merge of #18893 - emilio:bye-can-be-fragmented, r=SimonSapin
style: Remove TNode::set_can_be_fragmented and TNode::can_be_fragmented.

Replace them instead by a computed value flag, the same way as the
IS_IN_DISPLAY_NONE_SUBTREE flag works.

<!-- 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/18893)
<!-- Reviewable:end -->
2018-01-05 05:11:00 -06:00
Pyfisch
859f002bf2 Correctly place images with background-position: center
Add a regression ref test.
See also #19680.
2018-01-05 10:45:26 +01:00