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

Insert row #10508

Merged
merged 1 commit into from Apr 18, 2016
Merged

Insert row #10508

merged 1 commit into from Apr 18, 2016

Conversation

@g-k
Copy link
Contributor

g-k commented Apr 10, 2016

Fixes #9269


This change is Reviewable

@highfive
Copy link

highfive commented Apr 10, 2016

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/webidls/HTMLTableElement.webidl, components/script/dom/htmltableelement.rs
@KiChjang
Copy link
Member

KiChjang commented Apr 10, 2016

Great job! I'm not entirely sure we need all those .expect() there though... @nox or @jdm, do you think an .unwrap() is good enough for these use cases? I'm mostly concerned about polluting the error logs.


Reviewed 4 of 5 files at r1, 1 of 1 files at r2.
Review status: all files reviewed at latest revision, 2 unresolved discussions.


components/script/dom/htmltableelement.rs, line 143 [r2] (raw file):
Fallible<Root<HTMLTableRowElement>>


components/script/dom/htmltableelement.rs, line 190 [r2] (raw file):
This doesn't look correct. The new_row should be inserted before the _i_th element, not appended as a child to its parent.


Comments from Reviewable

@jdm
Copy link
Member

jdm commented Apr 10, 2016

I have no problem with choosing expect over unwrap.

@frewsxcv
Copy link
Member

frewsxcv commented Apr 10, 2016

Great job! I'm not entirely sure we need all those .expect() there though...

All the expect()s on AppendChilds should probably use try!, right?

@g-k
Copy link
Contributor Author

g-k commented Apr 10, 2016

Review status: 4 of 5 files reviewed at latest revision, 2 unresolved discussions.


components/script/dom/htmltableelement.rs, line 143 [r2] (raw file):
Done.


components/script/dom/htmltableelement.rs, line 190 [r2] (raw file):
d'oh! Fixed.


Comments from Reviewable

@g-k
Copy link
Contributor Author

g-k commented Apr 10, 2016

Let me know if I should update the Option unwrapping to be more concise with try! or unwrap.

@KiChjang
Copy link
Member

KiChjang commented Apr 10, 2016

@g-k I think it's better to use try! here, since the method is explicitly marked as Fallible.

@KiChjang
Copy link
Member

KiChjang commented Apr 11, 2016

-S-awaiting-review +S-needs-code-changes


Reviewed 3 of 3 files at r4.
Review status: all files reviewed at latest revision, 2 unresolved discussions.


components/script/dom/domexception.rs, line 105 [r4] (raw file):
Is there a spec link that defines this UnknownError type?


components/script/dom/htmltableelement.rs, line 190 [r2] (raw file):
This is still not fixed; you're inserting the new node before the parent, not before the _i_th row.


Comments from Reviewable

@Ms2ger
Copy link
Contributor

Ms2ger commented Apr 11, 2016

I'm sorry, but @KiChjang is wrong in suggesting try!() here. If the logic of the function ensures that the operation will always be successful, we should .expect() or .unwrap().

@bors-servo
Copy link
Contributor

bors-servo commented Apr 12, 2016

The latest upstream changes (presumably #10543) made this pull request unmergeable. Please resolve the merge conflicts.

@g-k g-k force-pushed the g-k:insert-row branch from df7c572 to fa4e282 Apr 13, 2016
@KiChjang
Copy link
Member

KiChjang commented Apr 17, 2016

@bors-servo r-

Sorry, this still needs to be squashed. Your first commit alone will cause build errors.

@bors-servo
Copy link
Contributor

bors-servo commented Apr 17, 2016

💔 Test failed - linux-rel

@g-k g-k force-pushed the g-k:insert-row branch from 2bf763e to cf425a1 Apr 17, 2016
@KiChjang
Copy link
Member

KiChjang commented Apr 18, 2016

@bors-servo r+

Thanks!

@bors-servo
Copy link
Contributor

bors-servo commented Apr 18, 2016

📌 Commit cf425a1 has been approved by KiChjang

@KiChjang
Copy link
Member

KiChjang commented Apr 18, 2016

@bors-servo r-

The test expectations need to be updated.

Ran 4677 tests finished in 357.0 seconds.
  • 4676 ran as expected. 1363 tests skipped.
  • 1 tests had unexpected subtest results

Tests with unexpected results:
  ▶ Unexpected subtest result in /html/dom/interfaces.html:
  └ PASS [expected FAIL] HTMLTableElement interface: operation insertRow(long)

  ▶ Unexpected subtest result in /html/dom/interfaces.html:
  └ PASS [expected FAIL] HTMLTableElement interface: document.createElement("table") must inherit property "insertRow" with the proper type (12)

  ▶ Unexpected subtest result in /html/dom/interfaces.html:
  └ PASS [expected FAIL] HTMLTableElement interface: calling insertRow(long) on document.createElement("table") with too few arguments must throw TypeError
refs: #9269

and update HTMLTableElement.webidl

insertRow returns an HTMLTableRowElement and throws an IndexSizeError
sortable and stopSorting were removed.
@g-k g-k force-pushed the g-k:insert-row branch from cf425a1 to 1d59d87 Apr 18, 2016
@KiChjang
Copy link
Member

KiChjang commented Apr 18, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Apr 18, 2016

📌 Commit 1d59d87 has been approved by KiChjang

@bors-servo
Copy link
Contributor

bors-servo commented Apr 18, 2016

Testing commit 1d59d87 with merge 19a5a9a...

bors-servo added a commit that referenced this pull request Apr 18, 2016
Insert row

Fixes #9269

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10508)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 18, 2016

@bors-servo bors-servo merged commit 1d59d87 into servo:master Apr 18, 2016
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@g-k g-k deleted the g-k:insert-row branch Apr 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

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