Commit graph

10 commits

Author SHA1 Message Date
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
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
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
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
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
Martin Robinson
ea14fca1dc Store content offset in unscaled pixels
Content offset is now stored in unscaled pixels, so that it can be
applied to tile positions during compositor rendering without unscaling
it. This means that when using it in calculations of layer size (stored
in device pixels), we need to scale it. Scene scale is now stored as a
scale rather than a transformation.

Fixes #3269.
Fixes #3042.
2014-09-16 08:57:08 -07:00
Jack Moffitt
c6ab60dbfc Cargoify servo 2014-09-08 20:21:42 -06:00
Renamed from src/components/compositing/events.rs (Browse further)