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

Compat issue: <div><table><svg><foreignObject><select><table><s> #137

Closed
Ms2ger opened this issue Jul 9, 2021 · 4 comments · Fixed by #163
Closed

Compat issue: <div><table><svg><foreignObject><select><table><s> #137

Ms2ger opened this issue Jul 9, 2021 · 4 comments · Fixed by #163

Comments

@Ms2ger
Copy link
Contributor

Ms2ger commented Jul 9, 2021

Chrome:
Chrome
Firefox:
Firefox
Not sure who's right.

@annevk
Copy link
Contributor

annevk commented Apr 1, 2023

I think Firefox is correct. At least I can't find a reason why foreignObject would be popped from the stack of open elements.

@hsivonen @mfreed7?

@annevk
Copy link
Contributor

annevk commented Apr 5, 2023

I've changed my mind. WebKit and Chromium are correct.

Reasoning:

  • <div> gets put on the stack
  • <table> gets put on the stack
  • <svg> gets foster parented and put on the stack
  • <foreignObject> gets put on the stack
  • <select> gets put on the stack
  • <table> implies </select> which resets the insertion mode. That walks up the stack until it finds <table> which sets the insertion mode to "in table". Then <table> in that mode causes everything up to and including the prior <table> to be popped from the stack.
  • <s> gets foster parented.

@zcorpan
Copy link
Contributor

zcorpan commented Apr 27, 2023

Stepping through the spec I reach the same conclusion.

Notes
<div>
stack: html,body,div
im: in body

<table>
stack: html,body,div,table
im: in body -> in table

<svg>
stack: html,body,div,table
im: in table
Parse error. Enable foster parenting, process the token using the rules for the "in body" insertion mode, and then disable foster parenting.

<svg>
stack: html,body,div,table,svg
im: in table -> using the rules for in body
dom:
| <html>
|   <head>
|   <body>
|     <div>
|       <svg svg>
|       <table>

<foreignObject>
stack: html,body,div,table,svg
im: in table
Parse error. Enable foster parenting, process the token using the rules for the "in body" insertion mode, and then disable foster parenting.

<foreignObject>
stack: html,body,div,table,svg,foreignObject
im: in table, using the rules for in body; Process the token according to the rules given in the section for parsing tokens in foreign content.
dom:
| <html>
|   <head>
|   <body>
|     <div>
|       <svg svg>
|         <svg foreignObject>
|       <table>

<select>
stack: html,body,div,table,svg,foreignObject,select
im: in table, using the rules for in body -> in select in table
dom: 
| <html>
|   <head>
|   <body>
|     <div>
|       <svg svg>
|         <svg foreignObject>
|           <select>
|       <table>

<table>
Pop elements from the stack of open elements until a select element has been popped from the stack.
stack: html,body,div,table,svg,foreignObject
Reset the insertion mode appropriately.
im: in table
Reprocess the current token.

<table>
Pop elements from this stack until a table element has been popped from the stack.
stack: html,body,div
Reset the insertion mode appropriately.
im: in body
Reprocess the token.

<table>
stack: html,body,div,table
im: in body -> in table
dom:
| <html>
|   <head>
|   <body>
|     <div>
|       <svg svg>
|         <svg foreignObject>
|           <select>
|       <table>
|       <table>

<s>
stack: html,body,div,table,s
im: in table
Parse error. Enable foster parenting, process the token using the rules for the "in body" insertion mode, and then disable foster parenting.
dom:
| <html>
|   <head>
|   <body>
|     <div>
|       <svg svg>
|         <svg foreignObject>
|           <select>
|       <table>
|       <s>
|       <table>

@zcorpan
Copy link
Contributor

zcorpan commented Apr 27, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants