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

Side by Side Diff: sky/engine/core/dom/Document.cpp

Issue 786933008: Simplify StyleEngine clean up. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | sky/engine/core/dom/StyleEngine.h » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 detachParser(); 324 detachParser();
325 #endif 325 #endif
326 326
327 #if !ENABLE(OILPAN) 327 #if !ENABLE(OILPAN)
328 328
329 if (m_importsController) 329 if (m_importsController)
330 HTMLImportsController::removeFrom(*this); 330 HTMLImportsController::removeFrom(*this);
331 331
332 m_timeline->detachFromDocument(); 332 m_timeline->detachFromDocument();
333 333
334 // We need to destroy CSSFontSelector before destroying m_fetcher.
335 if (m_styleEngine)
336 m_styleEngine->detachFromDocument();
337
338 if (m_elemSheet) 334 if (m_elemSheet)
339 m_elemSheet->clearOwnerNode(); 335 m_elemSheet->clearOwnerNode();
340 336
341 m_fetcher.clear(); 337 m_fetcher.clear();
342 338
343 // We must call clearRareData() here since a Document class inherits TreeSco pe 339 // We must call clearRareData() here since a Document class inherits TreeSco pe
344 // as well as Node. See a comment on TreeScope.h for the reason. 340 // as well as Node. See a comment on TreeScope.h for the reason.
345 if (hasRareData()) 341 if (hasRareData())
346 clearRareData(); 342 clearRareData();
347 343
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 if (m_domWindow) 1272 if (m_domWindow)
1277 m_domWindow->clearEventQueue(); 1273 m_domWindow->clearEventQueue();
1278 1274
1279 m_hoverNode = nullptr; 1275 m_hoverNode = nullptr;
1280 m_focusedElement = nullptr; 1276 m_focusedElement = nullptr;
1281 m_activeHoverElement = nullptr; 1277 m_activeHoverElement = nullptr;
1282 1278
1283 m_renderView = 0; 1279 m_renderView = 0;
1284 ContainerNode::detach(context); 1280 ContainerNode::detach(context);
1285 1281
1286 m_styleEngine->didDetach();
1287 m_styleEngine = nullptr; 1282 m_styleEngine = nullptr;
1288 1283
1289 // This is required, as our LocalFrame might delete itself as soon as it det aches 1284 // This is required, as our LocalFrame might delete itself as soon as it det aches
1290 // us. However, this violates Node::detach() semantics, as it's never 1285 // us. However, this violates Node::detach() semantics, as it's never
1291 // possible to re-attach. Eventually Document::detach() should be renamed, 1286 // possible to re-attach. Eventually Document::detach() should be renamed,
1292 // or this setting of the frame to 0 could be made explicit in each of the 1287 // or this setting of the frame to 0 could be made explicit in each of the
1293 // callers of Document::detach(). 1288 // callers of Document::detach().
1294 m_frame = 0; 1289 m_frame = 0;
1295 1290
1296 if (m_mediaQueryMatcher) 1291 if (m_mediaQueryMatcher)
(...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after
2763 using namespace blink; 2758 using namespace blink;
2764 void showLiveDocumentInstances() 2759 void showLiveDocumentInstances()
2765 { 2760 {
2766 WeakDocumentSet& set = liveDocumentSet(); 2761 WeakDocumentSet& set = liveDocumentSet();
2767 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 2762 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
2768 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) { 2763 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) {
2769 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data()); 2764 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data());
2770 } 2765 }
2771 } 2766 }
2772 #endif 2767 #endif
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/dom/StyleEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698