Commit graph

1586 commits

Author SHA1 Message Date
bors-servo
b5a23a16be Auto merge of #10941 - samlh:patch-2, r=mbrubeck
Remove dead code left over from #10085

cc @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/10941)
<!-- Reviewable:end -->
2016-04-30 09:44:25 -07:00
bors-servo
0f1a921ba6 Auto merge of #10928 - servo:warnings, r=mbrubeck
Fix some warnings

<!-- 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/10928)
<!-- Reviewable:end -->
2016-04-30 05:16:46 -07:00
Samuel Harrington
4691dc0c6e Remove dead code from block.rs 2016-04-29 20:13:42 -07:00
Samuel Harrington
b2cd35da47 Delete dead code from flow.rs 2016-04-29 20:12:22 -07:00
Emilio Cobos Álvarez
9c44062836
layout: be clearer about resolved_style 2016-04-29 22:54:52 +02:00
Emilio Cobos Álvarez
5577a083ec
layout: Simplify ThreadSafeLayout::text_content 2016-04-29 22:54:50 +02:00
Emilio Cobos Álvarez
2e05190e68
layout: Add test for size of ServoThreadSafeLayoutNode 2016-04-29 22:54:50 +02:00
Emilio Cobos Álvarez
cf5c090576
layout: Don't force to overwrite display for pseudo-elements. 2016-04-29 22:54:49 +02:00
Emilio Cobos Álvarez
2a499d5a0b
layout: Stop storing PrecomputedStyleData in LayoutNode
Use the SharedStyleContext instead.
2016-04-29 22:54:48 +02:00
Emilio Cobos Álvarez
979c3a54b9
layout: Tidy a bit style pseudo-elements stuff 2016-04-29 22:54:47 +02:00
Emilio Cobos Álvarez
5a43c7e3cd
style: Allow inheritance when computing anonymous box styles
This is used a lot by Gecko, not still for servo though.
2016-04-29 22:54:46 +02:00
Emilio Cobos Álvarez
3563ecb770
style: Use precomputation for the -servo-details-content pseudo-element 2016-04-29 22:54:45 +02:00
Emilio Cobos Álvarez
b6402a81d0
style: Add infrastructure for non-eagerly-cascaded pseudo-elements
This commit also removes StylistWrapper and uses Arc::get_mut instead.
2016-04-29 22:54:45 +02:00
Simon Sapin
756a34e93d Fix some warnings 2016-04-29 19:14:46 +02:00
bors-servo
ac8406f4ae Auto merge of #10834 - yoava333:master, r=SimonSapin
added support for :read-only and :read-write pseudo-classes

partial fix for https://github.com/servo/servo/issues/10732

It's not a full fix because:
1. there's a bug in wpt-test https://github.com/w3c/web-platform-tests/issues/2889#issuecomment-214144420
2. we don't fully support all input types (namely image, color, hidden and range), which are defaulted to input text. this means that :read-write which is applicable to input text is mis-handled in those cases.
3. we don't support contenteditable, which is also possibly :read-write

<!-- 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/10834)
<!-- Reviewable:end -->
2016-04-29 08:12:18 -07:00
bors-servo
cf121ad8df Auto merge of #10895 - mbrubeck:byteindex, r=pcwalton
Use byte indices instead of char indices for text runs

Replace character indices with UTF-8 byte offsets throughout all code dealing with text runs.  This eliminates a lot of complexity when converting from one to the other, and interoperates better with the rest of the Rust ecosystem.

For most code this is just a simple replacement of char indices with byte indices.  In a few places like glyph storage and text fragment scanning, it also lets us get rid of code that existed only to map between bytes and chars.

Also includes some related fixes to text shaping, discovered while working on this conversion.  See the commit messages for details.

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/10895)
<!-- Reviewable:end -->
2016-04-28 20:22:09 -07:00
Matt Brubeck
c4872d9544 Replace range::Range with std::ops::Range in script 2016-04-28 14:54:07 -07:00
Matt Brubeck
659305fe0a Use byte indices instead of char indices for text runs
Replace character indices with UTF-8 byte offsets throughout the code dealing
with text shaping and breaking.  This eliminates a lot of complexity when
converting from one to the other, and interoperates better with the rest of
the Rust ecosystem.
2016-04-28 14:32:14 -07:00
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
Yoav Alon
9bf909ac2f added support for :read-only and :read-write pseudo-classes
partial fix for https://github.com/servo/servo/issues/10732
2016-04-27 01:38:58 +03: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