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

Pass intended parent to create_element #312

Closed
wants to merge 2 commits into from

Conversation

@cbrewster
Copy link
Member

cbrewster commented Sep 17, 2017

This is needed to resolve servo/servo#18277

@cbrewster cbrewster force-pushed the cbrewster:intended_parent branch from ce31957 to 380e38c Sep 17, 2017
@KiChjang
Copy link
Member

KiChjang commented Sep 17, 2017

I sort of believe that the intended parent parameter shouldn't be optional, since the spec did not mention that it is optional.

@cbrewster
Copy link
Member Author

cbrewster commented Sep 18, 2017

@KiChjang probably... In some uses of create_element, the intended parent was not immediately obvious to me. Like https://github.com/cbrewster/html5ever/blob/380e38cb078c5ee4eb80be97c18d3d7c7dcc5dd2/html5ever/src/driver.rs#L53-L59

@nox
Copy link
Member

nox commented Oct 3, 2017

@bors-servo delegate=cynicaldevil

@cynicaldevil Would you be interested in reviewing this?

@bors-servo
Copy link
Contributor

bors-servo commented Oct 3, 2017

✌️ @cynicaldevil can now approve this pull request

let insertion_point = self.appropriate_place_for_insertion(None);
let (node1, node2) = match insertion_point {
LastChild(ref p) |
BeforeSibling(ref p) => (p.clone(), None),
TableFosterParenting { ref element, ref prev_element } => (element.clone(), Some(prev_element.clone())),
};

// Step 7.
let qname = QualName::new(None, ns, name);
let elem = create_element(&mut self.sink, qname.clone(), attrs.clone(), Some(&node1));

This comment has been minimized.

Copy link
@cynicaldevil

cynicaldevil Oct 3, 2017

Contributor

This might cause problems, because if the TableFosterParenting arm is matched in the match block, then either node1 or node2 can be the parent. This decision is taken on Servo's side, because we need to access the DOM to figure out which node is the parent.

This comment has been minimized.

Copy link
@cbrewster

cbrewster Oct 4, 2017

Author Member

Hmm true... Would elements be in the same document? Should I send both to create_element?

This comment has been minimized.

Copy link
@cynicaldevil

cynicaldevil Oct 5, 2017

Contributor

These elements are from the stack of open elements, where it is possible that two elements may not have the same document associated with them. So you need to pass both elements.

This comment has been minimized.

Copy link
@jdm

jdm Jun 19, 2018

Member

@cbrewster Does this comment still need to be addressed?

This comment has been minimized.

Copy link
@cbrewster

cbrewster Jun 27, 2018

Author Member

I believe so, its been a while since I worked on these changes. I'm a bit busy at the moment with school, but I'll get back to this in a couple weeks.

@bors-servo
Copy link
Contributor

bors-servo commented Oct 4, 2017

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

@cbrewster cbrewster force-pushed the cbrewster:intended_parent branch from 380e38c to 090940f Jul 26, 2018
@@ -1,7 +1,7 @@
[package]

name = "xml5ever"
version = "0.12.1"
version = "0.12.2"

This comment has been minimized.

Copy link
@cbrewster

cbrewster Jul 26, 2018

Author Member

I'm not sure if this should be bumped as 0.12.2 or 0.13.0 here.

This comment has been minimized.

Copy link
@nox

nox Jul 26, 2018

Member

0.13, markup5ever is a public dependency and it got a breaking bump, so the breaking bump needs to be propagated as such.

This comment has been minimized.

Copy link
@cbrewster

cbrewster Jul 26, 2018

Author Member

Makes sense, thanks!

@cbrewster cbrewster force-pushed the cbrewster:intended_parent branch from 090940f to 0e82cef Jul 26, 2018
@cbrewster cbrewster force-pushed the cbrewster:intended_parent branch from 0e82cef to baea611 Jul 26, 2018
@bors-servo
Copy link
Contributor

bors-servo commented Oct 16, 2018

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

@cbrewster
Copy link
Member Author

cbrewster commented Jun 25, 2019

I don't have the bandwidth to finish this at the moment.

@cbrewster cbrewster closed this Jun 25, 2019
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.

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