| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of using a simple `Atom` to identify a local font, use a data
structure. This allows us to carry more information necessary to
identify a local font (such as a path on MacOS). We need this for the
new version of WebRender, as fonts on MacOS now require a path.
This has a lot of benefits:
1. We can avoid loading fonts without paths on MacOS, which should
avoid a lot of problems with flakiness and ensure we always load the
same font for a given identifier.
2. This clarifies the difference between web fonts and local fonts,
though there is more work to do here.
3. This avoid a *lot* of font shenanigans, such as trying to work
backwards from the name of the font to the path of the font we
actually matched. In general, we can remove a lot of code trying to
accomplish these shenanigans.
4. Getting the font bytes always returns an `Arc` now avoiding an extra
full font copy in the case of Canvas.
|
|
|
|
|
| |
* clippy: fix warnings in components/layout
* fix: formatting
|
|
|
|
|
|
|
|
|
|
|
|
| |
Synthetic small caps is supported by the font subsystem, but this is
disabled in Layout 2020. We can turn this on to bring support to parity
with the old layout system.
In addition to turning on synthetic small-caps this change also improves
the way that they work. Before, synthetic small caps meant that every
character was a small version of capitalized character. After this
change, capital letters are larger than small caps versions of small
letters -- matching other browsers and the common expectation of how
small caps works.
|
|
|
|
|
|
|
|
|
| |
* Lint layout_2013 with clippy
CARGO_BUILD_RUSTC=rustc cargo clippy --fix -p layout_2013 --broken-code
* ./mach fmt
* Cosmetic adjustments
|
| |
|
|
|
|
| |
Instead of panicking when no found is found for a TextRun, instead print
a warning. This prevents panics on pages with very large font sizes.
|
|
|
|
|
| |
* strict imports formatting
* Reformat all imports
|
|
|
|
|
|
|
|
|
|
|
| |
* remove extern crate
* Update components/script_plugins/lib.rs
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
---------
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
| |
This reverts commit 10ae3bfbbb2383d349de6150434cc47c6ad1c8e9.
|
|
|
|
| |
This reverts commit 5c0d7998bd28ceb383f553cd7af5a60f472a47ba.
|
| |
|
|
|
|
|
|
|
| |
It's not possible anymore, in the presence of min() / max(), to split a
<length-percentage> value into a <length> and a <percentage> component.
Tweak word_spacing to do what Gecko does (resolving it in advance).
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Add license to two files.
Bypass DisplayListBuilder for some items.
|
| |
|
| |
|
|
|
|
| |
Because reem/rust-debug-unreachable#6 makes `debug_unreachable` enable debug checks even in release builds since Rust 1.0.
|
|
|
|
|
|
|
|
| |
We can encounter control characters here, for example when processing a
<pre> element which contains newlines. Control characters are inherently
non-printing, therefore if we try to call find_by_codepoint for these
characters we will end up triggering an unnecessary font fallback
search.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unfortunately, this required quite a bit of changes to the non-test
code. That's because FontContext depends on a FontCacheThread, which in
turn depends on a CoreResourceThread and therefore lots of other data
structures.
It seemed like it would be very difficult to instantiate a FontContext
as it was, and even if we could it seems like overkill to have all these
data structures present for a relatively focused test.
Therefore, I created a FontSource trait which represents the interface
which FontContext uses to talk to FontCacheThread. FontCacheThread then
implements FontSource. Then, in the test, we can create a dummy
implementation of FontSource rather than using FontCacheThread.
This actually has the advantage that we can make our dummy
implementation behave in certain specific way which are useful for
testing, for example it can count the number of times
find_font_template() is called, which helps us verify that
caching/lazy-loading is working as intended.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Fixes #874
|
|
|
|
| |
This prevents confusion and paves the ground for derive(Parse) of them.
|
| |
|
|
|
|
|
|
| |
failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/18809
|
|
|
|
|
| |
It still needs dependencies update to remove all the other bitflags
versions.
|
|
|
|
|
| |
… because there’s a lot of it,
and script still uses any other unstable features anyway.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
First, we define computed::CSSPixelLength which contains a CSSFloat, a
pixel value, and then we replace computed::Length with CSSPixelLength.
Therefore, the |ComputedValue| of NoCalcLength, AbsoluteLength,
FontRelativeLength, ViewportPercentageLength, CharacterWidth, and
PhysicalLength is CSSPixelLength.
Besides, we drop NonNegativeAu, and replace computed::NonNegativeLength
with NonNegative<computed::Length>. (i.e. NonNegative<CSSPixelLength>)
|
|
|
|
|
|
| |
Ignoring :
- **generated**.rs
- python/tidy/servo_tidy_tests/rust_tidy.rs
|
| |
|
|
|
|
|
|
|
| |
Besides, we replace its type with
GenericLineHeight<NonNegativeNumber, NonNegativeAu>.
MozReview-Commit-ID: GGOGXyUFJsJ
|
|
|
|
|
|
|
|
| |
related properties.
For font-size and font-size-adjust.
MozReview-Commit-ID: 5rrfVSzB7WF
|
|
|
|
|
|
| |
The alias is left there temporarilly and will be removed completely in a later commit where
also components/style/gecko/generated/structs_{debug|release}.rs are re-generated (they still
use the old alias).
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Remove incomplete and buggy support for text-orientation in Servo.
Make the property values align with Gecko and the latest draft of CSS
Writing Modes Level 3.
|
|
|
|
| |
Since they do the same.
|