| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Lazy load fonts in a FontGroup
The first commit message explains this so I'll just copy it here:
---
This is a step towards fixing #17267. To fix that, we need to be able to
try various different fallback fonts in turn, which would become
unweildy with the prior eager-loading strategy.
Prior to this change, FontGroup loaded up all Font instances, including
the fallback font, before any of them were checked for the presence of
the glyphs we're trying to render.
So for the following CSS:
font-family: Helvetica, Arial;
The FontGroup would contain a Font instance for Helvetica, and a Font
instance for Arial, and a Font instance for the fallback font.
It may be that Helvetica contains glyphs for every character in the
document, and therefore Arial and the fallback font are not needed at
all.
This change makes the strategy lazy, so that we'll only create a Font
for Arial if we cannot find a glyph within Helvetica. I've also
substantially refactored the existing code in the process and added
some documentation along the way.
---
I've added some tests in the second commit, but it required quite a bit of gymnastics to make it possible to write such a test. I'm not sure if the added complexity to the production code is worth it?
On the other hand, having this infrastructure in place may be useful for testing future changes in this area, and also possibly brings us a step closer to extracting a library as discussed in #4901. (What I mean by that is: it reduces coupling between `FontCacheThread` and `FontContext` -- the latter would have a place in such a library, the former wouldn't.)
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20021)
<!-- Reviewable:end -->
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a step towards fixing #17267. To fix that, we need to be able to
try various different fallback fonts in turn, which would become
unweildy with the prior eager-loading strategy.
Prior to this change, FontGroup loaded up all Font instances, including
the fallback font, before any of them were checked for the presence of
the glyphs we're trying to render.
So for the following CSS:
font-family: Helvetica, Arial;
The FontGroup would contain a Font instance for Helvetica, and a Font
instance for Arial, and a Font instance for the fallback font.
It may be that Helvetica contains glyphs for every character in the
document, and therefore Arial and the fallback font are not needed at
all.
This change makes the strategy lazy, so that we'll only create a Font
for Arial if we cannot find a glyph within Helvetica. I've also
substantially refactored the existing code in the process and added
some documentation along the way.
|
|/
|
|
|
| |
Otherwise the log gets spammed with all the individual bytes of the
underlying font file.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This prevents confusion and paves the ground for derive(Parse) of them.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`.
`malloc_size_of` is better -- it handles various cases that `heapsize` does not
-- so this patch changes Servo to use `malloc_size_of`.
This patch makes the following changes to the `malloc_size_of` crate.
- Adds `MallocSizeOf` trait implementations for numerous types, some built-in
(e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`).
- Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't
support that operation.
- For `HashSet`/`HashMap`, falls back to a computed estimate when
`enclosing_size_of_op` isn't available.
- Adds an extern "C" `malloc_size_of` function that does the actual heap
measurement; this is based on the same functions from the `heapsize` crate.
This patch makes the following changes elsewhere.
- Converts all the uses of `heapsize` to instead use `malloc_size_of`.
- Disables the "heapsize"/"heap_size" feature for the external crates that
provide it.
- Removes the `HeapSizeOf` implementation from `hashglobe`.
- Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of`
doesn't derive those types, unlike `heapsize`.
|
|
|
|
|
|
| |
Ignoring :
- **generated**.rs
- python/tidy/servo_tidy_tests/rust_tidy.rs
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
x-height of a font.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make font template data load fallible
Remove a TODO around dealing with a failed file operation.
Can we write an automated test for this? I don't really know what font template data is, but this failure seems to be fontconfig-specific...
---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12037
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12076)
<!-- Reviewable:end -->
|
| | |
|
| | |
|
|/
|
|
| |
Fixes #12081.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to 400, not 500.
CSS `normal` font-weight is specified as 400, while Mac "Regular" font
weight is reported as 0.0. On the Mac, we need to center the two ranges
on the same value to avoid choosing "Light" fonts where "Regular" would
have been more appropriate.
Closes #9487.
fix for mac
|
|
|
|
|
|
|
|
| |
Roboto on Android.
This matches what I believe the OS native defaults to be.
Partially addresses #9487.
|
|
|
|
|
|
|
|
|
|
| |
Core Text treats a font size of 0.0 as 12.0, which is obviously not what
we want.
Improves Twitter.
Improves Reddit /r/rust.
Closes #10492.
|
| |
|
|
|
|
|
|
|
|
| |
WebRender is an experimental GPU accelerated rendering backend for Servo.
The WebRender backend can be specified by running Servo with the -w option (otherwise the default rendering backend will be used).
WebRender has many bugs, and missing features - but it is usable to browse most websites - please report any WebRender specific rendering bugs you encounter!
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Updated string_cache, html5ever, xml5ever and selectors in Cargo.toml files and Cargo.lock.
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!(foo) by atom!("foo").
Replaced Atom::from_slice by Atom::from.
Replaced atom.as_slice() by &*atom.
|
| |
|
| |
|
| |
|
|
|
|
| |
This merges import blocks that were reported by tidy as unmerged.
|
| |
|
|
|
|
| |
Also fixes use-after-free of FontTable buffers.
|
|
|
|
| |
This is no longer necessary for opting out of the Copy trait.
|
| |
|
| |
|
|
|
|
|
| |
Make the structure for the `stretchiness` and `boldness` methods more
similar
|