New issue
Advanced search Search tips

Issue 919095 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Chrome DevTools cannot locate closing tags

Reported by briancf...@gmail.com, Jan 4

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36

Steps to reproduce the problem:
1. Go to any web page (example: https://developers.google.com/web/tools/chrome-devtools/) 
2. Use the Chrome DevTools search to search on a closing tag or partial closing tag (examples: </head>, </script>, /head, /body, /p, /ul, etc. )
3. No results are returned.

What is the expected behavior?
Chrome DevTools should be able to find closing tags via search functionality. 

What went wrong?
No results were returned. Also, I was unable to locate any documentation on how to perform searches with Chrome DevTools. 

Did this work before? N/A 

Chrome version: 71.0.3578.98  Channel: stable
OS Version: 10.0
Flash Version: 

I've created a composite of 2 screenshots (see attached file), where I've searched for 2 closing tags & they were not 'found', despite that I can see the closing tag(s). Hope this helps to identify what the issue is, whether it's technical or user error. Thank you.
 
Issues-With-Chrome-Dev-Tools-Search-Not-Finding-Closing-Tag_12-18-2018.png
527 KB View Download
It's not implemented currently.

Devtools uses the internal DOM.performSearch command:
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/inspector/inspector_dom_agent.cc?l=962&rcl=0a6953c5

AFAICT it tries to match these types of queries:

  text - inside #text nodes (like textContent in js)
  text - inside tag names
  text - inside attribute names
  text - inside attribute values

  <text - matching at the start of a tag name
  text> - matching at the end of a tag name
  <text> - matching an entire tag name

  "text - matching at the start of an attribute value
  text" - matching at the end of an attribute value
  "text" - matching an entire attribute value

  //a/[@valid='xpath-selector']
  a#valid.css[selector]

As you can see the literal text matching is limited to the first four types, and it won't find things that span more than one type e.g. attr="value". For these complex queries you'll have to use XPath:

  //*[@attr="value"]
  //*[contains(@attr,"value")]
  //*[starts-with(@attr,"value")]

And of course you can use CSS selectors - just make sure it doesn't match as a literal text by prefixing it like e.g. "html a"
Labels: Needs-Triage-M71
Cc: vamshi.kommuri@chromium.org
Components: -UI Platform>DevTools UI>Browser>Search
Labels: Triaged-ET Target-73 M-73 FoundIn-71 FoundIn-73 FoundIn-72 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)
Thanks for filing the issue!

Able to reproduce the issue on reported chrome version 71.0.3578.98 and on the latest canary 73.0.3663.0 using Ubuntu 14.04, Mac 10.14.1 and Windows 10 

As the issue is seen from M60(60.0.3112.0) considering it as Non-Regression and marking it as Untriaged.
Owner: l...@chromium.org
Status: Assigned (was: Untriaged)

Sign in to add a comment