sass-site/source/documentation/Sass/Selector/SimpleSequence.html
2018-10-22 14:13:05 -07:00

2177 lines
100 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Class: Sass::Selector::SimpleSequence
&mdash; Documentation by YARD 0.9.12
</title>
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="../../../assets/css/docs.css" type="text/css" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
hasFrames = window.top.frames.main ? true : false;
relpath = '../../';
framesUrl = "../../frames.html#!Sass/Selector/SimpleSequence.html";
</script>
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
</head>
<body>
<div id="header">
<div id="menu">
<a href="../../_index.html">Index (S)</a> &raquo;
<span class='title'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Selector.html" title="Sass::Selector (module)">Selector</a></span></span>
&raquo;
<span class="title">SimpleSequence</span>
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="../../class_list.html">
Class List
</a>
<a class="full_list_link" id="method_list_link"
href="../../method_list.html">
Method List
</a>
<a class="full_list_link" id="file_list_link"
href="../../file_list.html">
File List
</a>
</div>
<div class="clear"></div>
</div>
<iframe id="search_frame"></iframe>
<div id="content"><h1>Class: Sass::Selector::SimpleSequence
</h1>
<dl class="box">
<dt class="r1">Inherits:</dt>
<dd class="r1">
<span class="inheritName"><span class='object_link'><a href="AbstractSequence.html" title="Sass::Selector::AbstractSequence (class)">AbstractSequence</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="AbstractSequence.html" title="Sass::Selector::AbstractSequence (class)">AbstractSequence</a></span></li>
<li class="next">Sass::Selector::SimpleSequence</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
<dt class="r2 last">Defined in:</dt>
<dd class="r2 last">.ruby-sass/lib/sass/selector/simple_sequence.rb</dd>
</dl>
<div class="clear"></div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>A unseparated sequence of selectors that all apply to a single element. For
example, `.<a href="attr=baz">foo#bar</a>` is a simple sequence of the
selectors `.foo`, `#bar`, and `[attr=baz]`.</p>
</div>
</div>
<div class="tags">
</div>
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#members-instance_method" title="#members (instance method)">#<strong>members</strong> &#x21d2; Array&lt;Simple&gt; </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>The array of individual selectors.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#source_range-instance_method" title="#source_range (instance method)">#<strong>source_range</strong> &#x21d2; Sass::Source::Range </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>This sequence source range.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#sources-instance_method" title="#sources (instance method)">#<strong>sources</strong> &#x21d2; Set&lt;Sequence&gt; </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>The extending selectors that caused this selector sequence to be generated.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#subject=-instance_method" title="#subject= (instance method)">#<strong>subject</strong> &#x21d2; Object </a>
</span>
<span class="note title writeonly">writeonly</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
</ul>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="AbstractSequence.html" title="Sass::Selector::AbstractSequence (class)">AbstractSequence</a></span></h3>
<p class="inherited"><span class='object_link'><a href="AbstractSequence.html#filename-instance_method" title="Sass::Selector::AbstractSequence#filename (method)">#filename</a></span>, <span class='object_link'><a href="AbstractSequence.html#line-instance_method" title="Sass::Selector::AbstractSequence#line (method)">#line</a></span></p>
<h2>
Instance Method Summary
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#base-instance_method" title="#base (instance method)">#<strong>base</strong> &#x21d2; Element, ... </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the element or universal selector in this sequence, if it exists.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#do_extend-instance_method" title="#do_extend (instance method)">#<strong>do_extend</strong>(extends, parent_directives, replace, seen) &#x21d2; Array&lt;Sequence&gt; </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Non-destructively extends this selector with the extensions specified in a
hash (which should come from <span class='object_link'><a href="../Tree/Visitors/Cssize.html" title="Sass::Tree::Visitors::Cssize (class)">Tree::Visitors::Cssize</a></span>).</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(selectors, subject, source_range = nil) &#x21d2; SimpleSequence </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of SimpleSequence.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#inspect-instance_method" title="#inspect (instance method)">#<strong>inspect</strong> &#x21d2; String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns a string representation of the sequence.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#pseudo_elements-instance_method" title="#pseudo_elements (instance method)">#<strong>pseudo_elements</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#resolve_parent_refs-instance_method" title="#resolve_parent_refs (instance method)">#<strong>resolve_parent_refs</strong>(super_cseq) &#x21d2; CommaSequence </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Resolves the <span class='object_link'><a href="Parent.html" title="Sass::Selector::Parent (class)">Parent</a></span> selectors within this selector by replacing them with
the given parent selector, handling commas appropriately.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#rest-instance_method" title="#rest (instance method)">#<strong>rest</strong> &#x21d2; Set&lt;Simple&gt; </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the non-base, non-pseudo-element selectors in this sequence.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#selector_pseudo_classes-instance_method" title="#selector_pseudo_classes (instance method)">#<strong>selector_pseudo_classes</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#subject%3F-instance_method" title="#subject? (instance method)">#<strong>subject?</strong> &#x21d2; Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Whether or not this compound selector is the subject of the parent
selector; that is, whether it is prepended with `$` and represents the
actual element that will be selected.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#superselector%3F-instance_method" title="#superselector? (instance method)">#<strong>superselector?</strong>(their_sseq, parents = []) &#x21d2; Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns whether or not this selector matches all elements that the given
selector matches (as well as possibly more).</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong>(opts = {}) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#unify-instance_method" title="#unify (instance method)">#<strong>unify</strong>(other) &#x21d2; SimpleSequence<sup>?</sup> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Unifies this selector with another <span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></span>, returning another
`SimpleSequence` that is a subselector of both input selectors.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#with_more_sources-instance_method" title="#with_more_sources (instance method)">#<strong>with_more_sources</strong>(sources) &#x21d2; SimpleSequence </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Return a copy of this simple sequence with `sources` merged into the
<span class='object_link'><a href="#sources-instance_method" title="Sass::Selector::SimpleSequence#sources (method)">#sources</a></span> set.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="AbstractSequence.html" title="Sass::Selector::AbstractSequence (class)">AbstractSequence</a></span></h3>
<p class="inherited"><span class='object_link'><a href="AbstractSequence.html#eql%3F-instance_method" title="Sass::Selector::AbstractSequence#eql? (method)">#eql?</a></span>, <span class='object_link'><a href="AbstractSequence.html#hash-instance_method" title="Sass::Selector::AbstractSequence#hash (method)">#hash</a></span>, <span class='object_link'><a href="AbstractSequence.html#invisible%3F-instance_method" title="Sass::Selector::AbstractSequence#invisible? (method)">#invisible?</a></span>, <span class='object_link'><a href="AbstractSequence.html#specificity-instance_method" title="Sass::Selector::AbstractSequence#specificity (method)">#specificity</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<div class="method_details first">
<h3 class="signature first" id="initialize-instance_method">
#<strong>initialize</strong>(selectors, subject, source_range = nil) &#x21d2; <tt><span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of SimpleSequence</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>selectors</span>
<span class='type'>(<tt>Array&lt;<span class='object_link'><a href="Simple.html" title="Sass::Selector::Simple (class)">Simple</a></span>&gt;</tt>)</span>
&mdash;
<div class='inline'>
<p>See <span class='object_link'><a href="#members-instance_method" title="Sass::Selector::SimpleSequence#members (method)">#members</a></span></p>
</div>
</li>
<li>
<span class='name'>subject</span>
<span class='type'>(<tt>Boolean</tt>)</span>
&mdash;
<div class='inline'>
<p>See <span class='object_link'><a href="#subject%3F-instance_method" title="Sass::Selector::SimpleSequence#subject? (method)">#subject?</a></span></p>
</div>
</li>
<li>
<span class='name'>source_range</span>
<span class='type'>(<tt><span class='object_link'><a href="../Source/Range.html" title="Sass::Source::Range (class)">Sass::Source::Range</a></span></tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
74
75
76
77
78
79</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 74</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_selectors'>selectors</span><span class='comma'>,</span> <span class='id identifier rubyid_subject'>subject</span><span class='comma'>,</span> <span class='id identifier rubyid_source_range'>source_range</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='ivar'>@members</span> <span class='op'>=</span> <span class='id identifier rubyid_selectors'>selectors</span>
<span class='ivar'>@subject</span> <span class='op'>=</span> <span class='id identifier rubyid_subject'>subject</span>
<span class='ivar'>@sources</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
<span class='ivar'>@source_range</span> <span class='op'>=</span> <span class='id identifier rubyid_source_range'>source_range</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<div class="method_details first">
<h3 class="signature first" id="initialize-instance_method">
#<strong>initialize</strong>(selectors, subject, source_range = nil) &#x21d2; <tt><span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of SimpleSequence</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>selectors</span>
<span class='type'>(<tt>Array&lt;<span class='object_link'><a href="Simple.html" title="Sass::Selector::Simple (class)">Simple</a></span>&gt;</tt>)</span>
&mdash;
<div class='inline'>
<p>See <span class='object_link'><a href="#members-instance_method" title="Sass::Selector::SimpleSequence#members (method)">#members</a></span></p>
</div>
</li>
<li>
<span class='name'>subject</span>
<span class='type'>(<tt>Boolean</tt>)</span>
&mdash;
<div class='inline'>
<p>See <span class='object_link'><a href="#subject%3F-instance_method" title="Sass::Selector::SimpleSequence#subject? (method)">#subject?</a></span></p>
</div>
</li>
<li>
<span class='name'>source_range</span>
<span class='type'>(<tt><span class='object_link'><a href="../Source/Range.html" title="Sass::Source::Range (class)">Sass::Source::Range</a></span></tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
74
75
76
77
78
79</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 74</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_selectors'>selectors</span><span class='comma'>,</span> <span class='id identifier rubyid_subject'>subject</span><span class='comma'>,</span> <span class='id identifier rubyid_source_range'>source_range</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='ivar'>@members</span> <span class='op'>=</span> <span class='id identifier rubyid_selectors'>selectors</span>
<span class='ivar'>@subject</span> <span class='op'>=</span> <span class='id identifier rubyid_subject'>subject</span>
<span class='ivar'>@sources</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
<span class='ivar'>@source_range</span> <span class='op'>=</span> <span class='id identifier rubyid_source_range'>source_range</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_attr_details" class="attr_details">
<h2>Instance Attribute Details</h2>
<span id="members=-instance_method"></span>
<div class="method_details first">
<h3 class="signature first" id="members-instance_method">
#<strong>members</strong> &#x21d2; <tt>Array&lt;<span class='object_link'><a href="Simple.html" title="Sass::Selector::Simple (class)">Simple</a></span>&gt;</tt>
</h3><div class="docstring">
<div class="discussion">
<p>The array of individual selectors.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Array&lt;<span class='object_link'><a href="Simple.html" title="Sass::Selector::Simple (class)">Simple</a></span>&gt;</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
11
12
13</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 11</span>
<span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='ivar'>@members</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="source_range=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="source_range-instance_method">
#<strong>source_range</strong> &#x21d2; <tt><span class='object_link'><a href="../Source/Range.html" title="Sass::Source::Range (class)">Sass::Source::Range</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>This sequence source range.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../Source/Range.html" title="Sass::Source::Range (class)">Sass::Source::Range</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
32
33
34</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 32</span>
<span class='kw'>def</span> <span class='id identifier rubyid_source_range'>source_range</span>
<span class='ivar'>@source_range</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="sources=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="sources-instance_method">
#<strong>sources</strong> &#x21d2; <tt>Set&lt;<span class='object_link'><a href="Sequence.html" title="Sass::Selector::Sequence (class)">Sequence</a></span>&gt;</tt>
</h3><div class="docstring">
<div class="discussion">
<p>The extending selectors that caused this selector sequence to be generated.
For example:</p>
<pre class="code ruby"><code class="ruby">a.foo { ... }
b.bar {@extend a}
c.baz {@extend b}
</code></pre>
<p>The generated selector `b.foo.bar` has `Sass::Selector::SimpleSequence.bb.bar` as its `sources` set, and
the generated selector `c.foo.bar.baz` has `c.baz` as its
`sources` set.</p>
<p>This is populated during the <span class='object_link'><a href="Sequence.html#do_extend-instance_method" title="Sass::Selector::Sequence#do_extend (method)">Sass::Selector::Sequence#do_extend</a></span> process.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Set&lt;<span class='object_link'><a href="Sequence.html" title="Sass::Selector::Sequence (class)">Sequence</a></span>&gt;</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
27
28
29</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 27</span>
<span class='kw'>def</span> <span class='id identifier rubyid_sources'>sources</span>
<span class='ivar'>@sources</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="subject=-instance_method">
#<strong>subject=</strong>(value) &#x21d2; <tt>Object</tt> <span class="extras">(writeonly)</span>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">See Also:</p>
<ul class="see">
<li>Sass::Selector::SimpleSequence.\{\{#subject?}</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
35
36
37</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 35</span>
<span class='kw'>def</span> <span class='id identifier rubyid_subject='>subject=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
<span class='ivar'>@subject</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="base-instance_method">
#<strong>base</strong> &#x21d2; <tt><span class='object_link'><a href="Element.html" title="Sass::Selector::Element (class)">Element</a></span></tt>, ...
</h3><div class="docstring">
<div class="discussion">
<p>Returns the element or universal selector in this sequence, if it exists.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="Element.html" title="Sass::Selector::Element (class)">Element</a></span></tt>, <tt><span class='object_link'><a href="Universal.html" title="Sass::Selector::Universal (class)">Universal</a></span></tt>, <tt>nil</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
41
42
43</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 41</span>
<span class='kw'>def</span> <span class='id identifier rubyid_base'>base</span>
<span class='ivar'>@base</span> <span class='op'>||=</span> <span class='lparen'>(</span><span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='kw'>if</span> <span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Element.html" title="Sass::Selector::Element (class)">Element</a></span></span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Universal.html" title="Sass::Selector::Universal (class)">Universal</a></span></span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="do_extend-instance_method">
#<strong>do_extend</strong>(extends, parent_directives, replace, seen) &#x21d2; <tt>Array&lt;<span class='object_link'><a href="Sequence.html" title="Sass::Selector::Sequence (class)">Sequence</a></span>&gt;</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Non-destructively extends this selector with the extensions specified in a
hash (which should come from <span class='object_link'><a href="../Tree/Visitors/Cssize.html" title="Sass::Tree::Visitors::Cssize (class)">Tree::Visitors::Cssize</a></span>).</p>
<pre class="code ruby"><code class="ruby"><span class='const'>The</span> <span class='id identifier rubyid_extensions'>extensions</span> <span class='id identifier rubyid_to'>to</span> <span class='id identifier rubyid_perform'>perform</span> <span class='id identifier rubyid_on'>on</span> <span class='id identifier rubyid_this'>this</span> <span class='id identifier rubyid_selector'>selector</span>
</code></pre>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>extends</span>
<span class='type'>(<tt>{<span class='object_link'><a href="Simple.html" title="Sass::Selector::Simple (class)">Selector::Simple</a></span> =&gt;
<span class='object_link'><a href="../Tree/Visitors/Cssize/Extend.html" title="Sass::Tree::Visitors::Cssize::Extend (class)">Sass::Tree::Visitors::Cssize::Extend</a></span>}</tt>)</span>
</li>
<li>
<span class='name'>parent_directives</span>
<span class='type'>(<tt>Array&lt;<span class='object_link'><a href="../Tree/DirectiveNode.html" title="Sass::Tree::DirectiveNode (class)">Sass::Tree::DirectiveNode</a></span>&gt;</tt>)</span>
&mdash;
<div class='inline'>
<p>The directives containing this selector.</p>
</div>
</li>
<li>
<span class='name'>seen</span>
<span class='type'>(<tt>Set&lt;Array&lt;<span class='object_link'><a href="Simple.html" title="Sass::Selector::Simple (class)">Selector::Simple</a></span>&gt;&gt;</tt>)</span>
&mdash;
<div class='inline'>
<p>The set of simple sequences that are currently being replaced.</p>
</div>
</li>
<li>
<span class='name'>original</span>
<span class='type'>(<tt>Boolean</tt>)</span>
&mdash;
<div class='inline'>
<p>Whether this is the original selector being extended, as opposed to the
result of a previous extension that&#39;s being re-extended.</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Array&lt;<span class='object_link'><a href="Sequence.html" title="Sass::Selector::Sequence (class)">Sequence</a></span>&gt;</tt>)</span>
&mdash;
<div class='inline'>
<p>A list of selectors generated by extending this selector with `extends`.</p>
</div>
</li>
</ul>
<p class="tag_title">See Also:</p>
<ul class="see">
<li><span class='object_link'><a href="CommaSequence.html#do_extend-instance_method" title="Sass::Selector::CommaSequence#do_extend (method)">CommaSequence#do_extend</a></span></li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 157</span>
<span class='kw'>def</span> <span class='id identifier rubyid_do_extend'>do_extend</span><span class='lparen'>(</span><span class='id identifier rubyid_extends'>extends</span><span class='comma'>,</span> <span class='id identifier rubyid_parent_directives'>parent_directives</span><span class='comma'>,</span> <span class='id identifier rubyid_replace'>replace</span><span class='comma'>,</span> <span class='id identifier rubyid_seen'>seen</span><span class='rparen'>)</span>
<span class='id identifier rubyid_seen_with_pseudo_selectors'>seen_with_pseudo_selectors</span> <span class='op'>=</span> <span class='id identifier rubyid_seen'>seen</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
<span class='id identifier rubyid_modified_original'>modified_original</span> <span class='op'>=</span> <span class='kw'>false</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_sel'>sel</span><span class='op'>|</span>
<span class='kw'>next</span> <span class='id identifier rubyid_sel'>sel</span> <span class='kw'>unless</span> <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Pseudo.html" title="Sass::Selector::Pseudo (class)">Pseudo</a></span></span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_selector'>selector</span>
<span class='kw'>next</span> <span class='id identifier rubyid_sel'>sel</span> <span class='kw'>if</span> <span class='id identifier rubyid_seen'>seen</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_sel'>sel</span><span class='rbracket'>]</span><span class='rparen'>)</span>
<span class='id identifier rubyid_extended'>extended</span> <span class='op'>=</span> <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_selector'>selector</span><span class='period'>.</span><span class='id identifier rubyid_do_extend'>do_extend</span><span class='lparen'>(</span><span class='id identifier rubyid_extends'>extends</span><span class='comma'>,</span> <span class='id identifier rubyid_parent_directives'>parent_directives</span><span class='comma'>,</span> <span class='id identifier rubyid_replace'>replace</span><span class='comma'>,</span> <span class='id identifier rubyid_seen'>seen</span><span class='comma'>,</span> <span class='kw'>false</span><span class='rparen'>)</span>
<span class='kw'>next</span> <span class='id identifier rubyid_sel'>sel</span> <span class='kw'>if</span> <span class='id identifier rubyid_extended'>extended</span> <span class='op'>==</span> <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_selector'>selector</span>
<span class='id identifier rubyid_extended'>extended</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_reject!'>reject!</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_seq'>seq</span><span class='op'>|</span> <span class='id identifier rubyid_seq'>seq</span><span class='period'>.</span><span class='id identifier rubyid_invisible?'>invisible?</span><span class='rbrace'>}</span>
<span class='comment'># For `:not()`, we usually want to get rid of any complex
</span> <span class='comment'># selectors because that will cause the selector to fail to
</span> <span class='comment'># parse on all browsers at time of writing. We can keep them
</span> <span class='comment'># if either the original selector had a complex selector, or
</span> <span class='comment'># the result of extending has only complex selectors,
</span> <span class='comment'># because either way we aren&#39;t breaking anything that isn&#39;t
</span> <span class='comment'># already broken.
</span> <span class='kw'>if</span> <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_normalized_name'>normalized_name</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>not</span><span class='tstring_end'>&#39;</span></span> <span class='op'>&amp;&amp;</span>
<span class='lparen'>(</span><span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_selector'>selector</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_none?'>none?</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_seq'>seq</span><span class='op'>|</span> <span class='id identifier rubyid_seq'>seq</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>&gt;</span> <span class='int'>1</span><span class='rbrace'>}</span> <span class='op'>&amp;&amp;</span>
<span class='id identifier rubyid_extended'>extended</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_seq'>seq</span><span class='op'>|</span> <span class='id identifier rubyid_seq'>seq</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>1</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_extended'>extended</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_reject!'>reject!</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_seq'>seq</span><span class='op'>|</span> <span class='id identifier rubyid_seq'>seq</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>&gt;</span> <span class='int'>1</span><span class='rbrace'>}</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_modified_original'>modified_original</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_with_selector'>with_selector</span><span class='lparen'>(</span><span class='id identifier rubyid_extended'>extended</span><span class='rparen'>)</span>
<span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_new_sel'>new_sel</span><span class='op'>|</span> <span class='id identifier rubyid_seen_with_pseudo_selectors'>seen_with_pseudo_selectors</span> <span class='op'>&lt;&lt;</span> <span class='lbracket'>[</span><span class='id identifier rubyid_new_sel'>new_sel</span><span class='rbracket'>]</span><span class='rbrace'>}</span>
<span class='id identifier rubyid_result'>result</span>
<span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
<span class='id identifier rubyid_groups'>groups</span> <span class='op'>=</span> <span class='id identifier rubyid_extends'>extends</span><span class='lbracket'>[</span><span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_to_set'>to_set</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_group_by'>group_by</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_ex'>ex</span><span class='op'>|</span> <span class='id identifier rubyid_ex'>ex</span><span class='period'>.</span><span class='id identifier rubyid_extender'>extender</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span>
<span class='id identifier rubyid_groups'>groups</span><span class='period'>.</span><span class='id identifier rubyid_map!'>map!</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_seq'>seq</span><span class='comma'>,</span> <span class='id identifier rubyid_group'>group</span><span class='op'>|</span>
<span class='id identifier rubyid_sels'>sels</span> <span class='op'>=</span> <span class='id identifier rubyid_group'>group</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_target'>target</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
<span class='comment'># If A {@extend B} and C {...},
</span> <span class='comment'># seq is A, sels is B, and self is C
</span>
<span class='id identifier rubyid_self_without_sel'>self_without_sel</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Util.html" title="Sass::Util (module)">Util</a></span></span><span class='period'>.</span><span class='id identifier rubyid_array_minus'><span class='object_link'><a href="../Util.html#array_minus-instance_method" title="Sass::Util#array_minus (method)">array_minus</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_members'>members</span><span class='comma'>,</span> <span class='id identifier rubyid_sels'>sels</span><span class='rparen'>)</span>
<span class='id identifier rubyid_group'>group</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_success'>success</span> <span class='op'>=</span> <span class='kw'>true</span><span class='rbrace'>}</span>
<span class='id identifier rubyid_unified'>unified</span> <span class='op'>=</span> <span class='id identifier rubyid_seq'>seq</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_unify'>unify</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Sass::Selector::SimpleSequence#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_self_without_sel'>self_without_sel</span><span class='comma'>,</span> <span class='id identifier rubyid_subject?'>subject?</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>next</span> <span class='kw'>unless</span> <span class='id identifier rubyid_unified'>unified</span>
<span class='id identifier rubyid_group'>group</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span> <span class='id identifier rubyid_check_directives_match!'>check_directives_match!</span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</span><span class='comma'>,</span> <span class='id identifier rubyid_parent_directives'>parent_directives</span><span class='rparen'>)</span><span class='rbrace'>}</span>
<span class='id identifier rubyid_new_seq'>new_seq</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Sequence.html" title="Sass::Selector::Sequence (class)">Sequence</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Sequence.html#initialize-instance_method" title="Sass::Selector::Sequence#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_seq'>seq</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>...</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>+</span> <span class='lbracket'>[</span><span class='id identifier rubyid_unified'>unified</span><span class='rbracket'>]</span><span class='rparen'>)</span>
<span class='id identifier rubyid_new_seq'>new_seq</span><span class='period'>.</span><span class='id identifier rubyid_add_sources!'>add_sources!</span><span class='lparen'>(</span><span class='id identifier rubyid_sources'>sources</span> <span class='op'>+</span> <span class='lbracket'>[</span><span class='id identifier rubyid_seq'>seq</span><span class='rbracket'>]</span><span class='rparen'>)</span>
<span class='lbracket'>[</span><span class='id identifier rubyid_sels'>sels</span><span class='comma'>,</span> <span class='id identifier rubyid_new_seq'>new_seq</span><span class='rbracket'>]</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_groups'>groups</span><span class='period'>.</span><span class='id identifier rubyid_compact!'>compact!</span>
<span class='id identifier rubyid_groups'>groups</span><span class='period'>.</span><span class='id identifier rubyid_map!'>map!</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_sels'>sels</span><span class='comma'>,</span> <span class='id identifier rubyid_seq'>seq</span><span class='op'>|</span>
<span class='kw'>next</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_seen'>seen</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_sels'>sels</span><span class='rparen'>)</span>
<span class='id identifier rubyid_seq'>seq</span><span class='period'>.</span><span class='id identifier rubyid_do_extend'>do_extend</span><span class='lparen'>(</span>
<span class='id identifier rubyid_extends'>extends</span><span class='comma'>,</span> <span class='id identifier rubyid_parent_directives'>parent_directives</span><span class='comma'>,</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='id identifier rubyid_seen_with_pseudo_selectors'>seen_with_pseudo_selectors</span> <span class='op'>+</span> <span class='lbracket'>[</span><span class='id identifier rubyid_sels'>sels</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='kw'>false</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_groups'>groups</span><span class='period'>.</span><span class='id identifier rubyid_flatten!'>flatten!</span>
<span class='kw'>if</span> <span class='id identifier rubyid_modified_original'>modified_original</span> <span class='op'>||</span> <span class='op'>!</span><span class='id identifier rubyid_replace'>replace</span> <span class='op'>||</span> <span class='id identifier rubyid_groups'>groups</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='comment'># First Law of Extend: the result of extending a selector should
</span> <span class='comment'># (almost) always contain the base selector.
</span> <span class='comment'>#
</span> <span class='comment'># See https://github.com/nex3/sass/issues/324.
</span> <span class='id identifier rubyid_original'>original</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Sequence.html" title="Sass::Selector::Sequence (class)">Sequence</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Sequence.html#initialize-instance_method" title="Sass::Selector::Sequence#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Sass::Selector::SimpleSequence#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_members'>members</span><span class='comma'>,</span> <span class='ivar'>@subject</span><span class='comma'>,</span> <span class='id identifier rubyid_source_range'>source_range</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='rparen'>)</span>
<span class='id identifier rubyid_original'>original</span><span class='period'>.</span><span class='id identifier rubyid_add_sources!'>add_sources!</span> <span class='id identifier rubyid_sources'>sources</span>
<span class='id identifier rubyid_groups'>groups</span><span class='period'>.</span><span class='id identifier rubyid_unshift'>unshift</span> <span class='id identifier rubyid_original'>original</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_groups'>groups</span><span class='period'>.</span><span class='id identifier rubyid_uniq!'>uniq!</span>
<span class='id identifier rubyid_groups'>groups</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="inspect-instance_method">
#<strong>inspect</strong> &#x21d2; <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a string representation of the sequence. This is basically the
selector string.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
302
303
304
305
306</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 302</span>
<span class='kw'>def</span> <span class='id identifier rubyid_inspect'>inspect</span>
<span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_m'>m</span><span class='op'>|</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
<span class='id identifier rubyid_res'>res</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>!</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_subject?'>subject?</span>
<span class='id identifier rubyid_res'>res</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="pseudo_elements-instance_method">
#<strong>pseudo_elements</strong> &#x21d2; <tt>Object</tt>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 45</span>
<span class='kw'>def</span> <span class='id identifier rubyid_pseudo_elements'>pseudo_elements</span>
<span class='ivar'>@pseudo_elements</span> <span class='op'>||=</span> <span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_sel'>sel</span><span class='op'>|</span> <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Pseudo.html" title="Sass::Selector::Pseudo (class)">Pseudo</a></span></span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='symbol'>:element</span><span class='rbrace'>}</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="resolve_parent_refs-instance_method">
#<strong>resolve_parent_refs</strong>(super_cseq) &#x21d2; <tt><span class='object_link'><a href="CommaSequence.html" title="Sass::Selector::CommaSequence (class)">CommaSequence</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Resolves the <span class='object_link'><a href="Parent.html" title="Sass::Selector::Parent (class)">Parent</a></span> selectors within this selector by replacing them with
the given parent selector, handling commas appropriately.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>super_cseq</span>
<span class='type'>(<tt><span class='object_link'><a href="CommaSequence.html" title="Sass::Selector::CommaSequence (class)">CommaSequence</a></span></tt>)</span>
&mdash;
<div class='inline'>
<p>The parent selector</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="CommaSequence.html" title="Sass::Selector::CommaSequence (class)">CommaSequence</a></span></tt>)</span>
&mdash;
<div class='inline'>
<p>This selector, with parent references resolved</p>
</div>
</li>
</ul>
<p class="tag_title">Raises:</p>
<ul class="raise">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../SyntaxError.html" title="Sass::SyntaxError (class)">Sass::SyntaxError</a></span></tt>)</span>
&mdash;
<div class='inline'>
<p>If a parent selector is invalid</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 88</span>
<span class='kw'>def</span> <span class='id identifier rubyid_resolve_parent_refs'>resolve_parent_refs</span><span class='lparen'>(</span><span class='id identifier rubyid_super_cseq'>super_cseq</span><span class='rparen'>)</span>
<span class='id identifier rubyid_resolved_members'>resolved_members</span> <span class='op'>=</span> <span class='ivar'>@members</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_sel'>sel</span><span class='op'>|</span>
<span class='kw'>next</span> <span class='id identifier rubyid_sel'>sel</span> <span class='kw'>unless</span> <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Pseudo.html" title="Sass::Selector::Pseudo (class)">Pseudo</a></span></span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_selector'>selector</span>
<span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_with_selector'>with_selector</span><span class='lparen'>(</span><span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_selector'>selector</span><span class='period'>.</span><span class='id identifier rubyid_resolve_parent_refs'>resolve_parent_refs</span><span class='lparen'>(</span><span class='id identifier rubyid_super_cseq'>super_cseq</span><span class='comma'>,</span> <span class='kw'>false</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
<span class='comment'># Parent selector only appears as the first selector in the sequence
</span> <span class='kw'>unless</span> <span class='lparen'>(</span><span class='id identifier rubyid_parent'>parent</span> <span class='op'>=</span> <span class='id identifier rubyid_resolved_members'>resolved_members</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Parent.html" title="Sass::Selector::Parent (class)">Parent</a></span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="CommaSequence.html" title="Sass::Selector::CommaSequence (class)">CommaSequence</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="CommaSequence.html#initialize-instance_method" title="Sass::Selector::CommaSequence#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="Sequence.html" title="Sass::Selector::Sequence (class)">Sequence</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Sequence.html#initialize-instance_method" title="Sass::Selector::Sequence#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Sass::Selector::SimpleSequence#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_resolved_members'>resolved_members</span><span class='comma'>,</span> <span class='id identifier rubyid_subject?'>subject?</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>return</span> <span class='id identifier rubyid_super_cseq'>super_cseq</span> <span class='kw'>if</span> <span class='ivar'>@members</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>==</span> <span class='int'>1</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_parent'>parent</span><span class='period'>.</span><span class='id identifier rubyid_suffix'>suffix</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='const'><span class='object_link'><a href="CommaSequence.html" title="Sass::Selector::CommaSequence (class)">CommaSequence</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="CommaSequence.html#initialize-instance_method" title="Sass::Selector::CommaSequence#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_super_cseq'>super_cseq</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_super_seq'>super_seq</span><span class='op'>|</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='id identifier rubyid_super_seq'>super_seq</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
<span class='id identifier rubyid_newline'>newline</span> <span class='op'>=</span> <span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span> <span class='kw'>if</span> <span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>unless</span> <span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../SyntaxError.html" title="Sass::SyntaxError (class)">SyntaxError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../SyntaxError.html#initialize-instance_method" title="Sass::SyntaxError#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Invalid parent selector for \&quot;</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='embexpr_end'>}</span><span class='tstring_content'>\&quot;: \&quot;</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span>
<span class='id identifier rubyid_super_seq'>super_seq</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&quot;</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_parent_sub'>parent_sub</span> <span class='op'>=</span> <span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_parent'>parent</span><span class='period'>.</span><span class='id identifier rubyid_suffix'>suffix</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='id identifier rubyid_parent_sub'>parent_sub</span> <span class='op'>=</span> <span class='id identifier rubyid_parent_sub'>parent_sub</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
<span class='id identifier rubyid_parent_sub'>parent_sub</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_parent_sub'>parent_sub</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
<span class='kw'>case</span> <span class='id identifier rubyid_parent_sub'>parent_sub</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span>
<span class='kw'>when</span> <span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Selector.html" title="Sass::Selector (module)">Selector</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Class.html" title="Sass::Selector::Class (class)">Class</a></span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Selector.html" title="Sass::Selector (module)">Selector</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Id.html" title="Sass::Selector::Id (class)">Id</a></span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Selector.html" title="Sass::Selector (module)">Selector</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Placeholder.html" title="Sass::Selector::Placeholder (class)">Placeholder</a></span></span>
<span class='id identifier rubyid_parent_sub'>parent_sub</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_parent_sub'>parent_sub</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_parent_sub'>parent_sub</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span> <span class='op'>+</span> <span class='id identifier rubyid_parent'>parent</span><span class='period'>.</span><span class='id identifier rubyid_suffix'>suffix</span><span class='rparen'>)</span>
<span class='kw'>when</span> <span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Selector.html" title="Sass::Selector (module)">Selector</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Element.html" title="Sass::Selector::Element (class)">Element</a></span></span>
<span class='id identifier rubyid_parent_sub'>parent_sub</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_parent_sub'>parent_sub</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
<span class='id identifier rubyid_parent_sub'>parent_sub</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span> <span class='op'>+</span> <span class='id identifier rubyid_parent'>parent</span><span class='period'>.</span><span class='id identifier rubyid_suffix'>suffix</span><span class='comma'>,</span>
<span class='id identifier rubyid_parent_sub'>parent_sub</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_namespace'>namespace</span><span class='rparen'>)</span>
<span class='kw'>when</span> <span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Selector.html" title="Sass::Selector (module)">Selector</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Pseudo.html" title="Sass::Selector::Pseudo (class)">Pseudo</a></span></span>
<span class='kw'>if</span> <span class='id identifier rubyid_parent_sub'>parent_sub</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_arg'>arg</span> <span class='op'>||</span> <span class='id identifier rubyid_parent_sub'>parent_sub</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_selector'>selector</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../SyntaxError.html" title="Sass::SyntaxError (class)">SyntaxError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../SyntaxError.html#initialize-instance_method" title="Sass::SyntaxError#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Invalid parent selector for \&quot;</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='embexpr_end'>}</span><span class='tstring_content'>\&quot;: \&quot;</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span>
<span class='id identifier rubyid_super_seq'>super_seq</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&quot;</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_parent_sub'>parent_sub</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Selector.html" title="Sass::Selector (module)">Selector</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Pseudo.html" title="Sass::Selector::Pseudo (class)">Pseudo</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Pseudo.html#initialize-instance_method" title="Sass::Selector::Pseudo#initialize (method)">new</a></span></span><span class='lparen'>(</span>
<span class='id identifier rubyid_parent_sub'>parent_sub</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='comma'>,</span>
<span class='id identifier rubyid_parent_sub'>parent_sub</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span> <span class='op'>+</span> <span class='id identifier rubyid_parent'>parent</span><span class='period'>.</span><span class='id identifier rubyid_suffix'>suffix</span><span class='comma'>,</span>
<span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../SyntaxError.html" title="Sass::SyntaxError (class)">SyntaxError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../SyntaxError.html#initialize-instance_method" title="Sass::SyntaxError#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Invalid parent selector for \&quot;</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='embexpr_end'>}</span><span class='tstring_content'>\&quot;: \&quot;</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span>
<span class='id identifier rubyid_super_seq'>super_seq</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&quot;</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='const'><span class='object_link'><a href="Sequence.html" title="Sass::Selector::Sequence (class)">Sequence</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Sequence.html#initialize-instance_method" title="Sass::Selector::Sequence#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_members'>members</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>...</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>+</span>
<span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Sass::Selector::SimpleSequence#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_parent_sub'>parent_sub</span> <span class='op'>+</span> <span class='id identifier rubyid_resolved_members'>resolved_members</span><span class='lbracket'>[</span><span class='int'>1</span><span class='op'>..</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_subject?'>subject?</span><span class='rparen'>)</span><span class='rbracket'>]</span> <span class='op'>+</span>
<span class='lbracket'>[</span><span class='id identifier rubyid_newline'>newline</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='rparen'>)</span>
<span class='kw'>end</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="rest-instance_method">
#<strong>rest</strong> &#x21d2; <tt>Set&lt;<span class='object_link'><a href="Simple.html" title="Sass::Selector::Simple (class)">Simple</a></span>&gt;</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the non-base, non-pseudo-element selectors in this sequence.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Set&lt;<span class='object_link'><a href="Simple.html" title="Sass::Selector::Simple (class)">Simple</a></span>&gt;</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
58
59
60</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 58</span>
<span class='kw'>def</span> <span class='id identifier rubyid_rest'>rest</span>
<span class='ivar'>@rest</span> <span class='op'>||=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_members'>members</span> <span class='op'>-</span> <span class='lbracket'>[</span><span class='id identifier rubyid_base'>base</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='id identifier rubyid_pseudo_elements'>pseudo_elements</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="selector_pseudo_classes-instance_method">
#<strong>selector_pseudo_classes</strong> &#x21d2; <tt>Object</tt>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
49
50
51
52
53</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 49</span>
<span class='kw'>def</span> <span class='id identifier rubyid_selector_pseudo_classes'>selector_pseudo_classes</span>
<span class='ivar'>@selector_pseudo_classes</span> <span class='op'>||=</span> <span class='id identifier rubyid_members'>members</span><span class='period'>.</span>
<span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_sel'>sel</span><span class='op'>|</span> <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Pseudo.html" title="Sass::Selector::Pseudo (class)">Pseudo</a></span></span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='symbol'>:class</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_selector'>selector</span><span class='rbrace'>}</span><span class='period'>.</span>
<span class='id identifier rubyid_group_by'>group_by</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_sel'>sel</span><span class='op'>|</span> <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_normalized_name'>normalized_name</span><span class='rbrace'>}</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="subject?-instance_method">
#<strong>subject?</strong> &#x21d2; <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Whether or not this compound selector is the subject of the parent
selector; that is, whether it is prepended with `$` and represents the
actual element that will be selected.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
67
68
69</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 67</span>
<span class='kw'>def</span> <span class='id identifier rubyid_subject?'>subject?</span>
<span class='ivar'>@subject</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="superselector?-instance_method">
#<strong>superselector?</strong>(their_sseq, parents = []) &#x21d2; <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns whether or not this selector matches all elements that the given
selector matches (as well as possibly more).</p>
</div>
</div>
<div class="tags">
<div class="examples">
<p class="tag_title">Examples:</p>
<pre class="example code"><code>(.foo).superselector?(.foo.bar) #=&gt; true
(.foo).superselector?(.bar) #=&gt; false</code></pre>
</div>
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>their_sseq</span>
<span class='type'>(<tt><span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></span></tt>)</span>
</li>
<li>
<span class='name'>parents</span>
<span class='type'>(<tt>Array&lt;<span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></span>, String&gt;</tt>)</span>
<em class="default">(defaults to: <tt>[]</tt>)</em>
&mdash;
<div class='inline'>
<p>The parent selectors of `their_sseq`, if any.</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 254</span>
<span class='kw'>def</span> <span class='id identifier rubyid_superselector?'>superselector?</span><span class='lparen'>(</span><span class='id identifier rubyid_their_sseq'>their_sseq</span><span class='comma'>,</span> <span class='id identifier rubyid_parents'>parents</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_base'>base</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_base'>base</span><span class='period'>.</span><span class='id identifier rubyid_eql?'>eql?</span><span class='lparen'>(</span><span class='id identifier rubyid_their_sseq'>their_sseq</span><span class='period'>.</span><span class='id identifier rubyid_base'>base</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_pseudo_elements'>pseudo_elements</span><span class='period'>.</span><span class='id identifier rubyid_eql?'>eql?</span><span class='lparen'>(</span><span class='id identifier rubyid_their_sseq'>their_sseq</span><span class='period'>.</span><span class='id identifier rubyid_pseudo_elements'>pseudo_elements</span><span class='rparen'>)</span>
<span class='id identifier rubyid_our_spcs'>our_spcs</span> <span class='op'>=</span> <span class='id identifier rubyid_selector_pseudo_classes'>selector_pseudo_classes</span>
<span class='id identifier rubyid_their_spcs'>their_spcs</span> <span class='op'>=</span> <span class='id identifier rubyid_their_sseq'>their_sseq</span><span class='period'>.</span><span class='id identifier rubyid_selector_pseudo_classes'>selector_pseudo_classes</span>
<span class='comment'># Some psuedo-selectors can be subselectors of non-pseudo selectors.
</span> <span class='comment'># Pull those out here so we can efficiently check against them below.
</span> <span class='id identifier rubyid_their_subselector_pseudos'>their_subselector_pseudos</span> <span class='op'>=</span> <span class='qwords_beg'>%w(</span><span class='tstring_content'>matches</span><span class='words_sep'> </span><span class='tstring_content'>any</span><span class='words_sep'> </span><span class='tstring_content'>nth-child</span><span class='words_sep'> </span><span class='tstring_content'>nth-last-child</span><span class='tstring_end'>)</span></span><span class='period'>.</span>
<span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='op'>|</span> <span class='id identifier rubyid_their_spcs'>their_spcs</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
<span class='comment'># If `self`&#39;s non-pseudo simple selectors aren&#39;t a subset of `their_sseq`&#39;s,
</span> <span class='comment'># it&#39;s definitely not a superselector. This also considers being matched
</span> <span class='comment'># by `:matches` or `:any`.
</span> <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_rest'>rest</span><span class='period'>.</span><span class='id identifier rubyid_all?'>all?</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_our_sel'>our_sel</span><span class='op'>|</span>
<span class='kw'>next</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_our_sel'>our_sel</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Pseudo.html" title="Sass::Selector::Pseudo (class)">Pseudo</a></span></span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_our_sel'>our_sel</span><span class='period'>.</span><span class='id identifier rubyid_selector'>selector</span>
<span class='kw'>next</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_their_sseq'>their_sseq</span><span class='period'>.</span><span class='id identifier rubyid_rest'>rest</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_our_sel'>our_sel</span><span class='rparen'>)</span>
<span class='id identifier rubyid_their_subselector_pseudos'>their_subselector_pseudos</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_their_pseudo'>their_pseudo</span><span class='op'>|</span>
<span class='id identifier rubyid_their_pseudo'>their_pseudo</span><span class='period'>.</span><span class='id identifier rubyid_selector'>selector</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_all?'>all?</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_their_seq'>their_seq</span><span class='op'>|</span>
<span class='kw'>next</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_their_seq'>their_seq</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>1</span>
<span class='id identifier rubyid_their_sseq'>their_sseq</span> <span class='op'>=</span> <span class='id identifier rubyid_their_seq'>their_seq</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
<span class='kw'>next</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_their_sseq'>their_sseq</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_their_sseq'>their_sseq</span><span class='period'>.</span><span class='id identifier rubyid_rest'>rest</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_our_sel'>our_sel</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_our_spcs'>our_spcs</span><span class='period'>.</span><span class='id identifier rubyid_all?'>all?</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid__name'>_name</span><span class='comma'>,</span> <span class='id identifier rubyid_pseudos'>pseudos</span><span class='op'>|</span>
<span class='id identifier rubyid_pseudos'>pseudos</span><span class='period'>.</span><span class='id identifier rubyid_all?'>all?</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_pseudo'>pseudo</span><span class='op'>|</span> <span class='id identifier rubyid_pseudo'>pseudo</span><span class='period'>.</span><span class='id identifier rubyid_superselector?'>superselector?</span><span class='lparen'>(</span><span class='id identifier rubyid_their_sseq'>their_sseq</span><span class='comma'>,</span> <span class='id identifier rubyid_parents'>parents</span><span class='rparen'>)</span><span class='rbrace'>}</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="to_s-instance_method">
#<strong>to_s</strong>(opts = {}) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">See Also:</p>
<ul class="see">
<li><span class='object_link'><a href="Simple.html#to_s-instance_method" title="Sass::Selector::Simple#to_s (method)">Sass::Selector::Simple#to_s</a></span></li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
287
288
289
290
291
292
293
294
295
296</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 287</span>
<span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='ivar'>@members</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_m'>m</span><span class='op'>|</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
<span class='comment'># :not(%foo) may resolve to the empty string, but it should match every
</span> <span class='comment'># selector so we replace it with &quot;*&quot;.
</span> <span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>*</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_res'>res</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='id identifier rubyid_res'>res</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>!</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_subject?'>subject?</span>
<span class='id identifier rubyid_res'>res</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="unify-instance_method">
#<strong>unify</strong>(other) &#x21d2; <tt><span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></span></tt><sup>?</sup>
</h3><div class="docstring">
<div class="discussion">
<p>Unifies this selector with another <span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">Sass::Selector::SimpleSequence</a></span>, returning another
`SimpleSequence` that is a subselector of both input selectors.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>other</span>
<span class='type'>(<tt><span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></span></tt>)</span>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></span></tt>, <tt>nil</tt>)</span>
&mdash;
<div class='inline'>
<p>A <span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">Sass::Selector::SimpleSequence</a></span> matching both `sels` and this selector, or `nil` if this
is impossible (e.g. unifying `#foo` and `#bar`)</p>
</div>
</li>
</ul>
<p class="tag_title">Raises:</p>
<ul class="raise">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../SyntaxError.html" title="Sass::SyntaxError (class)">Sass::SyntaxError</a></span></tt>)</span>
&mdash;
<div class='inline'>
<p>If this selector cannot be unified. This will only ever occur when a
dynamic selector, such as <span class='object_link'><a href="Parent.html" title="Sass::Selector::Parent (class)">Parent</a></span> or Interpolation, is used in
unification. Since these selectors should be resolved by the time extension
and unification happen, this exception will only ever be raised as a result
of programmer error</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
236
237
238
239
240
241
242
243</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 236</span>
<span class='kw'>def</span> <span class='id identifier rubyid_unify'>unify</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
<span class='id identifier rubyid_sseq'>sseq</span> <span class='op'>=</span> <span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_inject'>inject</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_member'>member</span><span class='comma'>,</span> <span class='id identifier rubyid_sel'>sel</span><span class='op'>|</span>
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_member'>member</span>
<span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_unify'>unify</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_sseq'>sseq</span>
<span class='const'><span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Sass::Selector::SimpleSequence#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_sseq'>sseq</span><span class='comma'>,</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_subject?'>subject?</span> <span class='op'>||</span> <span class='id identifier rubyid_subject?'>subject?</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="with_more_sources-instance_method">
#<strong>with_more_sources</strong>(sources) &#x21d2; <tt><span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Return a copy of this simple sequence with `sources` merged into the
<span class='object_link'><a href="#sources-instance_method" title="Sass::Selector::SimpleSequence#sources (method)">#sources</a></span> set.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>sources</span>
<span class='type'>(<tt>Set&lt;<span class='object_link'><a href="Sequence.html" title="Sass::Selector::Sequence (class)">Sequence</a></span>&gt;</tt>)</span>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
313
314
315
316
317
318</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/selector/simple_sequence.rb', line 313</span>
<span class='kw'>def</span> <span class='id identifier rubyid_with_more_sources'>with_more_sources</span><span class='lparen'>(</span><span class='id identifier rubyid_sources'>sources</span><span class='rparen'>)</span>
<span class='id identifier rubyid_sseq'>sseq</span> <span class='op'>=</span> <span class='id identifier rubyid_dup'>dup</span>
<span class='id identifier rubyid_sseq'>sseq</span><span class='period'>.</span><span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='id identifier rubyid_members'>members</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
<span class='id identifier rubyid_sseq'>sseq</span><span class='period'>.</span><span class='id identifier rubyid_sources'>sources</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_sources'>sources</span> <span class='op'>|</span> <span class='id identifier rubyid_sources'>sources</span>
<span class='id identifier rubyid_sseq'>sseq</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Oct 22 13:20:56 2018 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.12 (ruby-2.5.3).
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-535380-14', 'sass-lang.com');
ga('send', 'pageview');
</script>
</body>
</html>