Commit graph

3667 commits

Author SHA1 Message Date
Ms2ger
cba3b6806e Use raw::Slice where it makes sense. 2015-04-07 17:54:36 +02:00
Ms2ger
b5d41aa8a5 Use boxed::into_raw where it makes sense. 2015-04-07 17:54:16 +02:00
Ms2ger
dd7ec693a5 Remove some unnecessary transmute calls. 2015-04-07 17:53:12 +02:00
Josh Matthews
5728799479 Get the barest bones of webdriver integration ready for keeners. 2015-04-06 18:22:32 -04:00
Matt Brubeck
791fa3757d Implement the :focus pseudo-class selector
Fixes #5460. This supports for simple focusable elements that are their own
DOM anchors, like text `input` fields.
2015-04-04 10:57:11 -07:00
Manish Goregaokar
51625d7d06 Fix gonk net_traits dependencies
Issue #4476
2015-04-03 13:43:16 -04:00
Ms2ger
eefb0773a0 Remove the unsafe impl Send for ConstellationControlMsg.
This impl made it possible to put raw pointers in ConstellationControlMsg and
send them across threads without considering the consequences.

This required making SmallVec1<T> Send if T is Send.
2015-04-03 13:32:51 +02:00
Ms2ger
6b127a8df8 Introduce a MouseButton enum. 2015-04-03 01:24:33 +02:00
Matt McCoy
818f1c5748 Closes #2587 Adding HTTP compression capability 2015-04-01 21:18:47 -04:00
Mátyás Mustoha
56303e21cc Canvas: added arcTo() support. 2015-04-01 21:20:05 +02:00
Patrick Walton
750bbed2cb gfx: Perform more aggressive caching in
`FontContext::get_layout_font_group_for_style()`.

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.
2015-04-01 08:58:16 -07:00
Patrick Walton
66dd8c8a6c layout: Implement CSS transitions per CSS-TRANSITIONS § 2.
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.
2015-03-31 08:46:11 -07:00
Adenilson Cavalcanti
cdebb3ca54 Load a placeholder when a url to an image is broken.
I decided to use the old Netscape broken image link icon (later we may
replace the image asset for something more trendier). The ref test will
expect that a failed load should display the rippy image.

ImageCacheTask users can define if a placeholder image should be loaded
at start up or not. This enables both the new behavior (e.g. always
return an image even for broken urls) as also the previous one.
2015-03-30 10:02:54 -07:00
Ms2ger
259d650a21 Remove an unused import.
I accidentally left it in after removing the calls to stdout/stderr in
d926b8342b.
2015-03-30 10:22:31 +02:00
bors-servo
acf98dcccd auto merge of #5444 : servo/servo/gonk-warnings, r=jdm 2015-03-29 17:54:59 -06:00
bors-servo
39556cc832 auto merge of #5422 : bdero/servo/bdero/box-syntax, r=jdm
Closes #5417
2015-03-29 17:10:01 -06:00
Corey Farwell
d838fcce30 Remove some unnecessary uses of as_slice
For the majority of these cases, `as_slice` can be removed due to
`Deref`. In particular, `Deref` for:

* `String` -> `str`
* `Atom` -> `str`

The latter of those two requires, a bump of the locked `string-cache`
library
2015-03-29 14:42:19 -04:00
Brandon DeRosier
ccc55d658f Use box syntax instead of Box::new()
Closes #5417
2015-03-29 13:41:14 -04:00
Ms2ger
98c5da7e2e Stop using int in ANativeWindow. 2015-03-29 14:36:38 +02:00
Ms2ger
d926b8342b Update gonk's build.rs. 2015-03-29 14:36:11 +02:00
Michael Wu
88b31933c4 Sync gonk lib.rs & main.rs with components/servo 2015-03-29 12:38:05 +02:00
Michael Wu
1ffa40ab55 Fix warning in gonk input code 2015-03-29 12:36:05 +02:00
Ms2ger
6ea514bc06 Update js. 2015-03-26 17:53:51 +01:00
Nicholas Nethercote
ce36e574f4 Rename lots of profiling-related things.
------------------------------------------------------------------------
BEFORE                              AFTER
------------------------------------------------------------------------
util::memory                        util::mem
- heap_size_of                      - heap_size_of (unchanged)
- SizeOf                            - HeapSizeOf
  - size_of_excluding_self            - heap_size_of_children

prof::mem                           prof::mem
- MemoryProfilerChan                - ProfilerChan
- MemoryReport                      - Report
- MemoryReportsChan                 - ReportsChan
- MemoryReporter                    - Reporter
- MemoryProfilerMsg                 - ProfilerMsg
  - {R,UnR}egisterMemoryReporter      - {R,UnR}egisterReporter
- MemoryProfiler                    - Prof
- ReportsForest                     - ReportsForest (unchanged)
- ReportsTree                       - ReportsTree   (unchanged)
- SystemMemoryReporter              - SystemReporter

prof::time                          prof::time
- TimeProfilerChan                  - ProfilerChan
- TimerMetadata                     - TimerMetadata (unchanged)
- Formatable                        - Formattable [spelling!]
- TimeProfilerMsg                   - ProfilerMsg
- TimeProfilerCategory              - ProfilerCategory
- TimeProfilerBuckets               - ProfilerBuckets
- TimeProfiler                      - Profiler
- TimerMetadataFrameType            - TimerMetadataFrameType (unchanged)
- TimerMetadataReflowType           - TimerMetadataReflowType (unchanged)
- ProfilerMetadata                  - ProfilerMetadata (unchanged)

In a few places both prof::time and prof::mem are used, and so
module-qualification is needed to avoid overlap, e.g. time::Profiler and
mem::Profiler. Likewise with std::mem and prof::mem. This is not a big
deal.
2015-03-25 16:00:23 -07:00
Glenn Watson
7163a3c580 Add mozbrowser events for location + title change. 2015-03-26 05:19:03 +10:00
bors-servo
f29ea4e4ef auto merge of #5302 : mmatyas/servo/canvas_stroke, r=jdm
This is the servo side patch of servo/rust-azure#149.
2015-03-25 07:54:50 -06:00
Mátyás Mustoha
698b88f71d Canvas: added stroke() support. 2015-03-25 12:52:05 +01:00
Glenn Watson
a3b1fac503 Fixes #4964 and #4965. 2015-03-25 13:26:23 +10:00
Nicholas Nethercote
52447ccd9b Move profiler code from util into a new crate profile.
- 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.
2015-03-24 02:09:31 -07:00
Ms2ger
b45cf4ccf8 Fix some warnings in the CEF port. 2015-03-23 00:35:23 +01:00
Ms2ger
561f7e594e Update rust-png. 2015-03-21 14:31:14 +01:00
Ms2ger
1604515fd9 Fix various build warnings. 2015-03-20 17:57:49 +01:00
Ms2ger
dce11222ba Update some feature gates.
CC #5286.
2015-03-20 13:55:11 +01:00
bors-servo
dea36f9816 auto merge of #4891 : mmatyas/servo/canvas_gradient, r=jdm
Based on [ebalint](https://github.com/ebalint)'s original patch, this commit implements the linear and radial gradients for the canvas. The PR also includes test cases.
Depends on #4623 and servo/rust-azure#136.
2015-03-20 03:12:47 -06:00
Matt Brubeck
970f275b94 Use the same version of rand everywhere 2015-03-19 16:32:38 -07:00
bors-servo
e845695b66 auto merge of #5276 : metajack/servo/fix-idle-loop, r=pcwalton
This fixes 100% CPU usage during idle.
2015-03-19 12:03:52 -06:00
Mátyás Mustoha
d3199aef74 Implement gradient fill styles for canvas. 2015-03-19 15:59:08 +01:00
Jack Moffitt
f02c5500a3 Switch from poll_events to wait_events.
This fixes 100% CPU usage during idle.
2015-03-19 08:15:41 -06:00
Michael Wu
67666c4418 Fix warnings in gonk port 2015-03-18 23:52:29 -04:00
bors-servo
124a78fb2e auto merge of #5262 : servo/servo/fix-warnings, r=metajack 2015-03-18 15:21:49 -06:00
Simon Sapin
6a58cbd118 Fix more warnings everywhere. 2015-03-18 22:11:20 +01:00
bors-servo
477f8d22a4 auto merge of #5088 : bjwbell/servo/osx-set_cursor, r=jdm
Dependent on https://github.com/tomaka/glutin/pull/300
2015-03-18 13:24:55 -06:00
bors-servo
4dc5287b4e auto merge of #5257 : michaelwu/servo/enable-b2s-pie, r=Manishearth
PIE is required on lollipop. PIE has been supported since jellybean.
2015-03-18 12:30:55 -06:00
Ms2ger
5f15eb5fbf Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev. 2015-03-18 13:18:31 -04:00
Michael Wu
2f999ec728 Enable PIE so b2s will run on Lollipop 2015-03-18 02:59:20 -04:00
Nicholas Nethercote
ece2711185 Add memory reporting infrastructure and use it to measure the display list.
This changeset implements the beginnings of fine-grained measurement of
Servo's data structures.

- It adds a new `SizeOf` trait, which is used to measure the memory used
  by heap data structures, and implements it for some std types: Box,
  String, Option, Arc, Vec, and DList.

- It adds a new `MemoryReporter` trait which is used to report memory
  measurements from other threads to the memory profiler. Reporters are
  registered and unregistered with the memory profiler, and the memory
  profiler makes measurement requests of reporters when necessary.

- It plumbs a MemoryProfilerChan through to the layout task so it can
  register a memory reporter.

- It implements the `SizeOf` trait for `DisplayList` and associated
  types, and adds a memory reporter that uses it.

The display list hits 14.77 MiB when viewing
tests/html/perf-rainbow.html, and 2.51 MiB when viewing the Guardians of
the Galaxy Wikipedia page from servo-static-suite. Example output:

  0.29: display-list::http://www.reddit.com/
  0.00: display-list::http://static.adzerk.net/reddit/ads.html?sr=-reddit.com,loggedout&bust2#http://www.reddit.com
  0.00: display-list::http://www.reddit.com/static/createadframe.html

There are a number of FIXME comments indicating sub-optimal things. This
is a big enough change for now that doing them as follow-ups seems best.
2015-03-16 18:12:26 -07:00
Patrick Walton
f9cdd05d58 layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1
§ 12.3-12.5.

Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.
2015-03-09 17:13:45 -07:00
Jack Moffitt
43c82b9076 Fix scrolling on OS X.
This just requires updating glutin and cocoa to pick up some backported fixes.
2015-03-06 16:37:29 -07:00
Gilles Leblanc
70aa253a65 Specify regex and regex_macros version numbers
For compatibility with current Rust version.

Issue #5063
2015-03-05 21:09:41 -05:00
Josh Matthews
b89339d055 Add missing crate to gonk. 2015-03-03 17:56:55 -05:00