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 place-{content,self,items} shorthand properties #15954

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

Implement place-{content,self,items} shorthand properties #15954

upsuper opened this issue Mar 15, 2017 · 19 comments

Comments

@upsuper
Copy link
Member

@upsuper upsuper commented Mar 15, 2017

@highfive
Copy link

@highfive highfive commented Mar 15, 2017

Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the #servo channel in IRC.

If you intend to work on this issue, then add @highfive: assign me to your comment, and I'll assign this to you. 😄

@SebastinSanty
Copy link

@SebastinSanty SebastinSanty commented Mar 15, 2017

I think this would be similar to the other issue I am solving and hence would like to work on this too. @highfive: assign me

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

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

@wafflespeanut wafflespeanut commented Mar 21, 2017

@SebastinSanty Have you made any progress? Any questions?

@SebastinSanty
Copy link

@SebastinSanty SebastinSanty commented Mar 21, 2017

@wafflespeanut Yep! I'm almost done. I'll put in a PR in some time.

@bholley bholley added the A-stylo label Mar 26, 2017
@highfive
Copy link

@highfive highfive commented Mar 26, 2017

cc @emilio

@wafflespeanut
Copy link
Member

@wafflespeanut wafflespeanut commented Mar 27, 2017

@SebastinSanty Any news?

@tamamu
Copy link
Contributor

@tamamu tamamu commented Apr 6, 2017

Is this issue now open? If so, I’ll give it a shot.
@highfive: assigin me

@wafflespeanut
Copy link
Member

@wafflespeanut wafflespeanut commented Apr 6, 2017

Yes it is. Go for it! (and, spelling) 😄

@tamamu
Copy link
Contributor

@tamamu tamamu commented Apr 6, 2017

Typo! Oops ... well, what I should do is to implement the shorthands properties in
https://github.com/servo/servo/blob/master/components/style/properties/shorthand/position.mako.rs
right? Is any test necessary?

@wafflespeanut
Copy link
Member

@wafflespeanut wafflespeanut commented Apr 6, 2017

You're right! And yeah, it'd be nice to have some tests in tests/unit/style/properties/serialization.rs (where other similar shorthand serialization tests live)

@tamamu
Copy link
Contributor

@tamamu tamamu commented Apr 8, 2017

Can I ask a question? I don't know how to import values::specified::align:::AlignJustifyContent. When I did mach test unit, I got an error as below (but mach build -d succeeded.)

   Compiling style v0.0.1 (file:///C:/Users/tamam/Documents/servo/components/style)
error[E0432]: unresolved import `values::specified::align::AlignJustifyContent`
     --> C:\Users\tamam\Documents\servo\target\debug\build\style-58fd9169ab377329\out/properties.rs:61186:9
      |
61186 |     use values::specified::align::AlignJustifyContent;
      |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not find `align` in `specified`

As requirements of place-content,

The second value is assigned to justify-content; if omitted, it is copied from the first value.

so I probably should use the type to convert an align-content value to justify-content value.

@upsuper
Copy link
Member Author

@upsuper upsuper commented Apr 9, 2017

Ah, it seems align mod is currently Gecko-only. I guess we may want to change it to not Gecko-only to help testing? But having a look at that mod, there are indeed lots of Gecko-specific things (from gecko_bindings::structs)... so I have no idea what should we do here.

Maybe we can just skip testing for this for now... @Manishearth what do you think?

@upsuper
Copy link
Member Author

@upsuper upsuper commented Apr 9, 2017

Or @wafflespeanut if you have any suggestion here.

@Manishearth
Copy link
Member

@Manishearth Manishearth commented Apr 9, 2017

yes, skipping testing is fine, provided the geckolib build works and it works in stylo

@Manishearth
Copy link
Member

@Manishearth Manishearth commented Apr 9, 2017

oh. don't remove the property from testing. not writing tests for it is fine (we have stylo reftests).

Instead of importing AlignJustifyContent, could you import properties::longhands::align_content::SpecifiedValue? That will do the right thing on both.

@tamamu
Copy link
Contributor

@tamamu tamamu commented Apr 9, 2017

OK, I have done place-content. So now I'm working on place-self.

And another question; one of place-self sub property, justify-self caught an error below by mach test-unit -p style. Though you said skipping testing is fine, can I ignore this error? Or have any solution?

Traceback (most recent call last):
  File "C:\Users\tamam\Documents\servo\components\style\properties\build.py", line 61, in render
    return template.render(**context).encode("utf8")
  File "C:\Users\tamam\Documents\servo\components\style\properties\Mako-0.9.1.zip\mako\template.py", line 443, in render
    return runtime._render(self, self.callable_, args, data)
  File "C:\Users\tamam\Documents\servo\components\style\properties\Mako-0.9.1.zip\mako\runtime.py", line 807, in _render
    **_kwargs_for_callable(callable_, data))
  File "C:\Users\tamam\Documents\servo\components\style\properties\Mako-0.9.1.zip\mako\runtime.py", line 839, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "C:\Users\tamam\Documents\servo\components\style\properties\Mako-0.9.1.zip\mako\runtime.py", line 865, in _exec_template
    callable_(context, *args, **kwargs)
  File "C:/Users/tamam/Documents/servo/components/style/properties\properties.mako.rs", line 165, in render_body
    <%include file="/shorthand/position.mako.rs" />
  File "C:\Users\tamam\Documents\servo\components\style\properties\Mako-0.9.1.zip\mako\runtime.py", line 734, in _include_file
    callable_(ctx, **_kwargs_for_include(callable_, context._data, **kwargs))
  File "C:/Users/tamam/Documents/servo/components/style/properties/shorthand/position.mako.rs", line 187, in render_body
    <%helpers:shorthand name="place-self" sub_properties="align-self justify-self"
  File "C:/Users/tamam/Documents/servo/components/style/properties/helpers.mako.rs", line 502, in render_shorthand
    <%
  File "C:/Users/tamam/Documents/servo/components/style/properties\data.py", line 274, in declare_shorthand
    sub_properties = [self.longhands_by_name[s] for s in sub_properties]
KeyError: u'justify-self'
@Manishearth
Copy link
Member

@Manishearth Manishearth commented Apr 9, 2017

No, it has to build. Mark the shorthand with product="gecko", and test that it builds with ./mach build-geckolib

@tamamu
Copy link
Contributor

@tamamu tamamu commented Apr 9, 2017

I already marked with that, and also building has succeeded.
The problem is the testing.

@tamamu tamamu mentioned this issue Apr 9, 2017
4 of 4 tasks complete
bors-servo added a commit that referenced this issue Apr 12, 2017
[WIP] Implement alignment shorthand properties

<!-- Please describe your changes on the following line: -->
I implemented the shorthand properties, but it may includes some bugs.

Currently, `mach test-unit -p style` caught some errors (see #15954). I already tried `mach build-geckolib`, though there is no improvement. Please check my code.

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

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/16322)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Apr 12, 2017
Implement alignment shorthand properties

<!-- Please describe your changes on the following line: -->
I implemented the shorthand properties, but it may includes some bugs.

Currently, `mach test-unit -p style` caught some errors (see #15954). I already tried `mach build-geckolib`, though there is no improvement. Please check my code.

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

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/16322)
<!-- Reviewable:end -->
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.

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