Commit graph

989 commits

Author SHA1 Message Date
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
bors-servo
acde10f005 Auto merge of #7656 - mbrubeck:incremental-text-6501, r=pcwalton
Reconstruct flows when text/font styles change

These styles are used during text shaping.  When they change, we need to re-run shaping and construct new flows.

Fixes #6501. r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7656)
<!-- Reviewable:end -->
2015-09-18 01:32:40 -06:00
Matt Brubeck
0c77705f52 Reconstruct flows when text/font/list styles change
Fixes #6501.
2015-09-17 11:59:00 -07:00
Matt Brubeck
040c09fbc5 Always reset HAS_NEWLY_CONSTRUCTED_FLOW during flow construction
This extra reflows when the HAS_NEWLY_CONSTRUCTED_FLOW flag remained set
during a later reflow.  This masked other incremental layout bugs, including
the one tested by the reftest in the commit following this one.
2015-09-17 10:50:47 -07: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
Simon Sapin
feaf6f4c3f Initial support for custom properties in CSSStyleDeclaration 2015-09-17 14:48:56 +02:00
Patrick Walton
757e2cf4e5 layout: Reformat some long lines and fix some whitespace issues. 2015-09-17 13:31:17 +02:00
Patrick Walton
efdf435ba3 gfx: Paint the insertion point as a one-pixel wide line. 2015-09-17 13:31:13 +02:00
Patrick Walton
357419dc8d layout: Query and maintain the position of the insertion point
throughout layout for input elements.
2015-09-17 13:31:12 +02:00
bors-servo
9e914ca0db Auto merge of #7588 - notriddle:master, r=pcwalton
Actually store the overflow for inline-block elements.

Fixes #7571

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7588)
<!-- Reviewable:end -->
2015-09-17 00:53:04 -06:00
Martin Robinson
30963d76be Improve printing of DisplayLists
Use box tree characters to make DisplayLists easier to scan when
printing them out.
2015-09-16 12:31:38 -07:00
bors-servo
6a12f00d6d Auto merge of #7605 - nox:skew, r=mbrubeck
Implement "transform: skew()"

Thanks to @Jinwoo-Song for the original commit, which I just rebased and cleaned up. Fixes #6237.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7605)
<!-- Reviewable:end -->
2015-09-16 06:31:48 -06:00
Ali Sabil
2e9d8a76d1 Use cached element ID in LayoutElement::get_id 2015-09-13 23:55:40 +02:00
bors-servo
b05f4aa3aa Auto merge of #7559 - ddrmanxbxfr:RFC-0344-Work, r=nox
Remove 'get_*' on getters as per RFC 0344 on canevas, compositing, devtools, gfx, layout, net, profile, servo and webdriver_server

Hi guys,

I just gave a big pass of RFC-0344 as per issue #6224 .

Pretty much renamed all the get_* fn that were used to fetch values. 

I hope I didn't rename too much. 

As said in the issue discussion, I didn't touch at the scripts folder so we keep the unsafe ones pretty explicit.

I've ran the whole pass of test, everything seems to be still working right :).

Please give feedback on this PR.

Thanks for looking into it.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7559)
<!-- Reviewable:end -->
2015-09-12 18:29:56 -06:00
Mathieu Rheaume
7320433cca Remove 'get_*' on getters as per RFC 0344 on various components 2015-09-12 20:14:01 -04:00
Jinwoo Song
d524601cf5 CSS 'transformation: skew()' should take <angle> type as parameters
Current implementation is taking <number> type as parameter so skew()
does not work properly. Let the skew() to get <angle> as specification
described.

Fixes #6237.
2015-09-12 01:06:35 +02:00
Anthony Ramine
f11fcebd9c Bump euclid to 0.2 2015-09-12 01:06:26 +02:00
bors-servo
8d7ba12f28 Auto merge of #7600 - pcwalton:body-overflow-scroll, r=mbrubeck
layout: Allow the overflow area of the `<body>` to be scrolled.

Fixes scrolling on Twitter.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7600)
<!-- Reviewable:end -->
2015-09-11 11:20:13 -06:00
bors-servo
c3f9e1813a Auto merge of #7550 - pcwalton:block-formatting-context-overflow, r=mbrubeck
layout: Defend the block formatting context speculation against going wrong in the presence of blocks that overflow in the inline direction.

Makes the Google search result links appear.

Closes #7298.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7550)
<!-- Reviewable:end -->
2015-09-11 10:03:39 -06:00
Patrick Walton
99587cf105 layout: Allow the overflow area of the <body> to be scrolled.
Fixes scrolling on Twitter.
2015-09-10 18:07:21 -07:00
Michael Howell
029af81570 Actually store the overflow for inline-block elements.
Fixes #7571
2015-09-09 12:24:28 -07:00
bors-servo
c0381c7325 Auto merge of #7563 - mrobinson:layerize-stacking-contexts, r=pcwalton
Layerize StackingContexts that are on top of layers

StackingContexts that should be painted on top of StackingContexts that
are already layerized should automatically get their own layer. This
will ensure proper painting order.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7563)
<!-- Reviewable:end -->
2015-09-09 10:52:56 -06:00
Martin Robinson
184238c348 Layerize StackingContexts that are on top of layers
StackingContexts that should be painted on top of StackingContexts that
are already layerized should automatically get their own layer. This
will ensure proper painting order.
2015-09-09 09:13:14 -07:00
bors-servo
be9a9ffda1 Auto merge of #7523 - eefriedman:unnecessary-unsafe, r=SimonSapin
Fix up some unnecessary uses of `unsafe`.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7523)
<!-- Reviewable:end -->
2015-09-09 00:05:17 -06:00
bors-servo
4221b354cf Auto merge of #7557 - glennw:fix-layout-panic, r=pcwalton
Handle cases where the layout root is None. Fixes #6375.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7557)
<!-- Reviewable:end -->
2015-09-08 20:39:09 -06:00
bors-servo
282f9ade93 Auto merge of #7556 - ddrmanxbxfr:MutabilityCleanup, r=Ms2ger
Remove unnecessary `mut` on variables declared in components/layout/block.rs

Small cleanup over mutable variables in components/layout/block.rs.

Thanks for looking into it!

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7556)
<!-- Reviewable:end -->
2015-09-08 00:28:42 -06:00
Michael Howell
6228edfb4c Include the overflow of the inline block itself.
Closes #7372.
2015-09-07 20:27:06 -07:00
Glenn Watson
a02d28a732 Handle cases where the layout root is None. Fixes #6375. 2015-09-08 11:19:58 +10:00
Mathieu Rheaume
bd07426735 Remove unnecessary mut on variables declared in components/layout/block.rs 2015-09-07 20:58:20 -04:00
Patrick Walton
683290e109 layout: Use a special path that treats margin: auto as zero for inline-block
inline size computation.

Places the search icon in the right place on the Google SERPs.
2015-09-04 20:42:57 -07:00
bors-servo
aeb8dce2d9 Auto merge of #7534 - pcwalton:inline-absolute-out-of-flow, r=mbrubeck
layout: Lay absolutely-positioned blocks with inline containing blocks out of flow.

Removes the long space before the site-specific drop-down in the Google SERPs.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7534)
<!-- Reviewable:end -->
2015-09-04 19:59:11 -06:00
bors-servo
5bad6b1b6e Auto merge of #7502 - bjwbell:elliptical-borders, r=pcwalton
gfx: Add elliptical border radius support

TODO: Add code for parsing shorthand border-radius e.g. "border-radius: 10px 5% / 20px".

r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7502)
<!-- Reviewable:end -->
2015-09-04 18:46:24 -06:00
Patrick Walton
ded4a5793e layout: Defend the block formatting context speculation against going wrong in
the presence of blocks that overflow in the inline direction.

Makes the Google search result links appear.

Closes #7298.
2015-09-04 17:00:15 -07:00
bors-servo
8e0b010117 Auto merge of #7487 - mrobinson:paint-layer-upgrade, r=pcwalton
Have PaintLayers own StackingContexts instead of the opposite

Previously, StackingContexts might have a PaintLayer. We switch the
ownership, for several reasons:

   * We want PaintLayers to potentially contain something other
     than a StackingContext soon.
   * We want to delay the creation of PaintLayers until the last
     minute, so that we can synthesize new layers for sandwiched
     content.

This commit also implements the second goal. Instead of creating
PaintLayers during layout itself, wait until we are sorting and
layerizing a completed DisplayList.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7487)
<!-- Reviewable:end -->
2015-09-04 17:31:54 -06:00
Martin Robinson
4ca93c39d6 Have PaintLayers own StackingContexts instead of the opposite
Previously, StackingContexts might have a PaintLayer. We switch the
ownership, for several reasons:

   * We want PaintLayers to potentially contain something other
     than a StackingContext soon.
   * We want to delay the creation of PaintLayers until the last
     minute, so that we can synthesize new layers for sandwiched
     content.

This commit also implements the second goal. Instead of creating
PaintLayers during layout itself, wait until we are sorting and
layerizing a completed DisplayList.
2015-09-04 15:07:09 -07:00
Bryan Bell
3e5fb49b6f gfx: Add elliptical border radius support 2015-09-04 14:42:44 -07:00
Patrick Walton
2276d642fd layout: Stop double-counting position: relative offsets for stacking
contexts.

Fixes the location of the gear menu on the Google SERPs.
2015-09-04 09:28:18 -07:00
Manish Goregaokar
8e2c37a542 Fix match_refs and let_returns in layout, address review changes 2015-09-04 18:30:46 +05:30
Manish Goregaokar
5c24da3e2d Undo elision for trait object; trait objects are strange 2015-09-04 09:24:49 +05:30
Manish Goregaokar
e94df1ed5c Remove needless returns 2015-09-04 09:13:48 +05:30
Manish Goregaokar
2e02ea38fc Elide most 'b lifetimes 2015-09-04 09:02:12 +05:30
Manish Goregaokar
54c036cd66 Elide most 'a lifetimes 2015-09-04 08:55:51 +05:30
Patrick Walton
dba3e41a63 layout: Lay absolutely-positioned blocks with inline containing blocks out of
flow.

Removes the long space before the site-specific drop-down in the Google SERPs.
2015-09-03 15:37:40 -07:00
Patrick Walton
ee8741b7a8 layout: Fix several bugs relating to inline borders, padding, and
margins.

* The code that attempted to strip out borders that span multiple
  fragments in the same element could go wrong if fragments were
  stripped out due to text clumping or whitespace stripping. This patch
  rewrites that code to maintain flags in the inline fragment context
  specifying whether the node is the beginning or end of the element.
  Not only is this easier to maintain, it's closer in spirit to what roc
  originally suggested two years ago: it's isomorphic to "begin element,
  end element" markers for inline layout.

* Padding and margins for spans containing inline-blocks are now
  properly handled via a division of labor between the `InlineBlock`
  fragment and the `BlockFlow` that represents the inline-block.

* Unscanned text fragments may not be joined together into a text run if
  borders, padding, or margins separate them.

Because Servo now matches the rendering of Gecko and WebKit on the
`input_button_margins_a` reftest, I had to modify it to add some
vertical alignment.

The combined effect of all of these fixes places "Advertising" on the
right place on google.com.
2015-09-03 10:24:59 -07:00
Eli Friedman
94dec69247 Fix up some unnecessary uses of unsafe. 2015-09-02 15:50:17 -07:00
bors-servo
3424e234c8 Auto merge of #7499 - nerith:style, r=metajack
Improve style nit check for space after a comma

Fixes #7345.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7499)
<!-- Reviewable:end -->
2015-09-02 12:05:58 -06:00
bors-servo
a547ae6826 Auto merge of #7496 - servo:calc_, r=SimonSapin
Implement CSS3 Calc

This is #7185 with one commit added to make it build merged with master, which got support for the `ch` unit in the meantime.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7496)
<!-- Reviewable:end -->
2015-09-02 02:33:18 -06:00
Simon Sapin
40b4348824 Upgrade to rustc 1.4.0-dev (cb9323ec0 2015-09-01) 2015-09-02 09:22:17 +02:00