Commit graph

290 commits

Author SHA1 Message Date
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
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
Martin Robinson
62ef7cd7ff Use LayerPixel for Layer bounds and most arguments
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 17:42:00 -07:00
bors-servo
93e259227a auto merge of #3536 : zwarich/servo/more-jsref, r=Manishearth
This also removes the unnecessary formation of a trait object.
2014-09-30 18:39:27 -06:00
Cameron Zwarich
3953456b61 Convert a method from &JSRef to JSRef
This also removes the unnecessary formation of a trait object.
2014-09-30 15:55:05 -07:00
Glenn Watson
55ef7ca5ad Refactor background image, fix fixed attachment. Improve acid2. 2014-10-01 08:54:24 +10:00
Keegan McAllister
d50114c41d Use string-cache's Namespace type 2014-09-29 21:40:54 -07:00
Keegan McAllister
6429750b33 Eliminate servo_util::atom
We only needed this for Encodable, and now we use JSTraceable instead.
2014-09-29 18:39:36 -07:00
Martin Robinson
a75594d7cf Mask root layer rectangles to their boundaries
This prevents iframes contents from overflowing their root layers.
2014-09-29 16:42:26 -07:00
Matt Brubeck
5f0d2ae98c Pass a viewport to the rendering code
Part of servo/rust-layers#114
2014-09-29 15:48:42 -07:00
Glenn Watson
52c5007b07 Add support for <super> and <sup> tags. Fixes equations on wikipedia. 2014-09-30 07:12:54 +10:00
Bruno de Oliveira Abinader
4e6785f513 CSS selector :enabled no longer matches Anchor, Area & Link elements
HTML spec has been modified [1] to disable support for :enabled CSS
selector on Anchor, Area & Link elements, after discussion on W3C
Bugzilla [2].

[1] https://html5.org/r/8818
[2] https://www.w3.org/Bugs/Public/show_bug.cgi?id=26622
2014-09-29 13:06:03 -04:00
Simon Sapin
3996a15adb Enable rustdoc for the style crate. Fix #2924.
We’re now at a Rust version that has a fix for
https://github.com/rust-lang/rust/issues/16274
2014-09-29 17:41:45 +01:00
Simon Sapin
b3245fa407 Upgrade to rustc d2b30f7d3 2014-09-23 2014-09-29 17:41:45 +01:00
Ms2ger
e72b5613ee Don't move the data when extracting the bytes in XMLHttpRequest::Send.
The data is used later to set the Content-Type header. Current rustc
(4d2af3861) does not detect this use-after-move, but treats the later use as
if the data was None. It will, however, detect the bug in d2b30f7d3, which we
are upgrading to.
2014-09-29 17:52:44 +02:00
Glenn Watson
e237519fdd Revert "Set default resolution to 1280x1024 now that reftests render to FBO."
This reverts commit c74798bb6b.
2014-09-29 10:10:37 +10:00
Glenn Watson
c74798bb6b Set default resolution to 1280x1024 now that reftests render to FBO. 2014-09-29 07:42:45 +10:00