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

Side by Side Diff: Source/core/css/DragUpdateTest.cpp

Issue 1126883002: Change all one-off lifecycle callers to FrameView::updateLayoutAndStyleForPainting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/AffectedByFocusTest.cpp ('k') | Source/core/dom/DocumentTest.cpp » ('j') | 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 #include "core/dom/Element.h" 6 #include "core/dom/Element.h"
7 #include "core/dom/StyleEngine.h" 7 #include "core/dom/StyleEngine.h"
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/html/HTMLDocument.h" 9 #include "core/html/HTMLDocument.h"
10 #include "core/html/HTMLElement.h" 10 #include "core/html/HTMLElement.h"
(...skipping 13 matching lines...) Expand all
24 OwnPtr<DummyPageHolder> dummyPageHolder = DummyPageHolder::create(IntSize(80 0, 600)); 24 OwnPtr<DummyPageHolder> dummyPageHolder = DummyPageHolder::create(IntSize(80 0, 600));
25 HTMLDocument& document = toHTMLDocument(dummyPageHolder->document()); 25 HTMLDocument& document = toHTMLDocument(dummyPageHolder->document());
26 document.documentElement()->setInnerHTML("<style>div {width:100px;height:100 px} div:-webkit-drag { background-color: green }</style>" 26 document.documentElement()->setInnerHTML("<style>div {width:100px;height:100 px} div:-webkit-drag { background-color: green }</style>"
27 "<div>" 27 "<div>"
28 "<span></span>" 28 "<span></span>"
29 "<span></span>" 29 "<span></span>"
30 "<span></span>" 30 "<span></span>"
31 "<span></span>" 31 "<span></span>"
32 "</div>", ASSERT_NO_EXCEPTION); 32 "</div>", ASSERT_NO_EXCEPTION);
33 33
34 document.view()->updateLayoutAndStyleIfNeededRecursive(); 34 document.view()->updateLayoutAndStyleForPainting();
35 unsigned startCount = document.styleEngine().resolverAccessCount(); 35 unsigned startCount = document.styleEngine().resolverAccessCount();
36 36
37 document.documentElement()->layoutObject()->updateDragState(true); 37 document.documentElement()->layoutObject()->updateDragState(true);
38 document.view()->updateLayoutAndStyleIfNeededRecursive(); 38 document.view()->updateLayoutAndStyleForPainting();
39 39
40 unsigned accessCount = document.styleEngine().resolverAccessCount() - startC ount; 40 unsigned accessCount = document.styleEngine().resolverAccessCount() - startC ount;
41 41
42 ASSERT_EQ(1U, accessCount); 42 ASSERT_EQ(1U, accessCount);
43 } 43 }
44 44
45 TEST(DragUpdateTest, ChildrenOrSiblingsAffectedByDragUpdate) 45 TEST(DragUpdateTest, ChildrenOrSiblingsAffectedByDragUpdate)
46 { 46 {
47 // Check that when dragging the div in the document below, you get a 47 // Check that when dragging the div in the document below, you get a
48 // full subtree style recalc. 48 // full subtree style recalc.
(...skipping 13 matching lines...) Expand all
62 62
63 document.documentElement()->layoutObject()->updateDragState(true); 63 document.documentElement()->layoutObject()->updateDragState(true);
64 document.updateLayout(); 64 document.updateLayout();
65 65
66 unsigned accessCount = document.styleEngine().resolverAccessCount() - startC ount; 66 unsigned accessCount = document.styleEngine().resolverAccessCount() - startC ount;
67 67
68 ASSERT_EQ(5U, accessCount); 68 ASSERT_EQ(5U, accessCount);
69 } 69 }
70 70
71 } // namespace 71 } // namespace
OLDNEW
« no previous file with comments | « Source/core/css/AffectedByFocusTest.cpp ('k') | Source/core/dom/DocumentTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698