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

Mark 'name' and 'namedItem' methods of an HTMLCollection as non-enumerable #1172

Closed
churkin opened this issue Jun 8, 2017 · 7 comments
Closed
Assignees
Labels
AREA: client !IMPORTANT! STATE: Auto-locked Issues that were automatically locked by the Lock bot TYPE: bug
Milestone

Comments

@churkin
Copy link
Contributor

churkin commented Jun 8, 2017

Based on
https://testcafe-discuss.devexpress.com/t/uncaught-typeerror-elm-getattribute-is-not-a-function/304

There are two extra methods item and namedItem in the for ... in loop.

Check all errors on this site.

@miherlosev
Copy link
Contributor

I'm working on this

@miherlosev
Copy link
Contributor

Page for reproduce - http://start.att.net

@LavrovArtem
Copy link
Contributor

duplicate of #1141

@miherlosev
Copy link
Contributor

I've reproduce an another problem:

Uncaught TypeError: Illegal invocation
    at ShadowUI.getRoot (http://localhost:1401/hammerhead.js:10511:59)
    at Object.set (http://localhost:1401/hammerhead.js:2328:68)
    at value (http://localhost:1401/hammerhead.js:2983:183)
....

@LavrovArtem
Copy link
Contributor

The last problem is regression of #1150

LavrovArtem added a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Jun 14, 2017
LavrovArtem added a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Jun 14, 2017
churkin pushed a commit that referenced this issue Jun 15, 2017
* fix regression of gh-1150 (#1172)

* fix review's issues

* fix review's issues
@miherlosev
Copy link
Contributor

miherlosev commented Jun 16, 2017

Aftex fix regression, I've the origin problem.

item and namedItem are placed in HTMLCollection prototype.
We use an Array to filter shadowUI items and put item and namedItem directly to result object.

The simple example to reproduce:

<html>
	<body>
		<script></script>
		<script>
			var nodeList = document.getElementsByTagName('script');
			
                        // Without proxing these statements log the 'false' value
                        // With proxing - 'true'
			console.log(nodeList.hasOwnProperty('item'));
			console.log(nodeList.hasOwnProperty('namedItem'));
		</script>
	</body>
</html>

To fix this issue need to move item and namedItem functions to a prototype.
It will be done in #1167

LavrovArtem added a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Jun 21, 2017
@miherlosev miherlosev changed the title "getElementsByTagName" method returns collection with extra properties Mark 'name' and 'namedItem' methods of an HTMLCollection as non-enumerable Jun 27, 2017
AndreyBelym pushed a commit to AndreyBelym/testcafe-hammerhead that referenced this issue Feb 28, 2019
* fix regression of DevExpressgh-1150 (DevExpress#1172)

* fix review's issues

* fix review's issues
AndreyBelym pushed a commit to AndreyBelym/testcafe-hammerhead that referenced this issue Feb 28, 2019
…ss#1141, close DevExpress#1172) (DevExpress#1183)

* fix `Incorrect overriding of the NodeList collection` (close DevExpress#1141, close DevExpress#1172)

* change a test logic
@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 !IMPORTANT! 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