Skip to content
This repository was archived by the owner on Sep 20, 2019. It is now read-only.
This repository was archived by the owner on Sep 20, 2019. It is now read-only.

incorrect childNodes for element after running document.execCommand("formatblock", false, "h1"); #212

Closed
@eeid26

Description

@eeid26

example showing the issue
http://jsbin.com/nikekogeqe/4/edit

<polymer-element name="custom-element" noscript>
    <template>
        <!-- formatblock(h1) does not work under the polyfill -->
        <div id="wrapper">
            <content></content>
        </div>
        <!-- formatblock(h1) works under the polyfill -->
        <!--<content></content>-->
    </template>
</polymer-element>

<custom-element id="myCustomElement" contenteditable="true">
    <p>test</p>
</custom-element>

After creating and selecting a range that includes the myCustomElement and executing something like

document.executeCommand("formatblock", isIE ? "

" : "h1");

Calling innerHtml on the myCustomElement returns

<p></p> 

but the element is rendered correctly.

calling invalidateShadowRenderer(); after executing the command

fixes the innerHtml, but the element is not rendered correctly.

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