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

Html option element.form#13111 #13126

Merged
merged 3 commits into from Aug 30, 2016

Conversation

splav
Copy link
Contributor

@splav splav commented Aug 30, 2016

Add HTMLOptionElement form attribute support


  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive
Copy link

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/htmloptionelement.rs, components/script/dom/webidls/HTMLOptionElement.webidl

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 30, 2016
@metajack
Copy link
Contributor

This does not seem to implement the logic described:

The form IDL attribute's behaviour depends on whether the option element is in a select element or not. If the option has a select element as its parent, or has an optgroup element as its parent and that optgroup element has a select element as its parent, then the form IDL attribute must return the same value as the form IDL attribute on that select element. Otherwise, it must return null.

This seems to grab the parent, test of that is an opt group, and if so, return its form. Otherwise it returns the parent. Nowhere is select checked for or form invoked on these parents. Also, it seems like we should be returning None if the parent isn't opt group or a select.

@splav
Copy link
Contributor Author

splav commented Aug 30, 2016

@metajack it checks if the parent is HTMLOptGroupElement, if it is - parent is set to grandparent, else to parent. Then it checks if the node, pointed by parent is HTMLSelectElement and returns its form. The None is forwarded through all the chain in all other cases.
May be the logic is a bit confusing and should be changed. Though I'm not sure how.

@metajack
Copy link
Contributor

Ok. I have read the code a little more carefully this time, and it does appear to do the right thing. The extra checks I was looking for are just implicit in the and_then calls.

@metajack
Copy link
Contributor

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit e4006fa has been approved by metajack

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Aug 30, 2016
bors-servo pushed a commit that referenced this pull request Aug 30, 2016
Html option element.form#13111

<!-- Please describe your changes on the following line: -->
Add HTMLOptionElement form attribute support

---
<!-- 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 #13111 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/13126)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

⌛ Testing commit e4006fa with merge 3d6827a...

@bors-servo
Copy link
Contributor

💔 Test failed - linux-rel

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Aug 30, 2016
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Aug 30, 2016
@splav
Copy link
Contributor Author

splav commented Aug 30, 2016

@metajack updated passing tests expectations.

@KiChjang
Copy link
Contributor

@bors-servo r=metajack

@bors-servo
Copy link
Contributor

📌 Commit 3b3b871 has been approved by metajack

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Aug 30, 2016
@bors-servo
Copy link
Contributor

⌛ Testing commit 3b3b871 with merge e07ee3f...

bors-servo pushed a commit that referenced this pull request Aug 30, 2016
Html option element.form#13111

<!-- Please describe your changes on the following line: -->
Add HTMLOptionElement form attribute support

---
<!-- 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 #13111 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/13126)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev

@bors-servo bors-servo merged commit 3b3b871 into servo:master Aug 30, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 30, 2016
@bors-servo bors-servo mentioned this pull request Aug 30, 2016
4 tasks
@splav splav deleted the HTMLOptionElement.form#13111 branch August 31, 2016 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement HTMLOptionElement#form
5 participants