It compiles on the current master, and as far as I can see, resolves the issue without creating any new one. I think the problem comes from the if(p_parent) on line 1254. If p_head is NULL, it does not satisfy the if condition, and everything gets shifted... I think...
Edited
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related.
Learn more.
Just want to add that node parents are used to determine style in a cascading way, and this is why node hierarchy impacts rendering... if that wasn't clear.
That's right, the tree is displayed correctly by the debug function, and that's why it took me forever to track down the issue...
The problem lays in the fact that the segment that follows a closing tag doesn't get the correct parent (despite the fact that it is indented properly in the debug function). Because the ComputeStyle() function applies styles in a cascading way (and it should), the identity of the parent matters there. What happens is that the leftover segment (that is, here, the second "TEXT IUb") gets the previous node as a parent (here the b tag).
I'm traveling and I don't have my test code with me to try again, but I had determined that this happened because of the if(p_parent) on line 1254. If p_parent is p_head and p_head is initialized to NULL, the having no parent (being head) and having head as a parent cannot be distinguished.
I'll look more in detail, and try to see why the debug function also shows the tree properly, as I don't understand it fully... but perhaps in the meantime you can try to compile with the proposed correction and see for yourself if it fixes the problem or not?
So first, the webvtt_domnode_Debug function doesn't check what parent is what it just uses child and next and increases indentation recursively. Maybe a way to convince yourself of the problem is to also display the parent (as an address) of each node.
Yes! You're right! I may have had this in my code too... and that may be why I ended up allocating p_head, so that p_head's parent is NULL, but p_head's children can still have p_head as a parent... or am I just blabbering at that point...?