Commit graph

420 commits

Author SHA1 Message Date
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
Anthony Ramine
201d7e79e7 Make text-shadow and box-shadow use SimpleShadow 2017-06-28 16:28:25 +02:00
Nathan Froyd
096cee8ebc remove various things now that Rust 1.17 is required
std::ptr::eq and Arc::ptr_eq are now usuable, and we can replace a
panic!() with abort().
2017-06-23 10:39:41 -04:00
Anthony Ramine
6f4061d4ad Use generics for the filter property
This introduces an additional shadow type for drop-shadow().
2017-06-20 13:48:53 +02:00
Simon Sapin
316cd35767 Untry 2017-06-18 13:21:51 +02:00
Anthony Ramine
608e7f71a2 Make computed types hold Percentage instead of bare CSSFloat 2017-06-15 16:59:03 +02:00
Nicolas Silva
997608f11f Make BaseFlow::stacking_relative_position a vector. 2017-06-14 16:01:01 +02:00
Nicolas Silva
8617320500 Bump euclid to 0.14. 2017-06-14 16:00:59 +02:00
Boris Chiou
313f7d86db Define ComputedOperation::AccmulateMatrix.
If we set the composite operation to accumulate, we may need to accumulate two
mismatched transform lists, and then to interpolate them. In order to
accumulate two mismatched transform lists, we also need the reference
box information, so use the same idea as that for interpolation. i.e.
use AccmulateMatrix to store it temporarily, and convert it into matrix
later.
2017-06-07 11:31:01 +08:00
Boris Chiou
a6099d0fc0 Define ComputedOperation::InterpolateMatrix.
We use this arm to store the interpolated result of two mismatched
transform lists, and we resolve it until we know the reference box size
(on Gecko side). The conversion from ComputedOperation::InterpolateMatrix
to eCSSKeyword_interpolatematrix will be implemented later in this patch series.
2017-06-07 11:30:39 +08:00
Manish Goregaokar
2230332f46 Update app_units to 0.4.1 2017-05-19 20:33:02 -07:00
bors-servo
62690887c1 Auto merge of #16913 - jdm:canvas2d, r=jdm
Make canvas origin clean checks use origin of image response

Adapted from #15887.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15409
- [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/16913)
<!-- Reviewable:end -->
2017-05-19 10:45:44 -05:00
SendilKumar N
5acee23f5d Use the origin of the actual image response when determining if a canvas is origin clean. 2017-05-19 09:38:50 -04:00
Anthony Ramine
307dd74ecf Introduce CalcLengthOrPercentage::unclamped_length
This is necessary for some operations, notably converting this to something
suitable for gecko.
2017-05-18 19:27:31 +02:00
Anthony Ramine
d0b9bd9c64 Refactor how calc() clamping is done on computed values (fixes #15296) 2017-05-18 10:14:59 +02:00
bors-servo
a5ff57b20f Auto merge of #16891 - kvark:preserve3d, r=glennw,emilio
Using TransformStyle::Preserve3D

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

The changes were reviewed previously as a part of WR update PRs, but then we decided to move them out.
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
- [ ] 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/16891)
<!-- Reviewable:end -->
2017-05-17 20:38:14 -05:00
Dzmitry Malyshau
d04a64394e Using TransformStyle::Preserve3D 2017-05-16 11:08:32 -04:00
Alan Jeffrey
607e011b05 Renamed constellation::Frame to constellation::BrowsingContext. 2017-05-15 21:03:11 -05:00
Connor Brewster
d004db95cf Make non-initial about:blank loads asynchronous
Don't update iframe pipeline until load completes

To preserve the previous functionality of delaying load events when a
new navigation is triggered, pending pipeline id represents the
current pending load. The load event is only fired if the load message's
pipeline id matches the pending pipeline id.

Track frame size on Frame instead of Pipeline

Disabled matchMedia test

Track creator pipeline id
2017-05-12 11:53:43 -06:00
Bobby Holley
7b0679848b Fix up script and layout. 2017-05-02 17:35:45 -07:00
Manish Goregaokar
f8e298b2b3 stylo: support all overflow values
MozReview-Commit-ID: 1iQdUDsb6u9
2017-04-25 13:52:39 -07:00
bors-servo
bbf292b120 Auto merge of #16337 - stshine:inline-block-intrinsic, r=notriddle
layout: Fix intrinsic inline size calculating of inline blocks

When calculating intrinsic inline sizes of an inline block, take its
nested inline parents into account.

---
<!-- 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 #7636 (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/16337)
<!-- Reviewable:end -->
2017-04-21 22:43:06 -05:00
Martin Robinson
d150cc9f95 Eliminate ScrollRootId
Just use WebRender's ClipId directly. This will allow us to create and
use ReferenceFrames in the future, if we need to do that. It will also
make it easier to have Servo responsible for creating the root
scrolling area, which will allow removing some old hacks in the future.
2017-04-20 08:51:38 +02:00
Nazım Can Altınova
f9225d84aa
Implement moz-transform property 2017-04-19 22:11:54 +03:00
Pu Xingyu
754d29c899 Floor to 0 when computing intrinsic sizes for box-sizing:border-box 2017-04-18 18:25:12 +08:00
Pu Xingyu
6c5dfdf19b layout: Fix intrinsic inline size calculating of inline blocks
When calculating intrinsic inline sizes of an inline block, take its
nested inline parents into account.
2017-04-12 02:42:18 +08:00
Pu Xingyu
dd26148d43 Use the margin box of an inline block when computing the inline size
When computing the inline size of an inline block in inline formating
context, use the margin box of the underling block.
2017-04-10 23:00:16 +08:00
Pu Xingyu
6da65d605b Various cleanups
Remove some hacks in layout, and unused function in style.
2017-04-01 18:49:50 +08:00
Pu Xingyu
951c050690 Use empty pseudo to cascade only inheritable properties for text
Since for nested inline elements non-inheritable properties are
properly stored in the inline context of an inline fragment, so get
rid of them on the style.
2017-04-01 14:05:11 +08:00
Fernando Jiménez Moreno
72d7ee613b Make image cache per-document rather than global 2017-03-27 19:54:13 +02:00
Xidorn Quan
9233882d49 Switch z-index to use predefined integer type 2017-03-17 23:08:03 +11:00
projektir
b4c50de31e Don't serialize initial text-decoration-style #15790 2017-03-09 00:33:17 -05:00
Glenn Watson
750794eb77 Update WR (reference frames for fixed position elements). 2017-03-03 10:33:52 +10:00
Josh Matthews
c890c9143c Make script thread initiate requests for images needed by layout.
In support of this goal, the layout thread collects information about
CSS images that are missing image data and hands it off to the script
thread after layout completes. The script thread stores a list of
nodes that will need to be reflowed after the associated network
request is complete. The script thread ensures that the nodes are
not GCed while a request is ongoing, which the layout thread is
incapable of guaranteeing.

The image cache's API has also been redesigned in support of this
work. No network requests are made by the new image cache, since it
does not possess the document-specific information necessary to
initiate them. Instead, there is now a single, synchronous
query operation that optionally reserves a slot when a cache
entry for a URL cannot be found. This reserved slot is then
the responsibility of the queryer to populate with the contents
of the network response for the URL once it is complete. Any
subsequent queries for the same URL will be informed that the
response is pending until that occurs.

The changes to layout also remove the synchronous image loading
code path, which means that reftests now test the same code
that non-test binaries execute. The decision to take a screenshot
now considers whether there are any outstanding image
requests for layout in order to avoid intermittent failures in
reftests that use CSS images.
2017-02-22 14:19:35 -05:00
Anthony Ramine
fe3f4ff0c2 Update serde to 0.9 (fixes #15325) 2017-02-18 21:09:46 +01:00
Pu Xingyu
31ad3b2949 layout: Fix integer overflow when computing size of replace elements 2017-02-09 17:08:13 +08:00
Pu Xingyu
336aa795b4 Remove cached thread local context from LayoutContext
Remove cached thread local context from LayoutContext, use LayoutContext for
assign_inline_sizes(), and simplify the parallel flow traversal code.
2017-02-08 08:47:54 +08:00
Pu Xingyu
f07bfaa974 Remove redundant style_context() method of LayoutContext 2017-02-06 00:44:11 +08:00
Michael Howell
cef4ebed20 Preserve the un-truncated version of fragments
Fixes #14952
2017-01-12 22:02:53 +00:00
Michael Howell
8a90cda09f Do not replace an ellipsis when reflowing a line
The ellipsis should be replaced, if needed, when the text itself is reflowed.
2017-01-12 21:16:27 +00:00
Bobby Holley
962a4a79bb Bug 1325734 - Remove Servo Layout's dependency on the initial-ness of the style. r=emilio 2017-01-09 11:51:36 -08:00
Martin Robinson
f3577e41c1 Move some methods from display_list_builder.rs
These methods are not only used during display list construction, so
they are a better fit for the flow structs themselves. This does
not introduce any behavior change, but should make it easier to fix
2017-01-09 12:33:23 +01:00
Emilio Cobos Álvarez
fa26e87030
layout: Remove get_font_arc in favor of clone_font.
Since they do the same.
2016-12-31 04:53:36 +01:00
Nazım Can Altınova
aeb5d34394 Move perspective and perspective-origin properties from effects to box. 2016-12-23 19:01:32 +03:00
Pu Xingyu
b0de105bb0 Various fixes
Fix the behavior of block-direction margins of replaced element both
as block level or inline level, and no longer query fragment info when
building display list for canvas.
2016-12-12 18:10:39 +08:00
Pu Xingyu
b1b17f1869 Remove some unused methods
Simply use `Fragment::is_replaced()` in block, and remove
`content_inline_size()` method from Fragment.
2016-12-12 18:10:37 +08:00
Pu Xingyu
07250a7d58 Remove unused replaced size calculation methods
Remove some fields and methods from SpecificFragmentInfo and change
some function signatures.
2016-12-12 18:10:36 +08:00
Pu Xingyu
19a4f8f6c1 Switch to new methods for size calculation of replaced elements
Use `calculate_replaced_sizes()` in `compute_intrinsic_inline_sizes()`
and `assign_replaced_inline_size_if_necessary()`, and remove size
calculation in `assign_replaced_block_size_if_necessary()`, since
we've already done that.
2016-12-12 18:09:52 +08:00
Pu Xingyu
d3ab919745 Add new methods to Fragment for size calculation of replaced element
These new methods calculate both the used width and height of an
replaced element and the same time. The `has_intrinsic_ratio()` method
also exposes information about whether a fragment has intrinsic aspect
ratio.
2016-12-12 15:37:12 +08:00
Pu Xingyu
39780e894b Rename the MinMaxConstraint to SizeConstraint and enhancement
Renamed to `SizeConstraint`, add an optional `border` parameter to
deal with `box-sizing: border-box`, and fix its bug when involving
with `calc`.
2016-12-11 00:54:00 +08:00