Commit graph

190 commits

Author SHA1 Message Date
Anthony Ramine
db8d502f41 Move util::logical_geometry to style 2016-02-18 10:17:13 +01:00
Anthony Ramine
290694b27e Move util::cursor to style_traits 2016-02-16 00:50:01 +01:00
Patrick Walton
7c5b2d6cb3 layout: Separate out overflow-for-scrolling from overflow-for-paint.
Closes #9484.
2016-02-03 16:06:24 -08:00
bors-servo
5e1f0495a9 Auto merge of #9170 - SimonSapin:multicol2, r=mbrubeck
Add CSS Multicolumn support with block fragmentation

![a](bfb198ac-b499-11e5-9936-c54c93d0b1ed.png)

Includes/supersedes #8763.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9170)
<!-- Reviewable:end -->
2016-01-30 00:49:14 +05:30
Simon Sapin
5498b54347 Add Multicolumn support block fragmentation. 2016-01-28 09:43:14 +01:00
Glenn Watson
183c3f5389 Fix panic when perspective property is zero. 2016-01-28 14:28:38 +10:00
bors-servo
8f7f7e11b7 Auto merge of #9341 - askalski:issue9338, r=KiChjang
Fix to issue 9338

Fixes #9338.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9341)
<!-- Reviewable:end -->
2016-01-18 20:30:41 +05:30
askalski
cf107bca4f replacing custom fmin function with standard f32.min in components/layout/display_list_builder.rs 2016-01-18 12:17:19 +01:00
Kishor Bhat
4c5eeb1f58 Remove unused imports in layout 2016-01-17 13:17:23 +05:30
rohan.prinja
1f02c4ebbb task -> thread 2016-01-10 17:58:13 +09:00
Martin Robinson
d720452698 Use DisplayListSection everywhere
DisplayListSection, StackingLevel, and BackgroundAndBorderLevel all
represent pretty much the same thing, a particular section of the
display list. Instead of maintaining three enums which do the same
thing, just use DisplayListSection everywhere. It's a superset of the
other two and this change will make it easier to flatten the DisplayList
in the future for WebRender.
2016-01-08 10:19:03 -08:00
bors-servo
58111a6420 Auto merge of #9177 - pcwalton:filter-out-useless-clips, r=glennw
gfx: Eagerly transform clips into `ClippingRegion::max()` if possible.

This helps WebRender look for useless clips and optimize them out.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9177)
<!-- Reviewable:end -->
2016-01-08 21:24:45 +05:30
Patrick Walton
3103b03262 gfx: Eagerly transform clips into ClippingRegion::max() if possible.
This helps WebRender look for useless clips and optimize them out.
2016-01-06 19:48:14 -08:00
Patrick Walton
fdb791bdd5 layout: Take the value of background-clip into account when
determining the painting area for background images and gradients.

See: https://drafts.csswg.org/css-backgrounds-3/#the-background-clip
2016-01-06 10:39:51 -08:00
bors-servo
f77c792886 Auto merge of #9055 - simartin:issue_9042, r=Wafflespeanut
Issue #9042: Report incorrect number of spaces around => in the style checker

Fixes https://github.com/servo/servo/issues/9042

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9055)
<!-- Reviewable:end -->
2015-12-24 10:55:48 +05:30
Simon Martin
cec661fa86 Issue #9042: Report incorrect number of spaces around => in the style checker. 2015-12-23 20:54:26 +01:00
bors-servo
68c4f290c7 Auto merge of #8938 - nerith:gfx, r=Ms2ger
Move LayerKind and ScrollPolicy enums to gfx_traits

Fixes #8836.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8938)
<!-- Reviewable:end -->
2015-12-23 18:38:51 +05:30
bors-servo
48388ad036 Auto merge of #9040 - mrobinson:fix-comment, r=nox
Remove a fixed TODO

Issue #2009 has already been fixed and closed so we can remove this TODO
entirely.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9040)
<!-- Reviewable:end -->
2015-12-22 20:40:13 +05:30
Martin Robinson
ecc58786b7 Remove workaround for Rect::is_empty
Now that euclid is up-to-date this workaround is no longer necessary.
2015-12-22 10:30:52 +01:00
Martin Robinson
74a23c9af2 Remove a fixed TODO
Issue #2009 has already been fixed and closed so we can remove this TODO
entirely.
2015-12-21 18:37:54 +01:00
Brandon Fairchild
637afecec9 Move LayerKind and ScrollPolicy enums to gfx_traits
This also moves LayerId and LayerProperties to gfx_traits.

Fixes #8836.
2015-12-20 20:43:31 -05:00
bors-servo
2dbc314e2d Auto merge of #8796 - cheba:zero-point, r=SimonSapin
Replaced ZERO_POINT with Point2D::zero()

This is a proposed in servo/servo#8792 clean up.

Fixes #8792.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8796)
<!-- Reviewable:end -->
2015-12-04 11:09:59 +05:30
Alexander Mankuta
ee746e252c Replaced ZERO_POINT with Point2D::zero() 2015-12-03 19:46:45 +02:00
Simon Sapin
b19cc7e44c Fix warnings
Fixing unused attributes warnings required updating serde_macros
which required updating to rustc 1.6.0-nightly (a2866e387 2015-11-30)
which required updating some other dependencies.
2015-12-03 17:05:26 +01:00
Martin Robinson
d572f1ca05 Properly make stacking contexts for inlines
Instead of making a stacking context out of inline fragments parent
flow, make the inline fragment itself the stacking context. This fixes
positioning and rendering of these sort of fragments and prevents
over-layerization.

Fixes #7424.
Fixes #5812.
2015-11-11 14:42:18 -08:00
Ms2ger
e9b77628ce Wrap SharedLayoutContext::canvas_layers_sender in a Mutex. 2015-11-07 11:23:48 +01:00
Martin Robinson
e5b2feda3f Remove DisplayListBuildingResult
Always produce a DisplayList when processing nodes for display list
construction. StackingContexts are now added to the positioned content
section of DisplayLists. This makes the code a bit simpler and opens up
the possibility of producing a StackingContext in another section of
the DisplayList. This doesn't change behavior, but is a cleanup
prerequisite for proper inline stacking context support.
2015-11-04 12:52:14 -08:00
Martin Robinson
c1a38e240a Mix stacking contexts into the positioned content list
Sometimes positioned content needs to be layered on top of stacking
contexts. The layer synthesis code can do this, but the current design
prevents it because stacking contexts are stored in a separate struct
member. In order to preserve tree order, mix stacking contexts into the
positioned content list, by adding a new StackingContextClass
DisplayItem. Such items do not have a base DisplayItem.

In some ways this simplifies the code, because we no longer have to
have a separate code path in the StackingContextLayerCreator.

Fixes #7779.
Fixes #7983.
Fixes #8122.
Fixes #8310.
2015-11-03 17:47:39 -08:00
bors-servo
b8f196f858 Auto merge of #8094 - glennw:fix-angle-gradients, r=pcwalton
Fix start and end points for linear gradients with angle specified.

Previously, this was most noticeable with 45deg gradients, where the gradient would end too early, and the remainder was filled with a solid color.

(This also fixes gradients on webrender, which relies on the start and stop points being correct).

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8094)
<!-- Reviewable:end -->
2015-10-26 17:59:39 -05:00
Ms2ger
a5a4ef7d70 Only construct a channel if necessary when building a fragment for a canvas. 2015-10-26 11:22:36 +01:00
Martin Robinson
30ba65b360 Integrate Canvas into the DisplayList
Canvas is currently given a layer at the stacking context level.
Instead it's DisplayItem should be given a layer directly. This fixes
painting order issues where canvases are painted on top of other
positioned content that is later in tree order. It always simplifies
the code a bit.
2015-10-21 14:00:20 -07:00
Martin Robinson
ac5525aeeb Integrate iframes into the display list
Instead of always promoting iframes to StackingContexts, integrate them
into the display list. This prevents stacking bugs when
non-stacking-context elements should be drawn on top of iframes.

To accomplish this, we add another step to ordering layer creation,
where LayeredItems in the DisplayList are added to layers described by
the LayerInfo structures collected at the end of the DisplayList.
Unlayered items that follow these layered items are added to
synthesized layers.

Another result of this change is that iframe layers can be positioned
directly at the location of the iframe fragment, eliminating the need
for the SubpageLayerInfo struct entirely.

Iframes are the first type of content treated this way, but this change
opens up the possibility to properly order canvas and all other layered
content that does not create a stacking context.

Fixes #7566.
Fixes #7796.
2015-10-20 07:29:06 -07:00
Glenn Watson
113778afaf Fix start and end points for linear gradients with angle specified.
Previously, this was most noticeable with 45deg gradients, where the gradient would end too early, and the remainder was filled with a solid color.

(This also fixes gradients on webrender, which relies on the start and stop points being correct).
2015-10-20 13:23:28 +10:00
Martin Robinson
f2a66af463 Z-index should be ignored for non-positioned stacking contexts
When a stacking-context is not positioned, its z-index should be
ignored. This is per CSS 2 9.9.1. The only exception to this is when
the z-index is applied to an element with display: flex | inline-flex.
inline-flex does not appear to be implemented at this time so we only
do this for flex.
2015-10-16 10:36:13 -07:00
bors-servo
1d617f332e Auto merge of #7899 - glennw:subpage-fixes-1, r=pcwalton
Remove constellation round trip for subpage mapping in compositor.

This makes use of the new functionality that allows iframes to generate their own pipeline IDs in order to remove any knowledge of subpage ids from the compositor.

(This is the first of several commits removing subpage from parts of servo).

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7899)
<!-- Reviewable:end -->
2015-10-07 18:36:35 -06:00
bors-servo
409fbafe9c Auto merge of #7883 - notriddle:master, r=pcwalton
Draw shadows after the background.

Fixes #7872

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7883)
<!-- Reviewable:end -->
2015-10-06 22:03:48 -06:00
Glenn Watson
da881947e5 Remove constellation round trip for subpage mapping in compositor.
This makes use of the new functionality that allows iframes to generate their own pipeline IDs in order to remove any knowledge of subpage ids from the compositor.

(This is the first of several commits removing subpage from parts of servo).
2015-10-07 12:24:15 +10:00
Patrick Walton
e3b988a1fe layout: Add a field in the display list for simple border radii on box
shadows.

Only supported in WebRender (with my upcoming PR) for now.
2015-10-06 14:04:50 -07:00
bors-servo
27d468b667 Auto merge of #7822 - mrobinson:layer-info, r=pcwalton
Rework how StackingContexts are dynamically added to layers

StackingContexts are added to layers when it is necessary to maintain
their ordering on top of other layered StackingContexts. Instead of
tracking the information about a layer scattered around into different
structs, combine it all into LayerInfo. LayerInfo will be used in the
future to hold layer information for DisplayItems that are layerized
independently of StackingContexts.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7822)
<!-- Reviewable:end -->
2015-10-05 23:05:21 -06:00
Michael Howell
75a08cc6ca Draw shadows after the background.
Fixes #7872
2015-10-05 14:43:32 -07:00
Martin Robinson
553f1fc192 Rework how StackingContexts are dynamically added to layers
StackingContexts are added to layers when it is necessary to maintain
their ordering on top of other layered StackingContexts. Instead of
tracking the information about a layer scattered around into different
structs, combine it all into LayerInfo. LayerInfo will be used in the
future to hold layer information for DisplayItems that are layerized
independently of StackingContexts.
2015-10-05 13:35:31 -07:00
Michael Howell
bb5234767d Create a pseudo-stacking context for positioned floats.
Fixes #7828
2015-10-05 11:27:32 -07:00
bors-servo
bb7742eecf Auto merge of #7804 - mrobinson:cleanup-stacking-context-creation, r=pcwalton
Simplify stacking context creation

Have Fragment::create_stacking_context understand which stacking
contexts need layers and which do not. This simplifies the way it is
called and eliminates a bunch of code.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7804)
<!-- Reviewable:end -->
2015-09-30 18:11:29 -06:00
Martin Robinson
1a494b1a73 Simplify stacking context creation
Have Fragment::create_stacking_context understand which stacking
contexts need layers and which do not. This simplifies the way it is
called and eliminates a bunch of code.
2015-09-30 16:09:03 -07:00
Glenn Watson
339a3f869b Split Au type into separate crate, with minimal dependencies. 2015-10-01 07:16:11 +10:00
Patrick Walton
c72d0c2ed0 layout: Make the compositor rather than layout determine the position of
each iframe.

The old code that attempted to do this during layout wasn't able to work
for multiple reasons: it couldn't know where the iframe was going to be
on the page (because of nested iframes), and at the time it was building
the display list for a fragment it couldn't know where that fragment was
going to be in page coordinates.

This patch rewrites that code so that both the sizes and positions of
iframes are determined by the compositor. Layout layerizes all iframes
and marks the iframe layers with the appropriate pipeline and subpage
IDs so that the compositor can place them correctly. This approach is
similar in spirit to Gecko's `RefLayer` infrastructure. The logic that
determines when it is time to take the screenshot for reftests has been
significantly revamped to deal with this change in delegation of
responsibility.

Additionally, this code removes the infrastructure that sends layout
data back to the layout task to be destroyed, since it is now all
thread-safe and can be destroyed on the script task.

The failing tests now fail because of a pre-existing bug related to
intrinsic heights and borders on inline replaced elements. They happened
to pass before because we never rendered the iframes at all, which meant
they never had a chance to draw the red border the tests expect to not
render!

Closes #7377.
2015-09-29 09:47:28 -07:00
Ravi Shankar
889eec364b sorted the extern crate, mod & use declarations 2015-09-24 02:12:45 +05:30
Brandon Fairchild
de3547e401 Fix reported test-tidy errors for unmerged import blocks
This merges import blocks that were reported by tidy as unmerged.
2015-09-19 12:50:14 -04:00
Martin Robinson
1e6f797268 Ensure unique LayerIds for pseudo-elements
Currently pseudo-elements, like the fragments created for ::before and
::after, with layers will have the same LayerId as the body of their
owning fragments. Instead all LayerIds should be unique.

Fixes #2010.
2015-09-17 06:42:29 -07:00
Patrick Walton
757e2cf4e5 layout: Reformat some long lines and fix some whitespace issues. 2015-09-17 13:31:17 +02:00