| Index: Source/core/css/SelectorChecker.cpp
|
| diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp
|
| index de27731db16336a195d864545acbed8ed457fa16..93df85b4e9c245d58229a8b0be98af02b2e93082 100644
|
| --- a/Source/core/css/SelectorChecker.cpp
|
| +++ b/Source/core/css/SelectorChecker.cpp
|
| @@ -407,14 +407,22 @@ SelectorChecker::Match SelectorChecker::matchForShadowDistributed(const Element*
|
| return SelectorFailsLocally;
|
| }
|
|
|
| -static inline bool containsHTMLSpace(const AtomicString& string)
|
| +template<typename CharType>
|
| +static inline bool containsHTMLSpaceTemplate(const CharType* string, unsigned length)
|
| {
|
| - for (unsigned i = 0; i < string.length(); i++)
|
| - if (isHTMLSpace<UChar>(string[i]))
|
| + for (unsigned i = 0; i < length; ++i)
|
| + if (isHTMLSpace<CharType>(string[i]))
|
| return true;
|
| return false;
|
| }
|
|
|
| +static inline bool containsHTMLSpace(const AtomicString& string)
|
| +{
|
| + if (LIKELY(string.is8Bit()))
|
| + return containsHTMLSpaceTemplate<LChar>(string.characters8(), string.length());
|
| + return containsHTMLSpaceTemplate<UChar>(string.characters16(), string.length());
|
| +}
|
| +
|
| static bool attributeValueMatches(const Attribute& attributeItem, CSSSelector::Match match, const AtomicString& selectorValue, bool caseSensitive)
|
| {
|
| const AtomicString& value = attributeItem.value();
|
|
|