Skip to content

Elements with special parsing rules #30

@foolip

Description

@foolip

Many elements have special parsing rules that end up limiting what kind of nodes can appear inside. For example, https://html.spec.whatwg.org/multipage/parsing.html#parsing-elements-that-contain-only-text is used for <xmp> and as a result there will be either no child node, or a single text node child.

Should <template patchfor> ensure that result will be the same as if it was parsed at the target location?

Test case:

<!DOCTYPE html>
<xmp id=target></xmp>
<template patchfor=target><span>hello</span></template>

Or should be behave exactly like setting innerHTML? https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=13929 tests that and at least <xmp> behaves the same as the main parser. Spec is at https://html.spec.whatwg.org/multipage/parsing.html#html-fragment-serialisation-algorithm and I'm not very familiar with where it differs from the main parser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions