Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement string-valued text-overflow in Servo #13709
Comments
|
@notriddle @jdm does this look like E-easy material? I tried to break it into steps to make it easier to work on. |
|
I would call it E-less easy. |
|
I'll take a look at this one. |
|
Cool! Let us know if you need help! |
|
@cynicaldevil Any updates? I got a ping from you yesterday but you weren't around when I came back online. Feel free to ask any questions here. |
|
@Manishearth I get a |
|
|
|
Negative on that as well. |
|
Could you put your code somewhere and pastebin the error? |
|
Also, did you remove the conditional as was mentioned in the first point above? |
|
https://github.com/Manishearth/servo/blob/ea765688cbc7a7f5e223cf060f2bf1341dfa0ae5/components/style/properties/longhand/text.mako.rs#L15 should not be there anymore, you need to change it to unconditionally use the |
|
Yes, I'd removed the conditional statement. I'll push my changes onto my fork now. |
|
|
|
It's |
|
Copied from IRC:
|
|
What's the error message that you get? |
|
|
Can you scope passed_str so that it is dropped before line 704? |
|
I can't do that, because I have to pass it to a function call which occurs after line 704. |
|
In that case it's not possible to hold on to a pointer derived from |
|
There's no need to try and borrow it in this case, just store an |
implemented string-valued text-overflow <!-- 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 - [X] These changes fix #13709 <!-- 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. --> cc @Manishearth The lorem-ipsum example from MDN works as expected. <!-- 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/13924) <!-- Reviewable:end -->
Part of #13702
In #13701, we added support for parsing the full range of values that
text-overflowsupports. However, this is disabled in Servo modeWhile supporting the two-value form of text-overflow (e.g.
text-overflow: "..." clip) is cumbersome, it should be pretty straightforward to support the one-value form.Steps:
<%helpers:longhand ...one unconditionally.push_fragment_to_line()incomponents/layout/inline.rs, becausetext_overflow::clip/text_overflow::ellipsisare nowtext_overflow::Side::Clip/text_overflow::Side::Ellipsis, and what used to be an enum is now a struct. Match onfragment.style().get_text().text_overflow.firstinstead, and use the new names for the variants.transform_into_ellipsis()as an argument. Inpush_fragment_to_line()add an extra match arm that is similar to the ellipsis one, but pushes a string. In the ellipsis one, pass "…".Relevant layout code:
components/layout/inline.rs,components/layout/fragment.rsTests: None, but we will add some when this is done.