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
box-shadow is now serialized properly #15703
Conversation
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @Ms2ger (or someone else) soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR! The serialization changes look great to me, though I believe the test can be shorter.
Also, could you squash your commits? We don't use to land commits like "Fixes tidy" or so.
With that test change, this can land with r=emilio
.
Thanks again for this patch! :)
#[test] | ||
fn box_shadow_should_serialize_correctly() { | ||
let mut properties = Vec::new(); | ||
let color = Some(CSSColor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move the property_declaration_block
function to the parent module, and write this test as follows, which will be easier to maintain:
let shadow_css = "box-shadow: 1px 2px 3px 4px";
let shadow = property_declaration_block(shadow_css);
assert_eq!(shadow.to_css_string(), shadow_css);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review. So how to use the property_declaration_block function how do I define it in the parent module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just move it to the top of the file making it pub
(above the first mod
), and use it from the others.
@@ -1231,4 +1231,26 @@ mod shorthand_serialization { | |||
assert_eq!(serialization, block_text); | |||
} | |||
} | |||
mod effects { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, one nit, alignment seems to be off-by-one here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did make the changes. Also committed and squashed the commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think something went wrong and it created merge master branch. I don't know how to undo that but last commit to be considered is in box-shadow is now serialized properly. Let me know if I need to do anything to fix it. Sorry if this messes something!!
ce78317
to
8801300
Compare
☔ The latest upstream changes (presumably #15856) made this pull request unmergeable. Please resolve the merge conflicts. |
Please remove the merge commit and rebase against master instead. |
48fa42e
to
8801300
Compare
I removed the merge commit. How do I rebase against the master instead. |
First, |
@niki-04 Are you planning to finish this? Need help? |
@wafflespeanut sorry about the delay. I will finish it by today. Will let you know if i need help |
I was going through the changes I see property_declaration_block to parse_declaration_block. Should I make the relevant changes in my code. I was having trouble merging the code for the same |
I resolved the conflicts and committed the code again. Let me know if I need to squash my commits. I did all the checks again everything passes :) |
No, you haven't? It looks like you haven't rebased it properly. |
When I rebased it showed me the conflicts and I resolved those and committed again. What should I do now to resolve the issue? |
|
@wafflespeanut thanks for the information. I am trying that but when I apply my patch it fails with the error patch does not apply. I tried looking for the same error but couldn't find any relevant information. |
It may probably have conflicts. Check whether the files have conflicts. If they don't have any, then what does it say? Can you paste the log output? |
No conflicts. The output is
|
Oh, okay. What if you try |
I get a Patch format detection failed. |
Oh wait, it should be done with |
git apply -3 --whitespace=fix doesn't work. It just hangs up and does nothing |
Oh, you need to point it to the patch like you did previously. |
Oh my bad. It still doesn't work |
Strange. I just pulled from your branch, exported the patch and applied it, and it seems to work. I'm unable to reproduce the error. Can you check the "Allow edits from maintainers" check box to the right? (so that I'll be able to push to your branch?) |
I did the check allow edits from maintainers. Thanks a lot for helping out. It is strange you don't get the error. |
a3b7bf7
to
d4d8293
Compare
☔ The latest upstream changes (presumably #16100) made this pull request unmergeable. Please resolve the merge conflicts. |
…lespeanut Properly serialize <box-shadow> Rebase of #15703, fixes #15203 <!-- 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/16104) <!-- Reviewable:end -->
No worries. I enjoyed working on this!! |
Box shadow in now serialized properly. The changes are in the file components/style/properties/longhand/effects.mako.rs. Tests for the serialization of box-shadow are in tests/unit/style/properties/serialization.rs. ./mach test-unit -p style passes all tests including the newly added test case.
./mach build -d
does not report any errors./mach test-tidy
does not report any errorsThis change is