Commit graph

1514 commits

Author SHA1 Message Date
Michael Howell
3c2210c5fc Propogate transformed clipping regions to nested flows.
Fixes #10559
2016-04-13 11:50:50 -07:00
Michael Howell
6c9efbf383 Take transform:translate into account when computing clipping regions.
Note that this only works for translation; a more general fix would
require major changes to how display lists work.

Closes #10431?
2016-04-12 14:39:13 -07:00
Patrick Walton
6a6b688fa8 layout: Make inner scroll wrappers acquire the overflow region of their
contents.

Makes Twitter pages show up when scrolling, if WebRender is not in use.
WebRender does not yet support overflow:scroll.
2016-04-08 18:18:49 -07:00
bors-servo
0a1efe4578 Auto merge of #10320 - malayaleecoder:master, r=KiChjang
Rename imm_child_iter() and child_iter().

Fixes #10286

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10320)
<!-- Reviewable:end -->
2016-04-09 03:54:40 +05:30
malayaleecoder
d4dcaf3167 Rename imm_child_iter() and child_iter(). Fixes #10286 2016-04-09 01:18:00 +05:30
Per Lundberg
96835c6d6f Renamed style structs.
The idea is to rename all style structs from Foo to ServoFoo, as described out in #10185.
2016-04-08 21:47:36 +03:00
bors-servo
a026e86267 Auto merge of #10444 - danlrobertson:fix9824, r=asajeffrey
Correct x and y input for origin_rect

Fix error in construction of the `origin_rect` for `UnioningFragmentBorderBoxIterator`.

r? @asajeffrey

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10444)
<!-- Reviewable:end -->
2016-04-08 20:35:32 +05:30
bors-servo
bd2051d06a Auto merge of #10469 - mbrubeck:layout-misc, r=pcwalton
Some minor layout cleanups

* Prevent unnecessary copying in `strip_leading_whitespace_if_necessary`
* Remove unused argument to `adjust_clipping_region_for_children` (silences a compiler warning)

r? @pcwalton

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10469)
<!-- Reviewable:end -->
2016-04-08 10:10:11 +05:30
Matt Brubeck
66806229ad Prevent unnecessary copying in strip_leading_whitespace_if_necessary 2016-04-07 16:24:10 -07:00
Matt Brubeck
cac06e579c Remove unused argument to adjust_clipping_region_for_children 2016-04-07 16:22:51 -07:00
Matt Brubeck
32aad0838e Draw insertion point even for empty input fields
This allows text layout to generate an empty text fragment if the fragment
contains the insertion point for a text input box.
2016-04-07 16:09:35 -07:00
Matt Brubeck
831243af7c Fix insertion point layout for text runs with multiple fragments
Before this fix, if a TextRun containing an insertion point was split into
multiple ScannedText fragments, text layout would draw an insertion point
inside of each of the fragments.  This patch records the insertion point
position at most once per TextRun, and copies it only into the appropriate
ScannedText fragment.
2016-04-07 16:00:49 -07:00
Matt Brubeck
bcaa62e1bd Slight refactoring of RunMapping flush method 2016-04-07 16:00:14 -07:00
bors-servo
39ab006c8f Auto merge of #10402 - mbrubeck:make_mut, r=pcwalton
Avoid unnecessary Arc::clone and Arc::make_mut

r? @pcwalton

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10402)
<!-- Reviewable:end -->
2016-04-07 23:22:37 +05:30
Patrick Walton
1e884ddc69 layout: Allow non-absolutely-positioned elements with overflow: scroll
set to be scrolled.

This makes them establish stacking contexts, which is a CSS 2.1 spec
violation. However, we were already violating the spec here for
absolutely-positioned elements with `overflow: scroll`. It will probably
be easier to fix this spec violation once we either switch entirely to
WebRender or we have multiple layers per stacking context.

Closes #2742.
2016-04-06 17:58:47 -07:00
Daniel Robertson
44832a87af Correct x and y input for origin_rect
Fix error in construction of the origin_rect for
UnioningFragmentBorderBoxIterator.
2016-04-06 18:11:59 -04:00
Matt Brubeck
d276e9bc4c Remove an unnecessary Arc::clone 2016-04-06 15:06:51 -07:00
bors-servo
256b865055 Auto merge of #10407 - mauricioc:issue10403, r=bholley
Move some CSS properties to match Gecko's representation

Fixes #10403. Animation had an extra transition-delay property, which was also moved to Box. Let me know if I should squash the commits.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10407)
<!-- Reviewable:end -->
2016-04-07 03:18:15 +05:30
bors-servo
cb943b016f Auto merge of #10419 - notriddle:whitespace_border, r=mbrubeck
Whitespace stripping should not result in a dangling, open border.

No open issue (found it while working on #7681).

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10419)
<!-- Reviewable:end -->
2016-04-06 15:30:51 +05:30
Michael Howell
2b75ef09f7 Whitespace stripping should not result in a dangling, open border. 2016-04-05 11:39:49 -07:00
Mauricio Collares
d8222dd63d Move CSS line-height property from InheritedBox to InheritedText 2016-04-05 00:28:18 -03:00
Mauricio Collares
bbc5c51be8 Move CSS flex-direction property from Flex to Position and delete Flex 2016-04-05 00:28:08 -03:00
Mauricio Collares
aae8919da4 Move some CSS properties from Box to Position 2016-04-05 00:21:49 -03:00
Mauricio Collares
281e385ab2 Rename PositionOffsets to Position 2016-04-05 00:21:48 -03:00
Mauricio Collares
841aef06e0 Move CSS content property from Box to Counters 2016-04-05 00:21:47 -03:00
Mauricio Collares
8c8090b5cd Move CSS text-shadow property from Effects to InheritedText 2016-04-05 00:21:46 -03:00
Mauricio Collares
347cf0580c Move CSS text-overflow property from InheritedText to Text 2016-04-05 00:21:39 -03:00
Mauricio Collares
4f0558e84f Move CSS image-rendering property from Effects to InheritedBox 2016-04-04 21:36:51 -03:00
bors-servo
2477cfc9b4 Auto merge of #10330 - danlrobertson:flex-axes, r=SimonSapin
Compute available main and cross size of flex containers

Compute the available main and cross size of flex containers, and add a helper for min/main constraints. Currently, this should only impact inline sizing. I wanted to get some feedback before I made more changes. Will probably need to be rebased if #10178 is merged first or visa versa.

Specs:
https://drafts.csswg.org/css-flexbox/#line-sizing
https://drafts.csswg.org/css2/visudet.html#min-max-widths
https://drafts.csswg.org/css2/visudet.html#min-max-heights

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10330)
<!-- Reviewable:end -->
2016-04-04 21:18:45 +05:30
Rizky Luthfianto
07584b9f29 Implement Document#elementsFromPoint 2016-04-03 21:44:01 +07:00
Daniel Robertson
7946ebb36a Compute size of the axes of flex containers
Compute the available main and cross size of flex containers, and add a
helper for min/main constraints
2016-03-31 22:53:48 -04:00
Emilio Cobos Álvarez
4460712a8f layout: Propagate selected_style to InlineFragmentNodeInfo 2016-03-30 14:28:13 +02:00
Emilio Cobos Álvarez
359f7b7953 layout: Fix whitespace selected style 2016-03-30 14:28:12 +02:00
Emilio Cobos Álvarez
5303048c06 layout: prevent an extra arc clone for selected_style 2016-03-30 14:28:11 +02:00
Emilio Cobos Álvarez
92f39ea5cf Implement ::selection pseudo-element 2016-03-30 14:28:11 +02:00
bors-servo
77444d00be Auto merge of #10279 - notriddle:issue_10258, r=mbrubeck
Fix #10258

Respect border-box when computing the relative sizes of children.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10279)
<!-- Reviewable:end -->
2016-03-30 12:48:40 +05:30
bors-servo
0ec96ac02a Auto merge of #10277 - perlun:rename-tcomputedvalues-to-computedvalues, r=SimonSapin
Renamed TComputedValues to ComputedValues

This is a followup to #10210, and a continuation of #10185.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10277)
<!-- Reviewable:end -->
2016-03-30 11:04:57 +05:30
bors-servo
44b2ba2547 Auto merge of #10255 - mbrubeck:box-unscanned, r=pcwalton
Reduce size of layout::fragment::Fragment struct

This reduces the size of the SpecificFragmentInfo enum from 48 to 24.

r? @pcwalton

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10255)
<!-- Reviewable:end -->
2016-03-30 07:49:25 +05:30
Michael Howell
61c7ee917e Compute content box for children with box-sizing: border-box correctly.
Fixes #10258
2016-03-29 14:37:54 -07:00
Per Lundberg
4cb4cc93e4 Renamed TComputedValues to ComputedValues
This is a followup to #10210, and a continuation of #10185.
2016-03-29 23:30:13 +03:00
Matt Brubeck
f0f0265139 Unbox IframeFragmentInfo. 2016-03-29 08:40:13 -07:00
Matt Brubeck
31261f045e Put UnscannedTextFragmentInfo in a Box
This reduces the size of the SpecificFragmentInfo enum from 48 to 24.
2016-03-29 08:40:05 -07:00
Matt Brubeck
14e945f09a Add a unit test for Fragment size 2016-03-29 08:37:58 -07:00
bors-servo
639fdd6b12 Auto merge of #10210 - perlun:rename-computedvalues-to-servocomputedvalues, r=SimonSapin
ComputedValues is now ServoComputedValues

This is the first part of #10185. More to follow. I have built this locally with both servo and geckolib without errors; let's see if it succeeds on all platforms as well.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10210)
<!-- Reviewable:end -->
2016-03-29 18:25:40 +05:30
bors-servo
3f73321710 Auto merge of #10248 - pcwalton:float-speculation-with-negative-margins, r=mbrubeck
layout: Only take nonnegative margins into account when estimating inline placement of floats.

Otherwise, the heuristics can pass even when there are no floats,
causing block formatting contexts to be speculated to be flowing around
floats that don't exist!

Closes #10237.

r? @mbrubeck

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10248)
<!-- Reviewable:end -->
2016-03-29 16:04:01 +05:30
bors-servo
159be44193 Auto merge of #10246 - mbrubeck:strip-leading, r=pcwalton
Restore stripped whitespace before reflowing text fragments

Fixes #10200. r? @pcwalton

Note: The reftest uses a transition of non-zero duration, because I couldn't find any other way to reproduce the bug.  Unfortunately this makes it unreliable in debug builds. I tried to fix this using reftest-wait with setTimeout and requestAnimationFrame, but it still wouldn't complete the animation consistently.  To make the test work in debug builds we may need `transitionend` events (#10245) or a different way to reproduce the bug.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10246)
<!-- Reviewable:end -->
2016-03-29 14:30:40 +05:30
bors-servo
aac2da75f4 Auto merge of #8641 - notriddle:no_headless, r=glennw
No more headless compositor. Just the normal one.

Fixes #8573

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8641)
<!-- Reviewable:end -->
2016-03-29 12:42:01 +05:30
Patrick Walton
6eb58e2c54 layout: Only take nonnegative margins into account when estimating
inline placement of floats.

Otherwise, the heuristics can pass even when there are no floats,
causing block formatting contexts to be speculated to be flowing around
floats that don't exist!

Closes #10237.
2016-03-28 17:37:57 -07:00
Matt Brubeck
99885b1950 Restore stripped whitespace before reflowing text fragments
Fixes #10200.
2016-03-28 14:04:35 -07:00
Paul Rouget
2bbf35f2aa Use black on blue color for default selection color 2016-03-28 18:26:17 +08:00