Skip to content
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

Avoid processing documentFragmentNode on the server side #912

Closed
AlexanderMoskovkin opened this issue Nov 8, 2016 · 9 comments
Closed
Assignees
Labels
AREA: client STATE: Auto-locked Issues that were automatically locked by the Lock bot TYPE: bug
Milestone

Comments

@AlexanderMoskovkin
Copy link
Contributor

http://todomvc.com/examples/polymer/index.html

reproduced in playground. Tested in Chrome but should be check in other browsers

@georgiy-abbasov
Copy link
Contributor

Simplified page markup for reproducing

<body>
    <template is="dom-bind">
        <td-model id="model" items="{{todos}}"></td-model>
        <td-todos model-id="model" items="{{todos}}"></td-todos>
    </template>
</body>

@AlexanderMoskovkin
Copy link
Contributor Author

@georgiy-abbasov Are you working on it?

@georgiy-abbasov
Copy link
Contributor

Yes, it is

georgiy-abbasov pushed a commit to georgiy-abbasov/testcafe-hammerhead that referenced this issue Nov 10, 2016
@miherlosev miherlosev changed the title [todomvc] Polymer page hangs on opening Should omit documentFragmentNode processing on server side Dec 1, 2016
@MarinaRukavitsyna MarinaRukavitsyna changed the title Should omit documentFragmentNode processing on server side Avoid processing documentFragmentNode on the server side Dec 1, 2016
@ghost
Copy link

ghost commented Oct 1, 2018

Should this change also be applied to _processElement function? I.e.:

NodeSandbox.prototype._processElement = function _processElement(el) {
...
if (processedContext && el.nodeName!== '#document-fragment') { urlAttrName = _domProcessor2.default.getUrlAttr(el); urlAttrName = el.hasAttribute(urlAttrName) ? urlAttrName : null} }
Otherwise, it trips up loading a doc fragment with an error that hasAttribute is not a function.

@ghost ghost unassigned georgiy-abbasov Oct 1, 2018
@LavrovArtem
Copy link
Contributor

I'll investigate it.

@LavrovArtem LavrovArtem self-assigned this Oct 3, 2018
@LavrovArtem
Copy link
Contributor

I don't understand how a document-fragment is passed to the _processElement function. Could you please provide more information about it?

@ghost
Copy link

ghost commented Oct 3, 2018

In our particular app, we do a lot of asynchronous loading into an iframe. One case is loading other pages into a documentFragment via appendChild method. For example:
iframe.onload = function iframeOnLoad() {
var pageFrag = document.createDocumentFragment();
...
//Load some pages into page variable
for(var i=0; i<somecondition;i++){
var page = someLogicHere();
pageFrag.appendChild(page);
...
}
...
iframe.appendChild(pageFrag);

Hammerhead deals with this fine for most part, but, as I mentioned above it encounters issues if the nodeType is documentFragment. So far, filtering it out in the _proccessElement function has been an effective solution.

@LavrovArtem
Copy link
Contributor

I've reproduced the bug on the next example page:

<body>
    <script>
        var iframe = document.createElement('iframe');

        iframe.addEventListener('load', function () {
            var pageFrag = document.createDocumentFragment();

            iframe.contentDocument.body.appendChild(pageFrag);
        });

        document.body.appendChild(iframe);
    </script>
</body>

@nickkoss Thanks for the clarification.

@LavrovArtem LavrovArtem reopened this Oct 8, 2018
@LavrovArtem LavrovArtem modified the milestones: Sprint #2, Sprint #19 Oct 8, 2018
LavrovArtem added a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Oct 9, 2018
AndreyBelym pushed a commit to AndreyBelym/testcafe-hammerhead that referenced this issue Feb 28, 2019
AndreyBelym pushed a commit to AndreyBelym/testcafe-hammerhead that referenced this issue Feb 28, 2019
@lock
Copy link

lock bot commented Mar 28, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked Issues that were automatically locked by the Lock bot label Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AREA: client STATE: Auto-locked Issues that were automatically locked by the Lock bot TYPE: bug
Projects
None yet
Development

No branches or pull requests

3 participants