Commit graph

1861 commits

Author SHA1 Message Date
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
Anthony Ramine
03a0170c91 Update to webrender 0.4.0 2016-08-18 19:33:12 +02:00
Simon Sapin
d690bd2382 Update selectors to 0.10, with ToCss serialization. 2016-08-18 14:46:24 +02:00
Emilio Cobos Álvarez
3af774bd75
Rewrite the style sharing candidate cache.
The style candidate cache had regressed a few times (see #12534), and my
intuition is that being able to disable all style sharing with a single rule in
the page is really unfortunate.

This commit redesigns the style sharing cache in order to be a optimistic cache,
but then reject candidates if they match different sibling-affecting selectors
in the page, for example.

So far the numbers have improved, but not so much as I'd wanted (~10%/20% of
non-incremental restyling time in general). The current implementation is really
dumb though (we recompute and re-match a lot of stuff), so we should be able to
optimise it quite a bit.

I have different ideas for improving it (that may or may not work), apart of the
low-hanging fruit like don't re-matching candidates all the time but I have to
measure the real impact.

Also, I need to verify it against try.
2016-08-17 14:16:16 -07:00
Emilio Cobos Álvarez
fd3a99ead3
layout: Make the stacking context take into account the children transform when calculating overflow areas.
This only works for simple translations and similar, but I want Patrick to
validate my approach.
2016-08-16 15:34:28 -07:00
bors-servo
d687f77fef Auto merge of #12873 - shinglyu:abs-margin-patch, r=notriddle,emilio
Fix absolute-flow's auto positioning

<!-- Please describe your changes on the following line: -->
If an absolute positioned flow has no top, bottom, left, right property, its hypothetical box position should be the margin-end of its previous sibling, not the border-end.

---
<!-- 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 #12676 (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/12873)
<!-- Reviewable:end -->
2016-08-15 08:19:04 -05:00
Shing Lyu
332cdd05c8 Absolute positioned flow should be placed at the margin-end of its previous flow 2016-08-15 19:34:37 +08:00
Anthony Ramine
a1af2cded8 Use impl DoubleEndedIterator for two flow_list iterators 2016-08-14 19:06:18 +02:00
Anthony Ramine
fc6faf72ee Update Rust to 1.12.0-nightly (1deb02ea6 2016-08-12) 2016-08-13 18:34:44 +02:00
Anthony Ramine
7ad51dcd7a Update serde to 0.8 (fixes #12659) 2016-08-12 18:37:27 +02:00
bors-servo
5b915c403d Auto merge of #12817 - servo:euclid, r=nox
Update to euclid 0.8

<!-- 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/12817)
<!-- Reviewable:end -->
2016-08-11 20:12:29 -05:00
Martin Robinson
6259df5e2d Update to euclid 0.8 2016-08-12 03:12:06 +02:00
bors-servo
4cefbcc949 Auto merge of #12813 - emilio:hit-test, r=notriddle
dom: getElementsFromPoint does the hit testing on viewport coordinates.

<!-- Please describe your changes on the following line: -->

---
<!-- 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] There are tests for these changes OR

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

We got this wrong (I think it wasn't my fault actually), I was just writing a test for #12777 when I found this.

<!-- 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/12813)
<!-- Reviewable:end -->
2016-08-11 05:34:27 -05:00
Alexandrov Sergey
49b50e45a3 do not merge inline fragments if there is space in between 2016-08-11 10:11:11 +03:00
Alexandrov Sergey
69769e4493 do not reset pseudo elements style 2016-08-11 10:11:11 +03:00
Emilio Cobos Álvarez
f9c0f2df13
dom: getElementsFromPoint does the hit testing on viewport coordinates.
We got this wrong, I was just writing a test for #12777 when I found this.
2016-08-10 21:15:10 -07:00