Commit graph

682 commits

Author SHA1 Message Date
bors-servo
653b40d3e5 Auto merge of #5704 - jseaton:jseaton/animation-props, r=pcwalton
Contributes towards servo/servo#5494 - includes all properties listed at http://dev.w3.org/csswg/css-transitions/#animatable-css .

Unforunately the most obvious way to support text-shadow meant making a few structures NoCopy.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5704)
<!-- Reviewable:end -->
2015-04-16 13:42:16 -05:00
Joseph Seaton
d843526cb8 Animate many more CSS properties 2015-04-16 17:42:57 +01:00
Patrick Walton
14a544b64c layout: Clip the immediate fragments of block flows that establish
stacking contexts properly.

The code that existed before correctly translated the clips of child
elements, but not those of immediate display items belonging to the flow
itself.

Makes Leaflet.js maps usable.
2015-04-15 17:19:27 -07:00
bors-servo
bdcf606f48 Auto merge of #5691 - pcwalton:hypothetical-box-reform, r=glennw
Before this change, Servo used one code path that computed the position
of flows with `position: static` or `position: relative` and another
separate code path that computed the position of flows with `position:
absolute` or `position: fixed`. The latter code attempted to duplicate
the former code to determine the static position of hypothetical boxes,
but this was both fragile and incorrect in the case of hypothetical
boxes nested inside floats. In fact, it's impossible to determine the
static position of an absolute flow relative to its containing block at
inline-size assignment time, because that static position could depend
on a float that cannot be placed until block-size assignment!

This patch changes block layout to use the same code path for static
positioning of regular flows and static positioning of absolute flows
where applicable. This both simplifies the code and improves its
efficiency, since it allows the `hypothetical_position` field and
`static_block_offsets` data structure to be removed. Moreover, it
improves correctness in the above case (which the new reftest checks).
This allows the sidebar in Facebook Timeline to be positioned properly.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5691)
<!-- Reviewable:end -->
2015-04-14 18:14:11 -05:00
Corey Farwell
cc4a64e1fe Add/update comments with links to spec
Extracted out of #5649

* add more hyperlinks to associated specification for structs/methods
* follow redirects and update links
* replace broken links
* removal of WHATWG multipage page name since the page name is not
  guaranteed to be stable
2015-04-14 18:03:13 -04:00
Patrick Walton
82fcbf7870 layout: Minor stylistic cleanup. 2015-04-14 13:00:11 -07:00
Patrick Walton
acd08c67c6 layout: Use the same code path for computing static positions of regular
flows and static positions of hypothetical boxes.

Before this change, Servo used one code path that computed the position
of flows with `position: static` or `position: relative` and another
separate code path that computed the position of flows with `position:
absolute` or `position: fixed`. The latter code attempted to duplicate
the former code to determine the static position of hypothetical boxes,
but this was both fragile and incorrect in the case of hypothetical
boxes nested inside floats. In fact, it's impossible to determine the
static position of an absolute flow relative to its containing block at
inline-size assignment time, because that static position could depend
on a float that cannot be placed until block-size assignment!

This patch changes block layout to use the same code path for static
positioning of regular flows and static positioning of absolute flows
where applicable. This both simplifies the code and improves its
efficiency, since it allows the `hypothetical_position` field and
`static_block_offsets` data structure to be removed. Moreover, it
improves correctness in the above case (which the new reftest checks).
This allows the sidebar in Facebook Timeline to be positioned properly.
2015-04-14 13:00:10 -07:00
bors-servo
4997d3a112 Auto merge of #5677 - frewsxcv:https, r=Ms2ger
Extracted this out of #5649

This commit was created with the following commands:

```
find . -iname "*.webidl" -type f -print0 | xargs -0 sed -i '' 's/http:\(.*\)whatwg.org/https:\1whatwg.org/g'
```

```
find . -iname "*.rs" -type f -print0 | xargs -0 sed -i '' 's/http:\(.*\)whatwg.org/https:\1whatwg.org/g'
```
2015-04-14 02:57:41 -05:00
bors-servo
b7f59a3646 Auto merge of #5642 - aneeshusa:arc-box-image-to-arc-image, r=Ms2ger
Image used to be a trait, but no longer is, so boxing it is no longer
necessary. Fixes #5639.
2015-04-14 01:57:07 -05:00
bors-servo
4fac8b6810 Auto merge of #5593 - shinglyu:ismap, r=jdm
This implements issue 4873
2015-04-14 00:10:08 -05:00
Corey Farwell
5eaa922045 Update WHATWG links to use HTTPS
Extracted this out of #5649

This commit was created with the following commands:

```
find . -iname "*.webidl" -type f -print0 | xargs -0 sed -i '' 's/http:\(.*\)whatwg.org/https:\1whatwg.org/g'
```

```
find . -iname "*.rs" -type f -print0 | xargs -0 sed -i '' 's/http:\(.*\)whatwg.org/https:\1whatwg.org/g'
```
2015-04-13 21:34:27 -07:00
Shing Lyu
7a65b95ae5 4873 - Support the image map processing for <img ismap/> inside an <a/> 2015-04-14 10:09:23 +08:00
bors-servo
22e570a06e Auto merge of #5553 - luniv:css-rule-iterators, r=SimonSapin 2015-04-10 19:17:49 -05:00
Aneesh Agrawal
5b593a3d32 Switch Arc<Box<Image>> to Arc<Image> for perf boost.
Image used to be a trait, but no longer is, so boxing it is no longer
necessary.
2015-04-10 18:59:02 -04:00
Patrick Walton
002d0672ba layout: Fix some whitespace. 2015-04-10 15:33:40 -07:00
Patrick Walton
2f3b3eb4c4 layout: Include padding in the content block-size when computing the
block-size value when `height: auto` is specified for
absolutely-positioned elements.

Improves "Edit links" on the Wikipedia sidebar.
2015-04-10 15:33:07 -07:00
bors-servo
875f07ff25 Auto merge of #5608 - pgonda:cmdline-disable-style-sharing, r=Ms2ger
Let me know if I should fix anything, or how I could implement a test if needed.  I looked at some testing in servo/ports/command_line.rs but it did not seem to apply.

Thanks!
2015-04-10 03:06:11 -05:00
bors-servo
db4609d722 Auto merge of #5629 - glennw:glyph-count, r=pcwalton 2015-04-09 21:01:06 -05:00
Peter
881112d34e Adding cmdling argument for disabling style share cache, fix #5581 2015-04-09 21:42:41 -04:00
bors-servo
80851f7055 Auto merge of #5572 - laumann:remove-unnecessary-buffer-sends, r=glennw
Some debugging reveals that the send_back_unused_buffers() quite often sends empty vectors back to the paint task. This still incurs a communication overhead though. Instead check that the there actually are buffers to send back.
2015-04-09 20:28:31 -05:00
Glenn Watson
3815cb4a81 Remove unneeded assert (code below handles it) and a warning. Fixes #5230. 2015-04-10 09:55:59 +10:00
bors-servo
d7b6961104 Auto merge of #5623 - pcwalton:nested-inline-vertical-align, r=glennw
This allows things like `<sup><span>Foo</span></sup>` to work and
improves Wikipedia.

r? @glennw
2015-04-09 17:20:23 -05:00
Patrick Walton
18074bf908 layout: Lay out nested inline elements with different vertical-align
values properly in simple cases.

This allows things like `<sup><span>Foo</span></sup>` to work and
improves Wikipedia.
2015-04-09 14:55:05 -07:00
Patrick Walton
00a2685cbe layout: During inline layout, make place_between_floats use the same
line height computation logic as final block size assignment.

Improves Wikipedia.
2015-04-09 14:23:08 -07:00
Anthony Ramine
8f73b452fb Cleanup access to CharacterData nodes 2015-04-09 16:54:55 +02:00
bors-servo
1c884dc76b Auto merge of #5583 - pcwalton:float-ceiling-top-margin-redux, r=mbrubeck
As the float ceiling is relative to the border box, not the margin box,
of the parent flow, top margin must not be included.

This exposed a pre-existing bug whereby margins are discarded if a block
contains only floats and no content, affecting the tests
`float_intrinsic_height.html` and `margins_inside_floats_a.html`. As a
workaround, some invisible content has been added to the bodies of both
tests.

r? @mbrubeck
2015-04-08 18:04:14 -05:00
Patrick Walton
6d61468160 layout: Simplify and improve the correctness of whitespace stripping in
text layout, and unify the inline layout paths for pre- and
normally-formatted text.

This fixes a lot of "jumpiness" and removes the `new_line_pos` stuff.

Closes #2260.
2015-04-08 14:29:23 -07:00
bors-servo
267badae69 Auto merge of #5587 - pcwalton:list-style-image-sizing-redux, r=glennw
Improves Wikipedia.

r? @glennw
2015-04-08 04:48:30 -05:00
James Gilbertson
85dcc2deaf Use iterators for iterating through CSS rules 2015-04-07 22:28:06 -06:00
Patrick Walton
7a08a6c1ab layout: Position and size list images properly in the block direction.
Improves Wikipedia.
2015-04-07 15:42:52 -07:00
Patrick Walton
df9c0c7a26 layout: Remove the bogus
`assign_block_size_for_inorder_child_if_necessary` logic from table
wrapper flows.

As far as I can tell, this is a cut-and-paste of old buggy code from
block flows. Delegating to the correct block flow code fixes the sidebar
float placement on Guardians of the Galaxy.
2015-04-07 15:13:17 -07:00
Patrick Walton
c86bc2eb8b layout: Don't take collapsible top margin into account when determining
the float ceiling.

As the float ceiling is relative to the border box, not the margin box,
of the parent flow, top margin must not be included.

This exposed a pre-existing bug whereby margins are discarded if a block
contains only floats and no content, affecting the tests
`float_intrinsic_height.html` and `margins_inside_floats_a.html`. As a
workaround, some invisible content has been added to the bodies of both
tests.
2015-04-07 15:10:15 -07:00
Thomas Jespersen
0c1eeb2fc7 Only send unused buffers messages if there are actually any buffers
Some debugging reveals that the send_back_unused_buffers() quite often
sends empty vectors back to the paint task. This still incurs an
communication overhead though. Instead check that the there actually are
buffers to send back.
2015-04-07 17:52:42 +02:00
Patrick Walton
e10af4fc98 layout: Correctly take the inline size of cleared floats into account
when estimating the inline size of block formatting contexts.

The speculated inline-size of the preceding floats was forced to zero at
the wrong time if the float was itself cleared, causing it to overwrite
the speculated value. Shuffling the code around a bit fixes the problem.
2015-04-06 17:59:14 -07:00
Ms2ger
b50b21d1da Stop using int/uint in net_traits. 2015-04-06 16:08:53 +02: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
Gilles Leblanc
ba36a108c1 Split out shared networking code into net_traits crate
Fixes #4476
2015-04-03 13:38:10 -04:00
aditya
a3eaacccf6 Move iframe and url fields from Reflow to LayoutTask and LayoutTaskFactory
* Fix #5466
2015-04-02 16:09:48 -04:00
Ms2ger
a65c80231a Stop using u/i suffixes in layout. 2015-04-02 15:14:09 +02:00
Ms2ger
7fabf6071e Use usize in generated_content. 2015-04-02 15:06:27 +02:00
Ms2ger
8a8aee8576 Use usize in StopRun. 2015-04-02 15:05:27 +02:00
Ms2ger
2951455d18 Use usize for canvas sizes. 2015-04-02 15:04:29 +02:00
Ms2ger
683749c999 Use isize for Au::from_px. 2015-04-02 15:02:37 +02:00
Ms2ger
7b45a4384d Use a u32 in calculate_split_position_using_breaking_strategy. 2015-04-02 14:59:26 +02:00
Ms2ger
d418c0da3a Cleanup convert_length in ImageFragmentInfo. 2015-04-02 14:57:44 +02:00
Ms2ger
37b5e78a2c Avoid a cast in LayoutImageResponder. 2015-04-02 14:56:05 +02:00
Ms2ger
31c6a3977f Use usize in flow.rs. 2015-04-02 14:55:43 +02:00
Ms2ger
588143149c Use u32 for ImmutableFlowUtils::dump_with_level. 2015-04-02 14:55:25 +02:00
Ms2ger
a0ad6ba2d4 Use usize for indices into InlineFragments. 2015-04-02 14:53:30 +02:00
Ms2ger
232dadc81d Use isize for FragmentIndex. 2015-04-02 14:53:10 +02:00