This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
<html> <head></head> <body> <p> <table> <form> <div> this is a test div </div> </form> </table> </p> </body> </html> when the above test case is parsed according to the spec it becomes: <html> <head></head> <body> <p> <div> this is a test div </div> <table> <form></form> </table> </p> </body> </html> [in this <div> is inside <p>, while the spec explicitly states that <div> elements will be moved out of <p>] Thus the output of the parsing algorithm violates the spec!!
I believe this is intentional. The foster parenting algorithm doesn't care whether the new parent is an appropriate one. Where does the spec say that div will be moved out of p?
(In reply to comment #1) > I believe this is intentional. The foster parenting algorithm doesn't care > whether the new parent is an appropriate one. > > Where does the spec say that div will be moved out of p? well if you have <p> text inside p <div> text inside div </div> </p> it is converted to: <p> text inside p </p> <div> text inside div </div> <p></p> this is not really moving <div> outside <p> but at least means what <div> cannot be placed inside <p> as per the standard Please check answer 3 at http://stackoverflow.com/questions/10763780/putting-div-inside-p-is-adding-an-extra-p
I was asking for a statement in the spec which the spec contradicts. Different handling for different cases is intentional. AFAICT there's no spec bug here.