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 | 6 |
7 #include "public/web/WebDocument.h" | 7 #include "public/web/WebDocument.h" |
8 | 8 |
9 #include "core/CSSPropertyNames.h" | 9 #include "core/CSSPropertyNames.h" |
10 #include "core/dom/NodeLayoutStyle.h" | 10 #include "core/dom/NodeLayoutStyle.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 { | 28 { |
29 WebViewHelper webViewHelper; | 29 WebViewHelper webViewHelper; |
30 webViewHelper.initializeAndLoad("about:blank"); | 30 webViewHelper.initializeAndLoad("about:blank"); |
31 | 31 |
32 WebDocument webDoc = webViewHelper.webView()->mainFrame()->document(); | 32 WebDocument webDoc = webViewHelper.webView()->mainFrame()->document(); |
33 Document* coreDoc = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFr
ame())->document(); | 33 Document* coreDoc = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFr
ame())->document(); |
34 | 34 |
35 webDoc.insertStyleSheet("body { color: green }"); | 35 webDoc.insertStyleSheet("body { color: green }"); |
36 | 36 |
37 // Check insertStyleSheet did not cause a synchronous style recalc. | 37 // Check insertStyleSheet did not cause a synchronous style recalc. |
38 unsigned accessCount = coreDoc->styleEngine()->resolverAccessCount(); | 38 unsigned accessCount = coreDoc->styleEngine().resolverAccessCount(); |
39 ASSERT_EQ(0U, accessCount); | 39 ASSERT_EQ(0U, accessCount); |
40 | 40 |
41 HTMLElement* bodyElement = coreDoc->body(); | 41 HTMLElement* bodyElement = coreDoc->body(); |
42 ASSERT(bodyElement); | 42 ASSERT(bodyElement); |
43 | 43 |
44 LayoutStyle* style = bodyElement->layoutStyle(); | 44 LayoutStyle* style = bodyElement->layoutStyle(); |
45 ASSERT(style); | 45 ASSERT(style); |
46 | 46 |
47 // Inserted stylesheet not yet applied. | 47 // Inserted stylesheet not yet applied. |
48 ASSERT_EQ(Color(0, 0, 0), style->visitedDependentColor(CSSPropertyColor)); | 48 ASSERT_EQ(Color(0, 0, 0), style->visitedDependentColor(CSSPropertyColor)); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 ASSERT_FALSE(coreDoc->isTransitionDocument()); | 200 ASSERT_FALSE(coreDoc->isTransitionDocument()); |
201 | 201 |
202 frame->document().setIsTransitionDocument(true); | 202 frame->document().setIsTransitionDocument(true); |
203 ASSERT_TRUE(coreDoc->isTransitionDocument()); | 203 ASSERT_TRUE(coreDoc->isTransitionDocument()); |
204 | 204 |
205 frame->document().setIsTransitionDocument(false); | 205 frame->document().setIsTransitionDocument(false); |
206 ASSERT_FALSE(coreDoc->isTransitionDocument()); | 206 ASSERT_FALSE(coreDoc->isTransitionDocument()); |
207 } | 207 } |
208 | 208 |
209 } | 209 } |
OLD | NEW |