Commit Graph

21 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
80e92561e4 servo: Merge #17025 - script/layout: Stop doing unsafe transmutes between refcell references (from emilio:layout-data); r=jdm
This commit splits the style and layout data in two separate refcells.

These transmutes have been a source of trouble (for example on Android), and
they feel like a hack anyway.

Fixes #16982

Source-Repo: https://github.com/servo/servo
Source-Revision: 764da7ba39c0ccbaf807c6131418761f70584322

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 8c76908f751b0f628da00bd0aa46e7c1548b1b66
2017-05-25 19:58:47 -05:00
Imanol Fernandez
5ece11e724 servo: Merge #16816 - Fix unsafe casting between PersistentLayoutData and PartialPersistentLayoutData (from MortimerGoro:unsafe_layout_data_cast); r=SimonSapin
<!-- Please describe your changes on the following line: -->

PersistentLayoutData and PartialPersistentLayoutData castings in Layout component assume that they have the same base raw address. This is unsafe because field orders is not guaranteed by default, and it's causing some SEGV crashes on Android indeed (https://github.com/servo/servo/issues/16647)

Add a C representation to guarantee that the order of the fields and the safe casting.
---
<!-- 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 #16647 (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. -->

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

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 63ed76e1f28219f41e5dbf2cf25ba9d31930af10
2017-05-11 14:47:24 -05:00
Bobby Holley
e445eee20a servo: Merge #14907 - Give up on hoisting ElementData into the frame and eliminate the concept of consuming styles (from bholley:eliminate_consume); r=emilio
Servo PR for the work in https://bugzilla.mozilla.org/show_bug.cgi?id=1325734

Source-Repo: https://github.com/servo/servo
Source-Revision: 2a2a89b7e401e72a4d8d6199c483d7ab09ff5c1e
2017-01-09 17:26:50 -08:00
Bobby Holley
79a77ced40 servo: Merge #13655 - Move children_to_process to layout (from bholley:children_to_process); r=<try>
We don't need this for Gecko, and it's hard to implement in that case because
there's nowhere obvious to put it (we don't plan to create TSDs for non-dirty
nodes, and non-dirty nodes can have dirty children which require the
children_to_process atomic). There are various solutions here, but punting is
the easiest.

We'll need to rethink this if/when we need to do a bottom-up traversal for
Gecko.

Source-Repo: https://github.com/servo/servo
Source-Revision: 70dbfd28fa44b0cd89a0ea39a6bd1180611c5e66
2016-10-09 01:37:42 -05:00
Bobby Holley
4cf0bc2db4 servo: Merge #13520 - Implement AtomicRefCell and use it for layout/style node data (from bholley:atomic_refcell); r=emilio
See the rationale at https://bugzilla.mozilla.org/show_bug.cgi?id=1305141

Source-Repo: https://github.com/servo/servo
Source-Revision: c93eaca6a3563ea8472b2ac783e9a596528517b8
2016-10-02 21:24:11 -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
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
Matt Brubeck
ff8a4f5c36 servo: Merge #10944 - Upgrade a bunch of dependencies (from mbrubeck:bitflags-0.6); r=frewsxcv
Source-Repo: https://github.com/servo/servo
Source-Revision: 8db0367301b5ad5ab5ea4704d57755c166cfd5de
2016-04-30 15:21:22 -07:00
Emilio Cobos Álvarez
18f790ca50 servo: Merge #10815 - style: Support anonymous box pseudo-elements (from emilio:anonbox-gcs); r=SimonSapin,bholley
This is a work-in-progress that:

 * Adds support for some pseudo-elements to skip the cascade entirely, in an analogous way to Gecko's anonymous box pseudo-elements.
 * Takes rid of `StylistWrapper`, and uses `Arc::get_mut` instead.
 * Uses the first bullet to precompute the `-servo-details-content` pseudo's style.

I'd like @bholley to take a look before following, do you think that the aproach is the correct?
Also, @SimonSapin could want to put some eyes on it.

Depends on https://github.com/servo/rust-selectors/pull/81

Source-Repo: https://github.com/servo/servo
Source-Revision: 407f991c8aba5dcf5312bb2c34a3dd4fe12e5471
2016-04-29 14:27:16 -07:00
Michael Howell
802d6fe7b4 servo: Merge #9586 - Details ui (from notriddle:details_ui); r=SimonSapin
Requires a patch to rust-selectors, and doesn't currently recalculate the styles correctly (which is needed to make actual toggling work correctly).

Still trying to figure out what it takes to get style recalc to do what this needs.

Source-Repo: https://github.com/servo/servo
Source-Revision: 090da52913a47e027a96d4f6a39c56e55b9db811
2016-03-20 12:58:59 +05:01
Emilio Cobos Álvarez
b1dd4fcd79 servo: Merge #9567 - style: Make the whole style crate independent of the implementation (from emilio:general-pseudo-element-parsing); r=bholley,SimonSapin
This allows, among other things, having different implementations for parsing pseudo{elements, classes} in both `ports/geckolib` and in servo.

Source-Repo: https://github.com/servo/servo
Source-Revision: c11844cbf28054784c8d65781cff20045d8ee48b
2016-02-14 03:30:59 +05:01
Bobby Holley
a5868c1c28 servo: Merge #9051 - Split layout wrappers into style+layout and layout-only functionality (from bholley:split_style_and_layout_wrappers); r=SimonSapin
This is a step towards removing the dependency of stylo on layout/.

This PR depends on #9004.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0f5c614609fd8867a9e7c27b8a398ea7d877c714
2015-12-30 09:35:14 +05:01
Patrick Walton
0f5d421cf7 servo: Merge #7423 - layout: Make the compositor rather than layout determine the position of each iframe (from pcwalton:iframe-stacking-context-position); r=glennw
The old code that attempted to do this during layout wasn't able to work
for multiple reasons: it couldn't know where the iframe was going to be
on the page (because of nested iframes), and at the time it was building
the display list for a fragment it couldn't know where that fragment was
going to be in page coordinates.

This patch rewrites that code so that only the size of an iframe is
determined during layout, and the position is determined by the
compositor. Layout layerizes iframes and marks the iframe layers with
the appropriate subpage ID so that the compositor can place them
correctly.

Closes #7377.

Source-Repo: https://github.com/servo/servo
Source-Revision: a0cb657fe80859dd8862361631268479d1045432
2015-09-29 19:26:49 -06:00
Manish Goregaokar
cf0446c9f9 servo: Merge #7536 - More clippy fixes (from Manishearth:clippyfix); r=Ms2ger
Elided almost all the lifetimes and removed needless returns. Mostly done by sed + manual fixes.

r? @nox

Source-Repo: https://github.com/servo/servo
Source-Revision: c2c2646d37614ece5869af861993c3d619f6e003
2015-09-04 07:59:04 -06:00
erneyja
c4747f6c7e servo: Merge #7468 - Making test-tidy check that = have space after them (from JoshTheGoldfish:Issue7460); r=jdm
For issue #7460. Need to ensure compatibility with #7390.

Source-Repo: https://github.com/servo/servo
Source-Revision: 15de679f115f06a8ce33625d77e820b049730d4b
2015-09-01 08:33:02 -06:00
João Oliveira
8410286b02 servo: Merge #7225 - Replace uses of for foo in bar.iter() and for foo in bar.iter_mut() (from jxs:master); r=nox
closes #7197

Source-Repo: https://github.com/servo/servo
Source-Revision: a1b3f477aa541fda4d1b6ccb02c3e56143f4d217
2015-08-15 03:03:21 -06:00
Michael Wu
fac8c79199 servo: Merge #6546 - Remove LayoutChan from LayoutDataWrapper (from michaelwu:slim-layoutdatawrapper); r=Ms2ger
Saves 32 bytes in Node.

Source-Repo: https://github.com/servo/servo
Source-Revision: cc73aad447f0455606a5a6005d31aa55334668a8
2015-07-05 21:39:12 -06:00
Ms2ger
e448407e4d servo: Merge #6443 - Various layout cleanup (from Ms2ger:cleanup-layout); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 469b9550f6feec56d87ea5c772cb76453c13036a
2015-06-24 03:00:32 -06:00
Patrick Walton
c918f5d92e servo: Merge #5911 - layout: Allow inline elements to be containing blocks for absolutely-positioned elements (from pcwalton:absolute-inline-containing-blocks); r=mbrubeck
r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: c0ee952a2a7054dcc7e97990a625c281322dd526
2015-05-13 14:27:21 -05:00
Manish Goregaokar
5dbe6eb389 servo: Merge #5296 - Replace unsafe_blocks by unsafe_code (from servo:unsafe_code); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 29a36adbe7d87fb38ba9bef3a718c6c823fb5977
2015-03-21 05:12:45 -06:00
Dan Fox
f6711c6464 servo: Merge #5135 - Fix 5120 rename layout util (from iamdanfox:fix-5120-rename-layout-util); r=jdm
A simple rename/refactor (https://github.com/servo/servo/issues/5120)

My first servo contribution!

Source-Repo: https://github.com/servo/servo
Source-Revision: 7fc37dfaa76c9265e6d2145fe5ef2fba5f6bd013
2015-03-05 11:09:58 -07:00