Commit graph

1876 commits

Author SHA1 Message Date
Glenn Watson
6b1104e7f6 Update webrender to master, including shaders.
This updates webrender to include the webgl related changes
needed for this patch. There was an additional commit in
webrender before these landed, so also copy the shaders
for that change across. There is an interface change to
webrender push_image. For now, just pass zero, which is a
no-op to this function. A follow up commit will introduce
the servo specific changes to use this new interface.
2016-09-21 08:24:59 +10:00
bors-servo
53938c439f Auto merge of #13329 - pcwalton:last-line-in-flow, r=notriddle
layout: Make `baseline_offset_of_last_line_box_in_flow()` only check blocks in flow.

Improves python.org.

Closes #12124.

r? @notriddle

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13329)
<!-- Reviewable:end -->
2016-09-19 22:45:55 -05:00
Patrick Walton
c6b9b315aa layout: Make baseline_offset_of_last_line_box_in_flow() only check
blocks in flow.

Improves python.org.

Closes #12124.
2016-09-19 17:17:08 -07:00
Patrick Walton
b4aea115b8 layout: Disable the speculation of block formatting contexts' inline
sizes if the block formatting contexts have negative margins.

The heuristics that determine how and whether floats flow into the
margins are not valid in that case.

Closes #13299.
2016-09-19 16:27:55 -07:00
bors-servo
b38d9cc3ad Auto merge of #13214 - shinglyu:gen_trace, r=SimonSapin
Create separate layout trace file for each reflow

<!-- Please describe your changes on the following line: -->
Currently only the layout trace from the last reflow is dumped to the file. But the interesting reflow may not be the last one. So we are dumping each of them with filename `layout_trace-{generation}.json`.

This will be used by a GUI viewer to visualize the layout process, which I will check-in later.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because its a minor debug tool

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13214)
<!-- Reviewable:end -->
2016-09-09 21:13:42 -05:00
Shing Lyu
fc8731990c Create separate layout trace file for each reflow 2016-09-09 17:38:19 +08:00
bors-servo
2d13178d29 Auto merge of #13192 - notriddle:master, r=pcwalton
Account for percentages in fixed table layout

Don't just use the minimum length all the time.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13166 (github issue number if applicable).
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13192)
<!-- Reviewable:end -->
2016-09-08 23:17:06 -05:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
bors-servo
aa011ea275 Auto merge of #13175 - shinglyu:block-margin-patch, r=notriddle
Move collapse through margin to the top of block flow

<!-- Please describe your changes on the following line: -->
Based on the spec, a collapse through box should be put on the top edge of the flow. This fixed ~110 reftests

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #12824  (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13175)
<!-- Reviewable:end -->
2016-09-08 17:43:50 -05:00
Michael Howell
070bb7ff58 Account for percentages in fixed table layout
Fixes #13166
2016-09-07 09:43:30 -07:00
Simon Sapin
8bfe978c78 Update cssparser 2016-09-07 14:13:56 +08:00
Shing Lyu
345923b682 Move collapse through margin to the top of block flow 2016-09-06 15:41:21 +08:00
Emilio Cobos Álvarez
468b329645
style: Provide whether we're styling or not to rust-selectors.
This makes us not adding the flags to everything in servo.
2016-08-31 17:27:15 -07:00
bors-servo
f5a546a160 Auto merge of #12437 - gpoesia:tr_margin_fix, r=pcwalton
Handle row borders in border collapsing logic.

<!-- Please describe your changes on the following line: -->
Handle table row border when collapsing borders for a table row. The row border is combined with the cell's border using the already implemented conflict resolution logic.

This is a screenshot of the following test:

```html
<!doctype html>
<html><body>
    <style>
      table {
        border-collapse: collapse;
      }
      tr {
        border: 1px solid black;
      }
    </style>
    <table>
      <tr><td>Lorem</td><td>Ipsum</td><td>Sit</td><td>Dolor</td></tr>
      <tr><td>Lorem</td><td>Ipsum</td><td>Sit</td><td>Dolor</td></tr>
      <tr><td>Lorem</td><td>Ipsum</td><td>Sit</td><td>Dolor</td></tr>
      <tr><td>Lorem</td><td>Ipsum</td><td>Sit</td><td>Dolor</td></tr>
    </table>
  </body>
</html>
```

<img src="https://dl.dropboxusercontent.com/u/10962672/Screenshots%20Servo/servo_tr_border_collapse.png"/>

The top border is missing, but I think that's a different bug, since it also does not show up when the border is in the cells, and not the rows. Also, when debugging the border collapsing structures, they seem ok (the top border seems to be there). I can look at that bug in a separate issue (or in this one too if you prefer).

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #11527 (github issue number if applicable).

<!-- Either: -->
- [X] These changes do not require tests because I didn't find how to automatically test it (will be happy to provide a test if there's infrastructure for this kind of test already in place).

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Fixes #11527.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12437)
<!-- Reviewable:end -->
2016-08-31 11:28:18 -05:00
Gabriel Poesia
a3af2303d6 Handle row borders in border collapsing logic.
Fixes #11527.
2016-08-30 23:00:58 -03:00
bors-servo
07b770b829 Auto merge of #13051 - notriddle:root_flow_percent, r=glennw
Fix root flow's size at the browser window's size

When `<body>` needs to calculate its size based on `<html>`'s size, that should be the size of the browser window itself.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12802 (github issue number if applicable).
- [X] There are tests for these changes OR

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13051)
<!-- Reviewable:end -->
2016-08-28 19:16:19 -05:00
Simon Sapin
899192e046 Update cssparser
Today’s Rust Nigthly broke it
2016-08-28 23:10:56 +02:00
Keith Yeung
40c9601686 Update string_cache to 0.2.26 2016-08-28 07:51:49 -07:00
Anthony Ramine
c66380d83c Update Rust to 1.13.0-nightly (198713106 2016-08-26) 2016-08-28 13:45:03 +02:00
Michael Howell
ede4730913 Fix root flow's size at the browser window's size
Fixes #12802
2016-08-26 09:38:39 -07:00
bors-servo
545ae86dff Auto merge of #13050 - notriddle:tlapd, r=emilio
Fix spelling mistake

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13050)
<!-- Reviewable:end -->
2016-08-26 07:19:59 -05:00
Ms2ger
12d31d2d70 Pass &mut Flow to query functions. 2016-08-25 09:40:20 +02:00
Ms2ger
c1d953cd2e Pass a &mut Flow to build_display_list_for_subtree. 2016-08-25 09:21:36 +02:00
Ms2ger
fa0e198c8f Pass a &mut Flow to traverse_flow_tree_preorder. 2016-08-25 09:21:35 +02:00
Ms2ger
0efa583df4 Pass a &mut Flow to resolve_generated_content. 2016-08-25 09:21:34 +02:00
Ms2ger
67d6a02667 Pass a &mut Flow to iterate_through_flow_tree_fragment_border_boxes. 2016-08-25 09:21:33 +02:00
Michael Howell
018f948680 Fix spelling mistake
It's not Talk Like a Pirate Day anymore.
2016-08-24 19:04:58 -07:00
bors-servo
6191748907 Auto merge of #13012 - servo:shared-layout-context, r=nox
Stop creating a LayoutContext in build_display_list_for_subtree.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13012)
<!-- Reviewable:end -->
2016-08-24 09:38:31 -05:00
Ms2ger
fd68208da6 Stop creating a LayoutContext in build_display_list_for_subtree. 2016-08-24 10:16:53 +02:00
Ms2ger
871c207c44 Pass SharedLayoutContext to Flow::compute_absolute_position. 2016-08-24 10:12:38 +02:00
bors-servo
3993fde90a Auto merge of #12935 - shinglyu:layout_json, r=glennw
Fixed layout flow tree JSON serialization

<!-- Please describe your changes on the following line: -->
The second argument for the `emit_struct()` is the number of fields, if given `0`, the output JSON will always be empty.

This is used in `./mach run -d -Z trace-layout https://servo.org`, which will dump the layout flow tree into a `layout_trace.json` file for debugging.

This also unblocks https://github.com/servo/servo/issues/12675

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [x] These changes do not require tests because its a debugging tool, not critical for normal code path

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12935)
<!-- Reviewable:end -->
2016-08-23 21:43:13 -05:00
bors-servo
d5913035ec Auto merge of #12981 - splav:inline_reconstruct#12602, r=notriddle
Inline reconstruct#12602

<!-- Please describe your changes on the following line: -->
This PR fixes two different issues:
1) In non-incremental layout mode if the inline node hasn't changes - the style pass was skipped, that leads to the corresponding ConstructionResult was not produced. When the parent was rebuilt, the child without the ConstructionResult was omited.
2) When the opacity was changed (or other style change, causing only repaint) for image (and others, producing only ConstructionItem) the damage is calculated only from children's flows, not from individual fragments. So for now, let's pretend we've newly constructed the ConstructionItem and thus need to rebuild the parent's flow.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12602 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12981)
<!-- Reviewable:end -->
2016-08-23 15:43:56 -05:00
Ms2ger
05e9a9ac86 Pass SharedLayoutContext to DisplayListBuildState::new. 2016-08-23 18:04:33 +02:00
Ms2ger
938569e3c7 Pass SharedLayoutContext to ImageFragmentInfo::new. 2016-08-23 17:32:06 +02:00
Ms2ger
7524e5549f Pass SharedStyleContext to CanvasFragmentInfo::new. 2016-08-23 17:13:11 +02:00
Ms2ger
d00d9994e9 Pass SharedStyleContext to ReplacedImageFragmentInfo::new. 2016-08-23 16:58:55 +02:00
Ms2ger
0cb0c6bc4e Move image fetching methods to SharedLayoutContext. 2016-08-23 16:13:23 +02:00
Alexandrov Sergey
3e73475d5b set HAS_NEWLY_CONSTRUCTED_FLOW flag for reconstructed flow'less inline element 2016-08-23 01:45:11 +03:00
Manish Goregaokar
466df01e71
Review fixups 2016-08-22 22:45:16 +05:30
Manish Goregaokar
69ada0d7a3 Support multiple backgrounds in servo layout 2016-08-22 22:42:43 +05:30
bors-servo
91cee66fe8 Auto merge of #12930 - canaltinova:border-bottom, r=emilio
Fix wrong calculation of inline element's block size

Border, padding and margin properties' top and bottom values of inline elements were affecting the element's height. It shouldn't affect it normally. Fixed it and added a test.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #11729 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12930)
<!-- Reviewable:end -->
2016-08-22 06:57:57 -05:00
bors-servo
daee53cb76 Auto merge of #12918 - hsinewu:12902-typedefs, r=Manishearth
12902 typedefs

<!-- Please describe your changes on the following line: -->
Using type alias instead of newtype.
Removing duplicated implementation, it's already inherited.
No more type constructors and foo.0
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12902 (github issue number if applicable).

<!-- Either: -->
- [X] These changes do not require tests because it's refactoring.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12918)
<!-- Reviewable:end -->
2016-08-22 06:01:03 -05:00
Nazım Can Altınova
a14f6cb7e7 Fix wrong calculation of inline element's block size 2016-08-22 11:17:41 +03:00
hsinewu
ef9a690c9c Refactor: use type alias instead of newtype 2016-08-22 09:36:19 +08:00
Glenn Watson
51cfccf189 Update for webrender API change, and remove webrender specific hack
in display list building.
2016-08-22 07:38:58 +10:00
Anthony Ramine
51768844ed Update euclid to 0.10.1 2016-08-21 03:03:45 +02:00
bors-servo
8a75810eba Auto merge of #12861 - nox:impl-trait, r=Ms2ger
Clean up some iterators

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12861)
<!-- Reviewable:end -->
2016-08-20 13:35:04 -05:00
Anthony Ramine
1c4cc6c703 Update selectors to 0.11
This brings :not() with proper list of complex selectors as argument.
2016-08-20 11:24:17 +02:00
bors-servo
07b217368f Auto merge of #12924 - servo:selectors-ser, r=nox
Update selectors to 0.10, with ToCss serialization.

<!-- Please describe your changes on the following line: -->
r? @emilio

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12924)
<!-- Reviewable:end -->
2016-08-19 13:01:29 -05:00
Shing Lyu
a07be4c850 Fixed layout flow tree JSON serialization 2016-08-19 15:29:25 +08:00