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

Side by Side Diff: Source/core/html/HTMLFrameOwnerElement.cpp

Issue 641733004: Merge FrameView and ScrollView. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaseline. Created 6 years, 2 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/frame/FrameView.cpp ('k') | Source/core/page/AutoscrollController.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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 ++s_updateSuspendCount; 57 ++s_updateSuspendCount;
58 } 58 }
59 59
60 void HTMLFrameOwnerElement::UpdateSuspendScope::performDeferredWidgetTreeOperati ons() 60 void HTMLFrameOwnerElement::UpdateSuspendScope::performDeferredWidgetTreeOperati ons()
61 { 61 {
62 WidgetToParentMap map; 62 WidgetToParentMap map;
63 widgetNewParentMap().swap(map); 63 widgetNewParentMap().swap(map);
64 WidgetToParentMap::iterator end = map.end(); 64 WidgetToParentMap::iterator end = map.end();
65 for (WidgetToParentMap::iterator it = map.begin(); it != end; ++it) { 65 for (WidgetToParentMap::iterator it = map.begin(); it != end; ++it) {
66 Widget* child = it->key.get(); 66 Widget* child = it->key.get();
67 ScrollView* currentParent = toScrollView(child->parent()); 67 FrameView* currentParent = toFrameView(child->parent());
68 FrameView* newParent = it->value; 68 FrameView* newParent = it->value;
69 if (newParent != currentParent) { 69 if (newParent != currentParent) {
70 if (currentParent) 70 if (currentParent)
71 currentParent->removeChild(child); 71 currentParent->removeChild(child);
72 if (newParent) 72 if (newParent)
73 newParent->addChild(child); 73 newParent->addChild(child);
74 } 74 }
75 } 75 }
76 } 76 }
77 77
78 HTMLFrameOwnerElement::UpdateSuspendScope::~UpdateSuspendScope() 78 HTMLFrameOwnerElement::UpdateSuspendScope::~UpdateSuspendScope()
79 { 79 {
80 ASSERT(s_updateSuspendCount > 0); 80 ASSERT(s_updateSuspendCount > 0);
81 if (s_updateSuspendCount == 1) 81 if (s_updateSuspendCount == 1)
82 performDeferredWidgetTreeOperations(); 82 performDeferredWidgetTreeOperations();
83 --s_updateSuspendCount; 83 --s_updateSuspendCount;
84 } 84 }
85 85
86 static void moveWidgetToParentSoon(Widget* child, FrameView* parent) 86 static void moveWidgetToParentSoon(Widget* child, FrameView* parent)
87 { 87 {
88 if (!s_updateSuspendCount) { 88 if (!s_updateSuspendCount) {
89 if (parent) 89 if (parent)
90 parent->addChild(child); 90 parent->addChild(child);
91 else if (toScrollView(child->parent())) 91 else if (toFrameView(child->parent()))
92 toScrollView(child->parent())->removeChild(child); 92 toFrameView(child->parent())->removeChild(child);
93 return; 93 return;
94 } 94 }
95 widgetNewParentMap().set(child, parent); 95 widgetNewParentMap().set(child, parent);
96 } 96 }
97 97
98 HTMLFrameOwnerElement::HTMLFrameOwnerElement(const QualifiedName& tagName, Docum ent& document) 98 HTMLFrameOwnerElement::HTMLFrameOwnerElement(const QualifiedName& tagName, Docum ent& document)
99 : HTMLElement(tagName, document) 99 : HTMLElement(tagName, document)
100 , m_contentFrame(nullptr) 100 , m_contentFrame(nullptr)
101 , m_widget(nullptr) 101 , m_widget(nullptr)
102 , m_sandboxFlags(SandboxNone) 102 , m_sandboxFlags(SandboxNone)
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 256
257 void HTMLFrameOwnerElement::trace(Visitor* visitor) 257 void HTMLFrameOwnerElement::trace(Visitor* visitor)
258 { 258 {
259 visitor->trace(m_contentFrame); 259 visitor->trace(m_contentFrame);
260 HTMLElement::trace(visitor); 260 HTMLElement::trace(visitor);
261 FrameOwner::trace(visitor); 261 FrameOwner::trace(visitor);
262 } 262 }
263 263
264 264
265 } // namespace blink 265 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/core/page/AutoscrollController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698