Commit graph

137 commits

Author SHA1 Message Date
Josh Matthews
420e19f172 Revert "Revert "Update font-kit and freetype and unicode-script.""
This reverts commit 10ae3bfbbb.
2020-08-10 13:30:51 -04:00
Josh Matthews
10ae3bfbbb Revert "Update font-kit and freetype and unicode-script."
This reverts commit 5c0d7998bd.
2020-08-04 19:16:05 -04:00
Josh Matthews
5c0d7998bd Update font-kit and freetype and unicode-script. 2020-07-31 10:41:58 -04:00
Emilio Cobos Álvarez
f03026b869
layout: Resolve word_spacing ahead of time.
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).
2020-02-12 02:43:23 +01:00
Emilio Cobos Álvarez
7d30a7da75 Servo build fixes. 2019-12-16 14:23:56 +01:00
Emilio Cobos Álvarez
0000e4cec2 layout: fix Servo build. 2019-05-07 12:56:10 +02:00
Emilio Cobos Álvarez
0c01325c05 layout: Fix servo build. 2019-03-13 15:08:39 +01:00
Simon Sapin
be69f9c3e6 Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
Jan Andre Ikenmeyer
1d6fe65401
Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Simon Sapin
76e59a46d3 Sort use statements 2018-11-06 15:26:02 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
Pyfisch
d9b1950d74 Layout: Remove redundant deny unsafe and format
Add license to two files.

Bypass DisplayListBuilder for some items.
2018-10-22 16:15:48 +02:00
Pyfisch
349047b096 Rustfmt layout crate 2018-09-01 13:24:57 +02:00
Emilio Cobos Álvarez
895946bb18
layout: script: Fix build. 2018-06-23 20:34:10 +02:00
Matt Brubeck
f6404f0ec2 Update dependencies to use new_debug_unrechable
Because reem/rust-debug-unreachable#6 makes `debug_unreachable` enable debug checks even in release builds since Rust 1.0.
2018-06-06 08:54:51 -07:00
Jon Leighton
4403bcddfe Don't perform font matching for control characters
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.
2018-05-19 14:33:38 +10:00
Jon Leighton
e4acb3f77f Add test for FontContext/FontGroup functionality
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.
2018-02-22 16:36:09 +01:00
Jon Leighton
f22e5ef3bd Lazy load fonts in a FontGroup
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.
2018-02-22 16:36:05 +01:00
Igor Gutorov
7a00066477 style: Move content property out of mako. 2018-02-07 00:11:57 +02:00
Manish Goregaokar
f3c81fcda8 Share line breaking state across text runs
Fixes #874
2018-01-24 12:51:33 +05:30
Emilio Cobos Álvarez
af879523ea
style: Make all keywords CamelCase for consistency.
This prevents confusion and paves the ground for derive(Parse) of them.
2017-12-06 02:35:10 +01:00
Bastien Orivel
29b4eec141 Bump bitflags to 1.0 in every servo crate 2017-10-30 23:36:06 +01:00
Gecko Backout
11c64178d8 Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest 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
2017-10-19 21:26:51 +00:00
Bastien Orivel
e8e2d0a4b2 Update bitflags to 1.0 in every servo crate
It still needs dependencies update to remove all the other bitflags
versions.
2017-10-19 15:01:17 +02:00
Simon Sapin
aa5761a5fb Remove usage of unstable box syntax, except in the script crate
… because there’s a lot of it,
and script still uses any other unstable features anyway.
2017-10-12 12:10:56 +02:00
Manish Goregaokar
c2fcc9ce1a stylo: Add keyword info to computed value of font-size 2017-09-23 10:51:21 -07:00
Boris Chiou
a949e2a057 Introduce CSSPixelLength and update NonNegativeLength.
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>)
2017-09-13 18:05:14 +08:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Simon Sapin
b5a4b8d6a0 Upgrade to rustc 1.21.0-nightly (13d94d5fa 2017-08-10) 2017-08-15 14:10:44 +02:00
Boris Chiou
6dd8b159d7 Bug 1374233 - Part 12: Implement ToAnimatedValue for LineHeight.
Besides, we replace its type with
GenericLineHeight<NonNegativeNumber, NonNegativeAu>.

MozReview-Commit-ID: GGOGXyUFJsJ
2017-08-04 14:23:28 +08:00
Boris Chiou
234d2c1b32 Bug 1374233 - Part 3: Use NonNegativeAu as computed values for font-size related properties.
For font-size and font-size-adjust.

MozReview-Commit-ID: 5rrfVSzB7WF
2017-08-04 14:21:59 +08:00
Michael Partheil
b07ebbae6b Replace all uses of the style::stylearc alias with servo_arc.
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).
2017-07-19 09:29:05 +02:00
Manish Goregaokar
808b1f509b stylo: Use ComputedValuesInner instead of ComputedValues when we don't need it 2017-07-17 18:02:25 -07:00
Anthony Ramine
7da94d0880 Use BorderSideWidth for outline-width 2017-06-02 10:53:27 +02:00
Anthony Ramine
2c7fbb4b4c Use generics for text spacing properties 2017-06-02 10:21:22 +02:00
Anthony Ramine
5c6987a50d Use generics for the line-height property 2017-06-02 10:21:21 +02:00
Behnam Esfahbod
14c524df4f [gfx] [layout] [style] Upgrade unicode-bidi to 0.3 2017-05-22 20:06:19 -05:00
Bobby Holley
7b0679848b Fix up script and layout. 2017-05-02 17:35:45 -07:00
Josh Matthews
a20d0bccef Overwrite default RunInfo values with the first real ones encountered. 2017-04-13 09:56:48 +10:00
Matt Brubeck
b3820c1296 Convert text-orientation to a Gecko-only property
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.
2017-01-27 21:12:38 -08:00
Emilio Cobos Álvarez
fa26e87030
layout: Remove get_font_arc in favor of clone_font.
Since they do the same.
2016-12-31 04:53:36 +01:00
Felipe
e0a48fe596 Use word-break to decide how glyph runs should be created 2016-09-27 11:25:21 +02:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
Ravi Shankar
a04028eede Prefer length and percentage for word spacing 2016-08-09 17:53:40 +05:30
Simon Sapin
789807b7b0 Remove the ComputedValue traits and style_struct_traits 2016-07-20 08:42:40 +02:00
Emilio Cobos Álvarez
383ba964ab
layout: text: Don't consider the REQUIRES_LINE_BREAK_AFTERWARD_IF_WRAPPING_ON_NEWLINES if the fragment can wrap text.
This was making us fall in a loop where the start split was empty, but we didn't
ignore it because the current fragment had this flag, but then we treated it
differently depending on the white_space property.

Not totally sure this is the proper fix, but it makes sense to me. In case it
is:

Fixes #12369.
2016-07-10 15:34:57 -07:00
Anthony Ramine
3041084176 Move util::linked_list to layout 2016-06-29 17:23:04 +02:00
Michael Howell
b082dceebc Alignment is wrong. 2016-06-18 11:49:38 -07:00
Josh Matthews
3cb8af20c2 Remove empty lines following braces. 2016-05-27 13:32:05 -04:00