Commit graph

519 commits

Author SHA1 Message Date
bors-servo
22e570a06e Auto merge of #5553 - luniv:css-rule-iterators, r=SimonSapin 2015-04-10 19:17:49 -05: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
Ms2ger
2cc3c1d9c2 Use isize with children_count members.
I'm not size why these are signed.
2015-04-02 14:50:15 +02:00
Ms2ger
67b3a3d3d6 Use usize for propagate_to_child. 2015-04-02 14:47:48 +02:00
Ms2ger
3dd3ad728e Use u32 for TableColumnFragmentInfo::span. 2015-04-02 14:46:19 +02:00
Ms2ger
6d7dead4ef Use isize for CharIndex. 2015-04-02 14:45:49 +02:00
Ms2ger
cd8c03bb49 Use usize for layout node debug ids. 2015-04-02 14:21:33 +02:00
Patrick Walton
4011291bf2 layout: Stop rebuilding all inline-block flows unconditionally, and
bubble intrinsic inline sizes as necessary when doing incremental
reflow.
2015-04-01 10:52:15 -07: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
bors-servo
8976bbfe7d auto merge of #5441 : servo/servo/heap-unclassified, r=jdm 2015-03-31 15:03:56 -06:00
bors-servo
b79d06c8d2 auto merge of #5349 : mbrubeck/servo/placement-size, r=pcwalton
I think this should have been changed in #3618 but was missed. r? @pcwalton

I wasn't able to come up with a good test case for this, partly because of other bugs related to floats and formatting contexts.
2015-03-31 14:15:59 -06: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
Nicholas Nethercote
66902d2c90 Use usize rather than u64 in MemoryReport.
I should have used usize in the first place.
2015-03-31 15:37:15 +02:00
Patrick Walton
16db7bab28 layout: Stop going to the DOM to determine the root flow's background
color.

This allows us to do layout off the main thread, which is necessary for
transitions.
2015-03-30 10:00:32 -07: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