Commit graph

16155 commits

Author SHA1 Message Date
Manish Goregaokar
8de00ab999 Remove Traceable from browsercontext.rs 2014-10-05 21:12:26 +05:30
Manish Goregaokar
b908d5accb Remove Traceable from attr.rs 2014-10-05 21:12:26 +05:30
Ms2ger
e8de0d2b5e Remove the managed_boxes feature. 2014-10-04 15:30:42 +02:00
Ms2ger
31f8100b9d Cleanup URL handling in ScriptTask::load a bit.
This should make it clearer that we always pass a URL to Document::new, and
avoids an unnecessary unwrap() call.
2014-10-04 15:19:08 +02:00
Ms2ger
208afda890 Stop reference-counting the ScriptTask.
The ScriptTask is owned by the proc in ScriptTaskFactory::create.

We started using a managed box for what would eventually become ScriptTask in
d21d27e086.
2014-10-04 13:14:23 +02:00
Andrew Guertin
815a701455 Replace Cell<Option<JS<T>>> with MutNullableJS<T>
https://github.com/servo/servo/issues/3564
2014-10-03 20:08:05 -04:00
bors-servo
a6cd13c890 auto merge of #3567 : mrobinson/servo/optimizer, r=zwarich
The page_rect passed to DisplayListOptimizer is relative to the
RenderLayer origin, but the display list components are relative to the
page origin. Before passing the page rect to the display list, we
translate it by the RenderLayer position.
2014-10-03 16:27:25 -06:00
Martin Robinson
ec29723f2b Account for RenderLayer position when optimizing display list
The page_rect passed to DisplayListOptimizer is relative to the
RenderLayer origin, but the display list components are relative to the
page origin. Before passing the page rect to the display list, we
translate it by the RenderLayer position.
2014-10-03 14:55:03 -07:00
bors-servo
d4e977a2be auto merge of #3566 : metajack/servo/fixup-unit-tests, r=mbrubeck
This adds the subpackages to `./mach test-unit`.
2014-10-03 09:57:26 -06:00
Ms2ger
75ee535e3c Use or_else in Document.find_fragment_node. 2014-10-03 09:20:54 +02:00
Jack Moffitt
7f6f072b02 Fix up and run unit tests.
This adds the subpackages to `./mach test-unit`.
2014-10-02 23:14:42 -06:00
Glenn Watson
dc1d66d3ce Add cmd line option to set user agent. Improves github when used. 2014-10-03 13:57:12 +10:00
Ms2ger
c96018152f Cleanup Document.find_fragment_node. 2014-10-02 19:54:12 +02:00
bors-servo
643a6d07a2 auto merge of #3558 : Ms2ger/servo/fragment-node, r=jdm 2014-10-02 10:15:27 -06:00
Ms2ger
4cc24e727b Clear the fragment_name field when resizing.
This reinstates the behaviour from before the change in
a1bf49c1ce.
2014-10-02 18:07:41 +02:00
Patrick Walton
dbdfce0695 gfx: Use subpixel positioning for glyphs.
Improves text rendering significantly.
2014-10-02 08:05:24 -07:00
Ms2ger
7508ca94b3 Remove the fragment_node field from Page (fixes #3543).
Since Page isn't reflected, it cannot be rooted, and pointers to JS-managed
objects inside it are not guaranteed to be traced. This may cause the pointer
to become dangling.
2014-10-02 15:31:26 +02:00
Ms2ger
5d335fd524 Move find_fragment_node to Document. 2014-10-02 12:04:05 +02:00
bors-servo
c7915028b4 auto merge of #3556 : pcwalton/servo/box-sizing, r=SimonSapin
Improves GitHub.
2014-10-01 23:39:26 -06:00
Patrick Walton
cdc59fe68a gfx: Fix imprecision in float_to_fixed.
Improves text rendering a lot.
2014-10-01 22:07:50 -07:00
Patrick Walton
885fc1c28b layout: Implement box-sizing: border-box.
Improves GitHub.
2014-10-01 20:24:34 -07:00
Patrick Walton
287fe3b3ab layout: Implement the correct hypothetical box behavior for
absolutely-positioned elements declared with `display: inline`.

Although the computed `display` property of elements with `position:
absolute` is `block`, `position: absolute; display: inline` can still
behave differently from `position: absolute; display: block`. This is
because the hypothetical box for `position: absolute` can be at the
position it would have been if it had `display: inline`. CSS 2.1 §
10.3.7 describes this case in a parenthetical:

"The static-position containing block is the containing block of a
hypothetical box that would have been the first box of the element if
its specified 'position' value had been 'static' and its specified
'float' had been 'none'. (Note that due to the rules in section 9.7 this
hypothetical calculation might require also assuming a different
computed value for 'display'.)"

To handle this, I had to change both style computation and layout. For
the former, I added an internal property
`-servo-display-for-hypothetical-box`, which stores the `display` value
supplied by the author, before the computed value is calculated. Flow
construction now uses this value.

As for layout, implementing the proper behavior is tricky because the
position of an inline fragment in the inline direction cannot be
determined until height assignment, which is a parallelism hazard
because in parallel layout widths are computed before heights. However,
in this particular case we can avoid the parallelism hazard because the
inline direction of a hypothetical box only affects the layout if an
absolutely-positioned element is unconstrained in the inline direction.
Therefore, we can just lay out such absolutely-positioned elements with
a bogus inline position and fix it up once the true inline position of
the hypothetical box is computed. The name for this fix-up process is
"late computation of inline position" (and the corresponding fix-up for
the block position is called "late computation of block position").

This improves the header on /r/rust.
2014-10-01 18:34:53 -07:00
bors-servo
f800960695 auto merge of #3520 : jdm/servo/formcontrols, r=pcwalton
So far the changes to layout seem fairly well-contained; I think this is worth integrating to give us a browser that is easier to dogfood (and allows us to work on things like form submission much easier), especially since the long-term viability of WebComponents-as-forms is not assured.
2014-10-01 16:45:29 -06:00
Josh Matthews
be41c203ac Fix linux build error. 2014-10-01 18:43:24 -04:00
bors-servo
479d8567d1 auto merge of #3538 : mrobinson/servo/events-and-layers, r=zwarich
Select the topmost layer at a given point to send mouse events and when
sending the event, ensure that they are relative to the layer origin,
rather than in absolute page coordinates.

Fixes #3504.
2014-10-01 14:33:26 -06:00
bors-servo
da6878a4e2 auto merge of #3539 : jamesberlage/servo/fix/meaningful-is, r=jdm
This is intended to address #3488.  [AnyPrivate](http://doc.rust-lang.org/core/any/trait.AnyPrivate.html) is now in the Rust core, so we can leverage that instead of writing an implementation.
2014-10-01 14:03:27 -06:00
Josh Matthews
7401cd0aeb Split a long line. 2014-10-01 15:40:37 -04:00
Josh Matthews
5794da904e Remove unneeded input type information from layout. 2014-10-01 15:40:36 -04:00
Josh Matthews
ca5d4633c2 Disallow wrapping on input elements. 2014-10-01 15:37:40 -04:00
Josh Matthews
8112859d55 Disallow toggling radio buttons. Use generated content for checkboxes and radio buttons. Switching to the glyph 0 for the average advance width. 2014-10-01 15:37:40 -04:00
Josh Matthews
f70bb68503 Implement simple layout for text, button, radio, and checkbox inputs. Implement simple interaction for checkboxes and radio buttons. 2014-10-01 15:35:42 -04:00
Josh Matthews
9b20d6e7d2 Add average advance width to the font metrics structure, using the X glyph as a best guess. 2014-10-01 15:03:15 -04:00
Josh Matthews
08cac68d5a Check if the immediate node is an element before looking at ancestors when clicking, and flush pending layout changes after dispatching the event. 2014-10-01 15:03:15 -04:00
Martin Robinson
8d93ac460d Fix layer selection and point translation for mouse events
Select the topmost layer at a given point to send mouse events and when
sending the event, ensure that they are relative to the layer origin,
rather than in absolute page coordinates.

Fixes #3504.
2014-10-01 11:23:15 -07:00
Martin Robinson
31a6270d52 No longer consider window size when scrolling
Now that scrolling roots are properly sized, we can simply look at the
scrolling root layer size when deciding the extents of layer scrolling.
This simplifies things a bit and further codifies the current model of
scrolling root + mask_to_bounds.
2014-10-01 10:58:35 -07:00
Jim Berlage
28e29dc32e Use std::intrinsics::TypeId
Fix indentation + update comment
2014-10-01 13:56:34 -04:00
bors-servo
bae5440689 auto merge of #3531 : Ms2ger/servo/MutNullableJS, r=Ms2ger
Extracted from #3527.
2014-10-01 09:09:28 -06:00
Josh Matthews
54fcab61d6 Implement MutNullableJS for mutable, nullable member pointers to DOM objects. 2014-10-01 17:06:23 +02:00
Cameron Zwarich
0ef191b37a Remove an extra lifetime parameter on PrivateTreeWalkerHelpers 2014-10-01 02:07:52 -07:00
Cameron Zwarich
72656717d4 Remove an extra lifetime parameter on NodeHelpers 2014-10-01 02:07:46 -07:00
Cameron Zwarich
78791af7d6 Convert the NodeHelpers trait to use self methods 2014-09-30 23:42:03 -07:00
Cameron Zwarich
8b0361e251 Remove an unused lifetime parameter 2014-09-30 21:26:19 -07:00
Cameron Zwarich
79b4ec99b4 Convert TNode / TElement to use self methods rather than &self 2014-09-30 21:26:19 -07:00
Cameron Zwarich
63314208c0 Add Copy bounds to TNode / TElement 2014-09-30 21:26:19 -07:00
Cameron Zwarich
1581c383bb Convert the remaining ElementHelpers methods to take self 2014-09-30 21:26:19 -07:00
Cameron Zwarich
ccc5d976f7 Refine a lifetime parameter on TElement's get_local_name 2014-09-30 21:22:24 -07:00
Cameron Zwarich
e894499c17 Disambiguate methods without using trait objects 2014-09-30 21:22:24 -07:00
Cameron Zwarich
be9618d55b Add a lifetime parameter to the ElementHelper trait
This refines the lifetime used in get_local_name / get_namespace and
makes it independent of the lifetime on the &self parameter.
2014-09-30 21:21:00 -07:00
Cameron Zwarich
4ef0f39c78 Remove a prefix from a method name by manually resolving methods 2014-09-30 21:21:00 -07:00
bors-servo
6358b7d94e auto merge of #3537 : mrobinson/servo/scale, r=zwarich
When interacting with Layers it is simpler to use LayerPixels, which
are unscaled pixels in the Layer coordinate system. This removes a lot
of room for error and makes things simpler.
2014-09-30 18:57:26 -06:00