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

Side by Side Diff: Source/web/tests/WebDocumentTest.cpp

Issue 975933002: Return reference from styleEngine() accessor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 | « Source/web/WebDocument.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
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
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
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 }
OLDNEW
« no previous file with comments | « Source/web/WebDocument.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698