Commit graph

1567 commits

Author SHA1 Message Date
Patrick Walton
6b6587a73b layout: Translate floats flowing out of blocks to compensate for inline
direction margins.

Improves Reddit /r/rust.
2016-04-28 10:25:49 -07:00
Patrick Walton
97de2c2afa layout: Reset the speculated inline size of floats out to compensate for
margins for all blocks, not just block formatting contexts.

Partial fix for Reddit /r/rust.
2016-04-28 10:25:49 -07:00
Daosheng Mu
b7e05b4a9d Avoid drawing while canvases without contexts. 2016-04-28 07:03:45 +08:00
bors-servo
2729864af7 Auto merge of #10857 - servo:toml, r=nox
Simplify TOML syntax

* Sections like `[dependencies.foo]` can be entries in a `[dependencies]` section with the `{key = value}` syntax.
* Per-target dependencies can be expressed with more general `cfg(…)` conditions instead of exact target triples: https://github.com/rust-lang/cargo/pull/2328

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10857)
<!-- Reviewable:end -->
2016-04-26 15:46:37 -07:00
Simon Sapin
83b3ebf6ac Simplify TOML syntax
* Sections like `[dependencies.foo]` can be entries in a `[dependencies]`
  section with the `{key = value}` syntax.
* Per-target dependencies can be expressed with more general `cfg(…)`
  conditions instead of exact target triples:
  https://github.com/rust-lang/cargo/pull/2328
2016-04-26 23:51:36 +02:00
bors-servo
31a440867d Auto merge of #10722 - notriddle:table_cell_valign, r=SimonSapin
layout: Add support for vertical alignment within table cells.

Fixes #10621

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10722)
<!-- Reviewable:end -->
2016-04-26 11:04:41 -07:00
bors-servo
1fee7185a7 Auto merge of #10810 - mrobinson:displayitem, r=pcwalton
Merge DisplayListEntry into DisplayItem

We don't really need two levels of abstraction for every element in the
DisplayList. This simplifies the complexity of the data structure in
preparation for providing documentation and properly handling scrolling
roots.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10810)
<!-- Reviewable:end -->
2016-04-26 10:13:00 -07:00
bors-servo
20dd8ba7ec Auto merge of #10817 - danlrobertson:flex-basis, r=mbrubeck
Add style property for flex-basis

Add the style property for flex-basis. The property should allow all
values acceptable for `width` or `height` with the addition of `content`.

I also disabled the tests that I expect to pass. I am confused by [flexbox_computedstyle-flex-basis-0percent:20](https://github.com/servo/servo/blob/master/tests/wpt/css-tests/css-flexbox-1_dev/html/flexbox_computedstyle_flex-basis-0percent.htm#L20). Should that be `0%` instead of `0px`?

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10817)
<!-- Reviewable:end -->
2016-04-24 23:34:37 -07:00
Daniel Robertson
2d9d31ee04
Add style property for flex-basis
Add the style property for flex-basis. The property should allow all
values acceptable for `width`|`height` with the addition of `content`.
2016-04-24 14:04:40 -04:00
Simon Sapin
7932ab6ac2 Upgrade to rust-url 1.0 and hyper 0.9 2016-04-23 20:27:58 +02:00
bors-servo
5a5e928cb9 Auto merge of #10770 - notriddle:canvas_placeholder_block, r=mbrubeck
Do not render the contents of block-level replaced elements.

Fixes #10733

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10770)
<!-- Reviewable:end -->
2016-04-22 22:32:37 -07:00
Michael Howell
5a90c8f2bd Do not render the contents of block-level replaced elements.
Fixes #10733
2016-04-22 22:24:09 -07:00
bors-servo
0a3a50a129 Auto merge of #10706 - zwn:unused-extern-crates, r=nox
Turn on unused-extern-crates warning.

As discussed in #9256. It should solve second half of the issue.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10706)
<!-- Reviewable:end -->
2016-04-22 13:40:38 -07:00
Zbynek Winkler
41c293293b Remove references to unused crates.
The cleanup is based on info from using "-W unused-extern-crates".
2016-04-22 22:20:06 +02:00
Zbynek Winkler
b021874ba0 Silence unused-extern-crates false positives.
Added #[allow(unused_extern_crates)] to silence false positives

 * bitflags, lazy_static and matches because macro_use
 * alloc_jemalloc because builtin crate

See https://github.com/rust-lang/rust/issues/30849
2016-04-22 22:20:05 +02:00
Martin Robinson
05fb2ef6ee Merge DisplayListEntry into DisplayItem
We don't really need two levels of abstraction for every element in the
DisplayList. This simplifies the complexity of the data structure in
preparation for providing documentation and properly handling scrolling
roots.
2016-04-22 10:28:27 -07:00
Zbynek Winkler
924d804583 Move '&&' to the end of the previous line.
Following https://github.com/servo/servo/issues/10692 this is just a
formating change to satisfy a new tidy requirement of not having '&&' at
the beginning of a line.
2016-04-22 14:28:18 +02:00
Josh Matthews
1623114376 Use DOM width/height for canvas display list item. 2016-04-21 23:20:21 -04:00
Michael Howell
8953207f83 Add support for vertical alignment within table cells.
Fixes #10621
2016-04-20 14:40:02 -07:00
bors-servo
8d988f20c1 Auto merge of #9968 - izgzhen:scroll, r=asajeffrey
Implement scroll, scrollLeft, scrollTop and friends, addressing issue #9650

This is a work in progress to solve https://github.com/servo/servo/issues/9650. Thanks a lot for helping the review.

- [x] scroll
- [x] scrollTo
- [x] scrollBy
- [x] scrollTop (setter and getter)
- [x] scrollLeft (setter and getter)

The setters will be implemented in another PR after this is merged.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9968)
<!-- Reviewable:end -->
2016-04-20 18:40:26 +05:30
Patrick Walton
63279c316b layout: Implement support for overflow: scroll in WebRender.
Includes a WebRender upgrade.

Improves Twitter.
2016-04-19 14:13:13 -07:00
Alan Jeffrey
cfb066ef20 Added a dedicated panic channel. 2016-04-19 09:08:44 -05:00
Zhen Zhang
fefdaf76de Implement ScrollTop and ScrollLeft getters:
Add new compositor message to get scroll_offset;
Add new layout query for computed value of overflow-x/y;
Implement layer_id method for ThreadSafeLayoutNode;
Add new layout query for layer_id;
Implement script interface for getting scrollTop and scrollLeft, as well as relavant helper functions.
2016-04-19 12:27:35 +08:00
Martin Robinson
72e267953c WebRender no longer needs StackingLevel information
Since the display list is already sorted before it is passed to
WebRender, we don't need to pass the stacking level information any
longer. Update webrender, webrender_traits, and gleam.
2016-04-18 13:24:08 -07:00
Peter
b0ad3ddf5b Updated euclid to version 0.6.5
And updated existing usages of Matrix4 to use Matrix4D<T>
2016-04-17 18:39:49 +01:00
bors-servo
fd994c457e Auto merge of #10655 - mbrubeck:merge-margin, r=SimonSapin
Update margins when merging inline fragments

Fixes #10633.  r? @pcwalton

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10655)
<!-- Reviewable:end -->
2016-04-17 08:18:04 +05:30
Matt Brubeck
782e713472 Update margins when merging inline fragments
Fixes #10633.
2016-04-16 14:13:16 -07:00
Matt Brubeck
1695d14a9e Don't strip out all empty fragments
Empty fragments may need to be layed out to draw borders, padding/background,
and insertion points.  (Fragments that consist of discardable whitespace and
control characters, on the other hand, can still be discarded.)

This ends up preserving some useless empty fragments.  It's possible we could
avoid this by storing some sort of flag on "important" empty fragments, so we
can discard the rest.
2016-04-16 13:13:07 -07:00
Matt Brubeck
1807fd3cc5 Generate a fragment for an empty elements with borders or padding 2016-04-16 11:01:40 -07:00
Matt Brubeck
fbef2724bf Fix up inline context flags during text fragment scanning
This fixes two problems that could cause scanned text fragments to end up with
incorrect LAST_FRAGMENT_OF_ELEMENT or FIRST_FRAGMENT_OF_ELEMENT flags:

1. If a single unscanned fragment was split into multiple scanned fragments,
   then all of them would inherit its flags.  We need to clear these flags,
   except for the first and last scanned fragment.

2. When an unscanned fragment generated zero scanned fragments, we correctly
   called `meld_with_next_inline_fragment` to transfer LAST_FRAGMENT flags to
   the preceding fragment, but we didn't do anything to transfer
   FIRST_FRAGMENT flags to the following fragment.  We can fix this by calling
   `meld_with_prev_inline_fragment` on the following fragment.
2016-04-16 10:30:03 -07:00
Matt Brubeck
b607b3a932 Fix meld_with_next_inline_fragment and add meld_with_prev_inline_fragment
Factor out a new `meld_with_prev_inline_fragment` method that mirrors the
existing `meld_with_next_inline_fragment`.

This also fixes a bug in `meld_with_next` that was already fixed in the
`meld_with_prev` by @notriddle in #10419.  The bug is that it was traversing
the inline context nodes in the wrong order.  It should start at the outermost
enclosing node, since the fragments might be at different nesting levels under
some common ancestor.
2016-04-16 10:30:01 -07:00
Matt Brubeck
587314e52b Improve debug logging of non-printable chars 2016-04-16 10:30:00 -07:00
bors-servo
86778a0d71 Auto merge of #10644 - pcwalton:absolute-ib-split, r=mbrubeck
layout: Make absolutely-positioned blocks not generate {ib} splits.

Improves YouTube.

Closes #10642.

r? @mbrubeck

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10644)
<!-- Reviewable:end -->
2016-04-16 06:58:47 +05:30
Patrick Walton
e840c7aaa0 layout: Make absolutely-positioned blocks not generate {ib} splits.
Improves YouTube.

Closes #10642.
2016-04-15 17:27:25 -07:00
Michael Howell
03be4583e0 Do not propagate floats in or out of absolutely positioned flows.
Fixes #10625
2016-04-15 16:01:23 -07:00
Patrick Walton
f69931552b layout: Disallow margins from collapsing through block formatting
contexts per CSS 2.1 § 8.3.1.

Closes #10449.
2016-04-14 17:24:26 -07:00
Patrick Walton
a3fd226341 layout: Disallow margins from collapsing through blocks with clearance
per CSS 2.1 § 8.3.1.

Fixes the test failure in #10458.
2016-04-14 17:24:24 -07:00
Patrick Walton
e32455f7b8 layout: Disallow margins from collapsing through blocks that have
floated children per CSS 2.1 § 8.3.1.

Fixes the test failure in #10458.
2016-04-14 11:22:40 -07:00
bors-servo
2b910678db Auto merge of #10587 - asajeffrey:add-failure-panic-message, r=Manishearth
Added panic message to failures.

Added the panic message to failures. This is a step towards #10334, since it gives us access to the panic error message when we fire a `mozbrowsererror` event. The remaining steps are also to record the backtrace, and to report the failure in the event.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10587)
<!-- Reviewable:end -->
2016-04-14 19:55:17 +05:30
bors-servo
84f01d1d7b Auto merge of #10579 - notriddle:overflow_premature_clip, r=pcwalton
Propogate transformed clipping regions to nested flows.

Fixes #10559

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10579)
<!-- Reviewable:end -->
2016-04-14 03:32:33 +05:30
Alan Jeffrey
8c0fa01884 Added panic message to failures. 2016-04-13 16:09:48 -05:00
Michael Howell
3c2210c5fc Propogate transformed clipping regions to nested flows.
Fixes #10559
2016-04-13 11:50:50 -07:00
Emilio Cobos Álvarez
7712affd2c
layout: Minimal refactor in style_specified_intrinsic_inline_size to improve legibility. 2016-04-13 05:44:40 +02:00
Emilio Cobos Álvarez
3c105082b8
layout: take into account max and min inline size for canvas and images 2016-04-13 04:47:14 +02:00
Emilio Cobos Álvarez
8abefd7e5e
layout: Take in account max inline size for inline fragments 2016-04-13 04:47:14 +02:00
bors-servo
7e63c1be63 Auto merge of #10486 - notriddle:overflow_premature_clip, r=pcwalton
Take transform:translate into account when computing clipping regions.

Note that this only works for translation; a more general fix would
require major changes to how display lists work.

Closes #10431?

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10486)
<!-- Reviewable:end -->
2016-04-13 07:12:38 +05:30
Michael Howell
6c9efbf383 Take transform:translate into account when computing clipping regions.
Note that this only works for translation; a more general fix would
require major changes to how display lists work.

Closes #10431?
2016-04-12 14:39:13 -07:00
bors-servo
150338503d Auto merge of #10529 - pcwalton:nested-fixed-position-webrender, r=glennw
layout: Make child stacking contexts of fixed position stacking contexts also fixed position.

Improves YouTube.
Improves the Washington Post.

Closes #10526.

r? @glennw

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10529)
<!-- Reviewable:end -->
2016-04-12 10:38:11 +05:30
bors-servo
934ae41fc9 Auto merge of #10522 - KiChjang:input-cleanup, r=frewsxcv
Various cleanups in HTMLInputElement

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10522)
<!-- Reviewable:end -->
2016-04-12 07:56:38 +05:30
bors-servo
61865f66b5 Auto merge of #10505 - amarant:10491-HTMLInputElement-attr, r=KiChjang
Issue #10491 add HTMLInputElement attributes that reflect content ide…

…ntically

it uses a new version of string-cache https://github.com/servo/string-cache/pull/148

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10505)
<!-- Reviewable:end -->
2016-04-12 05:58:16 +05:30