New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
eeid26 opened this Issue Feb 22, 2015 · 5 comments

Comments

Projects
None yet
6 participants
@eeid26
Contributor

eeid26 commented Feb 22, 2015

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.

@garlicnation

This comment has been minimized.

Show comment
Hide comment
@garlicnation

garlicnation Mar 6, 2015

Contributor

execCommand isn't supported with the shadowDom polyfill. We're happy to look at a PR that adds support, however.

Contributor

garlicnation commented Mar 6, 2015

execCommand isn't supported with the shadowDom polyfill. We're happy to look at a PR that adds support, however.

@eeid26

This comment has been minimized.

Show comment
Hide comment
@eeid26

eeid26 Apr 2, 2015

Contributor

Started looking into the issues. First the range api needs to work with the polyfill shadow dom. created a PR to make sure the range works reasonably well under the shadow dom polyfill. I say reasonably well, because the shadow dom can have multiple insertion points. Once the shadow dom (oldest and youngest) have multiple insertion points, things do not even make sense what should be the range. Tried to make sense of chrome native implementation and I could not understand the complete logic. With what the users see and the limitation of the range has to be contiguous in the dom tree, the multiple insertion point might be impossible to implement with the browser editing range api.

At least with the PR one insertion point works well. Even if you have oldest and youngest shadow root associated with the host.

Contributor

eeid26 commented Apr 2, 2015

Started looking into the issues. First the range api needs to work with the polyfill shadow dom. created a PR to make sure the range works reasonably well under the shadow dom polyfill. I say reasonably well, because the shadow dom can have multiple insertion points. Once the shadow dom (oldest and youngest) have multiple insertion points, things do not even make sense what should be the range. Tried to make sense of chrome native implementation and I could not understand the complete logic. With what the users see and the limitation of the range has to be contiguous in the dom tree, the multiple insertion point might be impossible to implement with the browser editing range api.

At least with the PR one insertion point works well. Even if you have oldest and youngest shadow root associated with the host.

@jfrazzano

This comment has been minimized.

Show comment
Hide comment
@jfrazzano

jfrazzano Sep 20, 2016

you ever solve this out? We beeb using polymer for 18 months, wanted to try a bunch of native stuff while we wait and lightly test the newer configs, etc. We are trying to get a template repeat working. I sorta had it going last month but then the generator stopped working. I saw it was deprecated. Now we are just trying to get a render of a shadow, without an insertion, something declarative. We can see it on screen no problem in a codePen, when we inspect, and its holder is fine. We were thinking about running a data stream from the url/uri of a object element. That would seem to meet one of the render criteria.

Thanks for any assistance up frony. I know you guys are all swamped.

you ever solve this out? We beeb using polymer for 18 months, wanted to try a bunch of native stuff while we wait and lightly test the newer configs, etc. We are trying to get a template repeat working. I sorta had it going last month but then the generator stopped working. I saw it was deprecated. Now we are just trying to get a render of a shadow, without an insertion, something declarative. We can see it on screen no problem in a codePen, when we inspect, and its holder is fine. We were thinking about running a data stream from the url/uri of a object element. That would seem to meet one of the render criteria.

Thanks for any assistance up frony. I know you guys are all swamped.

@freeman

This comment has been minimized.

Show comment
Hide comment
@freeman

freeman May 15, 2017

any news on this front ? We are hit by this issue too.

freeman commented May 15, 2017

any news on this front ? We are hit by this issue too.

@TimvdLippe

This comment has been minimized.

Show comment
Hide comment
@TimvdLippe

TimvdLippe Jun 17, 2018

Contributor

Thanks for the issue. It has been a great while since this issue was opened. Sadly, this issue misses a live reproduction with the most recent version of the webcomponents polyfill for us to be able to debug and potentially fix. Versions 1 of the polyfills fix a large amount of issues, probably including this one as well.

Please see the CONTRIBUTING.md for guidelines on filing issues. You can start from this jsBin template as a starting point and link it in the issue template under "Live Demo".

Feel free to file a new issue following these instructions if you can still reproduce this issue with versions 1 of the polyfills. Thank you!

Contributor

TimvdLippe commented Jun 17, 2018

Thanks for the issue. It has been a great while since this issue was opened. Sadly, this issue misses a live reproduction with the most recent version of the webcomponents polyfill for us to be able to debug and potentially fix. Versions 1 of the polyfills fix a large amount of issues, probably including this one as well.

Please see the CONTRIBUTING.md for guidelines on filing issues. You can start from this jsBin template as a starting point and link it in the issue template under "Live Demo".

Feel free to file a new issue following these instructions if you can still reproduce this issue with versions 1 of the polyfills. Thank you!

@TimvdLippe TimvdLippe closed this Jun 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment