[Webkit-unassigned] [Bug 178392] New: DOM Selector parsing doesn't support selectors without ending tokens

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 17 09:30:05 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=178392

            Bug ID: 178392
           Summary: DOM Selector parsing doesn't support selectors without
                    ending tokens
           Product: WebKit
           Version: Safari 11
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML DOM
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: thejordanforeman at gmail.com
                CC: cdumez at apple.com

This bug was originally uncovered through jQuery's selector, but the behavior is consistent with document.querySelector (the underlying selector parsing is the same).

Per the CSS Working Group's spec - https://drafts.csswg.org/css-syntax/#rule-defs:

> When defining a function or a block, the ending token must be specified in the grammar, but if it’s not present in the eventual token stream, it still matches.

For example, the following will throw an exception in Safari: 

```
document.querySelector('[data-my-target="someId"');
```

Note the lack of a closing brace (]) in the selector. 

While I have my own opinions on this matter, it is inconsistent with other major browsers (Chrome and Firefox), and seems to run contrary to the working group's specification.

Note: this may be an issue specifically with Safari and not Webkit. I don't have access to Webkit builds on my work computer, otherwise I'd validate that

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20171017/b3d5ac57/attachment.html>


More information about the webkit-unassigned mailing list