luci-base: Replace legend element with h3.
authorOldřich Jedlička <oldium.pro@gmail.com>
Sat, 24 Oct 2020 17:18:11 +0000 (19:18 +0200)
committerOldřich Jedlička <oldium.pro@gmail.com>
Sat, 24 Oct 2020 17:18:50 +0000 (19:18 +0200)
The legend HTML element is allowed only as first element in fieldset, so
use h3 instead, which is rendered the same within themes.

Fixes #3149.

Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
modules/luci-base/htdocs/luci-static/resources/form.js

index 568a4abb6aa6761439e735db7f025c7718199197..612c8ff94423ab5ce92ff9e22ee54fff21e69829 100644 (file)
@@ -2219,7 +2219,7 @@ var CBITypedSection = CBIAbstractSection.extend(/** @lends LuCI.form.TypedSectio
                        });
 
                if (this.title != null && this.title != '')
-                       sectionEl.appendChild(E('legend', {}, this.title));
+                       sectionEl.appendChild(E('h3', {}, this.title));
 
                if (this.description != null && this.description != '')
                        sectionEl.appendChild(E('div', { 'class': 'cbi-section-descr' }, this.description));
@@ -3138,7 +3138,7 @@ var CBINamedSection = CBIAbstractSection.extend(/** @lends LuCI.form.NamedSectio
                        });
 
                if (typeof(this.title) === 'string' && this.title !== '')
-                       sectionEl.appendChild(E('legend', {}, this.title));
+                       sectionEl.appendChild(E('h3', {}, this.title));
 
                if (typeof(this.description) === 'string' && this.description !== '')
                        sectionEl.appendChild(E('div', { 'class': 'cbi-section-descr' }, this.description));