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

Hammerhead overrides some attributes, that are used in non-standard way, with null #2347

Closed
intermike opened this issue Apr 24, 2018 · 3 comments
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot.

Comments

@intermike
Copy link

intermike commented Apr 24, 2018

Are you requesting a feature or reporting a bug?

Bug

What is the current behavior?

Hammerhead nullifies attributes, that are used in non-standard way, e.g. @action for <input>.

What is the expected behavior?

Hammerhead leaves attributes, that are used in non-standard way, as they are.

How would you reproduce the current behavior (if this is a bug)?

The JS code on tested page

var div = document.createElement('div');
div.innerHTML = '<input type="submit" action="#test-me-out">';
console.log(div.firstChild.outerHTML);

produces this console output:

> <input type="submit" action="null">

But the code should produce the following:

> <input type="submit" action="#test-me-out">

Provide the test code and the tested page URL (if applicable)

Add the following test in testcafe-hammerhead/test/client/fixtures/sandbox/code-instrumentation/getters-test.js and observe it fails:

test('leaving attributes, that are used in non-standard way, as they are', function () {
    var htmlText = '<input action="#test-me-out">';
    var div      = document.createElement('div');

    setProperty(div, 'innerHTML', htmlText);

    var a = div.firstChild;

    strictEqual(a.outerHTML, processHtml(htmlText));
    strictEqual(getProperty(a, 'outerHTML'), htmlText);
});

Specify your

  • operating system: MacOS, Windows
  • testcafe version: 0.19.2
  • node.js version: 9.8.0
@intermike
Copy link
Author

intermike commented Apr 24, 2018

I have the fix already and I'm willing to create a pull request.

@intermike
Copy link
Author

@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 An issue has been 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
STATE: Auto-locked An issue has been automatically locked by the Lock bot.
Projects
None yet
Development

No branches or pull requests

1 participant