Commit graph

6401 commits

Author SHA1 Message Date
bors-servo
a35212410a Merge pull request #3496 from zwarich/disabled-state-helpers-jsref
Convert &JSRef -> JSRef in DisabledStateHelpers

Reviewed-by: jdm
2014-09-26 20:24:33 -06:00
bors-servo
86eec63a02 Merge pull request #3493 from zwarich/root-lifetimes
Improve the correctness of Root lifetimes

Reviewed-by: jdm
2014-09-26 19:57:33 -06:00
bors-servo
39b6bd9b95 Merge pull request #3489 from ProgramFOX/issue2242-2
Made some DOM fields private.

Reviewed-by: jdm
2014-09-26 19:30:33 -06:00
bors-servo
1e5770a138 Merge pull request #3432 from gilles-leblanc/issue-3361
Handle dynamic addition of attributes

Reviewed-by: jdm
2014-09-26 19:00:35 -06:00
bors-servo
1da014a13d Merge pull request #3495 from zwarich/private-node-helpers-jsref
Convert &JSRef -> JSRef for the PrivateNodeHelpers trait

Reviewed-by: jdm
2014-09-26 18:36:38 -06:00
Gilles Leblanc
8e77422d8e Handle dynamic addition of attributes
Handles dynamic addition of attributes to <link rel=stylesheet>
elements.

Fixes #3361
2014-09-26 19:04:32 -04:00
bors-servo
ecfa1a9040 Merge pull request #3494 from SimonSapin/flake8
Fix /python/servo code formatting.

Reviewed-by: larsbergstrom
2014-09-26 17:03:41 -06:00
Cameron Zwarich
4bf2a88ae2 Convert &JSRef -> JSRef in DisabledStateHelpers 2014-09-26 15:58:36 -07:00
Cameron Zwarich
4f32d54fd8 Convert &JSRef -> JSRef for the PrivateNodeHelpers trait 2014-09-26 15:46:37 -07:00
Simon Sapin
cd45258bf3 Fix /python/servo code formatting.
(My editor screams at me for flake8 lint errors.)
2014-09-26 23:12:51 +01:00
Cameron Zwarich
78f061ee54 Improve the correctness of Root lifetimes
Use the new lifetime bounds feature of Rust to enforce that the
RootCollection field of Root outlives the jsref field. This still
doesn't enforce that the Root itself outlives the jsref field, and
doing this would require some sort of init dance.
2014-09-26 14:25:43 -07:00
ProgramFOX
71a05a9c39 Made some DOM fields private.
Relevant to #2242.
2014-09-26 20:35:01 +02:00
bors-servo
ab17d31bbf Merge pull request #3483 from pcwalton/block-formatting-contexts-containing-floats
layout: Block formatting contexts should contain all their floats.

Reviewed-by: glennw
2014-09-26 01:42:27 -06:00
Patrick Walton
36f3f5a0ab layout: Block formatting contexts should contain all their floats.
Improves Pinterest considerably.
2014-09-26 00:39:07 -07:00
bors-servo
20f5fdd000 Merge pull request #3467 from pcwalton/enhance-block-formatting-context-guess
layout: Enhance the heuristic that guesses the inline size of block formatting contexts.

Reviewed-by: glennw
2014-09-25 19:24:30 -06:00
Patrick Walton
5b4380389e layout: Enhance the heuristic that guesses the inline size of block
formatting contexts.

The widths of block formatting contexts depend on the floats prior to
them. To avoid a circular dependency between width assignment and height
assignment, we must guess their widths during the assign-widths pass.
The old code simply used the size of the last float, whether
left-floated or right-floated, but this proved insufficient to handle
layouts like those seen on Reddit. The new heuristic keeps track of both
left and right floats independently and sums the width of all left and
right floats to determine the width of a block formatting context. This
is still insufficient to properly lay out Reddit, but the results are
much more acceptable.

A fully correct approach will require that blocks be laid out again if
the initial guess proved to be incorrect. A `TODO` is in the code to
handle this case.
2014-09-25 17:50:24 -07:00
bors-servo
177127e597 Merge pull request #3398 from glennw/config-res
Allow resolution to be configured on command line. Default to 1280x1024.

Reviewed-by: SimonSapin
2014-09-25 18:27:38 -06:00
bors-servo
9fb47b7636 Merge pull request #3472 from pcwalton/unify-block-and-float-layout
layout: Unify the block-size computation for blocks and floats.

Reviewed-by: glennw
2014-09-25 17:48:35 -06:00
Patrick Walton
9f4c2de211 layout: Unify the block-size computation for blocks and floats.
The float code was old and did not support most of CSS 2.1. So unifying
the two paths both simplifies code and improves functionality.

Improves the Reddit sidebar.
2014-09-25 16:43:24 -07:00
bors-servo
d9c13352c1 Merge pull request #3478 from zwarich/get-mut-ref
Remove use of deprecated get_mut_ref

Reviewed-by: metajack
2014-09-25 17:24:33 -06:00
bors-servo
c2d6d8084c Merge pull request #3480 from zwarich/trailing-whitespace
Fix trailing whitespace tidy errors

Reviewed-by: larsbergstrom
2014-09-25 17:00:34 -06:00
bors-servo
d95b88c830 Merge pull request #3477 from Ms2ger/global
Move global_object_for_js_object to global.rs

Reviewed-by: jdm
2014-09-25 14:48:32 -06:00
Cameron Zwarich
ce2484a7ce Fix trailing whitespace tidy errors 2014-09-25 13:48:07 -07:00
Manish Goregaokar
b3b9051ebc Merge pull request #3479 from zwarich/lints-license
Add the MPL back to components/plugs/lints.rs; r=Manishearth
2014-09-26 02:17:19 +05:30
Cameron Zwarich
5399e117de Add the MPL back to components/plugins/lints.rs
This license was accidentally removed in 5b866e9e.
2014-09-25 13:45:39 -07:00
Ms2ger
c4d36b5721 Remove unused cx_for_dom_object function. 2014-09-25 22:35:38 +02:00
Ms2ger
1d00b28df0 Regroup uses of JS constants in utils.rs. 2014-09-25 22:35:38 +02:00
Ms2ger
47829a37a9 Move global_object_for_js_object to global.rs.
This appears to be a more sensible place for it (related to #433).
2014-09-25 22:35:37 +02:00
Cameron Zwarich
e7c9b71d3a Remove use of deprecated get_mut_ref 2014-09-25 13:33:38 -07:00
bors-servo
1fba32af9f Merge pull request #3434 from pcwalton/directly-floated-tables
layout: Float table wrappers directly instead of generating a block

Reviewed-by: glennw
2014-09-25 10:36:33 -06:00
Martin Robinson
0951936abb Merge pull request #3464 from mrobinson/scroll_offset
Allow iframes to scroll their contents
2014-09-25 08:41:51 -07:00
Patrick Walton
62bb9093d7 layout: Float table wrappers directly instead of generating a block
wrapper around them.

Fixes Wikipedia tables leaking out.

Along the way, I refactored tables' width calculation significantly.
This was necessary in order to properly handle floated tables, as some
of the logic had to be ported over from block flows.
2014-09-25 08:06:03 -07:00
Martin Robinson
65c6689bcc Compound scrolling offsets when setting content offset
When traversing the layer tree to assign content offset, the new offset
needs to take into account any additional offset from children that are
also scrolling roots. This means that when you scroll a parent frame, it
doesn't override the scroll position of its children, but adds to it.
2014-09-25 07:57:47 -07:00
Martin Robinson
f346a215f3 Don't let base layers override root layer size
Base layers (the background layer of each frame) shouldn't override the
size of their root layers. This allows base layers to scroll inside
root layer frames. This does mean that when determining the maximum
scroll position, we need to look at the size of scrolling root children
though.
2014-09-25 07:57:46 -07:00
Martin Robinson
e01c5cd863 Differentiate clearly how child layers handle scroll events
This allows the scroll handler to know if a child layer didn't handle
an event or the scroll position of the child layer was simply unchanged.
2014-09-25 07:57:46 -07:00
Martin Robinson
80433f7ea0 Properly size root layers
Root layers should be sized to their frame rectangles and the root of
the root layers should track the window size. This is important because
layers need to be properly sized to scroll.
2014-09-25 07:57:44 -07:00
Martin Robinson
6bbde703c1 Give root layers a scrollable policy
This allows iframe layers to move properly when their parents scroll
and is necessary to properly track their masking rects as their
children move and to draw their backgrounds in the proper position.
2014-09-25 07:57:14 -07:00
Martin Robinson
2724c3c6bb Store scrolling root scroll offset explicitly
Instead of sneakily setting the content offset and not the transform on
scrolling roots, let scrolling roots specify their scroll offset
directly and separately. This will also be important when adding proper
scrolling support for iframes.
2014-09-25 07:57:14 -07:00
bors-servo
e9a7b44f68 Merge pull request #3475 from pcwalton/block-formatting-context-fixes
layout: Consider relatively positioned blocks as possible block

Reviewed-by: glennw
2014-09-25 00:26:42 -06:00
Patrick Walton
fffc7aaf38 layout: Consider relatively positioned blocks as possible block
formatting contexts, and translate floats out of block formatting
contexts.

These improve Reddit.
2014-09-24 22:03:06 -07:00
bors-servo
8668e67a6b Merge pull request #3473 from servo/disable_travis
Disable travis

Reviewed-by: SimonSapin
2014-09-24 22:13:53 -06:00
Lars Bergstrom
726cd91fd9 Disable travis 2014-09-24 18:29:37 -06:00
Manish Goregaokar
95a4731c0e Merge pull request #3468 from Manishearth/jstraceable
Replace our usage our Encodable with JSTraceable; r=jdm
2014-09-24 21:25:41 +05:30
Josh Matthews
c7a575e793 Merge pull request #3465 from Ms2ger/ns
Handle null strings in Namespace::new.
2014-09-24 10:30:13 -04:00
Manish Goregaokar
6f6a62e967 Address review comments 2014-09-24 19:35:41 +05:30
Patrick Walton
d9f836bc75 Merge pull request #3458 from pcwalton/whitespace-nowrap
layout: Implement `white-space: nowrap`.
2014-09-23 20:22:33 -07:00
Manish Goregaokar
3b842c4f06 Merge pull request #3466 from Ms2ger/into_string
Remove redundant into_string() calls.; r=jdm
2014-09-24 08:10:17 +05:30
Manish Goregaokar
5336dd9853 Update docs 2014-09-24 05:44:53 +05:30
Manish Goregaokar
cc44a3b064 Use JSTraceable everywhere 2014-09-24 05:44:49 +05:30
glennw
98222cf24c Merge pull request #3459 from glennw/small-caps
Add support for small-caps font-variant.
2014-09-24 09:49:05 +10:00