Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: third_party/WebKit/Source/core/dom/SelectorQueryTest.cpp

Issue 1602833002: No pseudo elements in SelectorChecker::Mode QueryingRules. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-pseudoelm-check-2-20160118
Patch Set: Another review issue Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/SelectorQuery.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/dom/SelectorQuery.h"
6
7 #include "core/css/parser/CSSParser.h"
8 #include "core/dom/Document.h"
9 #include "core/html/HTMLHtmlElement.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11
12 namespace blink {
13
14 TEST(SelectorQueryTest, NotMatchingPseudoElement)
15 {
16 RefPtrWillBeRawPtr<Document> document = Document::create();
17 RefPtrWillBeRawPtr<HTMLHtmlElement> html = HTMLHtmlElement::create(*document );
18 document->appendChild(html.release());
19 document->documentElement()->setInnerHTML("<body><style>span::before { conte nt: 'X' }</style><span></span></body>", ASSERT_NO_EXCEPTION);
20
21 CSSSelectorList selectorList = CSSParser::parseSelector(CSSParserContext(*do cument, nullptr), nullptr, "span::before");
22 OwnPtr<SelectorQuery> query = SelectorQuery::adopt(std::move(selectorList));
23 RefPtrWillBeRawPtr<Element> elm = query->queryFirst(*document);
24 EXPECT_EQ(nullptr, elm);
25
26 selectorList = CSSParser::parseSelector(CSSParserContext(*document, nullptr) , nullptr, "span");
27 query = SelectorQuery::adopt(std::move(selectorList));
28 elm = query->queryFirst(*document);
29 EXPECT_NE(nullptr, elm);
30 }
31
32 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/SelectorQuery.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698