Commit graph

2444 commits

Author SHA1 Message Date
bors-servo
ac37f81c1f Auto merge of #17972 - heycam:ignore-existing, r=bholley
style: Allow styles to be computed ignoring existing element data.

From https://bugzilla.mozilla.org/show_bug.cgi?id=1384824.

<!-- 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/17972)
<!-- Reviewable:end -->
2017-08-04 21:33:59 -05:00
Cameron McCormack
bb44c0a6bc style: Allow styles to be computed ignoring existing element data. 2017-08-05 10:33:31 +08:00
Martin Robinson
daf638bc3f Fix fixed position items with parents with CSS clips
In order to properly handle CSS clipping, we need to keep track of what
the different kinds of clips that we have. On one hand, clipping due to
overflow rules should respect the containing block hierarchy, while CSS
clipping should respect the flow tree hierarchy. In order to represent
the complexity of items that are scrolled via one clip/scroll frame and
clipped by another we keep track of that status with a
ClipAndScrollInfo.
2017-08-03 17:52:02 +02:00
Martin Robinson
815ed0c29c Fix warning in scroll root id assignment to TableColGroupFlow
The traversal currently expects every flow to have a scroll root id
assigned, even if it doesn't produce any display items. This change
fixes the error that arises from this situation.
2017-08-03 11:34:26 +02:00
Alan Jeffrey
936dd3ef63 Speculatively evaluate paint functions during style. 2017-07-31 13:02:28 -05:00
Alan Jeffrey
d101f9c945 Implemented paint worklet arguments. 2017-07-29 15:32:13 -05:00
Martin Robinson
537025800f Allow overflow:hidden to scroll via script 2017-07-26 09:58:33 +10:00
Alexis Beingessner
855b1fe6f1 use DisplayListBuilder::with_capacity 2017-07-24 11:47:38 -04:00
Glenn Watson
dc82366f72 Update WR (switch to new text-decorations API in WR).
This only makes use of the "Solid" text decoration type, which
matches the existing support. WR now supports dotted, dashed
and wavy text decorations, but supporting those will need some
extra work in Servo to pass through the correct values.
2017-07-24 13:02:21 +10:00
Emilio Cobos Álvarez
1c5d522742
layout: Make -Z show-parallel-layout show something useful again. 2017-07-23 01:47:47 +02:00
Alan Jeffrey
2318caf002 Implement drawing an image from a CSS style value into a canvas. 2017-07-21 16:39:11 -05:00
bors-servo
a3c398b5da Auto merge of #17802 - emilio:reland-stuff, r=heycam
Revert "Backed out changeset b10e6ba9cbdb because gecko part had to b…

…e backed out."

This reverts commit b96d96d448.

The fix on the Gecko side is trivial, and I can land it after this lands.

<!-- 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/17802)
<!-- Reviewable:end -->
2017-07-20 20:28:25 -07:00
Alan Jeffrey
caa3585219 Fixed scaling artefacts in paint worklets caused by zoom and hidpi. 2017-07-20 17:25:50 -05:00
Emilio Cobos Álvarez
ef4fbfaa6b
Revert "Backed out changeset b10e6ba9cbdb because gecko part had to be backed out."
This reverts commit b96d96d448.

The fix on the Gecko side is trivial, and I can land it after this lands.
2017-07-20 17:26:53 +02:00
Gecko Backout
b96d96d448 Backed out changeset b10e6ba9cbdb because gecko part had to be backed out. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/17796
2017-07-20 13:42:53 +00:00
bors-servo
7b71070c04 Auto merge of #17796 - heycam:calc-difference, r=emilio
style: pass old ComputedValues from Element data into Gecko_CalcStyleDifference

This is the Servo-side part of https://bugzilla.mozilla.org/show_bug.cgi?id=1380133.

<!-- 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/17796)
<!-- Reviewable:end -->
2017-07-20 03:39:15 -07:00
Cameron McCormack
914ba609c0 style: Pass old ComputedValues and old cached struct bits to Gecko_CalcStyleDifference. 2017-07-20 13:10:11 +08:00
Glenn Watson
8e979e301a Update WR (text-shadow optimizations). 2017-07-20 13:23:38 +10:00
Michael Partheil
b07ebbae6b Replace all uses of the style::stylearc alias with servo_arc.
The alias is left there temporarilly and will be removed completely in a later commit where
also components/style/gecko/generated/structs_{debug|release}.rs are re-generated (they still
use the old alias).
2017-07-19 09:29:05 +02:00
Glenn Watson
1b354994f6 Update WR (text-shadow improvements, iframe + image clips, depth buffer sharing).
Push multiple text shadows in the order WR expects them.
2017-07-18 15:26:06 +02:00
Martin Robinson
2aa34f9dc2 Rounded corners for images and iframes. 2017-07-18 15:25:45 +02:00
Alexis Beingessner
2d3eae3e3a Implement new Webrender PushTextShadow API
Also includes an incidental bugfix for the rendering order of text decorations.

This change depends on servo/webrender#1454 being merged and upstreamed to servo.
2017-07-18 12:53:34 +02:00
Manish Goregaokar
89930e7565 stylo: Switch Gecko over to ServoStyleContext 2017-07-17 18:03:23 -07:00
Manish Goregaokar
808b1f509b stylo: Use ComputedValuesInner instead of ComputedValues when we don't need it 2017-07-17 18:02:25 -07:00
bors-servo
2d37700cf8 Auto merge of #17731 - emilio:percentage-calc, r=nox
style: Respect calc for percentages.

<!-- 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/17731)
<!-- Reviewable:end -->
2017-07-17 01:29:11 -07:00
Bobby Holley
b7de96e702 Pass a callback to recalc_style_at to avoid traversing children twice.
MozReview-Commit-ID: DIHXaVNzbFM
2017-07-15 14:45:51 -07:00
Emilio Cobos Álvarez
bf9369b29d
script: Move the layout_wrapper outside of script.
This allows us to have ensure_data() and clear_data() functions on the TElement
trait, instead of hacking around it adding methods in random traits.

This also allows us to do some further cleanup, which I'd rather do in a
followup.
2017-07-15 16:41:12 +02:00
Emilio Cobos Álvarez
310be02ba8
style: Respect calc for percentages. 2017-07-14 13:43:27 +02:00
bors-servo
6597178b91
Auto merge of #17701 - bholley:reuse_allocations, r=emilio
reuse the bloom filter and style sharing cache across traversals

https://bugzilla.mozilla.org/show_bug.cgi?id=1380198

<!-- 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/17701)
<!-- Reviewable:end -->
2017-07-14 11:01:07 +02:00
Hugh Gallagher
579de83a53 Removed unsused import 2017-07-13 21:37:35 +01:00
bors-servo
14d5e4cc55 Auto merge of #17712 - mrobinson:overflow-scroll-clip, r=emilio
Fix the size and position of overflow:scroll clip

The clip for overflow:scroll clip was not including the space for
padding, which could lead to some content being clipped when it
shouldn't. This changes fixes that issue.

A test is skipped because this fix also stops hiding a failure due to
mispositioned text.

Fixes #16576.

<!-- 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 #16576 (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/17712)
<!-- Reviewable:end -->
2017-07-13 11:52:06 -07:00
bors-servo
95bad3f33a Auto merge of #17690 - stshine:no-inorder, r=emilio
layout: Stop in-order traversal on children of InlineFlow

No need to do in-order traversal for children of InlineFlow, since
they are either inline-block or absolutely positioned elements, which
are guaranteed to be block formatting context.

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

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

<!-- 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/17690)
<!-- Reviewable:end -->
2017-07-13 09:53:39 -07:00
Pu Xingyu
71fcdf683a layout: Stop in-order on children of InlineFlow
No need to do in-order traversal for children of InlineFlow, since
they are either inline-block or absolutely positioned elements, which
are guaranteed to be block formatting context.
2017-07-13 23:50:01 +08:00
Martin Robinson
39a98d4ff1 Fix the size and position of overflow:scroll clip
The clip for overflow:scroll clip was not including the space for
padding, which could lead to some content being clipped when it
shouldn't. This changes fixes that issue.

A test is skipped because this fix also stops hiding a failure due to
mispositioned text.

Fixes #16576.
2017-07-13 13:50:03 +02:00
Fernando Jiménez Moreno
6ae4bf6ee8 Implement serialization of linear-gradient the same ways as in Gecko 2017-07-13 12:20:30 +02:00
Emilio Cobos Álvarez
a34f288b98
Revert "Auto merge of #17701 - bholley:reuse_allocations, r=emilio"
This reverts commit ebfc8f5858, reversing
changes made to 5585ff2c44.

Animation code can reenter and create a new TLS context from the traversal
SequentialTask, so this won't work as written.
2017-07-13 09:58:08 +02:00
bors-servo
173181a491 Auto merge of #17694 - glennw:webrender-update, r=glennw
Upgrade to the latest version of WebRender

<!-- 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/17694)
<!-- Reviewable:end -->
2017-07-12 21:52:27 -07:00
Bobby Holley
d1c31f7eaf Add owning_ref back as a style dep, and update parking_lot. 2017-07-12 16:37:50 -07:00
Martin Robinson
e58e8ab42e Upgrade to the latest version of WebRender 2017-07-13 07:44:08 +10:00
Emilio Cobos Álvarez
0ad2d39c30
style: Rewrite get*Style using StyleResolverForElement.
Removing the ugly.

MozReview-Commit-ID: BvahbMKS7QU
2017-07-12 09:26:31 +02:00
Alan Jeffrey
ef033b8362 Implemented paint worklet properties. 2017-07-11 17:28:56 -05:00
bors-servo
8923a9e5f0 Auto merge of #17615 - bholley:simplify_local_context, r=emilio
Rip out the generic abstractions around ThreadLocalStyleContext

https://bugzilla.mozilla.org/show_bug.cgi?id=1378540

<!-- 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/17615)
<!-- Reviewable:end -->
2017-07-05 19:29:01 -07:00
bors-servo
03450ee8e1 Auto merge of #17556 - jyc:inline-metrics-of-block, r=emilio
layout: Clean up inline_metrics_of_block a little.

Previously the variable names were a little confusing (ascent was used
for the space_above_baseline in one branch and the and ascent field in
another branch, and was not really the ascent in one). Also add a
small diagram.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because they just refactor existing code

<!-- 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/17556)
<!-- Reviewable:end -->
2017-07-05 17:35:49 -07:00
Bobby Holley
3330653dc8 Rip out the generic abstractions around ThreadLocalStyleContext.
MozReview-Commit-ID: 5WTLuk323Ac
2017-07-05 16:37:17 -07:00
Jonathan Chan
7a7dfe44ed layout: Clean up inline_metrics_of_block a little.
Previously the variable names were a little confusing (ascent was used
for the space_above_baseline in one branch and the and ascent field in
another branch, and was not really the ascent in one). Also add a
small diagram.
2017-07-05 11:13:09 -07:00
Simon Sapin
86293c3b39 Replace remaining usage of deprecated Range::step_by
… which is being removed in https://github.com/rust-lang/rust/pull/43012
2017-07-05 13:54:40 +02:00
bors-servo
ece35f9caa Auto merge of #17581 - mbrubeck:incremental, r=pcwalton
Fix incremental layout bugs for absolute and cleared elements

Fixes #17307.  <del>There were two underlying bugs:</del>

* <del>Nodes were not marked dirty when their style attribute changed.</del>

* BaseFlow flags set during flow construction could get out of sync with the element's style if repair_style was called.

---

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #17307
- [x] There are tests for these changes

<!-- 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/17581)
<!-- Reviewable:end -->
2017-06-30 22:15:26 -07:00
Matt Brubeck
2aef2af9b8 Update flags for absolutely positioned elements on style changes
Fixes #17307.
2017-06-30 22:14:28 -07:00
Nazım Can Altınova
d589645ee9 stylo: Implement -moz-prefixed radial gradients 2017-06-30 17:54:01 -07:00
Alan Jeffrey
328fb25a65 Implemented paint worklet rendering context. 2017-06-30 16:41:08 -05:00