This is a direct extract from my abandoned PR for a lint (#7546), along with some rather clumsy modifications (only on `components/script/dom/mod.rs` and `components/style/lib.rs`), because I had to sort some of the files again to make peace with tidy, which hasn't been educated about sorting yet!
Source-Repo: https://github.com/servo/servo
Source-Revision: a7208869f2903e36f9b2f540b55b50283d7df466
Support `var()` in shorthand properties, and fix various bugs.
r? @pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 1b6d4daf85d672265824a014dba99c94c8c08814
Known issues:
* The caret doesn't show up if there's no text present, because we don't create text runs in that case. This should be a followup.
* Text runs don't support decomposing ligatures into their constituent subglyphs for advance computation, so the caret won't appear inside a ligature. This is a text run bug.
r? @mbrubeck
Source-Repo: https://github.com/servo/servo
Source-Revision: 6cd098da302db85975d0967ddee836f04eae3bd5
Use box tree characters to make DisplayLists easier to scan when
printing them out.
This is what the output looked like before:
```
#### start printing display list.
"####" Stacking context at Rect(800px×608px at (0px,0px)) with overflow Rect(800px×608px at (0px,0px)):
#### SolidColor(0,0,0,0). Rect(800px×608px at (0px,0px))
#### SolidColor(0,0,0,0). Rect(784px×0px at (8px,0px))
#### SolidColor(0,0.5019608,0,1). Rect(100px×100px at (0px,0px))
#### Child layers list length: 1
"########" Stacking context at Rect(100px×100px at (0px,0px)) with overflow Rect(100px×100px at (0px,0px)):
######## SolidColor(1,0,0,1). Rect(100px×100px at (0px,0px))
######## Child layers list length: 1
"############" Stacking context at Rect(100px×100px at (0px,0px)) with overflow Rect(100px×100px at (0px,0px)):
```
This is what it looks like after this patch:
```
┌ DisplayList
│ ├─ Layered StackingContext at Rect(800px×608px at (0px,0px)) with overflow Rect(800px×608px at (0px,0px)):
│ │ ├─ Block Backgrounds and Borders
│ │ │ ├─ SolidColor rgba(0, 0, 0, 0) @ Rect(800px×608px at (0px,0px)) (7f926f46f1f0)
│ │ │ └─ SolidColor rgba(0, 0, 0, 0) @ Rect(784px×0px at (8px,0px)) (7f926f46f2e0)
│ │ ├─ Layered StackingContext at Rect(100px×100px at (0px,0px)) with overflow Rect(100px×100px at (0px,0px)):
│ │ │ ├─ Backgrounds and Borders
│ │ │ │ └─ SolidColor rgba(1, 0, 0, 1) @ Rect(100px×100px at (0px,0px)) (7f926f46f310)
│ │ │ ├─ Layered StackingContext at Rect(100px×100px at (0px,0px)) with overflow Rect(100px×100px at (0px,0px)):
│ │ ├─ Layered StackingContext at Rect(100px×100px at (0px,0px)) with overflow Rect(100px×100px at (0px,0px)):
│ │ │ ├─ Backgrounds and Borders
│ │ │ │ └─ SolidColor rgba(0, 0.5019608, 0, 1) @ Rect(100px×100px at (0px,0px)) (7f926f46f3a0)
```
Source-Repo: https://github.com/servo/servo
Source-Revision: 4e9a888f1ac58866833418ee5e8253358918b741
Thanks to @Jinwoo-Song for the original commit, which I just rebased and cleaned up. Fixes#6237.
Source-Repo: https://github.com/servo/servo
Source-Revision: 6a12f00d6d392651bae10365b4c806f36d704b21
Fix#7609, "error: unable to create file tests/ref/hello_a?foo#bar.html (Invalid argument)" during git checkout on Windows.
Behavior change: passing an nonexistent file name on the command line now shows a blank page (like network errors) rather than exit with an error message.
Source-Repo: https://github.com/servo/servo
Source-Revision: 815e981c69f6fe09bcbf3c1937ed817f2cd38813
This allows for situations where there is no reasonable default
to apply for the pref value e.g. when we are just listing values
Source-Repo: https://github.com/servo/servo
Source-Revision: 9d4217990060b3d2c93a4b39fe391985f01a5979
*The goal of this PR is to get early feedback on this before I go too far down the rabbit hole. This new code path is working, and there's several tests I've written as a proof of concept. There are still some regressions that I'll be fixing in the coming days.*
I've abstracted out the request/response cycle so that it's no longer dependent on the Hyper request/response structs. Since request/response @ hyper are structs, not traits, it made mocking them for tests impossible.
Current issues/concerns:
* This relies on boxing the `HttpResponse` that gets returned from the `HttpRequester` because `HttpResponse` is unsized. I don't know if there's a more idiomatic rust-y way of doing this?
* This relies on boxing the `Read` that is now returned from `load` for the same reason.
* The devtools and resource manager channels are still passed into `load`. It might be easier to inject these as trait dependencies instead of chans as well?
* Needs more tests.
🎩#6727
Source-Repo: https://github.com/servo/servo
Source-Revision: 7dda183022f9bee8b4bdffe8b4cf31e09b885d94
I fear the category names are unimaginative; in some cases they may even be misleading or downright incorrect. Requests to rename categories as well as any other feedback are highly appreciated.
Source-Repo: https://github.com/servo/servo
Source-Revision: 6431e8da43817e8a6b1e4757afbcf45c1a629707
Expands on the work by @wilmoz and cleans up the existing errors. Closes#7180. Closes#7111.
Source-Repo: https://github.com/servo/servo
Source-Revision: e74825f9fde8e222f4ba9bb24b2c2a3864c73e5f
Refs: https://github.com/servo/servo/issues/7142
Ran some basic functional tests:
```
$ ./mach run -d -Z bubble-widths,disable-canvas-aa,trace-layout tests/ref/blur_ref.html
$ ./mach run -d -Z help
Usage: /Users/greg/servo/target/debug/servo debug option,[options,...]
where options include
Options:
bubble-widths Bubble intrinsic widths separately like other engines.
disable-text-aa Disable antialiasing of rendered text.
disable-canvas-aa Disable antialiasing on the HTML canvas element.
dump-flow-tree Print the flow tree after each layout.
dump-display-list Print the display list after each layout.
dump-display-list-json Print the display list in JSON form.
dump-display-list-optimized Print optimized display list (at paint time).
relayout-event Print notifications when there is a relayout.
profile-tasks Instrument each task, writing the output to a file.
show-compositor-borders Paint borders along layer and tile boundaries.
show-fragment-borders Paint borders along fragment boundaries.
show-parallel-paint Overlay tiles with colors showing which thread painted them.
show-parallel-layout Mark which thread laid each flow out with colors.
paint-flashing Overlay repainted areas with a random color.
trace-layout Write layout trace to an external file for debugging.
validate-display-list-geometry Display an error when display list geometry escapes overflow region.
disable-share-style-cache Disable the style sharing cache.
parallel-display-list-building Build display lists in parallel.
replace-surrogates Replace unpaires surrogates in DOM strings with U+FFFD. See https://github.com/servo/servo/issues/6564
gc-profile Log GC passes and their durations.
$ ./mach run -d -Z blah
error: unrecognized debug option: blah
Servo exited with return value 1
```
Didn't check that setting debug flags actually did anything.
Haven't written much Rust so this feels more verbose than necessary.
Added `disable-canvas-aa` to debug options help.
Should DebugOptions struct derive Clone like Opts does?
Source-Repo: https://github.com/servo/servo
Source-Revision: f5e97ef1b54b7f85d9c5a55712e802dd70a89f8e
Also adds HeapSizeOf implementations/derive for some types. I've used "Cannot calculate Heap size" as a reason everywhere, because my imagination is rather limited. If you'd like me to change this message for specific types, please write something like this: "Trusted - Cannot calculate Heap size for Trusted" so that it would be easier for me to replace them through a script :)
Source-Repo: https://github.com/servo/servo
Source-Revision: a03616f379c255cc6c9b6e1d04dd7d98bd9926ce
Fixes#4331. I've tested this out on desktop and Android on "the usual" sites (reddit, cnn, github, wikipedia, etc.).
r? @mbrubeck @metajack
Source-Repo: https://github.com/servo/servo
Source-Revision: 049cee1b5eaba598b71620fb842662c137f7f92d
Large improvement in page load times, especially in debug builds.
r? @jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: d4d4d6dc013ee322282de7ec0effa54c8827a775
Add support for user stylesheets, and provide one to tests with an `@font-face` rule for it.
Fix#6195.
Many previously-failing tests now pass, and a few previously-passing now fail.
Among the latter, `font-family-013.htm` and `fonts-013.htm` are testing that the Ahem font is not used for characters it doesn’t have a glyph for. They were passing because Ahem was not available at all, and now fail because we don’t implement font fallback correctly.
The others also use Ahem, but I don’t understand yet what’s going on exactly.
Source-Repo: https://github.com/servo/servo
Source-Revision: 08987e3eda370e3eb00876c7f5efdebf3ba0265a
…s for frame treese in script tasks.
This underreports by a significant amount, since only Document, Window and CharacterData (ie. text) nodes are fully represented. That being said, every HTML element in the tree is measured, but only counted as a Node. It's easy to improve this, it just requires adding the appropriate HeapSizeOf derives and increasing the granularity of `measure_memory_for_eventtarget`. google.com shows a dom-tree value of 0.24 MB for me at the moment.
r? @nnethercote
Source-Repo: https://github.com/servo/servo
Source-Revision: 84e25befdd97cf74fb00707dbe150d59d980e977
32-bit floats are not enough to hold timestamps since the epoch and
result in jank.
r? @metajack
Source-Repo: https://github.com/servo/servo
Source-Revision: 92cbb9368471d12f0d5492abd7e04b16df549366
This change makes Servo use serialized messages over IPC channels for resource loading. The goal is to make it easier to make Servo multiprocess in the future. This patch does not make Servo multiprocess now; there are many other channels that need to be changed to IPC before that can happen. It does introduce a dependency on https://github.com/serde-rs/serde and https://github.com/pcwalton/ipc-channel for the first time.
At the moment, `ipc-channel` uses JSON for serialization. This is because serde does not yet have official support for bincode. When serde gains support for bincode, I'll switch to that. For now, however, the JSON encoding and decoding will constitute a significant performance regression in resource loading.
To avoid having to send boxed `AsyncResponseTarget` trait objects across process boundaries, this series of commits changes `AsyncResponseTarget` to wrap a sender only. It is then the client's responsibility to spawn a thread to proxy calls from that sender to the consumer of the resource data. This only had to be done in a few places. In the future, we may want to collapse those threads into one per process to reduce overhead. (It is impossible to continue to use `AsyncResponseTarget` as a boxed trait object across processes, regardless of how much work is done on `ipc-channel`. Vtables are fundamentally incompatible with IPC across mutually untrusting processes.)
In general, I was pretty pleased with how this turned out. The main changes are adding serialization functionality to various objects that `serde` does not know how to serialize natively—the most complicated being Hyper objects—and reworking `AsyncResponseTarget`. The overall structure of the code is unchanged, and other than `AsyncResponseTarget` no functionality was lost in moving to serialization and IPC.
r? @jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 2eb122f394651232abd683fc576a5c4288bf277f
StrExt::slice_chars is deprecated and will be removed in Rust. This
lifts the implementation from Rust libstd and puts it in util::str.
This fixes a bunch of deprecation warnings in Servo.
Source-Repo: https://github.com/servo/servo
Source-Revision: a54404c92180b839d2cf089d9ec9a6afe8bd5ba3
This patch set introduces the `--multiprocess` (`-M`) switch. Right now, all it does it cause display lists to be serialized, but eventually it will cause actual processes to be spawned.
r? @metajack
Source-Repo: https://github.com/servo/servo
Source-Revision: c4480b5d0309acc7f154166b91992f73a85de57f
It's not quite done but can probably be reviewed anyway.
I still need to finish up a few of the ToCss impls, I just got lazy and wanted to make sure things worked.
The computation of the used values is definitely not right, I'm going to investigate that.
Source-Repo: https://github.com/servo/servo
Source-Revision: acbca7b3aaf18866f7a1a79d9684149897bf4305
To actually make the multiprocess communication work, we'll need to
reroute the task creation to the pipeline or the compositor. But this
works as a first step.
r? @jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 1764267379a00b96a1df89f3917299a0c6fd325c
This re-orders text according to the Unicode bidirectional layout algorithm, using the [unicode-bidi](https://github.com/mbrubeck/unicode-bidi) crate. It uses the natural order of the text based on Unicode character properties and the CSS `direction` property.
This does not yet support the CSS `unicode-bidi` property or the HTML `dir` attribute, but these should be straightforward to add.
r? @pcwalton. Also depends on servo/unicode-bidi#4.
Source-Repo: https://github.com/servo/servo
Source-Revision: d3a36fafd948d7b9366feeca44f9ca9ad012d706
…lel.
This should allow #6490 to land, since it's hitting problems with unit tests that create a resource task and therefore race on calling opts::get().
Source-Repo: https://github.com/servo/servo
Source-Revision: 126f5ae8f0a1041aa881b5b8d9396d0957b16036
Also updates glutin with a crash fix that was exposed by this patch.
Source-Repo: https://github.com/servo/servo
Source-Revision: 5ac80bff8e25be65e96daaf6b7403b11d23d561a
This checks every .toml file for an asterisk and prints an error if found.
Source-Repo: https://github.com/servo/servo
Source-Revision: 58e9bc6583b6ebbeb27e3b28a6b271ee48cd695a
This commit introduces the `serde` dependency, which we will use to
serialize messages going between processes in multiprocess Servo.
This also adds a new debugging flag, `-Z print-display-list-json`,
allowing the output of display list serialization to be visualized.
This will be useful for our experiments with alternate rasterizers.
r? @metajack
Source-Repo: https://github.com/servo/servo
Source-Revision: ef9715203edf0a280d019b6e8823666f0e7020be
This was the preferred pattern between the deprecation of Vec::from_elem and
the addition of the count argument to the vec![] macro.
Source-Repo: https://github.com/servo/servo
Source-Revision: 556c0e1509cb48b90f492bcf0f25d0ed14b015d1