Граф коммитов

240 Коммитов

Автор SHA1 Сообщение Дата
Martin Robinson 4608399eb9 servo: Merge #16336 - Used shared clips for overflow:hidden and CSS clip (from mrobinson:overflow-hidden); r=glennw
Instead of passing down a complex clipping region to each item, used
shared clipping to handle overflow:hidden and CSS clips. In addition to
being more efficient, this should also fix quite a few issues related
to absolutely positioned elements.

One existing reftest is slightly modified to avoid tickling a quirk
with the way that WebRender rasterizes masks. We are working out how to
best express these combined masks with the API or need to. The change
does not affect the original subject of the reftest.

Fixes #13109.
Fixes #10151.
Fixes #7575.
Fixes #8074.

<!-- 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 #13109, #10151, #7575, #8074.

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

Source-Repo: https://github.com/servo/servo
Source-Revision: ab7e1e2d36829e20df130f7174c3c7d1dbbd5cc5

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : f0f2687589ff10964ff809060f17d3c7e3e358c8
2017-04-17 16:08:00 -05:00
Glenn Watson 7ddc788706 servo: Merge #16073 - Update WR (gl trait, scroll roots) (from glennw:update-wr-glfns); r=mrobinson
Source-Repo: https://github.com/servo/servo
Source-Revision: c99289a928b30c874da2aa4d8aa869593bbb5e14

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : e963ce4fd8a3773dcd502808b89894a0d1755c07
2017-03-23 03:43:49 -07:00
Simon Sapin 33a9e6d050 servo: Merge #16014 - Per-process lock for CSSOM objects (from servo:style-ref); r=emilio
<!-- Please describe your changes on the following line: -->

Before this PR, every object reflected in CSSOM is in `Arc<RwLock<_>>` to enable safe (synchronized) mutable aliasing. Acquiring all these locks has significant cost during selector matching:

* https://bugzilla.mozilla.org/show_bug.cgi?id=1311469
* https://bugzilla.mozilla.org/show_bug.cgi?id=1335941
* https://bugzilla.mozilla.org/show_bug.cgi?id=1339703

This PR introduce a mechanism to protect many objects with the same `RwLock` that only needs to be acquired once.

In Stylo, there is one such lock per process (in a `lazy_static`), used for everything.

I non-Stylo Servo, I originally intended to have one such lock per document (for author-origin stylesheets, and one per process for user-agent and user sytlesheets since they’re shared across documents, and never mutated anyway). However I failed to have the same document-specific (or pipeline-specific) `Arc` reachable from both `Document` nodes and `LayoutThread`. Recursively following callers lead me to include this `Arc` in `UnprivilegedPipelineContent`, but that needs to be serializable. So there is a second process-wide lock.

This was previously #15998, closed accidentally.

---
<!-- 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
- [ ] 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: bb54f0a429de0e8b8861f8071b6cf82f73622664

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 851230e57ac8775707df5f0f103be5feac81fc41
2017-03-19 14:31:19 -07:00
Emilio Cobos Álvarez c1ff312d84 servo: Merge #15913 - Use the proper viewport size for stylo (from emilio:viewport-size); r=heycam,hiro
Reviewed upstream at [bug 1303229](https://bugzil.la/1303229).

Source-Repo: https://github.com/servo/servo
Source-Revision: 06f99c13f233bad71a42affccb10c86295ff014b

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : fd7d711c75bf2d5e217d186ad875e4d8e1602c3a
2017-03-11 04:40:31 -08:00
Glenn Watson 8f883113a7 servo: Merge #15804 - Update WR (reference frames for fixed position elements) (from glennw:update-wr-transforms); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 0f6b5c3b521686f79a18da64364eed5a03262605

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 005ea52828e73dce970ac55321f586771fffe909
2017-03-02 17:02:26 -08:00
Anthony Ramine b20ac2cefb servo: Merge #15588 - Update serde to 0.9 (from servo:serde); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: 7f3a75fa804c0be67f1567ca4a2449cebefa9616

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : ee100538644baf6bfc695351c42ab95295d7264f
2017-02-18 12:10:26 -08:00
Pu Xingyu f3c730e169 servo: Merge #15417 - layout: Remove cached thread local context from LayoutContext, and use LayoutContext for assign_inline_sizes() (from stshine:column-flexbox); r=emilio
<!-- 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: e2b494b1d08b8929ca7e5ae369304f41af81ace2

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 9cd92ed44acfaa3b2ba04e345b33d21aff3d752c
2017-02-07 17:16:05 -08:00
Matt Brubeck aa1b5f335e servo: Merge #15271 - Initialize block_container_inline_size for non-block root flows (from mbrubeck:root); r=notriddle
Fixes #14948. Fixes #14945.  Needs a try run.  r? @notriddle

Source-Repo: https://github.com/servo/servo
Source-Revision: fdf0833ec2dfc31e480670622066e61390069391
2017-01-28 19:18:53 -08:00
Shing Lyu 4821e9de84 servo: Merge #14978 - Implemented display: inline-flex (from shinglyu:inline-flex); r=notriddle
<!-- 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: c75946c3ed52d262aae585055023becd5a2e9769
2017-01-22 19:57:49 -08:00
Martin Robinson 68043687bf servo: Merge #14979 - Only create scrolling overflow regions when necessary (from mrobinson:scroll-roots-when-necessary); r=emilio
Only create scroll roots for overflow regions when the overflow region
is actually larger than the container size. This prevents creating
scrolling roots for elements that do not have overflow scroll as a
side-effect of the way their height and width is defined. For example,
tables should never respect overflow:scroll since their height and
width should always be large enough to prevent overflow. This also
decreases the size and complexity of the display list in many other
circumstances.

As part of this change, transformed overflow calculation is moved from
display list construction to layout. This should mean that overflow is
handled more accurately earlier.

Fixes #14574.

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

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 3ab514302f964a76938b8c87b4f27edb00d0f537
2017-01-17 07:18:42 -08:00
Martin Robinson 1798734219 servo: Merge #14603 - Rework the way scroll roots are collected (from mrobinson:collect-scoll-roots); r=emilio
<!-- 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 should not change behavior.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Collect scroll roots during the collect_stacking_context phase instead
of during display list construction. This will be useful in order to
collect containing block scroll roots as well as to give scroll roots
sequential ids in the future. This change also pulls stacking context
children out of the StackingContext struct itself, which should reduce
very slightly the memory used by the finished display list. This also
simplifies the DisplayListBuilder because it no longer has to maintain
a stack of ScrollRootIds and StackingContextIds and can instead just
rely on the program stack.

Source-Repo: https://github.com/servo/servo
Source-Revision: dabb79c7878fce31b8b979dd5fcfdfb8713a9d80
2017-01-10 04:48:31 -08:00
Martin Robinson 30ffe184f5 servo: Merge #14926 - Move some methods from display_list_builder.rs (from mrobinson:move-display-list-builder-methods); r=emilio
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

<!-- 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 are a simple refactor.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 23265321988113b290aff190f859be2290a81545
2017-01-09 04:31:30 -08:00
Jure Podgoršek 80f56a2927 servo: Merge #14896 - Tidy assignments (from g1smo:tidy-assignments); r=jdm
<!-- Please describe your changes on the following line: -->
I've added a new tidy rule (no = in the beginning of line) + tests for it. Also cleaned up a few rust source files to accord with the new rule.

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

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

Source-Repo: https://github.com/servo/servo
Source-Revision: b6c137b36f8b9f9cc5c0105bb94a4edeaf7d09be
2017-01-07 09:40:46 -08:00
Bobby Holley b0588eeb56 servo: Merge #14610 - Simplify style context architecture and make it safer (from bholley:style_context_refactor); r=emilio
See the discussion at https://bugzilla.mozilla.org/show_bug.cgi?id=1323372

Not done here, but want to get a try run in on the first patch.

Source-Repo: https://github.com/servo/servo
Source-Revision: a4ecdf2d5fda281f25e2689852bc2134429e07c6
2016-12-16 11:38:27 -08:00
Alan Jeffrey 07258edab3 servo: Merge #14592 - Remove the util crate (from asajeffrey:util-goodbye); r=mbrubeck
<!-- Please describe your changes on the following line: -->

This PR removes the `util` crate.

* Replaced the `spawn_named` and `clamp` functions by appropriate uses of `std:🧵:Builder::spawn`, `std::cmp::min` and `std::cmp::max`.
* Moved `opts`, `prefs` and `resource_files` into a new `config` crate.
* Moved `remutex` and `geometry` into their own crates.

---
<!-- 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 do not require tests because they are refactorings

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 4eb653817f87e5fb47de34356f558eb76ecbca9f

--HG--
rename : servo/components/util/Cargo.toml => servo/components/config/Cargo.toml
rename : servo/components/util/basedir.rs => servo/components/config/basedir.rs
rename : servo/components/util/lib.rs => servo/components/config/lib.rs
rename : servo/components/util/opts.rs => servo/components/config/opts.rs
rename : servo/components/util/prefs.rs => servo/components/config/prefs.rs
rename : servo/components/util/resource_files.rs => servo/components/config/resource_files.rs
rename : servo/components/util/geometry.rs => servo/components/geometry/lib.rs
rename : servo/components/util/remutex.rs => servo/components/remutex/lib.rs
rename : servo/tests/unit/util/lib.rs => servo/tests/unit/servo_config/lib.rs
rename : servo/tests/unit/util/opts.rs => servo/tests/unit/servo_config/opts.rs
rename : servo/tests/unit/util/prefs.rs => servo/tests/unit/servo_config/prefs.rs
rename : servo/tests/unit/util/remutex.rs => servo/tests/unit/servo_remutex/lib.rs
2016-12-14 16:48:42 -08:00
Pu Xingyu d9d8fc335a servo: Merge #14490 - layout: Unify size calculation of replaced elements (from stshine:replaced-size); r=emilio
<!-- 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: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 1993b6e812de30de06100e7d52c1d90af929f24f
2016-12-12 03:25:03 -08:00
Pu Xingyu bcaf6bd9aa servo: Merge #14130 - layout: Mark flex items properly during construction (from stshine:construct-flexbox); r=pcwalton
<!-- Please describe your changes on the following line: -->

Set the flag of the fragment of children in a flex container according
to the direction of the container. The mark is done on the fragment
because flex item enstablish a stacking context when its z-index is
non-zero ,despite its `position' property.

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. -->

r? @pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: 333c397f03bc2d143e0d8c112138d5758d37f6f5
2016-11-09 03:59:22 -06:00
Martin Robinson b0c848f946 servo: Merge #14084 - Don't promote all scrollable regions to stacking contexts (from mrobinson:scroll_root_2); r=glennw
<!-- Please describe your changes on the following line: -->

Don't promote all scrollable regions to stacking contexts

Instead annotate all flows with their owning ScrollRoots. When
processing the display list items into a flattened display list, we add
PushScrollRoot and PopScrollRoot to signal when scrolling regions start
and end. It is possible for content from different scrolling regions to
intersect and when they do, the stack of scrolling regions is
duplicated.  When these duplicated scrolling regions stacks reach
WebRender, it will scroll them in tandem.

The PushScrollRoot and PopScrollRoot items are currently represented as
StackingContexts in WebRender, but eventually these will be replaced
with special WebRender display items.

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

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

Source-Repo: https://github.com/servo/servo
Source-Revision: ef5ca14283f1f47654093b5c196ab813efb53ea8
2016-11-07 18:49:53 -06:00
Bobby Holley bc86bdcc31 servo: Merge #14034 - incremental restyle: Use more concrete types in the style system (from bholley:more_concrete_types); r=emilio
We need to hang both snapshots and restyle damage off of ElementData, and so we need them to be concrete to avoid infecting ElementData with the trait hierarchy.

Source-Repo: https://github.com/servo/servo
Source-Revision: d8ac5100e81ccbad4b5131688b96bedb9b5e279d

--HG--
rename : servo/resources/shaders/debug_color.fs.glsl => servo/components/style/servo/mod.rs
rename : servo/components/script_layout_interface/restyle_damage.rs => servo/components/style/servo/restyle_damage.rs
rename : servo/components/style/servo_selector_impl.rs => servo/components/style/servo/selector_impl.rs
2016-11-07 16:31:10 -06:00
Shing Lyu b988a636be servo: Merge #13740 - Migrated -Z trace-layout to serde_json (from shinglyu:layout_serde); r=jdm
<!-- Please describe your changes on the following line: -->

Migrated the trace-layout code from old `rustc-serialize` to `serde_json`. This will help us iterate faster on the layout viewer (#13432), #13436, #12675 and fix #12936.
---

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it's a relatively low risk debug tool

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 1c26f44cbb23e7da3b9d63f0223c8d5d43eec958
2016-11-07 02:15:03 -06:00
Michael Howell 5b347f4041 servo: Merge #14053 - Make `FlowRef` a newtype (from notriddle:flow_ref_unsafe); r=pcwalton
This creates a sharp distinction between `Arc<Flow>`s, which may be
owned by anyone, and `FlowRef`s, which may only be owned by the
traversal code. By checking the reference count, we ensure that a `Flow`
cannot be pointed to by `Arc`s and `FlowRef`s simultaneously.

This is not a complete fix for #6503, though it is a necessary start
(enforcing the no-aliasing rule of `FlowRef::deref_mut` will require far
more work).

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14014 (github issue number if applicable).
- [X] These changes do not require tests because the existing tests, plus the added assertions, should be sufficient

Source-Repo: https://github.com/servo/servo
Source-Revision: 2b4a7b0b7ad9dd568dfde15ab47dc634ec561d70
2016-11-04 16:53:38 -05:00
Martin Robinson 9a67ba798b servo: Merge #13957 - Track overflow:scroll stacking contexts with ScrollRootId instead of StackingContextId (from mrobinson:scroll_root); r=glennw
<!-- 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 this PR should not change behavior.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 3a3f3192a87dbcd5d05efb82a1f4dde23f9c4cf7

--HG--
rename : servo/resources/shaders/box_shadow.fs.glsl => servo/resources/shaders/cs_box_shadow.fs.glsl
rename : servo/resources/shaders/ps_box_shadow.glsl => servo/resources/shaders/cs_box_shadow.glsl
2016-10-30 15:27:56 -05:00
Patrick Walton dff6bf022d servo: Merge #13870 - layout: Rewrite anonymous table code, simplify and fix table intrinsic width calculation, and improve safety of flexbox code (from pcwalton:anonymous-table-rewrite); r=mbrubeck
Closes #13782.

Source-Repo: https://github.com/servo/servo
Source-Revision: 6b40f97289c4c5a20b539992c3d511b3bf470f28
2016-10-26 20:14:04 -05:00
Martin Robinson bc43e4931e servo: Merge #13848 - Remove concept of Layers from Servo (from mrobinson:remove-layers); r=glennw
<!-- 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 this PR should not change behavior.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Layers were a feature of the legacy drawing path. If we re-add them at
some point, it probably makes more sense to make them a product of
display list inspection.

This change also remove a bunch of dead painting code.

Source-Repo: https://github.com/servo/servo
Source-Revision: bb271ef4afea02b6b1b5d207e773d1fedccd2906
2016-10-21 01:43:25 -05:00
Glenn Watson 5d056c5039 servo: Merge #13711 - Remove old rendering backend (from glennw:remove-old-renderer); r=larsbergstrom
This removes paint threads, rust-layers dependency, and changes
optional webrender types to be required.

The use_webrender option has been removed, however I've left
the "-w" command line option in place for now so that wpt
runner can continue to pass that. Once it's removed from there
we can also remove the -w option.

Once this stage is complete, it should be fine to change the
display list building code to generate webrender display
lists directly and avoid the conversion step.

Source-Repo: https://github.com/servo/servo
Source-Revision: f96718d03da969510dc992699cb6f25c2e21ae1e
2016-10-17 19:22:20 -05:00
Patrick Walton abf10e1cb1 servo: Merge #13756 - layout: Rewrite clipping to be a two-phase process that takes physical border box positions and transforms into account (from pcwalton:relative-position-clip); r=notriddle
Clipping region computation now follows a simple process: (1) in the
parent's coordinate system, parents store appropriate clipping regions
into children; (2) each child moves its clipping region to its own
coordinate system if necessary.

Because clipping region computation is now based on stacking-relative
border box positions and the `transform_rect` method, it can handle
`position: relative` offsets and more types of transforms, such as
scaling.

Improves etsy.com.

Closes #13753.

Source-Repo: https://github.com/servo/servo
Source-Revision: c1abd8797c5b257c9339fbaf6ca4b7480c43a755
2016-10-15 16:19:10 -05:00
Patrick Walton 3dc4b5d94d servo: Merge #13765 - layout: Make percentages in `top` and `bottom` for relative positions relative to height, not width (from pcwalton:relative-position-vertical-percentage); r=emilio
Improves etsy.com.

Closes #13760.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 759185abe05c31c2851d9ac586ddc2d065aa755f
2016-10-14 23:47:24 -05:00
Patrick Walton f1f3ee7678 servo: Merge #13705 - layout: Don't touch the inline positions of block children unless they are to be reflowed (from pcwalton:incremental-float); r=notriddle
See the comment added to
`BlockFlow::propagate_assigned_inline_size_to_children()` for details.

Closes #13704.

r? @notriddle

Source-Repo: https://github.com/servo/servo
Source-Revision: 0ffbba94fa141f0049c96b3c30dccc22b1b43e6c
2016-10-12 16:00:37 -05:00
Patrick Walton 304472af14 servo: Merge #13685 - layout: Don't use the existing block position as the float ceiling when placing block formatting contexts in the sequential fallback (from pcwalton:block-formatting-context-fallback-placement); r=notriddle
The existing block position isn't yet computed at that time, so it
contains junk data. It just so happened to work on first reflow because
that value is usually set to zero, but it usually failed on subsequent
reflows.

Improves certain Wikipedia pages.

Closes #13630 (though Google is still broken; it was a separate bug and
will be split off into a separate issue).

r? @notriddle

Source-Repo: https://github.com/servo/servo
Source-Revision: cad5a4e3261ddb82b542b9a087b48daab51bbfd3
2016-10-11 01:11:24 -05:00
Alexandrov Sergey 8e0108af54 servo: Merge #13589 - Support SVG element (from splav:SVGElement#12974); r=pcwalton,Ms2ger
<!-- Please describe your changes on the following line: -->
minimal SVG element implementation
---
<!-- 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 #12974 (github issue number if applicable).

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

Source-Repo: https://github.com/servo/servo
Source-Revision: dad3b4785a73aa6ddea5ed50ee4ef01bd4049c8d
2016-10-07 17:40:13 -05:00
Michael Howell 0c9d616de3 servo: Merge #13401 - Implement sequential fallback to float speculation (from notriddle:master); r=pcwalton
This shouldn't impact any pages that are already rendering correctly, but it is a very naive implementation of this pass.

---

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 4ebecc915a13cd944b25738dd5859f1a6072a4ff
2016-09-29 13:16:24 -05:00
Martin Robinson aefcd15165 servo: Merge #13417 - Simplify stacking context collection (from mrobinson:simplify-stacking-context-collection); r=glennw
<!-- 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: -->
- [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. -->

Simplify the way that stacking contexts are collected. Instead of
passing the StackingContextId down the tree, pass the parent
StackingContext itself. This will allow future patches to get more
information about the parent stacking context (such as location).

Also remove the return value of collect_stacking_contexts, which was
unused.

Source-Repo: https://github.com/servo/servo
Source-Revision: 81dfa6a96b99eae8a7232eab39de96edf663ba99
2016-09-29 09:01:33 -05:00
Patrick Walton b13d5121e5 servo: Merge #13346 - layout: Make some major improvements to incremental layout to improve CNN (from pcwalton:cnn); r=notriddle
CNN is still too slow to be usable, but this is a partial solution.

r? @notriddle (feel free to reassign if you like)

Source-Repo: https://github.com/servo/servo
Source-Revision: cbe54582727e3d756aa084e94520f2f29f9d7c86
2016-09-26 20:57:59 -05:00
Patrick Walton 15ca037bb1 servo: Merge #13302 - layout: Disable the speculation of block formatting contexts' inline sizes if the block formatting contexts have negative margins (from pcwalton:negative-margin-speculation); r=notriddle
The heuristics that determine how and whether floats flow into the
margins are not valid in that case.

Closes #13299.

r? @notriddle

Source-Repo: https://github.com/servo/servo
Source-Revision: 993fbc4320e6429c3edb43c9c5a3221a801f6f6f
2016-09-19 19:22:29 -05:00
UK992 f8cb9971b7 servo: Merge #13205 - Tidy: Fix ordering use statements with braces (from UK992:tidy-sort); r=Wafflespeanut
This hack fixes https://github.com/servo/servo/issues/7412 and matches behavior with rustfmt.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3117787fd2a8b7748cfde1e9b8c5be3c00f2c599
2016-09-08 22:19:19 -05:00
Shing Lyu c852686abe servo: Merge #13175 - Move collapse through margin to the top of block flow (from shinglyu:block-margin-patch); r=notriddle
<!-- Please describe your changes on the following line: -->
Based on the spec, a collapse through box should be put on the top edge of the flow. This fixed ~110 reftests

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

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

Source-Repo: https://github.com/servo/servo
Source-Revision: aa011ea2759683ede76639a1ea889c93c21d1cb8
2016-09-08 17:43:50 -05:00
Michael Howell 95ae94306a servo: Merge #13051 - Fix root flow's size at the browser window's size (from notriddle:root_flow_percent); r=glennw
When `<body>` needs to calculate its size based on `<html>`'s size, that should be the size of the browser window itself.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12802 (github issue number if applicable).
- [X] There are tests for these changes OR

Source-Repo: https://github.com/servo/servo
Source-Revision: 07b770b829c7148d3a10e7a7467e114bc2f23125
2016-08-28 19:16:19 -05:00
Michael Howell 89c329f951 servo: Merge #13050 - Fix spelling mistake (from notriddle:tlapd); r=emilio
Source-Repo: https://github.com/servo/servo
Source-Revision: 545ae86dff6513f1f5de083ba3ce64b181368482
2016-08-26 07:19:59 -05:00
Ms2ger 8466cae183 servo: Merge #13012 - Stop creating a LayoutContext in build_display_list_for_subtree (from servo:shared-layout-context); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: 6191748907e0480059a9a33c5c8c7be42d79efe3
2016-08-24 09:38:31 -05:00
Shing Lyu 28a02a9533 servo: Merge #12873 - Fix absolute-flow's auto positioning (from shinglyu:abs-margin-patch); r=notriddle,emilio
<!-- Please describe your changes on the following line: -->
If an absolute positioned flow has no top, bottom, left, right property, its hypothetical box position should be the margin-end of its previous sibling, not the border-end.

---
<!-- 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 #12676 (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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: d687f77fefbe3a9fada4f97913001c7f54218719
2016-08-15 08:19:04 -05:00
Martin Robinson c116a510e2 servo: Merge #12817 - Update to euclid 0.8 (from servo:euclid); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: 5b915c403d2e96bd2917e7df4f2a58a6668a0c0e
2016-08-11 20:12:29 -05:00
Pu Xingyu 4d52c1a87a servo: Merge #12330 - Implement flexible box layout for row container (from stshine:flexitem); r=pcwalton
<!-- Please describe your changes on the following line: -->

This pull requests implements basic flexible box layout for row container.
It  has implemented most basic flexbox features, including grow, shrink, multi-line, *reverse properties, and alignment under `justify-content`, `align-items`, `align-self`, `align-content`.

---
<!-- 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]  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. -->

r? @pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: 15947f8f73bc8145916e1213f559eede815d8529
2016-08-03 09:24:31 -05:00
Ms2ger 4d99624507 servo: Merge #12677 - Remove unused inline_size_of_preceding_{left,right}_floats fields from BlockFlow (from Ms2ger:unused-float-sizes); r=Manishearth
Source-Repo: https://github.com/servo/servo
Source-Revision: e9d647ca5401f9603295882fe647a53c4ee88d14
2016-08-01 08:04:30 -05:00
Simon Sapin c710b104be servo: Merge #12515 - Make the style crate more concrete (from servo:concrete-style); r=bholley
Background:

The changes to Servo code to support Stylo began in the `selectors` crate with making pseudo-elements generic, defined be the user, so that different users (such as Servo and Gecko/Stylo) could have a different set of pseudo-elements supported and parsed. Adding a trait makes sense there since `selectors` is in its own repository and has others users (or at least [one](https://github.com/SimonSapin/kuchiki)).

Then we kind of kept going with the same pattern and added a bunch of traits in the `style` crate to make everything generic, allowing Servo and Gecko/Stylo to do things differently. But we’ve also added a `gecko` Cargo feature to do conditional compilation, at first to enable or disable some CSS properties and values in the Mako templates. Since we’re doing conditional compilation anyway, it’s often easier and simpler to do it more (with `#[cfg(feature = "gecko")]` and `#[cfg(feature = "servo")]`) that to keep adding traits and making everything generic. When a type is generic, any method that we want to call on it needs to be part of some trait.

----

The first several commits move some code around, mostly from `geckolib` to `style` (with `#[cfg(feature = "gecko")]`) but otherwise don’t change much.

The following commits remove some traits and many type parameters through the `style` crate, replacing them with pairs of conditionally-compiled API-compatible items (types, methods, …).

Simplifying code is nice to make it more maintainable, but this is motivated by another change described in https://github.com/servo/servo/pull/12391#issuecomment-232183942. (Porting Servo for that change proved difficult because some code in the `style` crate was becoming generic over `String` vs `Atom`, and this PR will help make that concrete. That change, in turn, is motivated by removing geckolib’s `[replace]` override for string-cache, in order to enable using a single Cargo "workspace" in this repository.)

r? @bholley

---
<!-- 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: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require new 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 2d01d41a506bcbc7f26a2284b9f42390d6ef96ab

--HG--
rename : servo/ports/geckolib/selector_impl.rs => servo/components/style/gecko_selector_impl.rs
rename : servo/ports/geckolib/values.rs => servo/components/style/gecko_values.rs
rename : servo/ports/geckolib/properties.mako.rs => servo/components/style/properties/gecko.mako.rs
2016-07-20 02:58:34 -05:00
Anthony Ramine cc183b15a7 servo: Merge #12224 - Remove some stuff from util (from nox:die-util-die); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 3b0dadda529a5ba45a8a0dc394187f43a66e7c1f

--HG--
rename : servo/components/util/print_tree.rs => servo/components/gfx_traits/print_tree.rs
rename : servo/components/util/workqueue.rs => servo/components/style/workqueue.rs
2016-07-04 12:57:00 -07:00
Ms2ger ac18eb8bf1 servo: Merge #11822 - Avoid creating a LayoutContext in parallel::assign_inline_sizes (from Ms2ger:sharedcontext); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: 44b0bddf413563890481fd77e43d3d073bd6b627
2016-06-23 03:03:02 -05:00
Matt Brubeck 274e69bf1e servo: Merge #11752 - Minor code cleanup in layout (from mbrubeck:cleanup); r=pcwalton
r? @pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: 47387a5c442c5a0167b5286fa1113124ba8d67db
2016-06-21 17:51:26 -05:00
Ms2ger a1e8c195d7 servo: Merge #11804 - Introduce a layout_thread crate; drop the dependency of layout on script (from Ms2ger:layout-thread-crate); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: a94d3ee744fd0ff87bfe0548ba96927e64ce4b54

--HG--
rename : servo/components/layout/layout_thread.rs => servo/components/layout_thread/lib.rs
2016-06-20 17:00:13 -05:00
Ms2ger 874621db97 servo: Merge #11754 - Move ServoLayoutNode and related structs to script (from Ms2ger:wrapper-traits-prep2); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: ee8c5c5a67e1181eca163d3cd1189866d230b8f0

--HG--
rename : servo/components/script/reporter.rs => servo/components/script_layout_interface/reporter.rs
rename : servo/components/layout/incremental.rs => servo/components/script_layout_interface/restyle_damage.rs
2016-06-20 12:54:20 -05:00
Ms2ger baf90775bd servo: Merge #11800 - Remove unused argument to place_float_if_applicable (from Ms2ger:place_float_if_applicable); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: c270622bfdd7a409c1a940322f630fd6cbd985c0
2016-06-20 08:17:13 -05:00