Commit graph

2489 commits

Author SHA1 Message Date
Matt Brubeck
1807fd3cc5 Generate a fragment for an empty elements with borders or padding 2016-04-16 11:01:40 -07:00
Matt Brubeck
fbef2724bf Fix up inline context flags during text fragment scanning
This fixes two problems that could cause scanned text fragments to end up with
incorrect LAST_FRAGMENT_OF_ELEMENT or FIRST_FRAGMENT_OF_ELEMENT flags:

1. If a single unscanned fragment was split into multiple scanned fragments,
   then all of them would inherit its flags.  We need to clear these flags,
   except for the first and last scanned fragment.

2. When an unscanned fragment generated zero scanned fragments, we correctly
   called `meld_with_next_inline_fragment` to transfer LAST_FRAGMENT flags to
   the preceding fragment, but we didn't do anything to transfer
   FIRST_FRAGMENT flags to the following fragment.  We can fix this by calling
   `meld_with_prev_inline_fragment` on the following fragment.
2016-04-16 10:30:03 -07:00
Matt Brubeck
b607b3a932 Fix meld_with_next_inline_fragment and add meld_with_prev_inline_fragment
Factor out a new `meld_with_prev_inline_fragment` method that mirrors the
existing `meld_with_next_inline_fragment`.

This also fixes a bug in `meld_with_next` that was already fixed in the
`meld_with_prev` by @notriddle in #10419.  The bug is that it was traversing
the inline context nodes in the wrong order.  It should start at the outermost
enclosing node, since the fragments might be at different nesting levels under
some common ancestor.
2016-04-16 10:30:01 -07:00
Matt Brubeck
587314e52b Improve debug logging of non-printable chars 2016-04-16 10:30:00 -07:00
bors-servo
86778a0d71 Auto merge of #10644 - pcwalton:absolute-ib-split, r=mbrubeck
layout: Make absolutely-positioned blocks not generate {ib} splits.

Improves YouTube.

Closes #10642.

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/10644)
<!-- Reviewable:end -->
2016-04-16 06:58:47 +05:30
Patrick Walton
e840c7aaa0 layout: Make absolutely-positioned blocks not generate {ib} splits.
Improves YouTube.

Closes #10642.
2016-04-15 17:27:25 -07:00
Michael Howell
03be4583e0 Do not propagate floats in or out of absolutely positioned flows.
Fixes #10625
2016-04-15 16:01:23 -07:00
Patrick Walton
f69931552b layout: Disallow margins from collapsing through block formatting
contexts per CSS 2.1 § 8.3.1.

Closes #10449.
2016-04-14 17:24:26 -07:00
Patrick Walton
a3fd226341 layout: Disallow margins from collapsing through blocks with clearance
per CSS 2.1 § 8.3.1.

Fixes the test failure in #10458.
2016-04-14 17:24:24 -07:00
Patrick Walton
e32455f7b8 layout: Disallow margins from collapsing through blocks that have
floated children per CSS 2.1 § 8.3.1.

Fixes the test failure in #10458.
2016-04-14 11:22:40 -07:00
bors-servo
2b910678db Auto merge of #10587 - asajeffrey:add-failure-panic-message, r=Manishearth
Added panic message to failures.

Added the panic message to failures. This is a step towards #10334, since it gives us access to the panic error message when we fire a `mozbrowsererror` event. The remaining steps are also to record the backtrace, and to report the failure in the event.

<!-- 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/10587)
<!-- Reviewable:end -->
2016-04-14 19:55:17 +05:30
bors-servo
84f01d1d7b Auto merge of #10579 - notriddle:overflow_premature_clip, r=pcwalton
Propogate transformed clipping regions to nested flows.

Fixes #10559

<!-- 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/10579)
<!-- Reviewable:end -->
2016-04-14 03:32:33 +05:30
Alan Jeffrey
8c0fa01884 Added panic message to failures. 2016-04-13 16:09:48 -05:00
Michael Howell
3c2210c5fc Propogate transformed clipping regions to nested flows.
Fixes #10559
2016-04-13 11:50:50 -07:00
Emilio Cobos Álvarez
7712affd2c
layout: Minimal refactor in style_specified_intrinsic_inline_size to improve legibility. 2016-04-13 05:44:40 +02:00
Emilio Cobos Álvarez
3c105082b8
layout: take into account max and min inline size for canvas and images 2016-04-13 04:47:14 +02:00
Emilio Cobos Álvarez
8abefd7e5e
layout: Take in account max inline size for inline fragments 2016-04-13 04:47:14 +02:00
bors-servo
7e63c1be63 Auto merge of #10486 - notriddle:overflow_premature_clip, r=pcwalton
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?

<!-- 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/10486)
<!-- Reviewable:end -->
2016-04-13 07:12:38 +05:30
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
bors-servo
150338503d Auto merge of #10529 - pcwalton:nested-fixed-position-webrender, r=glennw
layout: Make child stacking contexts of fixed position stacking contexts also fixed position.

Improves YouTube.
Improves the Washington Post.

Closes #10526.

r? @glennw

<!-- 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/10529)
<!-- Reviewable:end -->
2016-04-12 10:38:11 +05:30
bors-servo
934ae41fc9 Auto merge of #10522 - KiChjang:input-cleanup, r=frewsxcv
Various cleanups in HTMLInputElement

<!-- 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/10522)
<!-- Reviewable:end -->
2016-04-12 07:56:38 +05:30
bors-servo
61865f66b5 Auto merge of #10505 - amarant:10491-HTMLInputElement-attr, r=KiChjang
Issue #10491 add HTMLInputElement attributes that reflect content ide…

…ntically

it uses a new version of string-cache https://github.com/servo/string-cache/pull/148

<!-- 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/10505)
<!-- Reviewable:end -->
2016-04-12 05:58:16 +05:30
Arnaud Marant
9b8f183cba Issue #10491 add HTMLInputElement attributes that reflect content identically
it uses a new version of string-cache https://github.com/servo/string-cache/pull/148
2016-04-12 00:15:57 +02:00
Daniel Robertson
3580f91291 Implement flexbox reordering
Add style property for order and implement reordering by this property
in flex flow. Based on previous work by @zentner-kyle.
2016-04-11 16:55:16 -04:00
Patrick Walton
8cc3e0660b layout: Make child stacking contexts of fixed position stacking contexts
also fixed position.

Improves YouTube.
Improves the Washington Post.

Closes #10526.
2016-04-11 13:36:31 -07:00
Keith Yeung
c9193eaeca Remove get_ prefix for functions in LayoutHTMLInputElementHelpers 2016-04-11 09:17:04 -04:00
Daniel Robertson
e0454e0b65 Add tests and clean up *_mode_assign_inline_sizes
Clean up block_mode_assign_inline_sizes and
inline_mode_assign_inline_sizes and add extra css tests.
2016-04-09 01:13:30 -04: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