<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>149160</bug_id>
          
          <creation_ts>2015-09-15 05:45:44 -0700</creation_ts>
          <short_desc>querySelector() throws exception for -webkit-prefixed pseudo elements</short_desc>
          <delta_ts>2023-12-20 04:46:18 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>Safari 9</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://jsfiddle.net/TheDJ/db27kn7p/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Derk-Jan Hartman">hartman.wiki</reporter>
          <assigned_to name="Anne van Kesteren">annevk</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>annevk</cc>
    
    <cc>ap</cc>
    
    <cc>benjamin</cc>
    
    <cc>bfulgham</cc>
    
    <cc>dino</cc>
    
    <cc>hyatt</cc>
    
    <cc>joepeck</cc>
    
    <cc>koivisto</cc>
    
    <cc>ntim</cc>
    
    <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1125941</commentid>
    <comment_count>0</comment_count>
    <who name="Derk-Jan Hartman">hartman.wiki</who>
    <bug_when>2015-09-15 05:45:44 -0700</bug_when>
    <thetext>Per: http://dev.w3.org/2006/webapi/selectors-api/#interface-definitions

Authors are advised that while the use of pseudo-elements in selectors is permitted, they will not match any elements in the document, and thus would not result in any elements being returned. Therefore, authors are advised to avoid the use of pseudo-elements in selectors that are passed to the methods defined in this specification.

This works as expected (returns null) in Webkit for pseudo elements like ::before and ::after, but all Webkit specific pseudo elements (like -webkit-search-decoration) throws DOM Exception 12

This fails:
document.querySelector( &apos;input::-webkit-search-decoration&apos; )

See also the console output of this Fiddle: http://jsfiddle.net/TheDJ/db27kn7p/
This will return null in Chrome.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1125943</commentid>
    <comment_count>1</comment_count>
    <who name="Derk-Jan Hartman">hartman.wiki</who>
    <bug_when>2015-09-15 06:31:52 -0700</bug_when>
    <thetext>Downstream ticket on Wikipedia where we noticed this: https://phabricator.wikimedia.org/T112650

Related ticket in Firefox:
https://bugzilla.mozilla.org/show_bug.cgi?id=1204880</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1266037</commentid>
    <comment_count>2</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2017-01-11 19:36:09 -0800</bug_when>
    <thetext>This is still the case.

For example:

    document.querySelector(&quot;input::placeholder&quot;);

Outputs an Exception in Safari, but returns null in Firefox and Chrome.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1702692</commentid>
    <comment_count>3</comment_count>
    <who name="Derk-Jan Hartman">hartman.wiki</who>
    <bug_when>2020-10-29 06:09:17 -0700</bug_when>
    <thetext>Still a problem in Safari 14</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1814137</commentid>
    <comment_count>4</comment_count>
    <who name="Derk-Jan Hartman">hartman.wiki</who>
    <bug_when>2021-11-11 11:23:09 -0800</bug_when>
    <thetext>Still a problem in 15.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1894661</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-08-29 15:24:11 -0700</bug_when>
    <thetext>I am able to reproduce this in Safari Technical Preview 152 as well. It does not show &apos;null&apos; similar to other browsers (Chrome Canary 107 and Firefox Nightly 106) for third case - console.log( document.querySelector( &apos;input::-webkit-search-decoration&apos; ) );</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1894664</commentid>
    <comment_count>6</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-08-29 15:33:01 -0700</bug_when>
    <thetext>&lt;rdar://problem/99299129&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1945335</commentid>
    <comment_count>7</comment_count>
    <who name="Derk-Jan Hartman">hartman.wiki</who>
    <bug_when>2023-03-30 07:30:48 -0700</bug_when>
    <thetext>Still present in Safari 16.4</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2000745</commentid>
    <comment_count>8</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2023-12-19 09:50:27 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/22038</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2001002</commentid>
    <comment_count>9</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-12-20 04:12:31 -0800</bug_when>
    <thetext>Committed 272337@main (a23b77e8bca1): &lt;https://commits.webkit.org/272337@main&gt;

Reviewed commits have been landed. Closing PR #22038 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2001016</commentid>
    <comment_count>10</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2023-12-20 04:46:18 -0800</bug_when>
    <thetext>Derk-Jan, sorry voor de vertraging. Als Wikipedia nog andere problemen heeft hoor ik er graag van. Kan niks beloven, maar hopelijk duurt het niet nog een keer acht jaar.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>