Commit graph

53 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
083857a4b0
Fix Servo build. 2018-06-18 20:01:48 +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
Emilio Cobos Álvarez
bbb59614fa
Fix Servo build. 2018-05-28 16:02:31 +02: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
Emilio Cobos Álvarez
2a5007926d
Fix Servo build. 2018-05-19 10:15:17 +02: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
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
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
Brody Eastwood
8a1590efc6 Add unique canvas IDs to all canvas operations. 2018-04-02 22:02:22 -04: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
Pyfisch
23fcd3a850 Rebase and fix innerText 2018-02-24 10:56:11 +01:00
Pyfisch
bc87b41db3 Remove image_data from tests.
Store multiple indexable text items for a node.
2018-02-24 10:56:11 +01:00
Pyfisch
0d0f2abf12 Move calculation functions out of builder.rs 2018-02-24 10:56:11 +01:00
Pyfisch
8d061118c4 Remove now unnecessary fix_gradient_stops function
Webrender solved the issue with servo/webrender#1189.
2018-02-24 10:36:10 +01:00
Pyfisch
2d74bcfea5 Introduce a dedicated data structure for text queries
Add an IndexableText structure for text queries.
Instead of linear search for a node this now uses a HashMap.
Remove the now irrelevant fields from TextDisplayItem.
2018-02-24 10:36:10 +01:00
Pyfisch
a5115139ba Remove image_data field from display item
It was unused.
2018-02-24 10:36:10 +01:00
Pyfisch
279cda65ed Use typed transforms in stacking contexts 2018-02-24 10:36:10 +01:00
Manish Goregaokar
265a2ab2cc Allow for build_display_list to be called immutably 2018-02-16 16:01:48 -08:00
Manish Goregaokar
db6ec58e6b Generate display lists for table cells during display list generation for their table parent 2018-02-16 16:01:46 -08:00
Manish Goregaokar
6232846699 Add stacking_relative_border_box_for_display_list 2018-02-16 16:01:46 -08:00
Manish Goregaokar
f7ac5d712f Add build_display_list_for_background_if_applicable_with_background 2018-02-16 16:01:45 -08:00
Manish Goregaokar
f3531d1d35 Factor out BlockFlow::background_border_section() 2018-02-16 16:01:44 -08:00
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
janczer
661d234c3c Change debug assertions to specific ones 2018-02-07 09:21:24 +01: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
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
Igor Gutorov
4ee9eb8563 style: Move cursor property out of mako 2018-01-20 19:06:29 +02: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
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
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
Pyfisch
a74688b992 Remove BoxShadowClipMode from gfx 2018-01-07 23:13:41 +01:00