Commit graph

1908 commits

Author SHA1 Message Date
bors-servo
dad3b4785a Auto merge of #13589 - splav:SVGElement#12974, r=pcwalton,Ms2ger
Support SVG element

<!-- Please describe your changes on the following line: -->
minimal SVG element implementation
---
<!-- 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 #12974 (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/13589)
<!-- Reviewable:end -->
2016-10-07 17:40:13 -05:00
Alexandrov Sergey
14934a42d7 add SVG fragment (SpecificFragmentInfo::Svg) 2016-10-07 21:41:02 +03:00
Ravi Shankar
5fd398ec06 Change 'image_rendering' enum variants to snake cases 2016-10-07 23:31:30 +05:30
Patrick Walton
5232b0c85f layout: Place inline absolute hypothetical boxes properly during block
fragment position assignment.

Improves Rust documentation.

Closes #13471.
2016-10-04 18:40:40 -07:00
bors-servo
19a5a30113 Auto merge of #13387 - emilio:debug-assertions, r=aneeshusa,jdm,pcwalton
Honor SERVO_ENABLE_DEBUG_ASSERTIONS on the build machines.

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

As part of #13127.

cc @aneeshusa

---
<!-- 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

<!-- 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/13387)
<!-- Reviewable:end -->
2016-10-04 14:01:49 -05:00
Simon Sapin
29c72d15a9 Make style build without impl<T: HeapSizeOf> HeapSizeOf for Arc<T>.
The removal of this impl is not included in this commit.
CC https://github.com/servo/heapsize/issues/37#issuecomment-249861171
2016-10-04 13:45:57 +02:00
Bobby Holley
687e1f701c Rename PrivateStyleData to PersistentStyleData and use AtomicRefCell instead of RefCell as a container.
This allows us to eliminate the unsafe borrows. \o/

MozReview-Commit-ID: 29hpGaWUFQz
2016-10-02 19:19:52 -07:00
Bobby Holley
5bcc4192bf Stop using Ref::map for selected_style and resolved_style.
Same concept as the previous patch.

MozReview-Commit-ID: RFC8s7qQPM
2016-10-02 19:19:52 -07:00
Bobby Holley
18d552a1e9 Stop using Ref::map for style().
It's not possible to implement a Ref::map equivalent method on AtomicRefCell
while having AtomicRefCell implemented on top of RwArc. We could potentially
reimplement AtomicRefCell to be more like RefCell and add a Ref::map equivalent
method, but I (and pcwalton) think we should try just cloning a few extra
Arcs at these callsites instead.

MozReview-Commit-ID: 6H8vAWguO3z
2016-10-02 19:19:52 -07:00
Emilio Cobos Álvarez
bdf1d179ba
layout: Use the fragment's writing mode when computing sizes relevant to that fragment.
Otherwise we might mix writing modes. Not totally sure this change is correct in
the case we're mixing them, we might need to just not checking that operation.
2016-10-02 17:57:07 +02:00
bors-servo
c9442346d3 Auto merge of #13414 - flacerdk:master, r=mbrubeck
Implement `word-break: keep-all` (#9673)

<!-- Please describe your changes on the following line: -->
Implement the `keep-all` value for the `word-break` property, as specified in [CSS](https://drafts.csswg.org/css-text-3/#word-break-property).

The relevant CSSWG tests (in `tests/wpt/css-tests/css-text-3_dev/html/word-break-keep-all-*.htm`) do not currently pass. As far as I can tell, this is because the tests use some JavaScript code that is not working properly. (But then, it seems that most tests in this directory are failing at the moment. I'm not sure what can be done here for now.)

---
<!-- 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 #9673.

<!-- Either: -->
- [ ] 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/13414)
<!-- Reviewable:end -->
2016-09-29 19:20:55 -05:00
bors-servo
4ebecc915a Auto merge of #13401 - notriddle:master, r=pcwalton
Implement sequential fallback to float speculation

This shouldn't impact any pages that are already rendering correctly, but it is a very naive implementation of this pass.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13284 and fix #13223
- [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/13401)
<!-- Reviewable:end -->
2016-09-29 13:16:24 -05:00
Michael Howell
81676ea9d2 Add assertion that this is not a flex item 2016-09-29 10:29:35 -07:00
bors-servo
81dfa6a96b Auto merge of #13417 - mrobinson:simplify-stacking-context-collection, r=glennw
Simplify stacking context collection

<!-- 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
- [ ] 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. -->

Simplify the way that stacking contexts are collected. Instead of
passing the StackingContextId down the tree, pass the parent
StackingContext itself. This will allow future patches to get more
information about the parent stacking context (such as location).

Also remove the return value of collect_stacking_contexts, which was
unused.

<!-- 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/13417)
<!-- Reviewable:end -->
2016-09-29 09:01:33 -05:00
bors-servo
ccfc60161b Auto merge of #13470 - pcwalton:inline-absolute-hypothetical-baseline, r=notriddle
layout: Improve the interaction between baseline-offset-of-last-line-in-flow logic and inline absolute hypothetical boxes.

See commits for details. These changes place the heart icon on Twitter in the right place.

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/13470)
<!-- Reviewable:end -->
2016-09-29 00:11:33 -05:00
Patrick Walton
b021952be9 layout: Remove a stray newline. 2016-09-28 13:03:59 -07:00
Patrick Walton
0803ef98e3 layout: Don't count lines that consist solely of hypothetical boxes when
determining the baseline offset of the last line.

Improves Twitter by placing the favorite icon in the right place
vertically.
2016-09-28 13:03:58 -07:00
Patrick Walton
3a56cc7f2f layout: When searching for the baseline offset of the last in-flow line
and an inline flow has no applicable lines, continue checking previous
sibling flows.

Improves Twitter by placing the favorite icon in the right place.
2016-09-27 18:45:36 -07:00
Michael Howell
abe8c0d457 Add util::clamp function 2016-09-27 15:49:47 -07:00
Michael Howell
fe2018682b Implement sequential fallback to float speculation
Fixes #13284
Fixes #13223
2016-09-27 15:19:28 -07:00
Felipe Lacerda
fb66abba74 combine normal and keep-all into a single strategy 2016-09-27 20:07:32 +02:00
Felipe
e0a48fe596 Use word-break to decide how glyph runs should be created 2016-09-27 11:25:21 +02:00
Felipe
d5669ead29 Implement word-break: keep_all 2016-09-27 11:25:21 +02:00
Martin Robinson
066775915c Simplify stacking context collection
Simplify the way that stacking contexts are collected. Instead of
passing the StackingContextId down the tree, pass the parent
StackingContext itself. This will allow future patches to get more
information about the parent stacking context (such as location).

Also remove the return value of collect_stacking_contexts, which was
unused.
2016-09-27 10:48:44 +02:00
bors-servo
cbe5458272 Auto merge of #13346 - pcwalton:cnn, r=notriddle
layout: Make some major improvements to incremental layout to improve CNN.

CNN is still too slow to be usable, but this is a partial solution.

r? @notriddle (feel free to reassign if you like)

<!-- 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/13346)
<!-- Reviewable:end -->
2016-09-26 20:57:59 -05:00
Patrick Walton
83a73a979e layout: Remove reflow damage after reflowing table rows. 2016-09-26 14:48:32 -07:00
Patrick Walton
132810e739 layout: Remove reflow damage after reflowing replaced blocks. 2016-09-26 14:48:31 -07:00
Patrick Walton
65e3db1c0d layout: Add a REPOSITION restyle damage type.
Separating out `REPOSITION` from `REPAINT` allows us to compute
stacking-context-relative positions without rebuilding the display list.
This saves a lot of time when responding to script-to-layout queries.
2016-09-26 14:20:30 -07:00
Florent FAYOLLE
9df00199c6 #13262 Add a unit test verifying that SpecificFragmentInfo size 2016-09-25 10:35:39 +02:00
bors-servo
28ebab4398 Auto merge of #13354 - schuster:input-text-style, r=pcwalton
Style input-text pseudo with user-agent CSS

This changes the input-text pseudo-element to be styled with user-agent CSS rather than having a hard-coded style, as part of #8570

---
<!-- 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 they're a refactoring of existing functionality

<!-- 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/13354)
<!-- Reviewable:end -->
2016-09-23 21:08:19 -05:00
Martin Robinson
68ae97fd0e Add support for background-repeat: space and round
This adds support for more background-repeat modes using the legacy
rendering backend.
2016-09-22 13:20:08 +02:00
Jonathan Schuster
8500f3c8b8 Style input-text pseudo with user-agent CSS 2016-09-21 21:21:32 -04:00
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