Commit graph

497 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
2e5078e9c5 layout: Fix servo build. 2019-06-04 01:04:02 -04:00
Emilio Cobos Álvarez
70635e7815 layout: Fix servo build. 2019-05-29 16:14:35 +02:00
Emilio Cobos Álvarez
0000e4cec2 layout: fix Servo build. 2019-05-07 12:56:10 +02:00
Emilio Cobos Álvarez
0c01325c05 layout: Fix servo build. 2019-03-13 15:08:39 +01:00
Simon Sapin
4464354e2e Reformat 2019-02-26 08:18:33 +01:00
Emilio Cobos Álvarez
c2819365f0 style: Rename MozLength to Size, and MaxLength to MaxSize.
MozLength is not a very descriptive name. If we're going to use it in both Gecko
and Servo we may as well name it something more accurate.

I would've chosen `ContentSize` per CSS2[1][2] if it wasn't a lie in presence
of box-sizing. I don't have better ideas than `Size`, given that.

[1]: https://drafts.csswg.org/css2/visudet.html#propdef-width
[2]: https://drafts.csswg.org/css2/box.html#content-width

Differential Revision: https://phabricator.services.mozilla.com/D19280
2019-02-12 02:28:00 +01:00
Emilio Cobos Álvarez
6daebcc5df Fix servo build. 2019-02-10 07:23:51 +01:00
Emilio Cobos Álvarez
2a6cdaa30a Rustfmt recent changes. 2019-01-08 12:01:28 +01:00
Emilio Cobos Álvarez
c7f30ad0df style: Fix servo build. 2019-01-08 12:01:11 +01:00
Emilio Cobos Álvarez
4a31509215 style: Fix servo build.
This also fixes a bunch of calc handling issues and such.

Also remove tests that no longer compile and are covered by WPT.
2019-01-08 12:00:42 +01:00
Simon Sapin
be69f9c3e6 Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
Jan Andre Ikenmeyer
1d6fe65401
Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
Simon Sapin
9f977c5287 Remove useless use crate_name; imports.
A `crate_name::foo` path always works in 2018
2018-11-08 09:29:52 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Pyfisch
cb07debcb6 Format remaining files 2018-11-06 22:30:31 +01:00
Simon Sapin
76e59a46d3 Sort use statements 2018-11-06 15:26:02 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
Pyfisch
d9b1950d74 Layout: Remove redundant deny unsafe and format
Add license to two files.

Bypass DisplayListBuilder for some items.
2018-10-22 16:15:48 +02:00
Josh Matthews
49d2ea4f74 Make layout use available image data before querying the image cache. 2018-10-12 21:55:09 -04:00
Fernando Jiménez Moreno
50582f1548 Rustfmt and make tidy happy 2018-10-08 16:12:03 +02:00
Fernando Jiménez Moreno
8c40ef459b Do not share entire FrameRenderer with layout, only current frame 2018-10-08 16:12:01 +02:00
Víctor Manuel Jáquez Leal
bdd3e2c835 layout: handle MediaFragmentInfo 2018-10-08 16:12:01 +02:00
paavininanda
25027e476c Current-pixel-density tests passing 2018-09-13 00:23:09 +05:30
Pyfisch
349047b096 Rustfmt layout crate 2018-09-01 13:24:57 +02:00
bors-servo
e2fca1b228
Auto merge of #20892 - gw3583:update-wr, r=mbrubeck
Update WR (transaction API change)

<!-- 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/20892)
<!-- Reviewable:end -->
2018-06-26 17:27:31 -04:00
Martin Robinson
d41c512e98 Allow inline elements to create reference frames
This is important so that transforms applied to elements actually apply
to the display items created for those elements.
2018-06-25 07:35:10 +10:00
Emilio Cobos Álvarez
895946bb18
layout: script: Fix build. 2018-06-23 20:34:10 +02:00
Martin Robinson
32f00ef821 Use reference frames explicitly for fixed positioning
Now that WebRender gives us reference frame ClipIds, we can use those to
implement fixed positioning in Servo. This will allow us to remove the
feature from WebRender entirely.
2018-06-04 13:52:08 +02:00
Pyfisch
4b3ccc7c8c Pass Rect<Au> by value and not by reference
Style change in display_list/builder.rs to reduce
the number of & and * found in the code.
Rect<Au> are basically 4 integers so there is no
need to pass by reference.
2018-05-05 22:16:23 +02:00
bors-servo
0ff6f32d7d
Auto merge of #20420 - pyfisch:corner-clipping, r=emilio
Move DL items from gfx to layout and implement corner clipping

Implement corner clipping.
Remove PixelFormat from WebrenderImageInfo.
Use WebRender text shadow.
Remove MallocSizeOf and Deserialize for DL items.

Closes #19649, closes #19680, closes #19802

<!-- 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 #__ (github issue number if applicable).

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

<!-- 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/20420)
<!-- Reviewable:end -->
2018-04-29 02:30:16 -04:00
Pyfisch
c0be925bed Move DL items from gfx to layout
Implement corner clipping.
Remove PixelFormat from WebrenderImageInfo.
Use WebRender text shadow.
Remove MallocSizeOf and Deserialize for DL items.

Closes #19649, #19680, #19802
2018-04-22 13:13:45 +02:00
Brody Eastwood
8a1590efc6 Add unique canvas IDs to all canvas operations. 2018-04-02 22:02:22 -04:00
Anthony Ramine
260e05320c Replace LengthOrNone by a specific type for the perspective property
This was its only use, and it was bugged: AFAIK this didn't properly
clamp animated values below 0.
2018-02-26 22:32:06 +01:00
Pyfisch
279cda65ed Use typed transforms in stacking contexts 2018-02-24 10:36:10 +01:00
bors-servo
0b4ea018b0
Auto merge of #20034 - Manishearth:table-backgrounds, r=mbrubeck
Handle table cell backgrounds during display list generation for <table>

Fixes #19788

<!-- 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/20034)
<!-- Reviewable:end -->
2018-02-21 12:00:03 -05:00
Anthony Ramine
b44ffcf498 Replace IntegerOrAuto with ZIndex
It's its only use.
2018-02-20 15:18:22 +01:00
Manish Goregaokar
b416bb3aa7 Add get_column_styles for getting column structure and styles for a table 2018-02-16 16:01:41 -08: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
Igor Gutorov
7a00066477 style: Move content property out of mako. 2018-02-07 00:11:57 +02: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
e32d6f6adf
layout: Remove type parameter from PseudoElementType.
Everyone uses () now.
2018-01-14 21:45:39 +01:00
bors-servo
691bff86b6 Auto merge of #19651 - pyfisch:background-placement, r=emilio
Unify background placement code

Merges the implementations for background-image placement
from gradients and images. Add missing parts and fix bugs.

Now supported are the CSS properties:

* background-attachment (except for local value, see #19650)
* background-clip
* background-origin
* background-position-x/y
* background-repeat
* background-size

It should be noted that backgrounds are not clipped to
rounded border corners.
(This was done before but worked only in simple cases)
See: #19649

This solves the following issues:
closes #19626
closes #16657
closes #19482 (examples from http://lea.verou.me/css3patterns/ are rendered perfectly but the round border is completely ignored now)
closes #19577

- `./mach build -d` does not report any errors
- `./mach test-tidy` does not report any errors

I enabled a few tests with the first commit but I have written about a dozen manual tests I will try to turn into ref tests either before or after this patch lands.

@bors-servo try

The relationship between the different inputs is visualized in this flowchart:
![flowchart-background](https://user-images.githubusercontent.com/2781017/34394430-5a06c72c-eb59-11e7-9d51-3d23e2215f07.png)

<!-- 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/19651)
<!-- Reviewable:end -->
2018-01-02 08:47:24 -06:00
Pyfisch
3b3d4a9853 Unify background placement code
Merges the implementations for background-image placement
from gradients and images. Add missing parts and fix bugs.

Now supported are the CSS properties:

* background-attachment (except for local value)
* background-clip
* background-origin
* background-position-x/y
* background-repeat
* background-size

It should be noted that backgrounds are not clipped to
rounded border corners.
2017-12-28 20:14:31 +01:00
tigercosmos
43c94d3445 pretty print tree 2017-12-23 14:40:06 +08:00
Matt Brubeck
c60cfc5a9f Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
Matt Brubeck
3005a26daf style: Use the ? operator for Option 2017-12-09 08:29:53 -08:00
Emilio Cobos Álvarez
af879523ea
style: Make all keywords CamelCase for consistency.
This prevents confusion and paves the ground for derive(Parse) of them.
2017-12-06 02:35:10 +01:00
Boris Chiou
3a38e815ec Implement Servo_ParseTransformIntoMatrix.
DOMMatrix needs to convert a specified transform list into a matrix, so
we could rewrite to_transform_3d_matrix by generics for both specified
and computed transform lists.

Besides, we have to update the test case because we use Transform3D<f64> to
compute the matrix, instead of Transform3D<f32>, so the result will be
the same as that in Gecko. Using 0.3 may cause floating point issue
because (0.3f32 as f64) is not equal to 0.3 (i.e. floating point precision
issue), so using 0.25 instead.
2017-11-28 10:08:12 +08:00