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

Can't set the nextSibling properly of a plain object to null #1351

Closed
AlexanderMoskovkin opened this issue Oct 26, 2017 · 2 comments
Closed
Labels
!IMPORTANT! STATE: Auto-locked Issues that were automatically locked by the Lock bot TYPE: bug
Milestone

Comments

@AlexanderMoskovkin
Copy link
Contributor

Tested page:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <input id="input" />
    <script>
        function MyClass () {
            this.nextSibling = document.getElementById('input');
        }

        var instance = new MyClass();

        instance.nextSibling = null;

        alert(instance.nextSibling);
    </script>
</body>
</html>

Without hammerhead: alert(null).
With hammerhead: alert(<input-element-description>).

Reason:
https://github.com/DevExpress/testcafe-hammerhead/blob/master/src/client/sandbox/code-instrumentation/properties/index.js#L406

nextSibling: {
  condition: node => node.nextSibling && domUtils.isDomElement(node.nextSibling),
  get:       node => domUtils.isShadowUIElement(node.nextSibling) ? null : node.nextSibling,
  set:       () => void 0
},

It seems we should add one more check to the condition like: domUtils.isDomElement(node),.
Additionally take a look at other properties. It possible there similar things there.

@miherlosev
Copy link
Contributor

I'm working on this

miherlosev pushed a commit to miherlosev/testcafe-hammerhead that referenced this issue Oct 27, 2017
AndreyBelym pushed a commit to AndreyBelym/testcafe-hammerhead that referenced this issue Feb 28, 2019
…only for DOM elements' (close DevExpress#1351) (DevExpress#1352)

* fix 'should properly set value of instrumented property if it is readonly for DOM elements (DevExpressGH-1351)' (close DevExpress#1351)

* fix lint error
@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
!IMPORTANT! STATE: Auto-locked Issues that were automatically locked by the Lock bot TYPE: bug
Projects
None yet
Development

No branches or pull requests

2 participants