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 HTMLTableRowElement insertCell and deleteCell #7977

Merged

Conversation

@frewsxcv
Copy link
Member

frewsxcv commented Oct 12, 2015

Review on Reviewable

use dom::htmlelement::HTMLElement;
use dom::node::Node;
use std::iter;

This comment has been minimized.

Copy link
@frewsxcv

frewsxcv Oct 12, 2015

Author Member

So I'm not a huge fan with how these generic functions turned out. If anyone has any suggestions to clean these up, let me know

}

let node = NodeCast::from_ref(this);
let tr = new_child(node);

This comment has been minimized.

Copy link
@eefriedman

eefriedman Oct 12, 2015

Contributor

It would be a bit simpler to just unconditionally build the child in the caller.

match last_child.and_then(|node| node.inclusively_preceding_siblings()
.filter_map(ElementCast::to_root)
.filter(|elem| is_delete_type(elem))
.next()) {

This comment has been minimized.

Copy link
@eefriedman

eefriedman Oct 12, 2015

Contributor

This would be a lot simpler in both the caller and callee if you could just write let last_child = get_items().LastItem();. (I know it doesn't exist at the moment, but it could be added.)

.filter(|elem| is_delete_type(elem))
.next()) {
Some(element) => element,
None => return Ok(()),

This comment has been minimized.

Copy link
@eefriedman

This comment has been minimized.

Copy link
@eefriedman

eefriedman Oct 12, 2015

Contributor

Err, oops, that isn't actually the algorithm you're implementing here... that said, I would tend towards the interpretation that it's an unintentional hole in the deleteRow/deleteCell definitions: "remove the last element in the rows collection" makes no sense if the rows collection is empty.

(For reference, it looks like Chrome throws, but Firefox doesn't.)

@Ms2ger
Copy link
Contributor

Ms2ger commented Oct 12, 2015

Do file a spec issue on the hole.

@frewsxcv
Copy link
Member Author

frewsxcv commented Oct 12, 2015

Spec issue filed: whatwg/html#248

@jdm
Copy link
Member

jdm commented Oct 13, 2015

@eefriedman I've noticed you've been doing drive-by reviews in a bunch of PRs recently (thanks!). Would you be interested in doing a complete review of these changes in Reviewable?

@eefriedman
Copy link
Contributor

eefriedman commented Oct 13, 2015

Review status: 0 of 9 files reviewed at latest revision, 4 unresolved discussions, all commit checks successful.


tests/wpt/web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell.html, line 52 [r1] (raw file):
This doesn't match the style of the rest of the test


Comments from the review on Reviewable.io

@eefriedman
Copy link
Contributor

eefriedman commented Oct 13, 2015

Reviewed 9 of 9 files at r1.
Review status: all files reviewed at latest revision, 4 unresolved discussions, all commit checks successful.


Comments from the review on Reviewable.io

@bors-servo
Copy link
Contributor

bors-servo commented Oct 14, 2015

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

@frewsxcv
Copy link
Member Author

frewsxcv commented Oct 15, 2015

components/script/dom/utils.rs, line 34 [r1] (raw file):
Maybe, but this avoids an unnecessary allocation if it returns early


Comments from the review on Reviewable.io

@frewsxcv frewsxcv force-pushed the frewsxcv:htmltablerowelement-insertcell-deletecell branch from abbb54e to c3d8fdc Oct 15, 2015
@frewsxcv frewsxcv force-pushed the frewsxcv:htmltablerowelement-insertcell-deletecell branch from c3d8fdc to 9e79cce Oct 15, 2015
@frewsxcv
Copy link
Member Author

frewsxcv commented Oct 15, 2015

I did a little refactoring and got rid of the components/script/dom/util.rs file. Let me know what you think.

@eefriedman
Copy link
Contributor

eefriedman commented Oct 15, 2015

Reviewed 1 of 9 files at r1.
Review status: 4 of 8 files reviewed at latest revision, 2 unresolved discussions, all commit checks successful.


tests/wpt/web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell.html, line 52 [r1] (raw file):
Oh, nevermind, I see what you're trying to do.


Comments from the review on Reviewable.io

@jdm jdm removed the S-needs-rebase label Oct 15, 2015
@bors-servo
Copy link
Contributor

bors-servo commented Oct 15, 2015

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

@frewsxcv frewsxcv force-pushed the frewsxcv:htmltablerowelement-insertcell-deletecell branch from 9e79cce to 1f58169 Oct 17, 2015
@frewsxcv
Copy link
Member Author

frewsxcv commented Oct 17, 2015

Merge conflicts addressed in the latest force push. @eefriedman did you have any other comments?

@eefriedman
Copy link
Contributor

eefriedman commented Oct 17, 2015

Maybe we should follow the predicted direction of whatwg/html#248 ?

Otherwise looks good.

@jdm
Copy link
Member

jdm commented Oct 17, 2015

I'd rather implement the current spec behaviour and update accordingly after the spec is changed.

@jdm
Copy link
Member

jdm commented Oct 17, 2015

@bors-servo: r=eefriedman
Thanks @frewsxcv and @eefriedman!

@bors-servo
Copy link
Contributor

bors-servo commented Oct 17, 2015

📌 Commit 1f58169 has been approved by eefriedman

@bors-servo
Copy link
Contributor

bors-servo commented Oct 17, 2015

Testing commit 1f58169 with merge ef81195...

bors-servo pushed a commit that referenced this pull request Oct 17, 2015
…ell, r=eefriedman

Implement HTMLTableRowElement insertCell and deleteCell



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7977)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Oct 17, 2015

💔 Test failed - linux-rel

@Ms2ger
Copy link
Contributor

Ms2ger commented Oct 17, 2015

@bors-servo
Copy link
Contributor

bors-servo commented Oct 17, 2015

Previous build results for android, gonk, linux-dev, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt are reusable. Rebuilding only linux-rel...

@bors-servo
Copy link
Contributor

bors-servo commented Oct 17, 2015

@bors-servo bors-servo merged commit 1f58169 into servo:master Oct 17, 2015
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@frewsxcv frewsxcv deleted the frewsxcv:htmltablerowelement-insertcell-deletecell branch Oct 17, 2015
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

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