Unreviewed, rolling out r207783.
[WebKit-https.git] / Source / WebCore / css / parser / CSSParserValues.cpp
1 /*
2  * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3  * Copyright (C) 2004, 2005, 2006, 2008, 2014 Apple Inc. All rights reserved.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB.  If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20
21 #include "config.h"
22 #include "CSSParserValues.h"
23
24 #include "CSSCustomPropertyValue.h"
25 #include "CSSParserIdioms.h"
26 #include "CSSPrimitiveValue.h"
27 #include "CSSFunctionValue.h"
28 #include "CSSSelector.h"
29 #include "CSSSelectorList.h"
30 #include "CSSVariableValue.h"
31 #include "SelectorPseudoTypeMap.h"
32
33 #if COMPILER(MSVC)
34 // See https://msdn.microsoft.com/en-us/library/1wea5zwe.aspx
35 #pragma warning(disable: 4701)
36 #endif
37
38 namespace WebCore {
39
40 using namespace WTF;
41
42 void destroy(const CSSParserValue& value)
43 {
44     if (value.unit == CSSParserValue::Function)
45         delete value.function;
46     else if (value.unit == CSSParserValue::ValueList)
47         delete value.valueList;
48     else if (value.unit == CSSParserValue::Variable)
49         delete value.variable;
50 }
51
52 CSSParserValueList::~CSSParserValueList()
53 {
54     for (auto& value : m_values)
55         destroy(value);
56 }
57
58 void CSSParserValueList::addValue(const CSSParserValue& value)
59 {
60     m_values.append(value);
61 }
62
63 void CSSParserValueList::insertValueAt(unsigned i, const CSSParserValue& value)
64 {
65     m_values.insert(i, value);
66 }
67
68 void CSSParserValueList::extend(CSSParserValueList& other)
69 {
70     for (auto& value : other.m_values) {
71         m_values.append(value);
72         value.unit = 0; // We moved the CSSParserValue from the other list; this acts like std::move.
73     }
74 }
75
76 bool CSSParserValueList::containsVariables() const
77 {
78     for (unsigned i = 0; i < size(); i++) {
79         auto* parserValue = &m_values[i];
80         if (parserValue->unit == CSSParserValue::Variable)
81             return true;
82         if (parserValue->unit == CSSParserValue::Function && parserValue->function->args
83             && parserValue->function->args->containsVariables())
84             return true;
85         if (parserValue->unit == CSSParserValue::ValueList && parserValue->valueList->containsVariables())
86             return true;
87     }
88     return false;
89 }
90
91 RefPtr<CSSValue> CSSParserValue::createCSSValue()
92 {
93     RefPtr<CSSValue> parsedValue;
94     if (id)
95         return CSSPrimitiveValue::createIdentifier(id);
96     
97     if (unit == CSSParserValue::Operator)
98         return CSSPrimitiveValue::createParserOperator(iValue);
99     if (unit == CSSParserValue::Function)
100         return CSSFunctionValue::create(function);
101     if (unit == CSSParserValue::Variable)
102         return CSSVariableValue::create(variable);
103     if (unit == CSSParserValue::ValueList)
104         return CSSValueList::createFromParserValueList(*valueList);
105
106     if (unit >= CSSParserValue::Q_EMS)
107         return CSSPrimitiveValue::createAllowingMarginQuirk(fValue, CSSPrimitiveValue::CSS_EMS);
108
109     CSSPrimitiveValue::UnitTypes primitiveUnit = static_cast<CSSPrimitiveValue::UnitTypes>(unit);
110     switch (primitiveUnit) {
111     case CSSPrimitiveValue::CSS_IDENT:
112     case CSSPrimitiveValue::CSS_PROPERTY_ID:
113     case CSSPrimitiveValue::CSS_VALUE_ID:
114         return CSSPrimitiveValue::create(string, CSSPrimitiveValue::CSS_PARSER_IDENTIFIER);
115     case CSSPrimitiveValue::CSS_NUMBER:
116         return CSSPrimitiveValue::create(fValue, isInt ? CSSPrimitiveValue::CSS_PARSER_INTEGER : CSSPrimitiveValue::CSS_NUMBER);
117     case CSSPrimitiveValue::CSS_STRING:
118     case CSSPrimitiveValue::CSS_URI:
119     case CSSPrimitiveValue::CSS_PARSER_HEXCOLOR:
120     case CSSPrimitiveValue::CSS_DIMENSION:
121     case CSSPrimitiveValue::CSS_UNICODE_RANGE:
122     case CSSPrimitiveValue::CSS_PARSER_WHITESPACE:
123         return CSSPrimitiveValue::create(string, primitiveUnit);
124     case CSSPrimitiveValue::CSS_PERCENTAGE:
125     case CSSPrimitiveValue::CSS_EMS:
126     case CSSPrimitiveValue::CSS_QUIRKY_EMS:
127     case CSSPrimitiveValue::CSS_EXS:
128     case CSSPrimitiveValue::CSS_PX:
129     case CSSPrimitiveValue::CSS_CM:
130     case CSSPrimitiveValue::CSS_MM:
131     case CSSPrimitiveValue::CSS_IN:
132     case CSSPrimitiveValue::CSS_PT:
133     case CSSPrimitiveValue::CSS_PC:
134     case CSSPrimitiveValue::CSS_DEG:
135     case CSSPrimitiveValue::CSS_RAD:
136     case CSSPrimitiveValue::CSS_GRAD:
137     case CSSPrimitiveValue::CSS_MS:
138     case CSSPrimitiveValue::CSS_S:
139     case CSSPrimitiveValue::CSS_HZ:
140     case CSSPrimitiveValue::CSS_KHZ:
141     case CSSPrimitiveValue::CSS_VW:
142     case CSSPrimitiveValue::CSS_VH:
143     case CSSPrimitiveValue::CSS_VMIN:
144     case CSSPrimitiveValue::CSS_VMAX:
145     case CSSPrimitiveValue::CSS_TURN:
146     case CSSPrimitiveValue::CSS_REMS:
147     case CSSPrimitiveValue::CSS_CHS:
148     case CSSPrimitiveValue::CSS_FR:
149         return CSSPrimitiveValue::create(fValue, primitiveUnit);
150     case CSSPrimitiveValue::CSS_UNKNOWN:
151     case CSSPrimitiveValue::CSS_ATTR:
152     case CSSPrimitiveValue::CSS_COUNTER:
153     case CSSPrimitiveValue::CSS_RECT:
154     case CSSPrimitiveValue::CSS_RGBCOLOR:
155     case CSSPrimitiveValue::CSS_DPPX:
156     case CSSPrimitiveValue::CSS_DPI:
157     case CSSPrimitiveValue::CSS_DPCM:
158     case CSSPrimitiveValue::CSS_PAIR:
159 #if ENABLE(DASHBOARD_SUPPORT)
160     case CSSPrimitiveValue::CSS_DASHBOARD_REGION:
161 #endif
162     case CSSPrimitiveValue::CSS_PARSER_OPERATOR:
163     case CSSPrimitiveValue::CSS_PARSER_INTEGER:
164     case CSSPrimitiveValue::CSS_PARSER_IDENTIFIER:
165     case CSSPrimitiveValue::CSS_COUNTER_NAME:
166     case CSSPrimitiveValue::CSS_SHAPE:
167     case CSSPrimitiveValue::CSS_FONT_FAMILY:
168     case CSSPrimitiveValue::CSS_QUAD:
169 #if ENABLE(CSS_SCROLL_SNAP)
170     case CSSPrimitiveValue::CSS_LENGTH_REPEAT:
171 #endif
172     case CSSPrimitiveValue::CSS_CALC:
173     case CSSPrimitiveValue::CSS_CALC_PERCENTAGE_WITH_NUMBER:
174     case CSSPrimitiveValue::CSS_CALC_PERCENTAGE_WITH_LENGTH:
175         return nullptr;
176     }
177
178     ASSERT_NOT_REACHED();
179     return nullptr;
180 }
181
182 CSSParserSelector* CSSParserSelector::parsePagePseudoSelector(const CSSParserString& pseudoTypeString)
183 {
184     CSSSelector::PagePseudoClassType pseudoType;
185     if (equalLettersIgnoringASCIICase(pseudoTypeString, "first"))
186         pseudoType = CSSSelector::PagePseudoClassFirst;
187     else if (equalLettersIgnoringASCIICase(pseudoTypeString, "left"))
188         pseudoType = CSSSelector::PagePseudoClassLeft;
189     else if (equalLettersIgnoringASCIICase(pseudoTypeString, "right"))
190         pseudoType = CSSSelector::PagePseudoClassRight;
191     else
192         return nullptr;
193
194     auto selector = std::make_unique<CSSParserSelector>();
195     selector->m_selector->setMatch(CSSSelector::PagePseudoClass);
196     selector->m_selector->setPagePseudoType(pseudoType);
197     return selector.release();
198 }
199
200 CSSParserSelector* CSSParserSelector::parsePagePseudoSelector(const AtomicString& pseudoTypeString)
201 {
202     CSSSelector::PagePseudoClassType pseudoType;
203     if (equalLettersIgnoringASCIICase(pseudoTypeString, "first"))
204         pseudoType = CSSSelector::PagePseudoClassFirst;
205     else if (equalLettersIgnoringASCIICase(pseudoTypeString, "left"))
206         pseudoType = CSSSelector::PagePseudoClassLeft;
207     else if (equalLettersIgnoringASCIICase(pseudoTypeString, "right"))
208         pseudoType = CSSSelector::PagePseudoClassRight;
209     else
210         return nullptr;
211     
212     auto selector = std::make_unique<CSSParserSelector>();
213     selector->m_selector->setMatch(CSSSelector::PagePseudoClass);
214     selector->m_selector->setPagePseudoType(pseudoType);
215     return selector.release();
216 }
217
218 CSSParserSelector* CSSParserSelector::parsePseudoElementSelector(CSSParserString& pseudoTypeString)
219 {
220     pseudoTypeString.convertToASCIILowercaseInPlace();
221     AtomicString name = pseudoTypeString;
222
223     CSSSelector::PseudoElementType pseudoType = CSSSelector::parsePseudoElementType(name);
224     if (pseudoType == CSSSelector::PseudoElementUnknown)
225         return nullptr;
226
227     auto selector = std::make_unique<CSSParserSelector>();
228     selector->m_selector->setMatch(CSSSelector::PseudoElement);
229     selector->m_selector->setPseudoElementType(pseudoType);
230     if (pseudoType == CSSSelector::PseudoElementWebKitCustomLegacyPrefixed) {
231         ASSERT_WITH_MESSAGE(name == "-webkit-input-placeholder", "-webkit-input-placeholder is the only LegacyPrefix pseudo type.");
232         if (name == "-webkit-input-placeholder")
233             name = AtomicString("placeholder", AtomicString::ConstructFromLiteral);
234     }
235     selector->m_selector->setValue(name);
236     return selector.release();
237 }
238
239 CSSParserSelector* CSSParserSelector::parsePseudoElementSelectorFromStringView(StringView& pseudoTypeString)
240 {
241     convertToASCIILowercaseInPlace(pseudoTypeString);
242     AtomicString name = pseudoTypeString.toAtomicString();
243     
244     CSSSelector::PseudoElementType pseudoType = CSSSelector::parsePseudoElementType(name);
245     if (pseudoType == CSSSelector::PseudoElementUnknown)
246         return nullptr;
247     
248     auto selector = std::make_unique<CSSParserSelector>();
249     selector->m_selector->setMatch(CSSSelector::PseudoElement);
250     selector->m_selector->setPseudoElementType(pseudoType);
251     if (pseudoType == CSSSelector::PseudoElementWebKitCustomLegacyPrefixed) {
252         ASSERT_WITH_MESSAGE(name == "-webkit-input-placeholder", "-webkit-input-placeholder is the only LegacyPrefix pseudo type.");
253         if (name == "-webkit-input-placeholder")
254             name = AtomicString("placeholder", AtomicString::ConstructFromLiteral);
255     }
256     selector->m_selector->setValue(name);
257     return selector.release();
258 }
259
260 #if ENABLE(VIDEO_TRACK)
261 CSSParserSelector* CSSParserSelector::parsePseudoElementCueFunctionSelector(const CSSParserString& functionIdentifier, Vector<std::unique_ptr<CSSParserSelector>>* parsedSelectorVector)
262 {
263     ASSERT_UNUSED(functionIdentifier, String(functionIdentifier) == "cue(");
264
265     std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>> selectorVector(parsedSelectorVector);
266
267     if (!selectorVector)
268         return nullptr;
269
270     auto selector = std::make_unique<CSSParserSelector>();
271     selector->m_selector->setMatch(CSSSelector::PseudoElement);
272     selector->m_selector->setPseudoElementType(CSSSelector::PseudoElementCue);
273     selector->adoptSelectorVector(*selectorVector);
274     return selector.release();
275 }
276 #endif
277
278 CSSParserSelector* CSSParserSelector::parsePseudoElementSlottedFunctionSelector(const CSSParserString& functionIdentifier, CSSParserSelector* parsedSelector)
279 {
280     ASSERT_UNUSED(functionIdentifier, String(functionIdentifier) == "slotted(");
281
282     if (!parsedSelector)
283         return nullptr;
284
285     std::unique_ptr<CSSParserSelector> ownedParsedSelector(parsedSelector);
286
287     for (auto* component = parsedSelector; component; component = component->tagHistory()) {
288         if (component->matchesPseudoElement())
289             return nullptr;
290     }
291
292     auto selectorVector = std::make_unique<Vector<std::unique_ptr<CSSParserSelector>>>();
293     selectorVector->append(WTFMove(ownedParsedSelector));
294
295     auto selector = std::make_unique<CSSParserSelector>();
296     selector->m_selector->setMatch(CSSSelector::PseudoElement);
297     selector->m_selector->setPseudoElementType(CSSSelector::PseudoElementSlotted);
298     selector->adoptSelectorVector(*selectorVector);
299     return selector.release();
300 }
301
302 CSSParserSelector* CSSParserSelector::parsePseudoClassHostFunctionSelector(const CSSParserString& functionIdentifier, CSSParserSelector* parsedSelector)
303 {
304     ASSERT_UNUSED(functionIdentifier, String(functionIdentifier) == "host(");
305
306     if (!parsedSelector)
307         return nullptr;
308
309     std::unique_ptr<CSSParserSelector> ownedParsedSelector(parsedSelector);
310
311     for (auto* component = parsedSelector; component; component = component->tagHistory()) {
312         if (component->matchesPseudoElement())
313             return nullptr;
314     }
315
316     auto selectorVector = std::make_unique<Vector<std::unique_ptr<CSSParserSelector>>>();
317     selectorVector->append(WTFMove(ownedParsedSelector));
318
319     auto selector = std::make_unique<CSSParserSelector>();
320     selector->m_selector->setMatch(CSSSelector::PseudoClass);
321     selector->m_selector->setPseudoClassType(CSSSelector::PseudoClassHost);
322     selector->adoptSelectorVector(*selectorVector);
323     return selector.release();
324 }
325
326 CSSParserSelector* CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector(CSSParserString& pseudoTypeString)
327 {
328     if (pseudoTypeString.length() && pseudoTypeString[pseudoTypeString.length() - 1] == '(')
329         return nullptr;
330
331     PseudoClassOrCompatibilityPseudoElement pseudoType = parsePseudoClassAndCompatibilityElementString(pseudoTypeString);
332     if (pseudoType.pseudoClass != CSSSelector::PseudoClassUnknown) {
333         auto selector = std::make_unique<CSSParserSelector>();
334         selector->m_selector->setMatch(CSSSelector::PseudoClass);
335         selector->m_selector->setPseudoClassType(pseudoType.pseudoClass);
336         return selector.release();
337     }
338     if (pseudoType.compatibilityPseudoElement != CSSSelector::PseudoElementUnknown) {
339         auto selector = std::make_unique<CSSParserSelector>();
340         selector->m_selector->setMatch(CSSSelector::PseudoElement);
341         selector->m_selector->setPseudoElementType(pseudoType.compatibilityPseudoElement);
342         AtomicString name = pseudoTypeString;
343         selector->m_selector->setValue(name);
344         return selector.release();
345     }
346     return nullptr;
347 }
348
349 CSSParserSelector* CSSParserSelector::parsePseudoClassSelectorFromStringView(StringView& pseudoTypeString)
350 {
351     if (pseudoTypeString.length() && pseudoTypeString[pseudoTypeString.length() - 1] == '(')
352         return nullptr;
353     
354     PseudoClassOrCompatibilityPseudoElement pseudoType = parsePseudoClassAndCompatibilityElementString(pseudoTypeString);
355     if (pseudoType.pseudoClass != CSSSelector::PseudoClassUnknown) {
356         auto selector = std::make_unique<CSSParserSelector>();
357         selector->m_selector->setMatch(CSSSelector::PseudoClass);
358         selector->m_selector->setPseudoClassType(pseudoType.pseudoClass);
359         return selector.release();
360     }
361     if (pseudoType.compatibilityPseudoElement != CSSSelector::PseudoElementUnknown) {
362         auto selector = std::make_unique<CSSParserSelector>();
363         selector->m_selector->setMatch(CSSSelector::PseudoElement);
364         selector->m_selector->setPseudoElementType(pseudoType.compatibilityPseudoElement);
365         AtomicString name = pseudoTypeString.toAtomicString();
366         selector->m_selector->setValue(name);
367         return selector.release();
368     }
369     return nullptr;
370 }
371
372 CSSParserSelector::CSSParserSelector()
373     : m_selector(std::make_unique<CSSSelector>())
374 {
375 }
376
377 CSSParserSelector::CSSParserSelector(const QualifiedName& tagQName)
378     : m_selector(std::make_unique<CSSSelector>(tagQName))
379 {
380 }
381
382 CSSParserSelector::~CSSParserSelector()
383 {
384     if (!m_tagHistory)
385         return;
386     Vector<std::unique_ptr<CSSParserSelector>, 16> toDelete;
387     std::unique_ptr<CSSParserSelector> selector = WTFMove(m_tagHistory);
388     while (true) {
389         std::unique_ptr<CSSParserSelector> next = WTFMove(selector->m_tagHistory);
390         toDelete.append(WTFMove(selector));
391         if (!next)
392             break;
393         selector = WTFMove(next);
394     }
395 }
396
397 void CSSParserSelector::adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector)
398 {
399     auto selectorList = std::make_unique<CSSSelectorList>();
400     selectorList->adoptSelectorVector(selectorVector);
401     m_selector->setSelectorList(WTFMove(selectorList));
402 }
403
404 void CSSParserSelector::setLangArgumentList(const Vector<CSSParserString>& stringVector)
405 {
406     ASSERT_WITH_MESSAGE(!stringVector.isEmpty(), "No CSS Selector takes an empty argument list.");
407     auto argumentList = std::make_unique<Vector<AtomicString>>();
408     argumentList->reserveInitialCapacity(stringVector.size());
409     for (const AtomicString& languageArgument : stringVector)
410         argumentList->append(languageArgument);
411     m_selector->setLangArgumentList(WTFMove(argumentList));
412 }
413     
414 void CSSParserSelector::setSelectorList(std::unique_ptr<CSSSelectorList> selectorList)
415 {
416     m_selector->setSelectorList(WTFMove(selectorList));
417 }
418     
419 void CSSParserSelector::setPseudoClassValue(const CSSParserString& pseudoClassString)
420 {
421     ASSERT(m_selector->match() == CSSSelector::PseudoClass);
422
423     PseudoClassOrCompatibilityPseudoElement pseudoType = parsePseudoClassAndCompatibilityElementString(pseudoClassString);
424     m_selector->setPseudoClassType(pseudoType.pseudoClass);
425 }
426
427 static bool selectorListMatchesPseudoElement(const CSSSelectorList* selectorList)
428 {
429     if (!selectorList)
430         return false;
431
432     for (const CSSSelector* subSelector = selectorList->first(); subSelector; subSelector = CSSSelectorList::next(subSelector)) {
433         for (const CSSSelector* selector = subSelector; selector; selector = selector->tagHistory()) {
434             if (selector->matchesPseudoElement())
435                 return true;
436             if (const CSSSelectorList* subselectorList = selector->selectorList()) {
437                 if (selectorListMatchesPseudoElement(subselectorList))
438                     return true;
439             }
440         }
441     }
442     return false;
443 }
444
445 bool CSSParserSelector::matchesPseudoElement() const
446 {
447     return m_selector->matchesPseudoElement() || selectorListMatchesPseudoElement(m_selector->selectorList());
448 }
449
450 void CSSParserSelector::insertTagHistory(CSSSelector::RelationType before, std::unique_ptr<CSSParserSelector> selector, CSSSelector::RelationType after)
451 {
452     if (m_tagHistory)
453         selector->setTagHistory(WTFMove(m_tagHistory));
454     setRelation(before);
455     selector->setRelation(after);
456     m_tagHistory = WTFMove(selector);
457 }
458
459 void CSSParserSelector::appendTagHistory(CSSSelector::RelationType relation, std::unique_ptr<CSSParserSelector> selector)
460 {
461     CSSParserSelector* end = this;
462     while (end->tagHistory())
463         end = end->tagHistory();
464
465     end->setRelation(relation);
466     end->setTagHistory(WTFMove(selector));
467 }
468
469 void CSSParserSelector::appendTagHistory(CSSParserSelectorCombinator relation, std::unique_ptr<CSSParserSelector> selector)
470 {
471     CSSParserSelector* end = this;
472     while (end->tagHistory())
473         end = end->tagHistory();
474
475     CSSSelector::RelationType selectorRelation;
476     switch (relation) {
477     case CSSParserSelectorCombinator::Child:
478         selectorRelation = CSSSelector::Child;
479         break;
480     case CSSParserSelectorCombinator::DescendantSpace:
481         selectorRelation = CSSSelector::Descendant;
482         break;
483 #if ENABLE(CSS_SELECTORS_LEVEL4)
484     case CSSParserSelectorCombinator::DescendantDoubleChild:
485         selectorRelation = CSSSelector::Descendant;
486         break;
487 #endif
488     case CSSParserSelectorCombinator::DirectAdjacent:
489         selectorRelation = CSSSelector::DirectAdjacent;
490         break;
491     case CSSParserSelectorCombinator::IndirectAdjacent:
492         selectorRelation = CSSSelector::IndirectAdjacent;
493         break;
494     case CSSParserSelectorCombinator::ShadowDeep:
495         selectorRelation = CSSSelector::ShadowDeep;
496         break;
497     case CSSParserSelectorCombinator::ShadowPseudo:
498         selectorRelation = CSSSelector::ShadowPseudo;
499         break;
500     case CSSParserSelectorCombinator::ShadowSlot:
501         selectorRelation = CSSSelector::ShadowSlot;
502         break;
503     }
504     end->setRelation(selectorRelation);
505
506 #if ENABLE(CSS_SELECTORS_LEVEL4)
507     if (relation == CSSParserSelectorCombinator::DescendantDoubleChild)
508         end->setDescendantUseDoubleChildSyntax();
509 #endif
510
511     end->setTagHistory(WTFMove(selector));
512 }
513
514 void CSSParserSelector::prependTagSelector(const QualifiedName& tagQName, bool tagIsForNamespaceRule)
515 {
516     auto second = std::make_unique<CSSParserSelector>();
517     second->m_selector = WTFMove(m_selector);
518     second->m_tagHistory = WTFMove(m_tagHistory);
519     m_tagHistory = WTFMove(second);
520
521     m_selector = std::make_unique<CSSSelector>(tagQName, tagIsForNamespaceRule);
522     m_selector->setRelation(CSSSelector::Subselector);
523 }
524
525 std::unique_ptr<CSSParserSelector> CSSParserSelector::releaseTagHistory()
526 {
527     setRelation(CSSSelector::Subselector);
528     return WTFMove(m_tagHistory);
529 }
530
531 // FIXME-NEWPARSER: Add support for :host-context
532 bool CSSParserSelector::isHostPseudoSelector() const
533 {
534     return match() == CSSSelector::PseudoClass && pseudoClassType() == CSSSelector::PseudoClassHost;
535 }
536
537 }
538