Resolves#9222. Moved Epoch from components/msg/compositor_msg to
components/gfx_traits/lib. Updated use statements to reflect the move.
Source-Repo: https://github.com/servo/servo
Source-Revision: e89dd05a169aa16267bdb2dbfe5bca01ad6cfe84
DisplayListSection, StackingLevel, and BackgroundAndBorderLevel all
represent pretty much the same thing, a particular section of the
display list. Instead of maintaining three enums which do the same
thing, just use DisplayListSection everywhere. It's a superset of the
other two and this change will make it easier to flatten the DisplayList
in the future for WebRender.
Source-Repo: https://github.com/servo/servo
Source-Revision: be555a9409c949bea7287b0e21df009bce3cb328
This helps WebRender look for useless clips and optimize them out.
r? @glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: 58111a6420d3edded1cb66efa7c9863f1b3cdd8e
Currently, servo panics for me when loading something like this:
```
@font-face {
font-family: "test family";
src: local(test font face);
}
```
That's due to a bug in `FontCacheTask`. `FontCacheTask` tries to get the value for the key
"test font face" from `self.web_families`, but previously initialized a value for the key "test family".
These two commits add an awkward test and fix the bug by not shadowing the variable `family_name`. Since the argument to `local()` should explicitly not be the name of a font family, the previous variable name was wrong and misleading anyways.
Source-Repo: https://github.com/servo/servo
Source-Revision: 8e75a05e6bea78d388e6409020f3279a090c9168
It's not clear to me that it actually helps. Moreover, it's wrong and
results in fonts randomly changing e.g. on GitHub when mousing over
elements.
r? @mbrubeck
Source-Repo: https://github.com/servo/servo
Source-Revision: 6eb28c7fd829892842de6b5c4ae9166e8908a312
This fixes about 130 clippy lints. Let me know if i should split up the commit.
I wasn't sure about some of the changes, especially map_or instead of map(...).unwrap_or(...) and if let instead of single arm match were not always a strict improvement in my opinion, but i'll leave that decision to the reviewer :)
There are about 150 lints left which i thought were clippy bugs or i didn't know how to fix.
cc @Manishearth
Source-Repo: https://github.com/servo/servo
Source-Revision: 9da739acefc7d1776bf727c8bf782eb79f241028
This is a rebase of #7842 that also adds a test.
Fixes#4183.
@Yoric, how's this look to you?
Source-Repo: https://github.com/servo/servo
Source-Revision: af1690f3036bc329101bbd6f4e877672d58ca5e0
https://github.com/servo/servo/issues/8371
In addition to replacing loose strings with the FontFamily enum in `font_cache_task.rs`, I also centralized the add_generic_font calls into one single function. If centralizing into one function is not desired or if anything else needs to be changed, please let me know.
Source-Repo: https://github.com/servo/servo
Source-Revision: 66c8aa8cdac24ad956be5e99be3b7bc07c5f798c
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
This changes several tests that contain <iframe></iframe> from FAIL to TIMEOUT. This is correct
since there is a bug that prevents these iframes from ever rendering.
~~~There are also a few previous FAILs that changed to OK. These may be intermittents or they
may genuinely be fixed by this change.~~~
Source-Repo: https://github.com/servo/servo
Source-Revision: c6ae32abdde715dbdc3097a40ab7abdbc98cf4b0
The combined effects of these optimizations move `advance_for_range` from #1 in the layout profile on all sites I tested to #2, #3, or #4, depending on the site.
r? @mbrubeck
Source-Repo: https://github.com/servo/servo
Source-Revision: 67c3cb37073068fe8be7b35b26469e2e329ce385
On http://en.wikipedia.org/wiki/Spotted_hyena, I was seeing a 100% miss
rate in the first fast cache lookup and 45% of total layout time in this
function. After making this change, the first cache lookup almost always
succeeds, and the time spent in this function drops to 8%.
r? @mbrubeck
Source-Repo: https://github.com/servo/servo
Source-Revision: ebe3295424a4e2895657ef0defa5c90b4cd16718
This is a proposed in servo/servo#8792 clean up.
Fixes#8792.
Source-Repo: https://github.com/servo/servo
Source-Revision: 2dbc314e2dec39b8798d4e922dd5220d32083b56
This is a proposed in servo/servo#8791 clean up.
Fixes#8791.
Source-Repo: https://github.com/servo/servo
Source-Revision: 68922e0ac2e36d10dd5f079ecae5de7c07cd1253
This makes the initial download for skia go from a 300 MB git repository to a 5 MB tarball. This should help with issues like #6132 and #7687.
Fix https://github.com/servo/skia/issues/70
This builds, but the at the moment causes a number of tidy errors for duplicated crates.
Source-Repo: https://github.com/servo/servo
Source-Revision: 8b95d7b8d860ec4c0834192083361a9fb78ddbeb
Updated string_cache to 0.2, and updated the dependencies that depend on string_cache.
Removed references to string_cache_plugin.
Import atom! and ns! from string_cache.
Replaced ns!("") by ns!().
Replaced ns!(XML) and co by ns!(xml) and co.
Replaced Atom::from_slice by Atom::from.
Replaced atom.as_slice() by &*atom.
r? @SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: 188fa9378c103093f1f8dac24bff0d9d237fd2bc
Multiprocess mode is enabled with the `-M` switch, and sandboxing is
enabled with the `-S` switch.
Rebase of #6884.
Source-Repo: https://github.com/servo/servo
Source-Revision: 8b39b9afed6ef8a3d7d3e6609fd301a37825d3e1
When new_actual_size < old_actual_size, there is an overflow panic since we're using usize. This breaks Reddit for me.
Source-Repo: https://github.com/servo/servo
Source-Revision: 8950345e0e2c803cfa87105374dfdb30a550cfe0
I created draft. I'm not sure if we need any units conversion in PaintContext. There is also strange 'clear' method, we use PagePx origin and ScreenPx size is it OK?
Source-Repo: https://github.com/servo/servo
Source-Revision: 8d8ffa8265d67e0ec89cf2d37d1c549b47187cca
Always produce a DisplayList when processing nodes for display list
construction. StackingContexts are now added to the positioned content
section of DisplayLists. This makes the code a bit simpler and opens up
the possibility of producing a StackingContext in another section of
the DisplayList. This doesn't change behavior, but is a cleanup
prerequisite for proper inline stacking context support.
Source-Repo: https://github.com/servo/servo
Source-Revision: da25b8c848886d2fc875008de5adcaf13d7c9e99
Sometimes positioned content needs to be layered on top of stacking
contexts. The layer synthesis code can do this, but the current design
prevents it because stacking contexts are stored in a separate struct
member. In order to preserve tree order, mix stacking contexts into the
positioned content list, by adding a new StackingContextClass
DisplayItem. Such items do not have a base DisplayItem.
In some ways this simplifies the code, because we no longer have to
have a separate code path in the StackingContextLayerCreator.
Source-Repo: https://github.com/servo/servo
Source-Revision: 86e3add8fdc35fc6980bb63695781925607437b8
Before passing these layers to the paint task, expand them to pixel
boundaries. This ensures that subpixel edges of the layer will not be
clipped away and helps prevent rounding issues with layer contents.
Fixes#8166.
Source-Repo: https://github.com/servo/servo
Source-Revision: 94ca87e7ddc07160b9205c0112b60b0a951f0742
Instead of always promoting iframes to StackingContexts, integrate them
into the display list. This prevents stacking bugs when
non-stacking-context elements should be drawn on top of iframes.
To accomplish this, we add another step to ordering layer creation,
where LayeredItems in the DisplayList are added to layers described by
the LayerInfo structures collected at the end of the DisplayList.
Unlayered items that follow these layered items are added to
synthesized layers.
Another result of this change is that iframe layers can be positioned
directly at the location of the iframe fragment, eliminating the need
for the SubpageLayerInfo struct entirely.
Iframes are the first type of content treated this way, but this change
opens up the possibility to properly order canvas and all other layered
content that does not create a stacking context.
Source-Repo: https://github.com/servo/servo
Source-Revision: 11d23a41b31c2b2846d1e9c6b40e87ba7e2a095f
This is mostly straightforward. I had to modify a couple of places
which were accidentally discarding whitespace.
Fixes#1513.
This fixes some relevant tests from the CSS testsuite... but a lot of
them are either manual, or don't pass because of unrelated issues. (For
example, white-space-mixed-002 renders correctly, but
white-space-mixed-002-ref doesn't because of a float bug.)
I'd appreciate any suggestions for how to go about adding tests for this.
Source-Repo: https://github.com/servo/servo
Source-Revision: c3ab71109ee2ffcc31b40890f4c6739d8f5b1333
Layers that are composed of several stacking contexts that need to be
rendered on top of other layered content need synthesized layers.
Previously, these layers were placed into a stacking context that was
the same size as their parent. This patch creates a new type of
PaintLayer which simply holds a display list. The layer is sized to the
bounds of the DisplayList and its children are positioned relative to
the parent stacking context.
This will also be useful in the future, when items outside of
StackingContexts are given their own layer for render order purposes.
Source-Repo: https://github.com/servo/servo
Source-Revision: 6d52bdf4ffd5479780df4a3fb0ff07bd7378720e
Only supported in WebRender (with my upcoming PR) for now.
r? @mbrubeck
Source-Repo: https://github.com/servo/servo
Source-Revision: 5eb1c04e7854d932c0d63f9e5ed4d54ee43deb9b
This fixes an issue whereby normal text would intermittently be rendered as
small-caps and vice versa.
Source-Repo: https://github.com/servo/servo
Source-Revision: c0b397db77b87f02d1742efd71f526ba6e89197b
This doesn't change any functionality, but it's the first step towards removing SubpageId.
Adding this change now will allow us to gradually change over code referencing subpage id rather than in one massive PR.
Introduces a namespace for pipeline ID generation - there is a namespace for the constellation thread, and one per script thread.
Source-Repo: https://github.com/servo/servo
Source-Revision: 098bdb5f22500a6e856b085a1140090f63ef8645
StackingContexts are added to layers when it is necessary to maintain
their ordering on top of other layered StackingContexts. Instead of
tracking the information about a layer scattered around into different
structs, combine it all into LayerInfo. LayerInfo will be used in the
future to hold layer information for DisplayItems that are layerized
independently of StackingContexts.
Source-Repo: https://github.com/servo/servo
Source-Revision: 27d468b6674b81c396aa0a13d8fe9eb410c12d6e
Depends on servo/rust-azure#201 and pcwalton/ipc-channel#10.
Closes#7422.
r? @mbrubeck (don't r+ until the upstream dependencies have landed)
cc @jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: e2048d57c4c0602c5a6b82db8cb76e6c3e5467fa
This will allow us to hit test into DisplayLists that are not directly
contained in StackingContexts, but instead are children of PaintLayers.
It also makes things slightly simpler.
Source-Repo: https://github.com/servo/servo
Source-Revision: b1d9f438b79743e03cb5b81a0e36f336943e940e
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
Depends on servo/rust-harfbuzz#53 and introduces a dependency on the new servo/unicode-script crate. r? @pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: a144d086d911375f8d5674ac90ff55a9dcaf0cda
When one border is 0px and the other is >0px then the border corner
drawing code panics when computing the values to use in drawing the
border corner arcs.
This fixes that bug and makes the `draw_corner` function more robust
by explicitly passing an enum, `BorderCorner`, naming which corner is
being drawn e.g. `BorderCorner::TL`.
Add a ref test,
`border_radius_zero_sizes_a.html/border_radius_zero_sizes_ref.html`.
Fixes https://github.com/servo/servo/issues/7700.
r? @pcwalton or @mbrubeck
Source-Repo: https://github.com/servo/servo
Source-Revision: 4d1be2f56cd7a37c4c803ba12733fca55b57d4de
This will be useful when PaintLayers that contain DisplayLists instead
of StackingContexts need to draw themselves. This is a simple
preparatory refactoring and doesn't change any behavior.
Source-Repo: https://github.com/servo/servo
Source-Revision: 09b970af4aeba749146a9a9215e346653016672b
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
cgaebel had a TODO for a css twitter fail whale reftest, which depended on elliptical border-radius support.
I didn't see any feasible way other than a reference image for border_twitter_fail_whale_b.html.
r? @pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: c91c0188f279b9d7edf706fc7ad3111948156ed6
Currently pseudo-elements, like the fragments created for ::before and
::after, with layers will have the same LayerId as the body of their
owning fragments. Instead all LayerIds should be unique.
Fixes#2010.
Source-Repo: https://github.com/servo/servo
Source-Revision: cf13e806fe2f4cf5ad5f30efd16d7bd3f501f8b3
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
Hi guys,
I just gave a big pass of RFC-0344 as per issue #6224 .
Pretty much renamed all the get_* fn that were used to fetch values.
I hope I didn't rename too much.
As said in the issue discussion, I didn't touch at the scripts folder so we keep the unsafe ones pretty explicit.
I've ran the whole pass of test, everything seems to be still working right :).
Please give feedback on this PR.
Thanks for looking into it.
Source-Repo: https://github.com/servo/servo
Source-Revision: b05f4aa3aa3085e65cb75433ae37bf272216d033
In advance_for_char_range add a fast SIMD code path for the the common
case where there are no detailed glyphs.
r? @mbrubeck
Source-Repo: https://github.com/servo/servo
Source-Revision: c83825938346f794790bcd1343b7375e9e34f443
In to_nearest_azure_rect when rounding to pixel coordinates, maintain
the invariant of rect non-overlap (if before rounding two rects don't overlap).
The previous code rounded the rect top left corner to the nearest pixel with
the size rounded to the nearest pixel multiple which can violate the
non-overlap condition, e.g.
10px×9.60px at (0px,6.6px) & 10px×9.60px at (0px,16.2px)
would round to
10px×10.0px at (0px,7.0px) & 10px×10.0px at (0px,16.0px), which overlap.
Instead round each corner to the nearest pixel.
For rects that dont need to satify the non-overlap condition and with
width or height between 0.5px and 1px, rounding each rect corner to the
nearest pixel can yield an empty rect e.g.
10px×0.6px at 0px,28.56px -> 10px×0px at 0px,29px.
For this scenario a new function to_nearest_non_empty_azure_rect
rounds the rect top left corner to the nearest pixel and the rect size
to the nearest pixel multiple. It's possible for non-overlapping rects
after this rounding to overlap.
This should fix https://github.com/servo/servo/issues/7184 "rounding ...borders not to be visible", without breaking https://github.com/servo/servo/issues/7152 "Underlines less than 1px high sometimes invisible".
r? @mbrubeck
Source-Repo: https://github.com/servo/servo
Source-Revision: f29ddb4b5d5eed595df37fa989511d2cb3aa8dfd
StackingContexts that should be painted on top of StackingContexts that
are already layerized should automatically get their own layer. This
will ensure proper painting order.
Source-Repo: https://github.com/servo/servo
Source-Revision: c0381c732569b9abe6282c6c750533bc271a2019
Previously, StackingContexts might have a PaintLayer. We switch the
ownership, for several reasons:
* We want PaintLayers to potentially contain something other
than a StackingContext soon.
* We want to delay the creation of PaintLayers until the last
minute, so that we can synthesize new layers for sandwiched
content.
This commit also implements the second goal. Instead of creating
PaintLayers during layout itself, wait until we are sorting and
layerizing a completed DisplayList.
Source-Repo: https://github.com/servo/servo
Source-Revision: 8e0b010117889550effa3ad793e7ee8f9b692b40
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
This necessitated changing overflow to be calculated by the parent flow
if relatively positioned children are present. That is because the
overflow regions cannot be calculated without knowing relative offsets,
which themselves cannot be calculated without knowing the parent size
(because of percentages). To accomplish this without sacrificing
parallelism in the non-relative case, this patch splits overflow into
"early" and "late" computation. Late overflow computation cannot be
parallelized across children, while early overflow computation can.
Makes the "Apple Music" text show up over the full-bleed promotional
background on apple.com.
r? @SimonSapin -- would appreciate a look over the iframe test case that was changed.
Source-Repo: https://github.com/servo/servo
Source-Revision: dcaf66397a06246b9b4fdca3a10af1508a11f1e8
When the border-top/right/bottom/left-widths are not equal, the angle on the border corner arc separating the borders isn't PI/4.
For instance if the top border width is much larger than the left border width then most of the border corner should be drawn using the top border color.
This change adds support for calculating the correct angle in the border
corner arc for switching from one border to another e.g. the left border
to the top border.
It supports elliptical border radii for when elliptical border radii are
added.
A ref test is also included.
r? @Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: afc2c381db9c85eba3c10e87966351f77678dc6e
This patch is in preparation for more dynamic layerization of the
pieces of display lists. It also prevents having to sort the children
by z-index multiple times.
Source-Repo: https://github.com/servo/servo
Source-Revision: fa5ad1c6b4faa2c43ff79e77962b94034a4f2bd0
Fixes placement of the header on espn.go.com.
r? @glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: a1cd27e6a3b961129fd4710513cc29e4f7c9cc67
and `for foo in bar.iter_mut(), and for foo in bar.into_iter()
(continuation of #7197)
Source-Repo: https://github.com/servo/servo
Source-Revision: 0d6d6a05009606dfbbfc9765d7dc2c745c18f6a5
It's not ideal, but it was easy to implement and will do for now.
Closes#7157.
r? @glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: f4b526cfb4ea1ef263ff029650c74ff50a74d5db
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
… character boundary" when printing display list.
This whole piece of code seems a bit fragile, but it fixes the immediate problem for now.
Source-Repo: https://github.com/servo/servo
Source-Revision: 7a9458e530a3bd7a679cb21dec8586710cf4a416
Make the structure for the `stretchiness` and `boldness` methods more
similar
Source-Repo: https://github.com/servo/servo
Source-Revision: 55a9abdf358dd8f05b06849f0d39b4e8ca8f6ba3
This patch makes Servo unconditionally strip whitespace before text run
scanning (assuming that the `white-space` property allows it). Whitespace
stripping during reflow is now only used for handling whitespace at the ends of
lines; reflow now never attempts to handle ignorable whitespace.
Many CSS tests pass now. There are some new failures, however.
The following reference tests now fail due to a pre-existing bug whereby
whitespace is used to calculate the position of inline hypothetical boxes for
elements with `display: inline; position: absolute`:
* `absolute-replaced-height-036.htm`
* `vertical-align-sub-001.htm`
* `vertical-align-super-001.htm`
The following reference tests fail due to a pre-existing bug whereby we don't
handle `font-size: 0` properly in inline reflow:
* `font-size-zero-1.htm`
* `font-size-zero-2.htm`
The following reference test fails due to the fact that it relied on our
incorrect insertion of whitespace to make room for the black background:
* `inline-formatting-context-007.htm`
r? @mbrubeck
Source-Repo: https://github.com/servo/servo
Source-Revision: 7dc83e7820df43b1b617ae8dcf661398b0bd0842
Snapping the top-left and bottom-right corners separately can cause a rectangle to change size or even become empty when offset by a subpixel amount. Instead, this patch snaps the top-left corner, then snaps the size to a whole pixel amount, so any rectangle of a given original size will always have the same snapped size.
Fixes#7152. r? @pcwalton or @glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: 9c528c6382ee4355f42824a7caad217c4eb8a3b0
Known issues:
* Display list optimization can sometimes optimize out elements that
should be shown. This affects the Enyo demo.
* The `overflow: scroll` container doesn't clip the inner layer properly
when borders, border radius, etc. are present.
* `overflow-x: scroll` and `overflow-y: scroll` don't work individually;
elements are scrolled all at once.
Note that multiple layers per stacking context aren't needed for the Enyo demo; rather the issue is that the height of the main area is being calculated incorrectly. (It looks like JS is measuring the height and poking in an explicit value that is too tall.)
r? @glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: b05b02e11fb849e1f0153d009d8fcf0501ace8dc
Large improvement in page load times, especially in debug builds.
r? @jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: d4d4d6dc013ee322282de7ec0effa54c8827a775
Tying transitions to the DOM node avoids quadratic complexity when
updating them.
Finishing transitions instantly when styles are updated makes our
behavior more correct.
r? @glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: ffe4bd25a495efd672986f090150b165811b6708
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
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
The allocation APIs require that the alignment is a power-of-two;
meaning 1 is the "I don't care" alignment, not 0.
Source-Repo: https://github.com/servo/servo
Source-Revision: 3792bd7611df7343c1bad6119a07bd14296c9ba6
Now GLRasteizationContexts require having an active GLContext. This will
allow preserving GLContexts and possibly framebuffers between
rasterization sessions, improving GL Rasterization performance.
Linux Before:
+ Painting Per Tile 4.5559 4.3392 1.6920 18.5548 74
Painting 170.1554 151.8353 0.0008 350.1093 28
Linux After:
+ Painting Per Tile 3.8726 3.1299 1.5848 12.6732 62
Painting 13.5480 10.8947 0.0029 39.1198 23
Source-Repo: https://github.com/servo/servo
Source-Revision: ccd341cc68f034df675ffaf80673a1bece078e08
This makes hit tests work on stacking contexts with transforms.
Ref #6643.
Source-Repo: https://github.com/servo/servo
Source-Revision: fff104bb41dea0ba64fdca312de7b4c0d76277c8
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
Uses a couple of extra threads to work around the lack of cross-process
boxed trait objects.
r? @nnethercote
Source-Repo: https://github.com/servo/servo
Source-Revision: f778e0eecf7cd8a2b870d18c3c305ff10d6b1894
We currently store LayerBuffers, because previously NativeSurfaces did
not record their own size. Now we can store NativeSurfaces directly,
which saves a bit of space in the surface cache and allows us to create
LayerBuffers only in the PaintTask.
This also means that instead of sending cached LayerBuffers, the
compositor can just send cached NativeSurfaces to the PaintTask.
Source-Repo: https://github.com/servo/servo
Source-Revision: 590cb33bb7ae9f4713a7c2ee8bfe1076c180e392
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
* Adding dependencies
* Replacing `i8` with `libc::c_char` to build properly on platforms
where char is unsigned.
Source-Repo: https://github.com/servo/servo
Source-Revision: b386d7ae444af868907b9faff44e8432469160bd
- Use SmallVec<[T; N]>
- Make find_iframe a free function
- Make ProgressEvent use enums for bubbles and cancelable
- Change README, as `rust-snapshot-hash` is just a text file
Source-Repo: https://github.com/servo/servo
Source-Revision: aafc3dfa963b466303d5f241d69036f211aaad00
By doing this on either side of the call to the relevant tasks' start()
method, we don't need to store the mem::ProfilerChan or the reporter
name in the task itself.
Source-Repo: https://github.com/servo/servo
Source-Revision: cb52cc66581191b6f787a4a6d0d2844e2968b7eb
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
Now that NativeDisplay can be shared between the compositor and the
paint task, we can move the LayerBuffer cache to the compositor. This
allows surfaces to be potentially reused between different paint tasks
and will eventually allow OpenGL contexts to be preserved between
instances of GL rasterization.
Source-Repo: https://github.com/servo/servo
Source-Revision: 10b0d8c537c226400a617d28e8a060f9ca53d242
--HG--
rename : servo/components/gfx/buffer_map.rs => servo/components/compositing/buffer_map.rs
Fixes jumpiness on lots of Web sites.
r? @mbrubeck
Source-Repo: https://github.com/servo/servo
Source-Revision: bbcd42773342a587a8515f34bdc3ca69a380c0a8
The compositing context, painting context and display metadata have all
been collapsed into a single NativeDisplay class.
Source-Repo: https://github.com/servo/servo
Source-Revision: 4674afe846df6720882da28cbd2c3087c17d0b22
Sorry for not doing it yesterday, I couldn't.
cc @metajack @SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: 4ebb95ccd8e034007eacb447a054919ef4af2bf7
Depends on servo/rust-azure#170 which has been already merged.
So this patch contains the update of rust-azure.
r? @nox
cc @yichoi
Source-Repo: https://github.com/servo/servo
Source-Revision: e1b28d893e54601bf497d0d5b83d77658ca16bac
This will allow reporting of memory usage by FreeType instances, which
are measured in the MiBs for LayoutWorker threads.
This change also makes FreeType allocations happen with jemalloc instead
of the system malloc, which is a good thing.
Finally, the change documents some dubiousness involving
FontContextHandle.
Source-Repo: https://github.com/servo/servo
Source-Revision: fdeebf86a1424e9fffa122efa08fe397f6e7cd7d
The util component specified fnv and smallvec as dependencies and publicly
reexported both of them. Several other components utilized these reexports,
presumably because fnv and smallvec used to live in the tree so reexporting
made the transition easier.
These indirect dependencies through the util component are unnecessary.
This commit removes the fnv & smallvec crate reexports in the util component.
It exchange, it adds fnv & smallvec as dependencies to non-util components
wherever needed. Finally, it removes the fnv dependency from util as it is not
utilized anywhere in the util component.
Source-Repo: https://github.com/servo/servo
Source-Revision: 35000a9b854dc0989cc473aaec0ea8c082521c66
Overlaps a bunch with #6288. Putting this here so @frewsxcv can take a look and we can figure out how to merge our work together.
Source-Repo: https://github.com/servo/servo
Source-Revision: 96311aa9b71abb31fd8e4283de9e1b58813108a3
Fixes#5914
r? @nnethercote for the gfx changes
r? @kmcallister or @jdm for the plugin
Source-Repo: https://github.com/servo/servo
Source-Revision: 2ca606aaba432741ce4e8274835f26db3a3581fc
* Add parser support for 3d transforms.
* Change ComputedMatrix to a representation that suits interpolation.
* Switch stacking contexts to use 4x4 matrices.
The transforms themselves are still converted to 2d and handled by azure for now, but this is a small standalone part that can be landed now to make it easier to review.
Source-Repo: https://github.com/servo/servo
Source-Revision: 05212b702dbafacd3d1d44e600139af8d7516308
Part of #6224
I certainly didn't remove all of them; I avoided `unsafe` areas and also `components/script`
Source-Repo: https://github.com/servo/servo
Source-Revision: f6fe1953343a417b62fb310a380af7c6973849b0
Example output from the memory profiler:
```
| 1.04 MiB -- url(http://en.wikipedia.org/wiki/Main_Page)
| 0.26 MiB -- display-list
| 0.78 MiB -- paint-task # new output line
| 0.78 MiB -- buffer-map # new output line
```
The buffer maps aren't huge, but they're worth measuring, and it's good
to get the memory profiler plumbing into PaintTask.
Source-Repo: https://github.com/servo/servo
Source-Revision: 10127d6b5a71ee8927413ab746300e32a54b079d
This patch turns on antialiasing for the canvas, and updates the painting code to use the updated Azure DrawOptions defined in servo/rust-azure#158.
Source-Repo: https://github.com/servo/servo
Source-Revision: c97c0a9f94208828c617cbd99efd8e3e410c69ee
It is recommended to use FT_Done_Library with FT_New_Library
from freetype document.
Fixes#6191.
r? @jdm @nnethercote
cc @yichoi
Source-Repo: https://github.com/servo/servo
Source-Revision: af81db54790efbeb86ee03e6ca63fb9046c6111a
This improves numerous pages, for example Wikipedia and Ars Technica.
Built on #5493.
Closes#177.
Source-Repo: https://github.com/servo/servo
Source-Revision: 7561f7b83f27811683c1e724d75a935573a72813
I've done a bit of job to get this done. Right now readback is still used, but we have a `LayerId` -> `CanvasRenderer` map on the paint task, that we can use to get rid of that.
I'd want review, to see if this is a good approach (I know it's not the initial `CanvasId` -> renderer approach, but it's pretty similar, since a canvas involves a `PaintLayer`).
I had to do a bit of refactoring to avoid cyclic dependencies between canvas and gfx. I'd want you to review them too.
It's mergeable and doesn't break any tests :P
Some of my main concerns:
* Does the canvas render really need to be behind an `Arc<Mutex<T>>`?
* I can't clone a `NativeSurface` right now (that's why the `SendNativeSurface()` msg is unimplemented in the WebGL task). It should be easy to add that to rust-layers, supposing the caller is responsible to mark it as non-leaking, any reason to not do it?
cc @jdm @pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: ad53e95080144485e74cd9b9d48ce75e20de4e36
--HG--
rename : servo/components/gfx/color.rs => servo/components/gfx_traits/color.rs
I have a number of pcf fonts installed. One of them is Adobe Helvetica, and it turns out many websites try to use Helvetica. This crashes servo.
Source-Repo: https://github.com/servo/servo
Source-Revision: 165bfd6d5f901ef2e2619dbcc010166106cebd0b
This fixes a hang found while testing the jQuery test suite.
Source-Repo: https://github.com/servo/servo
Source-Revision: c51e9f04559f04f1e820b792261e1653c6869ee5
This improves Servo's performance on large pages.
Please double-check the logic when it comes to nested layers—I'm sure I've messed up some of the geometry calculations :)
r? @glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: 0880e54f987bac7c34c934ef6ee36f46475b06e3
--HG--
rename : servo/tests/html/lipsum.html => servo/tests/html/lipsum-large.html
This allows most of the jquery test suite to run without exhausting thread resources.
Source-Repo: https://github.com/servo/servo
Source-Revision: 7e022b25a8ab87897180dcf1b6aff8d9b57adcb4
The basic idea is it's safe to output an image for reftest by testing:
- That the compositor doesn't have any animations active.
- That the compositor is not waiting on any outstanding paint messages to arrive.
- That the script tasks are "idle" and therefore won't cause reflow.
- This currently means page loaded, onload fired, reftest-wait not active, first reflow triggered.
- It could easily be expanded to handle pending timers etc.
- That the "epoch" that the layout tasks have last laid out after script went idle, is reflected by the compositor in all visible layers for that pipeline.
Source-Repo: https://github.com/servo/servo
Source-Revision: 5e61ebaa05e5babb7b2fdd1347b6cdd23df38e62
* Fix queries involving stacking contexts
* The code was double accumulating stacking context origins.
* Handle queries of inline elements.
* The node addresses being compared were incorrect (CharacterData vs. Span)
* Handle ScriptQuery reflows correctly.
* The layout task was skipping the compute absolute positions traversal, so failed before window.onload.
Source-Repo: https://github.com/servo/servo
Source-Revision: 5f6a740190e1e5912d84162c92c6b79365df165a
A rebuild after touching components/profile/mem.rs now takes 48 seconds (and
only rebuilds `profile` and `servo`) which is much lower than it used to be.
In comparison, a rebuild after touching components/profile_traits/mem.rs takes
294 seconds and rebuilds many more crates.
This change also removes some unnecessary crate dependencies in `net` and
`net_traits`.
Source-Repo: https://github.com/servo/servo
Source-Revision: 77f653da2c4120ea7ac1a946d97fc70059d513d4
--HG--
rename : servo/tests/unit/gfx/lib.rs => servo/components/profile_traits/lib.rs
Fixes#5300, which it is a rebase of.
Known issues:
* Collapsed borders do not correctly affect the border-box of the table
itself.
* The content widths of all cells in a column and the content height of
all cells in a row is the same in this patch, but not in Gecko and
WebKit.
* Corners are not painted well. The spec does not say what to do here.
* Column spans are not handled well. The spec does not say what to do
here either.
Source-Repo: https://github.com/servo/servo
Source-Revision: 8a4555cc53bc1bbb21a08eb6f010cb1215034419
* Simpler image cache API for clients to use.
* Significantly fewer threads.
* One thread for image cache task (multiplexes commands, decoder threads and async resource requests).
* 4 threads for decoder worker tasks.
* Removed ReflowEvent hacks in script and layout tasks.
* Image elements pass a Trusted<T> to image cache, which is used to dirty nodes via script task. Previous use of Untrusted addresses was unsafe.
* Image requests such as background-image on layout / paint threads trigger repaint only rather than full reflow.
* Add reflow batching for when multiple images load quickly.
* Reduces the number of paints loading wikipedia from ~95 to ~35.
* Reasonably simple to add proper prefetch support in a follow up PR.
* Async loaded images always construct Image fragments now, instead of generic.
* Image fragments support the image not being present.
* Simpler implementation of synchronous image loading for reftests.
* Removed image holder.
* image.onload support.
* image NaturalWidth and NaturalHeight support.
* Updated WPT expectations.
Source-Repo: https://github.com/servo/servo
Source-Revision: ac0645c2363b5a6ea3930b0857b3a27f1b6d033f
This DL is created at paint time, per tile. To dump, pass -Z dump-display-list-optimized at startup.
Source-Repo: https://github.com/servo/servo
Source-Revision: ca8c0f353c2a13f6dbf7c4597a742d684c84c0d9
Image used to be a trait, but no longer is, so boxing it is no longer
necessary. Fixes#5639.
Source-Repo: https://github.com/servo/servo
Source-Revision: b7f59a36461e6c9eb08b8e48760168d3cb26a400
This fixes a lot of "jumpiness" and removes the `new_line_pos` stuff.
Closes#2260.
r? @mbrubeck
cc @metajack
Source-Repo: https://github.com/servo/servo
Source-Revision: d3478954fd8e3a8374104984efb91a918b5dbb7e
On my laptop, running `./mach test-unit` goes from about 11 minutes to 22 seconds, when run after `./mach build`.
Fix#5291.
Source-Repo: https://github.com/servo/servo
Source-Revision: 017d1053617f6769d7f355e4a97d52ae67e53d1c
--HG--
rename : servo/components/net/test.jpeg => servo/tests/unit/net/test.jpeg
rename : servo/components/script/tests.rs => servo/tests/unit/script/size_of.rs
There are several optimizations here:
* We make font families atoms, to allow for quicker comparisons.
* We precalculate an FNV hash of the relevant fields of the font style
structure.
* When obtaining a platform font group, we first check pointer equality
for the font style. If there's no match, we go to the FNV hash. Only
if both caches miss do we construct and cache a font group. Note that
individual fonts are *also* cached; thus there are two layers of
caching here.
15% improvement in total layout thread time for Facebook Timeline.
r? @glennw (since you last worked on `get_layout_font_group_for_style()` IIRC)
Source-Repo: https://github.com/servo/servo
Source-Revision: ba0d28e0023fce2003d64b9caf97fcdbeb7cdb28
Transition events are not yet supported, and the only animatable
properties are `top`, `right`, `bottom`, and `left`. However, all other
features of transitions are supported. There are no automated tests at
present because I'm not sure how best to test it, but three manual tests
are included.
r? @glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: ebdf1d494b6c986e6dfcb7d8fd3f0ffa126523ed
- Most of util::memory has been moved into profile::mem, though the
`SizeOf` trait and related things remain in util::memory. The
`SystemMemoryReporter` code is now in a submodule
profile::mem::system_reporter.
- util::time has been moved entirely into profile::time.
Source-Repo: https://github.com/servo/servo
Source-Revision: d1268ec9c6633684270015e7b2619181aeb47b8b
--HG--
rename : servo/components/util/time.rs => servo/components/profile/time.rs
Fixes deprecation warnings. Also removes a workaround for a fixed bug in Rust.
Source-Repo: https://github.com/servo/servo
Source-Revision: 2346c9b94055f84a536808e40ad0b596ee21fbf4
--HG--
rename : servo/components/util/dlist.rs => servo/components/util/linked_list.rs
These changeset implements the beginnings of fine-grained measurement of Servo's data structures.
@pcwalton, @jdm: are you likely reviewers for this?
Source-Repo: https://github.com/servo/servo
Source-Revision: f093620922621e1877393b03968ed0ce767fdf12
CGDataProviderCreateWithData just wraps the underlying buffer. The
underlying buffer needs to be kept around until the data provider is
freed. Adding the buffer to the FontTemplateData struct ensures it
sticks around.
Source-Repo: https://github.com/servo/servo
Source-Revision: 4f32596cc65ee75b700089ebe4c6c5a9789559f6
Thread font load errors from platform font loading code to
FontContext::get_layout_font_group_for_style, and cache the failure
result, instead of panicing the thread when a font fails to load.
Before this patch, a failed font load would panic a LayoutTask,
causing a cascade of panics, eventually aborting the whole engine
during a panic within panic.
On my Arch Linux machine almost every page would crash in this manner,
including e.g. reddit.com and cnn.com. Mosf of the requested fonts would
load fine but some single variant of Helvetica would fail always. Not sure
how to create a test for this as it seems pretty system-specific.
Cheers,
cyndis
Source-Repo: https://github.com/servo/servo
Source-Revision: 4bd5aed5005b1a8dba828a178ea9af4277d0d4a7
`background-size` per CSS-BACKGROUNDS § 3.9.
Nearest neighbor interpolation is used for `crisp-edges`, like Firefox.
A note has been added that we could do better if we wanted to.
Multiple backgrounds are not yet supported.
Rebase of #4368. Fixes#4368.
Source-Repo: https://github.com/servo/servo
Source-Revision: e1a50c771973fe3223cf98feea5d570375d68fa9
Move culling of transparent display items to paint task rather than display list builder, so that hit testing detects mouse over on transparent background elements.
Source-Repo: https://github.com/servo/servo
Source-Revision: ac4a690e8fa98da4e4f7adbc2d888a94c6d99e0e
This patch will iterate through the DisplayList after the reflow is done and print its elements (as also any sub-lists associated to a child node stacking context).
Source-Repo: https://github.com/servo/servo
Source-Revision: 67b78983db31128604339e2fd7f391e878cf9f9b
Ready for review.
Final link step on android fails, but we know how to fix it and will add it to this branch soon.
Source-Repo: https://github.com/servo/servo
Source-Revision: 2cc08f289ab909de44fa09a07b2c43b70ce379b9
--HG--
rename : servo/ports/gonk/build.rs => servo/support/rust-task_info/build.rs