MobileChromeApps / mobile-chrome-apps

Chrome apps on Android and iOS
BSD 3-Clause "New" or "Revised" License
2.5k stars 347 forks source link

markup between head and body go into head, chrome puts it in body #104

Open drkemp opened 10 years ago

drkemp commented 10 years ago

This appears to be a result of the injection at

mobile-chrome-apps/chrome-cordova/plugins/chrome-bootstrap/api/app/window.js line 112

clelland commented 10 years ago

What sort of markup are you referring to? Do you have an example of this?

I expect it would depend on the tags involved, and whether the </head> and/or <body> are present or not.

I think we're looking for an explicit <body> tag, while Chrome (and any conformant rendering engine) will assume an implied <body> tag as soon as one is required to make a valid document.

It would be great if we could leverage the parser in the WebView here rather than coding the logic in window.js

drkemp commented 10 years ago

I have the original html - but can't share that publicly. The tags involved were br, button,input,textarea,h3 . However, I believe that the core problem is that the parser simply sweeps everything not in the body tag into the head.