Fixed <header> is not safely removable

CyberAP

Well-known member
Affected version
2.0.1
If you remove <header> from PAGE_CONTAINER you'll get this error in threads:

jquery-3.2.1.min.js?_v=f84f555d:2 Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
at c.getEditorConfig (editor-compiled.js?_v=f84f555d:98)
at c.init (editor-compiled.js?_v=f84f555d:97)
at c (core-compiled.js?_v=f84f555d:112)
at e (core-compiled.js?_v=f84f555d:113)
at HTMLTextAreaElement.<anonymous> (core-compiled.js?_v=f84f555d:113)
at Function.each (jquery-3.2.1.min.js?_v=f84f555d:2)
at r.fn.init.each (jquery-3.2.1.min.js?_v=f84f555d:2)
at Object.f [as initialize] (core-compiled.js?_v=f84f555d:113)
at Object.activate (core-compiled.js?_v=f84f555d:42)
at HTMLDocument.onPageLoad (core-compiled.js?_v=f84f555d:25)

I didn't have a chance to get a deep dive into the code, but some functionality is dependent on #header element. If you remove just contents and preserve the tag itself the problem goes away. The deserved behaviour would be just to disable that functionality if there's no such an element.
 
Strictly speaking, it's not the <header> element -- it's the .p-header element. Though we should be trapping the error at least.
 
Back
Top Bottom