Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement parsing and serialization of font-variant-{alternates,east-asian,ligatures,numeric} #15957

Closed
upsuper opened this issue Mar 15, 2017 · 22 comments

Comments

@upsuper
Copy link
Member

@upsuper upsuper commented Mar 15, 2017

Their definitions can be found in CSS Font spec:

They should be added into https://github.com/servo/servo/blob/master/components/style/properties/longhand/font.mako.rs

And all of them should be added as subproperties of font and font-variant shorthands in https://github.com/servo/servo/blob/master/components/style/properties/shorthand/font.mako.rs

It might not be too hard, but the work here isn't trivial either.

@SebastinSanty
Copy link

@SebastinSanty SebastinSanty commented Mar 15, 2017

@highfive: assign me

@highfive highfive added the C-assigned label Mar 15, 2017
@highfive
Copy link

@highfive highfive commented Mar 15, 2017

Hey @SebastinSanty! Thanks for your interest in working on this issue. It's now assigned to you!

@KiChjang
Copy link
Member

@KiChjang KiChjang commented Mar 15, 2017

@SebastinSanty In general, it's discouraged to reserve issues that a person is not working on in the immediate future. Please finish the other issue first before claiming this one.

@KiChjang KiChjang removed the C-assigned label Mar 15, 2017
@SebastinSanty
Copy link

@SebastinSanty SebastinSanty commented Mar 15, 2017

@KiChjang Sorry for that. Thought of taking the easier one first.

@abhiQmar
Copy link
Contributor

@abhiQmar abhiQmar commented Mar 15, 2017

@highfive: assign me

@highfive
Copy link

@highfive highfive commented Mar 15, 2017

Hey @abhiQmar! Thanks for your interest in working on this issue. It's now assigned to you!

@highfive highfive added the C-assigned label Mar 15, 2017
@abhiQmar
Copy link
Contributor

@abhiQmar abhiQmar commented Mar 24, 2017

Sorry, haven't been able to find time to complete this, anyone is free to take this up.

@upsuper upsuper removed the C-assigned label Mar 24, 2017
@bholley bholley added the A-stylo label Mar 26, 2017
@highfive
Copy link

@highfive highfive commented Mar 26, 2017

cc @emilio

@streichgeorg
Copy link
Contributor

@streichgeorg streichgeorg commented Mar 28, 2017

@highfive: assign me

@highfive
Copy link

@highfive highfive commented Mar 28, 2017

Hey @streichgeorg! Thanks for your interest in working on this issue. It's now assigned to you!

@highfive highfive added the C-assigned label Mar 28, 2017
@streichgeorg
Copy link
Contributor

@streichgeorg streichgeorg commented Apr 9, 2017

I managed to implement the longhands but when I try to add them to the shorthands the tests
properties::scaffolding::properties_list_json and properties::serialization::shorthand_serialization::font::font_should_serialize_all_available_properties fail. What do I have to do to fix this?

@jdm
Copy link
Member

@jdm jdm commented Apr 9, 2017

What are the failures?

@streichgeorg
Copy link
Contributor

@streichgeorg streichgeorg commented Apr 11, 2017

	thread 'properties::serialization::shorthand_serialization::font::font_should_serialize_all_available_properties' panicked at 'assertion failed: `(left == right)` (left: `"font-style: italic; font-variant: normal; font-weight: bolder; font-stretch: expanded; font-size: 4px; line-height: 3; font-family: serif; font-size-adjust: none; font-kerning: auto; font-variant-caps: normal; font-variant-position: normal; font-language-override: normal;"`, right: `"font: italic normal bolder expanded 4px/3 serif;"`)', /home/computer/Documents/servo/tests/unit/style/properties/serialization.rs:659
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: style_tests::properties::serialization::shorthand_serialization::font::font_should_serialize_all_available_properties
             at ./properties/serialization.rs:659
   1: <F as test::FnBox<T>>::call_box
             at /checkout/src/libtest/lib.rs:1368
             at /checkout/src/libtest/lib.rs:140
   2: std::panicking::try::do_call
             at /checkout/src/libtest/lib.rs:1314
             at /checkout/src/libstd/panic.rs:296
             at /checkout/src/libstd/panicking.rs:454
   3: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
   4: std::panicking::try::do_call
             at /checkout/src/libstd/panicking.rs:433
             at /checkout/src/libstd/panic.rs:361
             at /checkout/src/libtest/lib.rs:1313
             at /checkout/src/libstd/panic.rs:296
             at /checkout/src/libstd/panicking.rs:454
   5: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
   6: <F as alloc::boxed::FnBox<A>>::call_box
             at /checkout/src/libstd/panicking.rs:433
             at /checkout/src/libstd/panic.rs:361
             at /checkout/src/libstd/thread/mod.rs:360
             at /checkout/src/liballoc/boxed.rs:640
   7: std::sys::imp::thread::Thread::new::thread_start
             at /checkout/src/liballoc/boxed.rs:650
             at /checkout/src/libstd/sys_common/thread.rs:21
             at /checkout/src/libstd/sys/unix/thread.rs:84
   8: start_thread
   9: clone

---- properties::scaffolding::properties_list_json stdout ----
	thread 'properties::scaffolding::properties_list_json' panicked at 'assertion failed: status.success()', /home/computer/Documents/servo/tests/unit/style/properties/scaffolding.rs:27
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: style_tests::properties::scaffolding::properties_list_json
             at ./properties/scaffolding.rs:27
   1: <F as test::FnBox<T>>::call_box
             at /checkout/src/libtest/lib.rs:1368
             at /checkout/src/libtest/lib.rs:140
   2: std::panicking::try::do_call
             at /checkout/src/libtest/lib.rs:1314
             at /checkout/src/libstd/panic.rs:296
             at /checkout/src/libstd/panicking.rs:454
   3: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
   4: std::panicking::try::do_call
             at /checkout/src/libstd/panicking.rs:433
             at /checkout/src/libstd/panic.rs:361
             at /checkout/src/libtest/lib.rs:1313
             at /checkout/src/libstd/panic.rs:296
             at /checkout/src/libstd/panicking.rs:454
   5: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
   6: <F as alloc::boxed::FnBox<A>>::call_box
             at /checkout/src/libstd/panicking.rs:433
             at /checkout/src/libstd/panic.rs:361
             at /checkout/src/libstd/thread/mod.rs:360
             at /checkout/src/liballoc/boxed.rs:640
   7: std::sys::imp::thread::Thread::new::thread_start
             at /checkout/src/liballoc/boxed.rs:650
             at /checkout/src/libstd/sys_common/thread.rs:21
             at /checkout/src/libstd/sys/unix/thread.rs:84
   8: start_thread
   9: clone```

I hope this helps.
@jdm
Copy link
Member

@jdm jdm commented Apr 12, 2017

The first test is verifying that if all of the known font longhands are present, the serialized version is the font shorthand. https://dxr.mozilla.org/servo/rev/065f50014f321466c979120967da720e88ae2b29/tests/unit/style/properties/serialization.rs#640-652 should be updated to include the new properties that the shorthand now checks for.

The second test looks like it might be failing to execute python correctly. It will be hard to provide any advice about that without seeing the changes you've made. You could check whether you see that failure on an unmodified version of master when running ./mach test-unit -p style.

@upsuper
Copy link
Member Author

@upsuper upsuper commented Apr 13, 2017

Sorry that it seems @hiikezoe has had some patches for this in bug 1354876. We will probably just take that and close this issue.

Thanks for your work.

@hiikezoe
Copy link
Contributor

@hiikezoe hiikezoe commented Apr 13, 2017

In bug 1354876, I did not parse font-variant-alternates properly, so there are still remaining work. And I am hoping @streichgeorg fixes the remaining issue.
Thanks!

@nox
Copy link
Member

@nox nox commented Apr 20, 2017

Are you still working on this, @streichgeorg?

@streichgeorg
Copy link
Contributor

@streichgeorg streichgeorg commented Apr 21, 2017

Oh I'm sorry, I kinda forgot this and also didn't have any time in the past week. But I should be able to finish this in the following days, I just need to do some minor stuff.

@hiikezoe
Copy link
Contributor

@hiikezoe hiikezoe commented Apr 21, 2017

That's good to know. Thank you!

@streichgeorg streichgeorg mentioned this issue Apr 22, 2017
3 of 5 tasks complete
@upsuper
Copy link
Member Author

@upsuper upsuper commented May 15, 2017

@hiikezoe I saw you wrote a FIXME in font.mako.rs referring this issue, but it is not clear to me what is left there. Could you clarify? It seems to me this issue can be considered fixed. Is there anything I'm missing?

@hiikezoe
Copy link
Contributor

@hiikezoe hiikezoe commented May 15, 2017

Some values (e.g. styleset) involve feature-value-name(s). I did not implement that part (Honestly I did miss that part completely). Whereas @streichgeorg tries to parse them [1] (Great!). This is the left issue.

[1] 72eddc0#diff-668b3a1bd0c2ed6b1cf89503c93ee9e8R1167

@upsuper
Copy link
Member Author

@upsuper upsuper commented May 15, 2017

That sounds like part of @font-feature-values support which @chenpighead is currently working on in bug 1355721. If that's the only remaining part, I think we can close this issue.

@upsuper upsuper closed this May 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

10 participants
You can’t perform that action at this time.