Commit graph

1036 commits

Author SHA1 Message Date
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
Anthony Ramine
aab2c40389 Generate the TypeId enums in codegen 2015-10-14 18:45:35 +02:00
Corey Farwell
20beaf5af3 Fix issues found by rust-clippy 2015-10-12 20:21:49 -04:00
Corey Farwell
81e034885b Cleanup code that was warned by rust-clippy 2015-10-11 20:47:45 -04:00
bors-servo
12139f73ef Auto merge of #7925 - Ms2ger:iframe-pipeline-layout, r=glennw
Implement HTMLIFrameElement::pipeline_id on LayoutJS<HTMLIFrameElement>.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7925)
<!-- Reviewable:end -->
2015-10-09 09:49:08 -06:00
bors-servo
ab42ca4296 Auto merge of #7825 - eefriedman:div-align, r=mbrubeck
Fully implement the "align descendants" rule for div.

This adds -servo-left and -servo-right to complement -servo-center.

~~This intentionally doesn't try to address issue #7301.~~  Commit added to address #7301.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7825)
<!-- Reviewable:end -->
2015-10-08 12:20:55 -06:00
Ms2ger
25c19f77af Implement HTMLIFrameElement::pipeline_id on LayoutJS<HTMLIFrameElement>. 2015-10-08 11:00:56 +02: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
098bdb5f22 Auto merge of #7807 - glennw:pid, r=jdm
Make it possible for iframes to create their own pipeline ID.

This doesn't change any functionality, but it's the first step towards removing SubpageId.

Adding this change now will allow us to gradually change over code referencing subpage id rather than in one massive PR.

Introduces a namespace for pipeline ID generation - there is a namespace for the constellation thread, and one per script thread.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7807)
<!-- Reviewable:end -->
2015-10-06 01:08:32 -06:00
Glenn Watson
5645dba1fa Make it possible for iframes to create their own pipeline ID.
This doesn't change any functionality, but it's the first step towards removing SubpageId.

Adding this change now will allow us to gradually change over code referencing subpage id rather than in one massive PR.

Introduces a namespace for pipeline ID generation - there is a namespace for the constellation thread, and one per script thread.
2015-10-06 17:06:53 +10: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
bors-servo
297184c6e0 Auto merge of #7834 - notriddle:float-stacking, r=pcwalton
Create a pseudo-stacking context for positioned floats.

Fixes #7828 

That was surprisingly easy...

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7834)
<!-- Reviewable:end -->
2015-10-05 12:30:10 -06:00
Michael Howell
bb5234767d Create a pseudo-stacking context for positioned floats.
Fixes #7828
2015-10-05 11:27:32 -07:00
bors-servo
a350b215cc Auto merge of #7867 - Ms2ger:layoutjs, r=nox
Move some methods from RawLayoutElementHelpers to LayoutElementHelpers.

This is part of a long-term plan to ensure layout never has access to
unwrapped pointers to DOM objects. The remaining methods on the
RawLayoutElementHelpers trait are harder to move, because of the lifetimes in
their signatures.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7867)
<!-- Reviewable:end -->
2015-10-05 08:19:21 -06:00
bors-servo
e616f4a74c Auto merge of #7817 - mbrubeck:prune, r=nox
Remove unused PostorderDomTraversal::should_prune

r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7817)
<!-- Reviewable:end -->
2015-10-05 05:23:20 -06:00
Ms2ger
1552022d96 Move some methods from RawLayoutElementHelpers to LayoutElementHelpers.
This is part of a long-term plan to ensure layout never has access to
unwrapped pointers to DOM objects. The remaining methods on the
RawLayoutElementHelpers trait are harder to move, because of the lifetimes in
their signatures.
2015-10-05 11:40:37 +02:00
Eli Friedman
a31461bad9 Make "align descendants" rule use parent's text-align.
Flows never care about their own text-align, only the text-align of
their parent; change the text-align flags to account for that.  Make the
"align descendants" rule use the flags instead of the current node's style.

Fixes #7301.
2015-10-02 12:53:43 -07:00
Eli Friedman
69ca066802 Fully implement the "align descendants" rule for div.
This adds -servo-left and -servo-right to complement -servo-center.

This intentionally doesn't try to address issue #7301.
2015-10-02 12:53:20 -07:00
Matt Brubeck
6426f714bd Incremental layout: Don't try to repair text fragment styles
Fixes #7814.
2015-10-01 15:07:39 -07:00
Matt Brubeck
52eda16cca Remove unused PostorderDomTraversal::should_prune 2015-10-01 10:01:07 -07:00
bors-servo
a7743052ca Auto merge of #6185 - luniv:viewport-meta, r=mbrubeck
Implement <meta name=viewport> handling

Translate <meta name=viewport> as according to [CSS Device Adaption § 9](http://dev.w3.org/csswg/css-device-adapt/#viewport-meta)

Note: as the PR currently stands, handling `<meta name=viewport>` elements always occurs. This is probably not desired for some contexts (e.g. desktop), but I'm unsure of how to conditionally handle elements based on that.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6185)
<!-- Reviewable:end -->
2015-09-30 22:49:41 -06:00
bors-servo
0860be4c28 Auto merge of #7811 - glennw:use-crates-au, r=larsbergstrom
Update servo to use published app units crate



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7811)
<!-- Reviewable:end -->
2015-09-30 22:21:36 -06:00
James Gilbertson
d0ace58452 Handle <meta name=viewport> elements when added to document 2015-09-30 20:31:35 -07:00
Glenn Watson
1999ea5e43 Update servo to use published app units crate 2015-10-01 11:45:35 +10: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
bors-servo
a0cb657fe8 Auto merge of #7423 - pcwalton:iframe-stacking-context-position, r=glennw
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 only the size of an iframe is
determined during layout, and the position is determined by the
compositor. Layout layerizes iframes and marks the iframe layers with
the appropriate subpage ID so that the compositor can place them
correctly.

Closes #7377.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7423)
<!-- Reviewable:end -->
2015-09-29 19:26:49 -06:00
bors-servo
a144d086d9 Auto merge of #7786 - mbrubeck:harfbuzz-sys, r=pcwalton
Use Harfbuzz 1.0 and unicode-script for text shaping

Depends on servo/rust-harfbuzz#53 and introduces a dependency on the new servo/unicode-script crate.  r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7786)
<!-- Reviewable:end -->
2015-09-29 15:37:11 -06:00
Matt Brubeck
6304186f4f Fix text-transform:capitalize across text runs 2015-09-29 14:34:50 -07:00
Matt Brubeck
371e6897e1 Break text runs by unicode script 2015-09-29 14:34:49 -07:00
bors-servo
0c64e4a2c9 Auto merge of #7764 - j3parker:input-caret-only-for-text, r=pcwalton
Only display text carets in text inputs

For #7756

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7764)
<!-- Reviewable:end -->
2015-09-29 14:13:32 -06: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
Matt Brubeck
441cc479a3 Use the correct container size in compute_overflow
Fixes #7768 - positioning of RTL stacking contexts.
2015-09-28 11:57:40 -07:00
Jacob Parker
9cf43877f2 Only display text carets in text inputs 2015-09-27 19:23:20 -04:00
Patrick Walton
1892b27daf layout: Do a couple of minor style cleanups. 2015-09-27 15:38:22 -07:00
Patrick Walton
9bb6acd690 layout: Load Web fonts asynchronously.
Improves page load times significantly.

Closes #7343.
2015-09-27 15:38:20 -07:00
Eli Friedman
f0da2a3701 Delete dead code.
(#[cfg(debug)] is false in every normal servo configuration, and the
code in question doesn't compile.)
2015-09-26 00:23:03 -07:00
bors-servo
b4b3cedc10 Auto merge of #7724 - glennw:expire-anims, r=pcwalton
Ensure that animations expire correctly and stop compositing occurring after they finish.

There were two problems here:

(1) The animation state update function was only called when nodes were dirty or there were new animations.
(2) When all animations for a node expired, the entry from the hash table was not removed.

The result was that once an animation began, the compositor would be running as fast as it can forever.

Fixes #7721.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7724)
<!-- Reviewable:end -->
2015-09-23 18:46:29 -06:00
Glenn Watson
f6cb6c3b86 Ensure that animations expire correctly and stop compositing occurring after they finish.
There were two problems here:
(1) The animation state update function was only called when nodes were dirty or there were new animations.
(2) When all animations for a node expired, the entry from the hash table was not removed.

The result was that once an animation began, the compositor would be running as fast as it can forever.

Fixes #7721.
2015-09-24 10:29:58 +10:00
Ravi Shankar
889eec364b sorted the extern crate, mod & use declarations 2015-09-24 02:12:45 +05:30
Manish Goregaokar
3c969b346a Upgrade rust to f93ab64d4a1a7ee91759a1594ab2a426b6cc657e/rustc-1.5.0-dev. 2015-09-23 14:44:59 +02:00
bors-servo
d1269294e6 Auto merge of #7611 - nox:cache-element-id, r=frewsxcv
Cache the `id` attribute on Element

Thanks to @asabil for the original work, I only rebased it.

Fixes #6359 and #7040.


<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7611)
<!-- Reviewable:end -->
2015-09-20 09:23:20 -06:00
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
Hugo Thiessard
6565e7b02f Issue #7390 correct the order of mod declaration 2015-09-18 22:02:04 +02:00