Commit graph

2752 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
083857a4b0
Fix Servo build. 2018-06-18 20:01:48 +02:00
Matt Brubeck
f6404f0ec2 Update dependencies to use new_debug_unrechable
Because reem/rust-debug-unreachable#6 makes `debug_unreachable` enable debug checks even in release builds since Rust 1.0.
2018-06-06 08:54:51 -07: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
bors-servo
7cc4165dda
Auto merge of #20868 - tigercosmos:gg1, r=emilio
fix logic in overflow_direction, also add a FIXME

<!-- Please describe your changes on the following line: -->
This PR fix #19477, which the logic is obviously wrong.

However, it is impossible to add a test for this.

Due to #20867, the ` overflow_direction` is a hard code now. It never go to other conditions.
I add a FIXME there, and also add a SPEC link.

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

<!-- Either: -->
- [ ] 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/20868)
<!-- Reviewable:end -->
2018-05-28 18:50:18 -04:00
Emilio Cobos Álvarez
bbb59614fa
Fix Servo build. 2018-05-28 16:02:31 +02:00
tigercosmos
423d417dd7 fix logic in overflow_direction, also add a FIXME 2018-05-26 10:31:26 -07:00
bors-servo
ea214e9bc3
Auto merge of #20752 - pyfisch:backgrounds42, r=emilio
Fix crash in DL building

Fix one crash and some style changes.

This HTML crashed servo before. Key parts are `background-clip: content-box` and `direction: rtl`

```html
<!DOCTYPE html>
<html>
    <style>
        #span1 {
            background-clip: content-box;
        }
        #span2
        {
            direction: rtl;
        }
    </style>
    <span id="span1">Filler Text <span id="span2">txeT relliF</span></span>
</html>
```
Should I add this as a test? And where do I put this "does-it-crash?" test?

I find always passing rectangles by value a lot easier as it avoids many references and dereferences and I assume that the compiler will always use the faster one either way. If you don't like the change feel free to only merge the first commit.

<!-- 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/20752)
<!-- Reviewable:end -->
2018-05-19 11:02:01 -04:00
bors-servo
77dcc678fe
Auto merge of #20506 - jonleighton:font-fallback, r=emilio,mbrubeck
Font fallback

This implements more complete support for font fallback, see #17267.

r? @glennw @mbrubeck

<!-- 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/20506)
<!-- Reviewable:end -->
2018-05-19 09:53:29 -04:00
Emilio Cobos Álvarez
2a5007926d
Fix Servo build. 2018-05-19 10:15:17 +02:00
Jon Leighton
4403bcddfe Don't perform font matching for control characters
We can encounter control characters here, for example when processing a
<pre> element which contains newlines. Control characters are inherently
non-printing, therefore if we try to call find_by_codepoint for these
characters we will end up triggering an unnecessary font fallback
search.
2018-05-19 14:33:38 +10:00
Pyfisch
ee38fd6f0a Rustfmt components/layout/display_list/ 2018-05-05 22:19:03 +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
Pyfisch
596b53d5f8 Fix crash in background building
Always use border_padding and writing_mode from the same fragment.
Mixing them will trigger a debug assertion if the writing modes are different.

Cleanup and use compute_background_clip
2018-05-05 21:38:51 +02:00
Emilio Cobos Álvarez
33b593d32e
style: Fix servo build. 2018-05-05 17:19:06 +02:00
Anthony Ramine
0f91712800 Update to gleam 0.5 2018-05-05 13:08:36 +02:00
Pyfisch
46283af211 Correct edge case for background color clip
Use the color clip corresponding to the last background-image instead
of the last background-clip. (There may be more clips than images and
clips are repeated if there are less clips than images.)

Add a test.
2018-05-03 11:34:04 +02:00
Pyfisch
7eff53e250 Implement border-image-outset
Add an automatic test for border-image-outset with a gradient.
Convert two tests from UTF-8 LE with CRLF line endings to
UTF-8 with LF endings as the old files could not be viewed with servo.

Closes #16638
2018-05-02 22:11:38 +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
Emilio Cobos Álvarez
292f899631
style: Fix tidy issues and Servo build. 2018-04-29 05:09:43 +02:00
Emilio Cobos Álvarez
54b444992d
Fix servo build. 2018-04-28 10:26:47 +02:00
Anthony Ramine
6156d9aacb Update Webrender to last version 2018-04-26 16:50:24 +02:00
Pyfisch
aada975dea Place item clipping_and_scrolling inside closure
A utility function assures that if the clipping and scrolling are changed
for a display item the old value is later restored.
2018-04-25 13:19:46 +02:00
Bastien Orivel
8bd2e91cdc Update Webrender
Fixes #20609
2018-04-25 10:25:21 +02: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
Ramshell
d588590ed2 Add support for percentages in column-gap. 2018-04-05 21:04:29 -03:00
bors-servo
d744e35d38
Auto merge of #20482 - brainlessdeveloper:list-style-image-computed, r=emilio
Implement a URL-generic type for ListStyleImage

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

This should fix the following two "expected to fail" tests described in https://github.com/servo/servo/issues/18015:

- getComputedStyle(elem) for url() listStyleImage uses the resolved URL
  and elem.style uses the original URL

- getComputedStyle(elem) for url() listStyle uses the resolved URL
  and elem.style uses the original URL

I updated the test failure expectations by removing the corresponding `.ini` file.

---
<!-- 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 #18015 (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/20482)
<!-- Reviewable:end -->
2018-04-03 18:12:13 -04:00
Fausto Núñez Alberro
cc838f54e5
Implement a URL-generic type for list-style-image
This should fix the following two "expected to fail" tests:

- getComputedStyle(elem) for url() listStyleImage uses the resolved URL
  and elem.style uses the original URL

- getComputedStyle(elem) for url() listStyle uses the resolved URL
  and elem.style uses the original URL
2018-04-03 22:01:26 +02:00
bors-servo
9cd60c8e78
Auto merge of #20447 - Brody-Eastwood:master, r=jdm
NCSU Canvas Rendering Project Initial Steps

<!-- Please describe your changes on the following line: -->
Implements the initial steps from:

https://github.com/servo/servo/wiki/Canvas-rendering-project

---
<!-- 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: -->
- [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/20447)
<!-- Reviewable:end -->
2018-04-02 22:24:34 -04:00
Brody Eastwood
8a1590efc6 Add unique canvas IDs to all canvas operations. 2018-04-02 22:02:22 -04:00
Emilio Cobos Álvarez
744809a8b2
style: Add support for 'flex-basis:content' in the style system.
Bug: 1105111
Reviewed-by: xidorn
MozReview-Commit-ID: 5WhgHJJ0mDB
2018-04-02 03:17:56 +02:00
Mats Palmgren
3532f64b32
[css-multicol] style: Implement percentages for 'column-gap'.
Bug: 1398537
Reviewed-by: emilio,dholbert
2018-04-02 00:56:45 +02:00
Bastien Orivel
0918ac8cc7 Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
bors-servo
eaf59ca9b9
Auto merge of #20390 - jdm:android-layout-workaround, r=emilio
Don't OOM when laying out basic web pages on Android

This is a workaround for the symptom described in https://github.com/servo/servo/issues/20149#issuecomment-375366991 which looks like either a standard library or compiler bug. My release android build can load all sorts of web pages as expected with this 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/20390)
<!-- Reviewable:end -->
2018-03-22 18:20:38 -04:00
Josh Matthews
391d0626db Workaround #20149 - presumed rustc bug on android. 2018-03-22 14:27:52 -04:00
Bastien Orivel
f71e34ccab Bump parking_lot to 0.5 2018-03-21 18:19:29 +01:00
Bastien Orivel
570d865065 Bump ipc-channel and bincode
This required bumping uuid too which unfortunately duplicated rand.
2018-03-21 13:05:47 +01:00
Martin Robinson
41cc348fc5 Update to handle WebRender API changes
Items now only take a clipping rectangle instead of a LocalClip.
2018-03-16 12:00:04 +10:00
Martin Robinson
e100a72122 Stop using LocalClip::RoundedRect
We would like to remove this functionality from WebRender, so convert
its use to clip scroll nodes. This change also removes the redundant
BlocBlockStackingContextType in favor of Option<StackingContextType>,
which is just as expressive. This simplifies the code a bit.
2018-03-06 21:26:22 +01:00
bors-servo
476a0764f5
Auto merge of #20171 - servo:content-item-counters, r=emilio
Make ContentItem use a CustomIdent for counter names

See https://github.com/w3c/csswg-drafts/pull/2377.

<!-- 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/20171)
<!-- Reviewable:end -->
2018-03-02 11:18:49 -05:00
Anthony Ramine
a4d3a8d74a Make ContentItem use a CustomIdent for counter names
See https://github.com/w3c/csswg-drafts/pull/2377
2018-03-02 16:06:54 +01:00
Manish Goregaokar
be12b90412 Don't panic on cells with both a rowspan and colspan in include_sizes_from_previous_rows
fixes #20162
2018-03-01 15:38:29 -08:00
Manish Goregaokar
54eb1eb780 Support rowspan=0; always fixup overflowing rowspans beforehand
This makes rowspan=0 work by storing notes on which group of rows we're
in for tables containing both rowgroups and rows, and using that to
respan cells with overlarge or zero rowspans.

This also gets rid of the largest_leftover_incoming_size business,
because now spans will always be correct and we'll never have any left
over.
2018-02-28 17:37:59 -08:00
bors-servo
e2f2814018
Auto merge of #20128 - Manishearth:rowspan, r=mbrubeck
Rowspan support for tables

fixes #20092

This just contains the first steps.

We apply a naive algorithm: Spanning cells apply a pressure equal to `block_size / rowspan` on each row they are in. We move table row block size computation into the tables, and make it two pass. In the first pass we compute the sizes of each row, and in the
second pass we assign them, adding them up for any involved cells.

This is missing:

 - [x] Accounting for border sizes
 - [x] Applying pressure to rows that are not the row containing the cell
 - [ ] Reducing pressure on future rows if the current row is able to accomodate more of the cell
 - [x] For tables containing both rows and rowgroups, reset the rowspan info when we hit a rowgroup
 - [x] Correctly handle overflowing rowspans

cc @mbrubeck @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/20128)
<!-- Reviewable:end -->
2018-02-28 18:40:39 -05:00
Bastien Orivel
c28dcbc3e5 Bump euclid to 0.17 2018-02-28 09:46:59 +01:00
Manish Goregaokar
cec37a492a Unconditionally layout rows when laying out tables
If the reflow flag is set on a row it will be on the table anyway
2018-02-27 14:47:22 -08:00
Manish Goregaokar
98e53db289 Assert that cells aren't floats 2018-02-27 14:44:44 -08:00
Manish Goregaokar
19974e39c8 Merge fourth and fifth (assign block sizes / positions) passes 2018-02-27 09:43:38 -08:00
Manish Goregaokar
ef983c340f Remove outdated comment 2018-02-26 23:35:01 -08:00
Manish Goregaokar
0261762fa4 Handle overlarge rowspans by keeping track of largest leftover incoming sizes 2018-02-26 23:35:00 -08:00
Manish Goregaokar
746acf7e2b Don't crash on overflowing rows 2018-02-26 22:48:21 -08:00