Commit graph

3647 commits

Author SHA1 Message Date
Patrick Walton
e1d562198c Merge pull request #1379 from pcwalton/png
net: Color space convert 32-bit ARGB PNGs as well.
2013-12-11 12:37:17 -08:00
Patrick Walton
85f1af42c3 net: Color space convert 32-bit ARGB PNGs as well. 2013-12-11 11:22:37 -08:00
Patrick Walton
fc80be982a Merge pull request #1368 from SimonSapin/master
Fix #1264: support namespaced attribute selectors.
2013-12-11 09:16:47 -08:00
Patrick Walton
64c18ab699 Merge pull request #1370 from pcwalton/height-containing-block
layout: Make "height" relative to the initial containing block for the root.
2013-12-11 09:15:39 -08:00
Simon Sapin
4f673f031e Make sure stylsheets have a base URL. 2013-12-11 16:51:08 +00:00
Simon Sapin
2d6ac33656 Add support for non-UTF8 CSS stylesheets, with rust-encoding. 2013-12-11 16:40:30 +00:00
Simon Sapin
b98acc2f75 Add rust-encoding as a submodule.
Upstream: https://github.com/lifthrasiir/rust-encoding
Servo’s fork: https://github.com/mozilla-servo/rust-encoding

As of this writing, upstream’s master branch targets Rust 0.8,
and its rust-0.9-pre branch targets Rust master.
Servo uses a Rust version in-between those.
I pushed a rust-servo branch to our fork
that backports from rust-0.9-pre.
2013-12-11 14:25:07 +00:00
Simon Sapin
bc36ca860d Remove obsolete makefile lines about Netsurf’s libcss. 2013-12-11 13:10:52 +00:00
bors-servo
803f9f6d7e auto merge of #1372 : ksh8281/servo/remove_@_in_LayoutTask.FontContext2, r=pcwalton
Remove @ in layout task.font_context & fix linux/FontContextHandle
Arc<FontContextHandle> -> Rc<FontContextHandle>
2013-12-10 21:01:12 -08:00
patrick kim
ac216be06d makes linux/Arc<FontContextHandle> Rc<FontContextHandle> 2013-12-11 11:42:14 +09:00
patrick kim
0026eb0899 remove @ in LayoutTask.FontContext 2013-12-11 11:42:14 +09:00
patrick kim
55771bc307 make font/platform/gfx/font_context safe 2013-12-11 11:40:58 +09:00
bors-servo
279a82bdd3 auto merge of #1371 : pcwalton/servo/flatten-box, r=larsbergstrom
63% improvement in box building on the rainbow page.

r? @larsbergstrom
2013-12-10 18:22:10 -08:00
Patrick Walton
1ba71432ee layout: Change ~Box to Box.
63% improvement in box building on the rainbow page.
2013-12-10 18:00:38 -08:00
Patrick Walton
225ae67b60 layout: Make "height" relative to the initial containing block for the root.
Fixes Wikipedia.
2013-12-10 17:30:31 -08:00
Simon Sapin
b290823f4d Fix #1264: support namespaced attribute selectors. 2013-12-10 17:53:12 +00:00
bors-servo
4b3defb282 auto merge of #1353 : dhedlund/servo/resource_port_and_user, r=pcwalton
User credentials and port were not being preserved when pre-fetching path-based resources.  For example, consider the following HTML:

```html
<html>
  <body>
    <img src="logo.png" />
  </body>
```

Running the following command would try to fetch the image from `http://localhost/my-site/logo.png` and crash the browser with ConnectionRefused error:
```
$ ./servo http://foo:bar@localhost:8080/my-site/
task '<unnamed>' failed at 'Unhandled condition: io_error: rt::io::IoError{kind: ConnectionRefused, desc: "connection refused", detail: None}', /home/daniel/Programming/servo/src/compiler/rust/src/libstd/condition.rs:131
...
```

This should now be fixed.
2013-12-09 22:16:10 -08:00
bors-servo
794ea62ed9 auto merge of #1363 : ryanhc/servo/owned_layout, r=metajack
Removing all @ from flowtree to make it parallelism-ready.
The connection between displaylist and flowtree is removed, i.e., when displaylist is built, box is cloned.
Whether displaylist still needs to have boxes is a design decision to make.

Also thanks to @ksh8281
2013-12-09 21:01:09 -08:00
Ryan Choi
d26bf36833 removing @ from flowtree. (but cloning boxes when creating a display list) 2013-12-10 13:44:20 +09:00
bors-servo
6014bd3813 auto merge of #1365 : pcwalton/servo/minor-layout-refactoring, r=metajack
r? @metajack
2013-12-09 19:43:16 -08:00
Patrick Walton
30bbaa49b7 Revert "auto merge of #1356 : ksh8281/servo/remove_@_in_LayoutTask.FontContext, r=pcwalton"
This reverts commit e8ffac13d7, reversing
changes made to db923feffe.

Reverting this change because FreeType is *not* thread safe. See the
documentation here:

http://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html

"In multi-threaded applications, make sure that the same FT_Library
object or any of its children doesn't get accessed in parallel."

We will need to use a `MutexArc` instead.
2013-12-09 19:40:08 -08:00
Patrick Walton
2624b937aa layout: Refactor InlineFlow::assign_height to pull out horizontal
position calculation into a separate function.
2013-12-09 19:25:04 -08:00
bors-servo
e8ffac13d7 auto merge of #1356 : ksh8281/servo/remove_@_in_LayoutTask.FontContext, r=pcwalton
Remove @ in LayoutTask.FontContext, ScannedTextBox.text_run
#1334
2013-12-09 19:13:45 -08:00
patrick kim
e1e59ac3b6 remove FontContxtHandle.clone 2013-12-10 11:58:51 +09:00
Patrick Walton
7148a28611 layout: Refactor try_append_to_line to eliminate duplicate code. 2013-12-09 18:54:17 -08:00
bors-servo
db923feffe auto merge of #1362 : pcwalton/servo/rm-display-boxes, r=larsbergstrom
`@`-free layout

r? @larsbergstrom
2013-12-09 18:34:16 -08:00
Patrick Walton
594eb0067a layout: Remove the ability to put boxes in display list items. 2013-12-09 18:18:52 -08:00
Patrick Walton
64222f5772 layout: Remove DisplayBoxes to save memory and as one step toward an
`@`-free layout
2013-12-09 18:16:06 -08:00
patrick kim
301df201c3 fix some code 2013-12-10 08:59:43 +09:00
patrick kim
f187035e25 remove @ in LayoutTask.FontContext 2013-12-10 08:59:43 +09:00
patrick kim
5077c771a5 make font/platform/gfx/font_context safe 2013-12-10 08:59:43 +09:00
patrick kim
2865ab4e29 remove @ from ScannedTextBox.run 2013-12-10 08:59:43 +09:00
bors-servo
f7cc49c30f auto merge of #1360 : kmcallister/servo/content-changed, r=jdm
r? @jdm
2013-12-09 13:07:24 -08:00
Keegan McAllister
962984fb3b Reflow with full style damage when content changes
Fixes #664.
2013-12-09 12:34:33 -08:00
Keegan McAllister
b61160490a Refactor DocumentDamageLevel::add and add test 2013-12-09 12:31:34 -08:00
bors-servo
1bf28ebaf4 auto merge of #1352 : dhedlund/servo/issue_76, r=jdm,metajack
Fixes #76.

Implemented the only font metric remaining to resolve issue #76 for the Linux platform.

There are still some variations between Linux and OS X font metrics.  Looking at values for the "Times New Roman" font, the following metrics differed by over 10%:  `leading`, `x_height` and `max_advance`.  It was not obvious if this would create any major difference in rendering, or whether the discrepancies would be handled in platform specific ways during the rendering process.  Only `x_height` is being used by existing code.  The `leading` property under Linux is still an order of magnitude off from the OS X version, but they are computed with similar calculations.  Issue #1355 has been opened to further investigate the discrepancies.

#### Platform comparison of font metrics for "Times New Roman" between Linux and OS X:
**Au** is the raw metric values stored in the `FontMetrics` struct.  **% of em** is how large that value is relative to the raw `em_size` of the font as a percentage.  Linux reports the pt size differently than OS X, but this is probably because the linux platform uses hard-coded points-per-inch value (hard-coded in `src/components/util/geometry.rs`), whereas OS X uses the points-per-inch value provided by the font library.

    +-----------------------------------+  +-----------------------------------+
    | Linux (@14.25pt, 1.33em)          |  | OS X (@19.35pt, 1.0em)            |
    +------------------+------+---------+  +------------------+------+---------+
    | property         |   Au | % of em |  | property         |   Au | % of em |
    +------------------+------+---------+  +------------------+------+---------+
    | underline_size   |   55 |    4.82 |  | underline_size   |   60 |    5.17 |
    | underline_offset | -151 |  -13.25 |  | underline_offset | -120 |  -10.34 |
    | strikeout_size   |   56 |    4.91 |  | strikeout_size   |    0 |    0.00 |
    | strikeout_offset |  295 |   25.88 |  | strikeout_offset |    0 |    0.00 |
    | leading          |  541 |   47.45 |  | leading          |   60 |    5.17 |
    | x_height         | 1015 |   89.04 |  | x_height         |  660 |   56.85 |
    | em_size          | 1140 |  100.00 |  | em_size          | 1161 |  100.00 |
    | ascent           | 1015 |   89.04 |  | ascent           |  893 |   76.92 |
    | descent          |  246 |   21.58 |  | descent          |  203 |   17.48 |
    | max_advance      | 1199 |  105.18 |  | max_advance      | 2820 |  242.89 |
    +------------------+------+---------+  +------------------+------+---------+

    +-----------------------------------+  +-----------------------------------+
    | Linux (@24pt, 1.33em)             |  | OS X (@32.683333pt, 1.0em)        |
    +------------------+------+---------+  +------------------+------+---------+
    | property         |   Au | % of em |  | property         |   Au | % of em |
    +------------------+------+---------+  +------------------+------+---------+
    | underline_size   |   93 |    4.84 |  | underline_size   |  120 |    6.12 |
    | underline_offset | -255 |  -13.28 |  | underline_offset | -240 |  -12.24 |
    | strikeout_size   |   95 |    4.95 |  | strikeout_size   |    0 |    0.00 |
    | strikeout_offset |  496 |   25.83 |  | strikeout_offset |    0 |    0.00 |
    | leading          |  912 |   47.50 |  | leading          |   60 |    3.06 |
    | x_height         | 1710 |   89.06 |  | x_height         | 1080 |   55.10 |
    | em_size          | 1920 |  100.00 |  | em_size          | 1960 |  100.00 |
    | ascent           | 1710 |   89.06 |  | ascent           | 1544 |   78.77 |
    | descent          |  415 |   21.61 |  | descent          |  365 |   18.62 |
    | max_advance      | 2020 |  105.21 |  | max_advance      | 4740 |  241.84 |
    +------------------+------+---------+  +------------------+------+---------+

    +-----------------------------------+  +-----------------------------------+
    | Linux (@45pt, 1.33em)             |  | OS X (@60.833333pt, 1.0em)        |
    +------------------+------+---------+  +------------------+------+---------+
    | property         |   Au | % of em |  | property         |   Au | % of em |
    +------------------+------+---------+  +------------------+------+---------+
    | underline_size   |  175 |    4.86 |  | underline_size   |  180 |    4.93 |
    | underline_offset | -479 |  -13.31 |  | underline_offset | -480 |  -13.15 |
    | strikeout_size   |  179 |    4.97 |  | strikeout_size   |    0 |    0.00 |
    | strikeout_offset |  931 |   25.86 |  | strikeout_offset |    0 |    0.00 |
    | leading          | 1709 |   47.47 |  | leading          |  180 |    4.93 |
    | x_height         | 3208 |   89.11 |  | x_height         | 2040 |   55.89 |
    | em_size          | 3600 |  100.00 |  | em_size          | 3650 |  100.00 |
    | ascent           | 3208 |   89.11 |  | ascent           | 2925 |   80.14 |
    | descent          |  778 |   21.61 |  | descent          |  690 |   18.90 |
    | max_advance      | 3788 |  105.22 |  | max_advance      | 8880 |  243.29 |
    +------------------+------+---------+  +------------------+------+---------+

    +-----------------------------------+  +-----------------------------------+
    | Linux (@30.75pt, 1.33em)          |  | OS X (@41.9pt, 1.0em)             |
    +------------------+------+---------+  +------------------+------+---------+
    | property         |   Au | % of em |  | property         |   Au | % of em |
    +------------------+------+---------+  +------------------+------+---------+
    | underline_size   |  120 |    4.88 |  | underline_size   |  120 |    4.77 |
    | underline_offset | -327 |  -13.29 |  | underline_offset | -360 |  -14.32 |
    | strikeout_size   |  122 |    4.95 |  | strikeout_size   |    0 |    0.00 |
    | strikeout_offset |  636 |   25.85 |  | strikeout_offset |    0 |    0.00 |
    | leading          | 1168 |   47.47 |  | leading          |  120 |    4.77 |
    | x_height         | 2192 |   89.11 |  | x_height         | 1440 |   57.27 |
    | em_size          | 2460 |  100.00 |  | em_size          | 2514 |  100.00 |
    | ascent           | 2192 |   89.11 |  | ascent           | 1991 |   79.20 |
    | descent          |  532 |   21.63 |  | descent          |  487 |   19.37 |
    | max_advance      | 2588 |  105.20 |  | max_advance      | 6120 |  243.44 |
    +------------------+------+---------+  +------------------+------+---------+
2013-12-09 11:04:57 -08:00
Daniel Hedlund
79789a18de Implement font leading metric for linux platform
Fixes #76.
2013-12-09 10:33:58 -08:00
Daniel Hedlund
00e3a2144d Document the Au struct and add similar font metrics debug as mac 2013-12-09 10:22:26 -08:00
Daniel Hedlund
2d3fa10923 Preserve port and user/pass info for path-based resources 2013-12-09 09:55:32 -08:00
bors-servo
c3a9583000 auto merge of #1359 : SimonSapin/servo/ns-noalloc, r=metajack
Also rename Element::get_namespace to get_namespace_url.
2013-12-09 08:16:21 -08:00
Simon Sapin
61c7f2f220 Change Namespace::to_str() to not allocate and return a reference. 2013-12-09 15:10:09 +00:00
bors-servo
4fc48f5e32 auto merge of #1358 : therealglazou/servo/therealglazou/namespaces, r=jdm
Add a namespace to elements. Sets by default the namespace to HTML for elements created by hubbub. Fixes :nth-of-type() and friends to match the namespace.

Note: prefix is not added by this PR because hubbub does not preserve it and I wanted to keep the patch as simple as possible.
2013-12-09 07:01:23 -08:00
Daniel Glazman
28575c20bf add namespaces to elements 2013-12-09 15:55:51 +01:00
Lars Bergstrom
76e3b34c75 Merge pull request #1348 from dhedlund/issue_163
Remove orphaned gfx::text::shaper code
2013-12-07 09:53:12 -08:00
Lars Bergstrom
030e3073c0 Merge pull request #1347 from ksh8281/remove_@_from_net_image_cache_task
remove @ from net/image_cache_task
2013-12-07 08:20:35 -08:00
Daniel Hedlund
b5046d24e0 Remove orphaned gfx::text::shaper code
The shaper code referenced in this issue is no longer being used.  It
was removed in commit a535f22146, but
later reintroduced due to a merge conflict in commit
d64d987e1d.

Fixes #163.
2013-12-07 03:03:39 -08:00
patrick kim
01a3edd2ac remove @ from net/image_cache_task
~[Chan<ImageResponseMsg>] is not freezetype.
so we have to use unsafe_access
2013-12-07 10:54:41 +09:00
Lars Bergstrom
403958aed7 Merge pull request #1342 from ksh8281/remove_@_from_font_context
Remove @ from font context, remove SendableTextRun
2013-12-06 17:18:04 -08:00
patrick kim
86e2cac8e8 fix indent & some code 2013-12-07 09:52:54 +09:00
Junyoung Cho
ab1291f34a Patch for macos 2013-12-07 09:52:54 +09:00