Commit graph

2186 commits

Author SHA1 Message Date
Nazım Can Altınova
d7c227f614
Fix parsing of ClipRect 2017-02-25 00:10:43 +03:00
bors-servo
1d13e6a2df Auto merge of #15700 - glennw:zoom-wip-2, r=mbrubeck
Introduce CSSPixel as a replacement for ViewportPx and PagePx.

<!-- 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/15700)
<!-- Reviewable:end -->
2017-02-23 16:01:16 -08:00
Glenn Watson
30ff2f8f0d Introduce CSSPixel as a replacement for ViewportPx and PagePx. 2017-02-24 06:58:10 +10:00
Glenn Watson
ffcb319324 Add support for most of the border-image properties, pass to WR.
This adds support for:
 * border-image (images, not gradients yet)
 * border-image-source
 * border-image-slice
 * border-image-repeat (stretch + repeat only for now)

Remaining work:
 * Connect border-image-outset (WR supports this).
 * border-image-width
2017-02-23 14:15:20 +10:00
bors-servo
854d720b21 Auto merge of #14962 - jdm:image_script_load, r=Ms2ger,glennw,emilio
Remove network requests from image cache thread

The design of initiating network requests from the image cache thread was simple, but it makes it difficult to implement image loading that conforms to the HTML specification. These changes make the implementation of HTMLImageElement responsible for network requests for `<img>` elements, and CSS-based images (background-image, bullets, etc.) are requested by the script thread to ensure that the layout thread does not attempt to retain unsafe pointers to DOM nodes during asynchronous operations.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #7708
- [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/14962)
<!-- Reviewable:end -->
2017-02-22 17:50:48 -08:00
Josh Matthews
980eb5ac33 Avoid dropping image requests on the ground from non-script-initiated reflow. 2017-02-22 14:19:35 -05: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
Glenn Watson
c4a972aa7b Update WR (inset box shadow fix, border-image support).
I have a follow up PR for Servo that uses the new border-image
APIs, but I'll land that separately, so that we don't delay
landing the WR update itself.
2017-02-22 16:12:21 +10:00
Anthony Ramine
63c4490e73 Kill the plugins crate and its clippy support
Sometimes clippy gets outdated by months, and its current support setup
means that each Servo component need to opt into it by depending on
the plugins crate manually, and not all components do that.
2017-02-21 11:50:36 +01:00
Anthony Ramine
fe3f4ff0c2 Update serde to 0.9 (fixes #15325) 2017-02-18 21:09:46 +01:00
Anthony Ramine
85e2648ffc Update ipc-channel to 0.6.3 2017-02-16 12:04:32 +01:00
Simon Sapin
c3cad2d6c7 Update cssparser to 0.9 2017-02-15 12:42:14 +01:00
bors-servo
5a624ff956 Auto merge of #15549 - mbrubeck:always-be-updating, r=jdm
Update aho-corasick, backtrace-sys, image, parking_lot, pdqsort, syn, & others

<!-- 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/15549)
<!-- Reviewable:end -->
2017-02-14 13:17:24 -08:00
Matt Brubeck
6d43fd933f Update aho-corasick, backtrace-sys, image, parking_lot, pdqsort, syn 2017-02-14 12:11:41 -08:00
bors-servo
357bf3b85a Auto merge of #15518 - emilio:color, r=SimonSapin
style: Unbox a bunch of color properties.

This builds on https://github.com/servo/rust-cssparser/pull/118.

<!-- 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/15518)
<!-- Reviewable:end -->
2017-02-14 11:43:16 -08:00
Emilio Cobos Álvarez
0c102e2350
style: Unbox a bunch of color properties.
This builds on https://github.com/servo/rust-cssparser/pull/118.
2017-02-14 20:18:31 +01:00
Glenn Watson
cbe7f09f81 Update WR (pixel snapping improvements).
This includes a WR update that improves pixel snapping. Specifically,
the non-transform shader now snaps to device pixels in world space,
rather than local space.

This makes 31 new tests pass, and adds 4 new failures.

Of the new failures:
 - The three background size tests appear to be an OSMesa accuracy
   issue. Near the bottom of the image, a small number of pixels
   are different from the reference by a value of 1.0 / 255.0. I've
   confirmed on 3 real GPUs and also on llvmpipe that the tests
   match on those devices. This would be a good case for fuzzy test
   support in WPT.
 - The other failing test appears to have unreasonable accuracy
   requirements as it also fails on Gecko and Chromium in the same
   way that the test now fails on WR.
2017-02-13 23:46:28 +01:00
Manish Goregaokar
6b0d3902de Factor out ClipRect type into values; use Either for clip
MozReview-Commit-ID: C3R1erJdiID
2017-02-09 15:09:35 -08:00
Pu Xingyu
31ad3b2949 layout: Fix integer overflow when computing size of replace elements 2017-02-09 17:08:13 +08:00
bors-servo
368af6f861 Auto merge of #15357 - dashed:gh-15207, r=Wafflespeanut,emilio
Refactor outline-style to accept "auto" value in addition to border-style values.

Fixes https://github.com/servo/servo/issues/15207

Refactored as per https://github.com/servo/servo/issues/15207#issuecomment-275171590 .

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

- [x] Correct refactor? I'd appreciate any feedback on this.
- [x] ~~~proper borderstyle value for `outline-style: auto;`?~~~ ~~~(EDIT: deferred to a `FIXME`)~~~ (EDIT2: it is now solid for behaviour parity with firefox)
- [x] squash pending PR review
- [x] mako code review

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

<!-- Either: -->
- [x] There are tests for these changes

<!-- 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/15357)
<!-- Reviewable:end -->
2017-02-08 21:10:57 -08:00
Alberto Leal
09d4751054 Refactor outline-style to accept "auto" value in addition to border-style values.
Fixes https://github.com/servo/servo/issues/15207
2017-02-08 23:13:20 -05:00
Bobby Holley
9e860df9df Bug 1336646 - Apply selector flags during traversal. r=emilio 2017-02-08 19:21:05 -08:00
Bobby Holley
8915e53cee Move rust-selectors in-tree. 2017-02-07 22:53:10 -08:00
bors-servo
f7e75fd001 Auto merge of #15440 - KiChjang:selectors, r=KiChjang
Update selectors to 0.17

Closes #15434.
2017-02-07 20:36:59 -08:00
Anthony Ramine
55b2c5c1bd Update selectors to 0.17 2017-02-07 20:33:35 -08:00
bors-servo
e2b494b1d0 Auto merge of #15417 - stshine:column-flexbox, r=emilio
layout: Remove cached thread local context from LayoutContext, and use LayoutContext for assign_inline_sizes()

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

According to https://github.com/servo/servo/pull/3069 the cached thread local context is introduced for green threads. Now green threads has gone, and the existence of cache force us to create a `LayoutContext`, an `AssignISizes` and an `AssignBSizes` for each flow during parallel layout, so the pull request tries to remove it. And it also switch `assign_inline_sizes()` to accept a `LayoutContext` parameter, as according to my current design we need to do full layout to some flex items for column flexbox during assign isize traversal.

Part of #14123.

---
<!-- 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 refactoring

<!-- 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/15417)
<!-- Reviewable:end -->
2017-02-07 17:16:05 -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
Glenn Watson
f1558b1c7b Update WR.
- Subpixel positioning improvements.
- Clipping fixes and optimizations.
- Fix panic when transform can't be inverted.
- Support multiple filters on single stacking context.
- Optimize gradients, support unlimited stops.
- Add external image + texture cache support.
- Support error path on shader compile error.
- Optimize border handling in texture atlas.
- Preliminary work towards clip/scroll root changes.
2017-02-07 17:19:16 +10:00
Anthony Ramine
db3e5be878 Update core-foundation-sys to 0.3 2017-02-07 14:35:30 +10:00
Pu Xingyu
f07bfaa974 Remove redundant style_context() method of LayoutContext 2017-02-06 00:44:11 +08:00
Glenn Watson
4cbefe82b5 Update WR (radial gradients, subpixel positioning, tiling changes). 2017-02-01 05:40:44 +10:00
bors-servo
fdf0833ec2 Auto merge of #15271 - mbrubeck:root, r=notriddle
Initialize block_container_inline_size for non-block root flows

Fixes #14948. Fixes #14945.  Needs a try run.  r? @notriddle

<!-- 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/15271)
<!-- Reviewable:end -->
2017-01-28 19:18:53 -08:00
Matt Brubeck
b3820c1296 Convert text-orientation to a Gecko-only property
Remove incomplete and buggy support for text-orientation in Servo.
Make the property values align with Gecko and the latest draft of CSS
Writing Modes Level 3.
2017-01-27 21:12:38 -08:00
Matt Brubeck
39826f817e Initialize block_container_inline_size for non-block root flows
Fixes #14948.
2017-01-27 12:34:00 -08:00
bors-servo
2b623fcc7a Auto merge of #15186 - servo:re-revert, r=mbrubeck
Re revert the backed out PRs

r? anyone

<!-- 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/15186)
<!-- Reviewable:end -->
2017-01-25 02:36:15 -08:00
bors-servo
1b1557839a Auto merge of #15156 - mbrubeck:border-collapse, r=notriddle
WIP: Fix missing borders in tables with border-collapse

This fixes a pair of bugs that caused some borders to be ignored by the border-collapse code. r? @notriddle

I haven't done a full test run with this change yet. After a `try` build I will update test expectations and/or add a new test.

---

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #14834 (github issue number if applicable).

- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/15156)
<!-- Reviewable:end -->
2017-01-24 20:06:18 -08:00
bors-servo
1934a33875 Auto merge of #15160 - emilio:expose-traversal-kind, r=bholley
style: Expose the traversal kind to the style system.

This way we'll be able to take different paths for the sequential and parallel
traversals in some concrete cases.

This is a preliminar patch to fix bug 1332525.

r? @bholley

<!-- 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/15160)
<!-- Reviewable:end -->
2017-01-24 17:02:41 -08:00
Matt Brubeck
258162fbee Fix block-direction border collapsing calculation
Previously the block-start collapsed borders from rows/cells were
written to `preliminary_collapsed_borders` but never read.  This fixes
the block-direction part of #14834.
2017-01-24 16:03:12 -08:00
Matt Brubeck
e315e2e167 Fix provenance of first cell's inline collapsed border
This fixes the inline-direction part of #14834.
2017-01-24 16:01:03 -08:00
Emilio Cobos Álvarez
4639940dfe
Revert "Revert "frame-resize refactor""
This reverts commit 6ead3952a3.
2017-01-24 22:20:39 +01:00
bors-servo
185759f87a Auto merge of #15164 - mbrubeck:revert, r=emilio
Revert several changes that broke tests

This is based on #15158 by @aneeshusa, with additional reverts.

This reverts #15064, which is causing many tests not to run, and #15129 and #15155 which landed while tests were not running and may have caused some new failures in iframe tests.

<!-- 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/15164)
<!-- Reviewable:end -->
2017-01-24 11:14:28 -08:00
bors-servo
2ff4246215 Auto merge of #15154 - servo:rustup, r=SimonSapin
Update rustc to 1.16.0-nightly (7821a9b99 2017-01-23).

<!-- 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/15154)
<!-- Reviewable:end -->
2017-01-24 06:11:40 -08:00
Ms2ger
14fe337866 Update rustc to 1.16.0-nightly (7821a9b99 2017-01-23). 2017-01-24 11:02:51 +01:00
Emilio Cobos Álvarez
f00b628c3a
style: Expose the traversal kind to the style system.
This way we'll be able to take different paths for the sequential and parallel
traversals in some concrete cases.

This is a preliminar patch to fix bug 1332525.
2017-01-24 08:41:29 +01:00
Matt Brubeck
6ead3952a3 Revert "frame-resize refactor"
This reverts commit bca565a1a3.
2017-01-23 16:44:56 -08:00
bors-servo
b0f91193fd Auto merge of #13681 - gpoesia:master, r=mbrubeck
Fix margin size calculation for TableWrapper

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

Fixes inline size calculation for TableWrapper. The table's width was always reaching the inline size equation solver as a specified variable, which was causing the system to be overdetermined when there was a margin specified for the table, and this caused the overflow reported in #12748. The fix consists in handling three cases when the table's width is not specified: if the preferred size of all columns fits, it is returned; if the minimum size does not fit, it is returned instead (it will overflow), otherwise, it is returned as a free variable (that should be solved together with the margin to some value above the minimum width and below the preferred width).

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12748
- [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/13681)

<!-- Reviewable:end -->
2017-01-23 08:55:44 -08:00
bors-servo
7e2329ea4e Auto merge of #15129 - cynicaldevil:iframe-resize, r=emilio
Refactor to send iframe resize messages directly from layout thread to constellation

<!-- 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 #14682.
<!-- Either: -->

r? @jdm
passing tests:
tests/wpt/mozilla/tests/css/matchMedia.html, tests/wpt/mozilla/tests/mozilla/window_resize_not_triggered_on_load.html, tests/wpt/mozilla/tests/mozilla/iframe/resize_after_load.html, tests/wpt/mozilla/tests/css/meta_viewport_resize.html

<!-- 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/15129)
<!-- Reviewable:end -->
2017-01-23 06:08:02 -08:00
Nikhil Shagrithaya
bca565a1a3 frame-resize refactor 2017-01-23 19:12:16 +05:30
Boris Chiou
9360beb03c Update selectors to 0.15.1
selectors 0.15.1 supports AFFECTED_BY_ANIMATIONS and
AFFECTED_BY_TRANSITIONS, which are used by stylo animations.
2017-01-23 14:51:10 +08:00
bors-servo
c75946c3ed Auto merge of #14978 - shinglyu:inline-flex, r=notriddle
Implemented display: inline-flex

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

<!-- Either: -->
- [x] There are tests for these changes
<!-- 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/14978)
<!-- Reviewable:end -->
2017-01-22 19:57:49 -08:00