2

Safari 9 let form tag disappeared under dom element. Safari 8 and Chrome and Firefox is fine.

enter image description here

  • My mac is yosemite 10.10.5.
  • Safari is 9.0 (10601.1.56.2)

I searched safari 9 documentation.

https://developer.apple.com/library/prerelease/mac/releasenotes/General/WhatsNewInSafari/Articles/Safari_9.html

But I don't find solution. Someone has any information?

update 2015-10-05

It was the template + form problem.

https://jsfiddle.net/svj7j2gs/

<form id="first-form">
  first-form
</form>
<template>
  <form id="second-form">
    second-form
  </form>
</template>
<form id="third-form">
  third-form
</form>

chrome result

The #third-form form tag existed.

enter image description here

safari 9 result

The #third-form form tag removed.

enter image description here

The template tag was supported since Safari 7.1 ? https://html.spec.whatwg.org/multipage/scripting.html#the-template-element

safari 8 result

enter image description here

Multiple post

If it's a bug, it's outside the reach of the stackoverflow. So I post Apple Support Communities. Safari 9 - broken DOM. Is it bug? | Apple Support Communities

Community
  • 1
  • 1
user3758624
  • 176
  • 5

1 Answers1

0

This is definitely a bug.

Solution 1: Move the needed form above the template with the nested form

Example:

<form id="first-form">
    I'm fine here
</form>
<template>
    <form id="second-form">
        second-form
    </form>
</template>

Solution 2: Add a dummy form directly following the template and before the needed form. Only the first form following the template will get stripped from the DOM.

Example:

<template>
    <form id="second-form">
        second-form
    </form>
</template>
<form id="third-form">
    I will get stripped
</form>
<form id="third-form">
    I will be fine here
</form>
skovy
  • 5,430
  • 2
  • 20
  • 34