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

Side by Side Diff: sky/engine/core/painting/LayoutRoot.cpp

Issue 1171643002: Make SkyShell stop crashing on scroll in Stocks2. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "sky/engine/config.h" 5 #include "sky/engine/config.h"
6 #include "sky/engine/core/painting/LayoutRoot.h" 6 #include "sky/engine/core/painting/LayoutRoot.h"
7 7
8 #include "sky/engine/core/dom/Document.h" 8 #include "sky/engine/core/dom/Document.h"
9 #include "sky/engine/core/dom/Element.h" 9 #include "sky/engine/core/dom/Element.h"
10 #include "sky/engine/core/frame/FrameView.h" 10 #include "sky/engine/core/frame/FrameView.h"
(...skipping 19 matching lines...) Expand all
30 m_settings = Settings::create(); 30 m_settings = Settings::create();
31 m_settings->setDefaultFixedFontSize(13); 31 m_settings->setDefaultFixedFontSize(13);
32 m_settings->setDefaultFontSize(16); 32 m_settings->setDefaultFontSize(16);
33 m_frameHost = FrameHost::createDummy(m_settings.get()); 33 m_frameHost = FrameHost::createDummy(m_settings.get());
34 m_frame = LocalFrame::create(nullptr, m_frameHost.get()); 34 m_frame = LocalFrame::create(nullptr, m_frameHost.get());
35 m_frame->createView(IntSize(), Color::white, false); 35 m_frame->createView(IntSize(), Color::white, false);
36 } 36 }
37 37
38 LayoutRoot::~LayoutRoot() 38 LayoutRoot::~LayoutRoot()
39 { 39 {
40 if (!m_document->needsAttach())
41 m_document->detach();
40 } 42 }
41 43
42 Element* LayoutRoot::rootElement() const 44 Element* LayoutRoot::rootElement() const
43 { 45 {
44 if (!m_document) 46 if (!m_document)
45 return nullptr; 47 return nullptr;
46 return m_document->firstElementChild(); 48 return m_document->firstElementChild();
47 } 49 }
48 50
49 void LayoutRoot::setRootElement(Element* root) 51 void LayoutRoot::setRootElement(Element* root)
(...skipping 27 matching lines...) Expand all
77 m_frame->setDocument(nullptr); 79 m_frame->setDocument(nullptr);
78 } 80 }
79 81
80 void LayoutRoot::paint(Canvas* canvas) 82 void LayoutRoot::paint(Canvas* canvas)
81 { 83 {
82 if (m_document) 84 if (m_document)
83 rootElement()->paint(canvas); 85 rootElement()->paint(canvas);
84 } 86 }
85 87
86 } // namespace blink 88 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698