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 upCorrectly gets and sets rel content attributes in linkelement #13311
Conversation
highfive
commented
Sep 18, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
Sep 18, 2016
| @@ -357,10 +357,21 @@ impl HTMLLinkElementMethods for HTMLLinkElement { | |||
| make_setter!(SetHref, "href"); | |||
|
|
|||
| // https://html.spec.whatwg.org/multipage/#dom-link-rel | |||
| make_getter!(Rel, "rel"); | |||
| fn Rel(&self) -> DOMString { | |||
| let atomVec: Vec<Atom> = self.upcast::<Element>().get_tokenlist_attribute(&atom!("rel")); | |||
This comment has been minimized.
This comment has been minimized.
KiChjang
Sep 18, 2016
Member
No need for type annotation here and atomVec should really be atom_vec.
| for data in &atomVec { | ||
| let dataStr = String::from(data as &str); | ||
| string_concat = string_concat + " " + &dataStr; | ||
| } |
This comment has been minimized.
This comment has been minimized.
KiChjang
Sep 18, 2016
Member
Instead of doing this in imperative style, I think you can do something fancy with iterators:
DOMString::from(atom_vec.iter().map(|a| &*a).join(" "))|
@KiChjang +1 on the test part, but don't you think the |
|
It is not. The issue is to fix the crash that happens when you use that test case, and your current PR doesn't actually fix it yet. |
|
@KiChjang alright. |
|
I'm afraid everything @KiChjang said here was wrong. The r? @Ms2ger @bors-servo try |
Correctly gets and sets rel content attributes in linkelement <!-- 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 #12799 . <!-- 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/13311) <!-- Reviewable:end -->
|
|
|
@Ms2ger I'm not sure what the point is to keep a |
|
@KiChjang you're confusing different types of objects... Please read the code more carefully. |
|
No, @msger is correct here, you need to use |
|
@KiChjang I pushed the changes onto PR branch. |
|
|
highfive
commented
Sep 22, 2016
|
|
@KiChjang Is this a good thing? Because the report is telling that it expected a crash but my PR fixed it...? |
|
Indeed, this is pretty good! Great work here! |
|
They used to crash because of the panic that this PR fixes. |
|
Next step is to change the test expectations and mark those tests as passing. |
|
If I understood this right, I have to change the respective |
|
The expected crashes were only added in #12493; you'll need to rebase. Also, you should be able to remove those files; "pass" is the default expectation. |
|
Thanks, I've updated the PR now. |
|
Could you just squash the two commits? Should be good to go then. |
|
@Ms2ger Done. |
|
Thanks! @bors-servo r+ |
|
|
Correctly gets and sets rel content attributes in linkelement <!-- 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 #12799 . <!-- 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/13311) <!-- Reviewable:end -->
|
|
Removed .ini files expecting crashes
cynicaldevil commentedSep 18, 2016
•
edited by larsbergstrom
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is