Recommend changing:
"footer (nearest ancestor sectioning content or sectioning root element is not body, or parent is main)"
to
"footer (nearest ancestor sectioning content or sectioning root element is not body or is a descendant of main)"
"footer (nearest ancestor sectioning content or sectioning root element is body)"
to
"footer (nearest ancestor sectioning content or sectioning root element is body and not a descendant of main)"
"header (nearest ancestor sectioning content or sectioning root element is not body, or parent is main)"
to
"header (nearest ancestor sectioning content or sectioning root element is not body or is a descendant of main)"
"header (nearest ancestor sectioning content or sectioning root element is body)"
to
"header (nearest ancestor sectioning content or sectioning root element is body and not a descendant of main)"