New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 628880 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Jan 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

Different behavior of querySelector depending on the caller

Reported by rianb...@gmail.com, Jul 16 2016

Issue description

Chrome Version       : <Version 51.0.2704.106 (64-bit)>
URLs (if applicable) : http://queryselector-question.m3c.space/
Other browsers tested:
  Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
     Safari: NOT TESTED
    Firefox: NOT TESTED
         IE: NOT TESTED

What steps will reproduce the problem?
(1) http://queryselector-question.m3c.space/
(2) querySelector at document.currentScript.ownerDocument
(3) Capital Case for the identifier

What is the expected result?
HTMLElement

What happens instead?
Null

Please provide any additional information below. Attach a screenshot if
possible.

https://github.com/w3c/web-platform-tests/issues/3301
 
Cc: durga.behera@chromium.org
Labels: Needs-Feedback
rianby64@ : Could you please help providing more inputs on it along with the OS details to reproduce and triage further.
After navigating to the given url what are the steps to be followed and what is their expected result.
Please review the screen shot after navigating to the url as attached.
628880_July_18.png
66.0 KB View Download

Comment 2 by rianb...@gmail.com, Jul 18 2016

Thanks for the feedback. Let's explain the situation.
I'm using chrome 51, under Linux CentOS.

And, I was planning with a feature called link rel=import .
Can you please test the code given at the demo?
This test passes (green) on Opera.
Thanks.

Comment 3 by rianb...@gmail.com, Jul 18 2016

In Chrome the test is red. And I'm querying the div by using capital letters. Any capital letter at the id will not be accepted by the query selector.

Comment 4 by rianb...@gmail.com, Jul 18 2016

Another thing that you should consider is that any instance of Document has a method called querySelector(query).
The behavior of querySelector doesn't change if calling from a document, or from a fragment or even from a shadowRoot. Right?
So, why querySelector doesn't work correclty from inside document.currentScript.ownerDocument ?

Let's supose,
<div id="myId"></div>

<script>
  var ownerDocument = document.currentScript.ownerDocument;
  var d = ownerDocument.querySelector('div#myId'); // this should point to the div
  // but not, d = null at this point
</script>

The test itself shows how to reproduce the error.
If you put any capital letter inside the querySelector's param, then the query will return null.

Comment 5 by rianb...@gmail.com, Jul 18 2016

If you notice, in my example, I'm using the querySelector inside a document that comes from a <link> - Right there is located the problem.

Project Member

Comment 6 by sheriffbot@chromium.org, Jul 18 2016

Labels: -Needs-Feedback Needs-Review
Owner: durga.behera@chromium.org
Thank you for providing more feedback. Adding requester "durga.behera@chromium.org" for another review and adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Needs-Review Needs-Feedback OS-Linux
Owner: ----
The Opera 38.0.2220.41 on a Mac 10.11.5 too behaves the same as chrome.
Could you please help providing a screen shot/screen cast of the expected result.
Opera_38_stable.png
72.8 KB View Download

Comment 8 by rianb...@gmail.com, Jul 18 2016

Durga, hello again ))
I can't do a screen-shot because I don't have Opera in my laptop, but from daughter's smartphone both tests pass on green.

Let's review...

1) can you read the code?
view-source:http://queryselector-question.m3c.space/external.html 9th line?
I expect to see "Pass" instead of "Fail".

2) if is expected to see "Fail" then, please tell me where the HTML-standard states that querySelector doesn't accept capital case when using it under <link rel="import">.

I'm getting confused with this bug. And I want to understand if I'm missing something or definitely this "Fail" test shows a real bug?

I expect to see "Pass" in both tests.
Thanks for your patience.
Project Member

Comment 9 by sheriffbot@chromium.org, Jul 19 2016

Labels: -Needs-Feedback Needs-Review
Owner: durga.behera@chromium.org
Thank you for providing more feedback. Adding requester "durga.behera@chromium.org" for another review and adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 10 by rianb...@gmail.com, Jul 28 2016

Please, close this issue. I added the correct DOCTYPE and all came green. Thanks a lot for your time and patience!
Labels: -Needs-Review
Owner: ----
Status: WontFix (was: Unconfirmed)
Thanks for the update, closing it as per the above comment #10.
Please report a new issue if you still have any using chrome in future.

Sign in to add a comment