Commit graph

585 commits

Author SHA1 Message Date
Lars Bergstrom
095658e098 Cargo updates and small workqueue change 2016-01-20 08:38:27 -06:00
Vladimir Vukicevic
025ed57c04 win32: use fontconfig/freetype on windows as well (for now) 2016-01-20 08:38:20 -06:00
bors-servo
380541bd48 Auto merge of #9352 - mattkuo:cleanup-private-types, r=nox
Convert private types to public

fixes #9347

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9352)
<!-- Reviewable:end -->
2016-01-18 01:58:01 +05:30
Matthew Kuo
8ecc120211 changed gfx private types to public 2016-01-17 04:48:32 -08:00
Brandon Fairchild
dce7c7bb69 Remove multiple unused imports in gfx
Fixes #9342.
2016-01-16 14:16:03 -05:00
bors-servo
3c6e16c9ad Auto merge of #9289 - mskrzypkows:move_FrameTreeId, r=KiChjang
Move FrameTreeId type to gfx_traits #9221

Fixes #9221.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9289)
<!-- Reviewable:end -->
2016-01-14 02:06:47 +05:30
Maciej Skrzypkowski
e52c53a7f2 Move FrameTreeId type to gfx_traits #9221 2016-01-13 13:36:28 +01:00
Ms2ger
86d3c576f2 Remove some unused extern crates. 2016-01-13 09:37:28 +01:00
John DeSilva
f32995543d Move Epoch to gfx_traits
Resolves #9222. Moved Epoch from components/msg/compositor_msg to
components/gfx_traits/lib. Updated use statements to reflect the move.
2016-01-10 17:36:52 -05:00
rohan.prinja
1f02c4ebbb task -> thread 2016-01-10 17:58:13 +09:00
Martin Robinson
d720452698 Use DisplayListSection everywhere
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.
2016-01-08 10:19:03 -08:00
bors-servo
58111a6420 Auto merge of #9177 - pcwalton:filter-out-useless-clips, r=glennw
gfx: Eagerly transform clips into `ClippingRegion::max()` if possible.

This helps WebRender look for useless clips and optimize them out.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9177)
<!-- Reviewable:end -->
2016-01-08 21:24:45 +05:30
bors-servo
8e75a05e6b Auto merge of #9149 - adrianheine:webFonts, r=glennw
Correctly handle local sources for CSS3 fonts

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.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9149)
<!-- Reviewable:end -->
2016-01-08 04:47:55 +05:30
Patrick Walton
3103b03262 gfx: Eagerly transform clips into ClippingRegion::max() if possible.
This helps WebRender look for useless clips and optimize them out.
2016-01-06 19:48:14 -08:00
Patrick Walton
154f970b5b Remove the fontgroup address cache.
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.
2016-01-06 17:06:59 -08:00
Tetsuharu OHZEKI
574f934314 gfx: handle the ResponseAction::ResponseComplete error case in font_cache_task 2016-01-06 04:59:10 +09:00
Adrian Heine
4069645729 Don't shadow family_name
The argument to `local()` is not a font family, but the name of a
»single font face within a larger family« according to
http://www.w3.org/TR/css3-fonts/#src-desc.

The previous implementation of `FontCache::run` would panic if the argument to
`local()` would not be the name of a font family present in `self.web_families`.
That happened since `FontCacheTask` tried to use the argument to `local()` as a
key for `self.web_families`, although it previously correctly initialized a
value for the `family` field of the `AddWebFont` command.
2016-01-04 15:23:27 +01:00
bors-servo
9da739acef Auto merge of #9123 - karyon:clippy_cleanup, r=Manishearth
Fix a bunch of clippy lints

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

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9123)
<!-- Reviewable:end -->
2016-01-03 09:16:34 +05:30
bors-servo
ebf4ce8288 Auto merge of #9070 - antrik:debug-fonts, r=nox
Derive Debug for more font-related types

Needs to pull in newer ipc-channel and azure.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9070)
<!-- Reviewable:end -->
2016-01-03 08:11:57 +05:30
Olaf Buddenhagen
3c5a3ca4ff Derive Debug for more font-related types 2016-01-03 02:54:55 +01:00
Johannes Linke
6b215f38ee Fix a bunch of clippy lints 2016-01-02 23:27:15 +01:00
Josh Matthews
20668da061 Accept all Content-Type values for fonts if sniffing is disabled. Restore the status quo. 2015-12-31 09:12:59 -05:00
Josh Matthews
afb4d90ad3 Send a response to font load initiators even when a font is ignored. 2015-12-31 07:45:50 -05:00
Josh Matthews
e17e553f04 Restrict font loads to known MIME types. 2015-12-31 07:45:48 -05:00
David Rajchenbach-Teller
1e81b8c133 Resolves #4183 - Implemementing context-based MIME type sniffing
The version of the standard is not finalized at the time of this writing.
Specifications may be found here: https://mimesniff.spec.whatwg.org/#context-specific-sniffing .
2015-12-31 07:45:03 -05:00
bors-servo
66c8aa8cda Auto merge of #8420 - craftytrickster:8371/generic-font-family, r=glennw
Enabled use of FontFamily enum type

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.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8420)
<!-- Reviewable:end -->
2015-12-31 16:49:48 +05:30
David Raifaizen
d942bfb474 Enabled use of FontFamily enum type and replaced plain string parameters with enum 2015-12-30 18:21:37 -05:00
Bobby Holley
47059d2d26 Separate style+layout and layout-specific wrapper functionality.
This patch does a number of things, unfortunately all at once:
* Hoists a large subset of the layout wrapper functionality into the style system.
* Merges TElementAttributes into the newly-created TElement.
* Reorganizes LayoutData by style vs layout, and removes LayoutDataShared.
* Simplifies the API for borrowing style/layout data.

There's still more to do to make the style system usable standalone, but
this is a good start.
2015-12-29 11:50:03 -08:00
bors-servo
f77c792886 Auto merge of #9055 - simartin:issue_9042, r=Wafflespeanut
Issue #9042: Report incorrect number of spaces around => in the style checker

Fixes https://github.com/servo/servo/issues/9042

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9055)
<!-- Reviewable:end -->
2015-12-24 10:55:48 +05:30
Simon Martin
cec661fa86 Issue #9042: Report incorrect number of spaces around => in the style checker. 2015-12-23 20:54:26 +01:00
Brandon Fairchild
637afecec9 Move LayerKind and ScrollPolicy enums to gfx_traits
This also moves LayerId and LayerProperties to gfx_traits.

Fixes #8836.
2015-12-20 20:43:31 -05:00
bors-servo
95eabdb4db Auto merge of #9022 - mskrzypkows:PaintMsg_refactoring, r=jdm
Move PaintMsg enum to gfx_traits #8844

re-PR of https://github.com/servo/servo/pull/9007, because homu seems stuck

Fixes #8844.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9022)
<!-- Reviewable:end -->
2015-12-20 01:34:26 +05:30
Mathieu Agopian
11234f5370 Use Url.join instead of UrlParser.base_url(...).parse (#9002) 2015-12-18 17:02:41 +01:00
bors-servo
6490d1e1c5 Auto merge of #9013 - antrik:debug-fontgroup, r=Ms2ger
Derive Debug for FontGroup and Homu is a bully

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9013)
<!-- Reviewable:end -->
2015-12-18 14:23:15 +05:30
Maciej Skrzypkowski
3f7f323556 Move PaintMsg enum to gfx_traits #8844 2015-12-18 08:33:32 +01:00
bors-servo
c6ae32abdd Auto merge of #8612 - glennw:pending-frames, r=jdm
Add test to constellation to avoid writing reftest image if there are pending frames.

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.~~~

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8612)
<!-- Reviewable:end -->
2015-12-17 16:19:16 +05:30
bors-servo
338f66003e Auto merge of #8995 - pcwalton:measure-text-shaping, r=mbrubeck
gfx: Measure text shaping time in the time profiler.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8995)
<!-- Reviewable:end -->
2015-12-17 10:57:29 +05:30
Glenn Watson
b670430cb2 Add test to constellation to avoid writing reftest image if there are pending frames.
Also change when pipelines become active.

This makes the constellation activate a pipeline as the current frame
when it is ready to do initial reflow, rather than when it is ready
to paint.

This fixes a number of intermittent failures that could previously occur
if an iframe was not visible - which would mean it was never moved from
a pending frame in the constellation to an active frame.

(It happens that webrender exposes these intermittents as permanent failures).
2015-12-17 12:30:19 +10:00
Patrick Walton
520c561d3d gfx: Cache the last result of
`TextRun::index_of_first_glyph_run_containing` in TLS.

This achieves a 40% or so hit rate on Wikipedia.
2015-12-16 09:44:43 -08:00
Patrick Walton
df93b1f194 gfx: Measure text shaping time in the time profiler. 2015-12-15 13:28:05 -08:00
Patrick Walton
85c73deb78 gfx: Cache the total advance of each glyph store.
The total advance is asked for over and over.
2015-12-15 11:24:36 -08:00
Olaf Buddenhagen
c5ede5851e Derive Debug on FontGroup and its components 2015-12-12 10:04:33 +01:00
bors-servo
23b220644c Auto merge of #8947 - Ms2ger:core-text, r=jdm
Use core-text from crates.io.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8947)
<!-- Reviewable:end -->
2015-12-12 13:27:45 +05:30
Ms2ger
5440a90a48 Use core-text from crates.io. 2015-12-12 02:19:24 -05:00
Ms2ger
70653bfe08 Remove unused imports. 2015-12-12 02:13:59 -05:00
bors-servo
9f0c6d75d1 Auto merge of #8939 - cnaj:msg_refactoring, r=Ms2ger
Move PaintListener to gfx_traits, Fixes #8834

Adding layers and msg dependency to gfx_traits.

Fixes #8834.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8939)
<!-- Reviewable:end -->
2015-12-12 04:27:55 +05:30
Patrick Walton
b31a3b3883 Cache font style struct addresses in a separate font group cache.
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%.
2015-12-11 15:43:32 -05:00
Tomas Cernaj
701aebee48 Move PaintListener to gfx_traits, Fixes #8834
Adding layers and msg dependency to gfx_traits.
2015-12-11 18:43:10 +01:00
Tetsuharu OHZEKI
e8c12c1c6d Fix warnings: Use Vec.extend_from_slice instead of Vec.push_all 2015-12-10 16:49:29 -05:00
Ms2ger
208c05f944 Fix warnings. 2015-12-04 10:31:19 +01:00