OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/HTMLNames.h" | 6 #include "core/HTMLNames.h" |
7 #include "core/dom/Element.h" | 7 #include "core/dom/Element.h" |
8 #include "core/dom/ElementTraversal.h" | 8 #include "core/dom/ElementTraversal.h" |
9 #include "core/dom/NodeRenderStyle.h" | 9 #include "core/dom/NodeRenderStyle.h" |
10 #include "core/dom/StyleEngine.h" | 10 #include "core/dom/StyleEngine.h" |
11 #include "core/frame/FrameView.h" | 11 #include "core/frame/FrameView.h" |
12 #include "core/html/HTMLDocument.h" | 12 #include "core/html/HTMLDocument.h" |
13 #include "core/html/HTMLElement.h" | 13 #include "core/html/HTMLElement.h" |
14 #include "core/testing/DummyPageHolder.h" | 14 #include "core/testing/DummyPageHolder.h" |
15 #include <gtest/gtest.h> | 15 #include <gtest/gtest.h> |
16 | 16 |
17 using namespace blink; | 17 using namespace blink; |
18 using namespace HTMLNames; | 18 using namespace HTMLNames; |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 class AffectedByFocusTest : public ::testing::Test { | 22 class AffectedByFocusTest : public ::testing::Test { |
23 | 23 |
24 protected: | 24 protected: |
25 | 25 |
26 struct ElementResult { | 26 struct ElementResult { |
27 const blink::QualifiedName tag; | 27 const blink::HTMLQualifiedName tag; |
28 bool affectedBy; | 28 bool affectedBy; |
29 bool childrenOrSiblingsAffectedBy; | 29 bool childrenOrSiblingsAffectedBy; |
30 }; | 30 }; |
31 | 31 |
32 virtual void SetUp() OVERRIDE; | 32 virtual void SetUp() OVERRIDE; |
33 | 33 |
34 HTMLDocument& document() const { return *m_document; } | 34 HTMLDocument& document() const { return *m_document; } |
35 | 35 |
36 void setHtmlInnerHTML(const char* htmlContent); | 36 void setHtmlInnerHTML(const char* htmlContent); |
37 | 37 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 | 308 |
309 document().getElementById("d")->focus(); | 309 document().getElementById("d")->focus(); |
310 document().view()->updateLayoutAndStyleIfNeededRecursive(); | 310 document().view()->updateLayoutAndStyleIfNeededRecursive(); |
311 | 311 |
312 unsigned accessCount = document().styleEngine()->resolverAccessCount() - sta
rtCount; | 312 unsigned accessCount = document().styleEngine()->resolverAccessCount() - sta
rtCount; |
313 | 313 |
314 ASSERT_EQ(1U, accessCount); | 314 ASSERT_EQ(1U, accessCount); |
315 } | 315 } |
316 | 316 |
317 } // namespace | 317 } // namespace |
OLD | NEW |