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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2149893003: Rename Node::inShadowIncludingDocument() to Node::isConnected() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 4 years, 5 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
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 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after
1826 1826
1827 m_lifecycle.advanceTo(DocumentLifecycle::LayoutSubtreeChangeClean); 1827 m_lifecycle.advanceTo(DocumentLifecycle::LayoutSubtreeChangeClean);
1828 } 1828 }
1829 1829
1830 bool Document::needsLayoutTreeUpdateForNode(const Node& node) const 1830 bool Document::needsLayoutTreeUpdateForNode(const Node& node) const
1831 { 1831 {
1832 if (!node.canParticipateInFlatTree()) 1832 if (!node.canParticipateInFlatTree())
1833 return false; 1833 return false;
1834 if (!needsLayoutTreeUpdate()) 1834 if (!needsLayoutTreeUpdate())
1835 return false; 1835 return false;
1836 if (!node.inShadowIncludingDocument()) 1836 if (!node.isConnected())
1837 return false; 1837 return false;
1838 1838
1839 if (needsFullLayoutTreeUpdate() || node.needsStyleRecalc() || node.needsStyl eInvalidation()) 1839 if (needsFullLayoutTreeUpdate() || node.needsStyleRecalc() || node.needsStyl eInvalidation())
1840 return true; 1840 return true;
1841 for (const ContainerNode* ancestor = LayoutTreeBuilderTraversal::parent(node ); ancestor; ancestor = LayoutTreeBuilderTraversal::parent(*ancestor)) { 1841 for (const ContainerNode* ancestor = LayoutTreeBuilderTraversal::parent(node ); ancestor; ancestor = LayoutTreeBuilderTraversal::parent(*ancestor)) {
1842 if (ancestor->needsStyleRecalc() || ancestor->needsStyleInvalidation() | | ancestor->needsAdjacentStyleRecalc()) 1842 if (ancestor->needsStyleRecalc() || ancestor->needsStyleInvalidation() | | ancestor->needsAdjacentStyleRecalc())
1843 return true; 1843 return true;
1844 } 1844 }
1845 return false; 1845 return false;
1846 } 1846 }
(...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after
3441 3441
3442 m_activeHoverElement = newActiveElement; 3442 m_activeHoverElement = newActiveElement;
3443 } 3443 }
3444 3444
3445 void Document::removeFocusedElementOfSubtree(Node* node, bool amongChildrenOnly) 3445 void Document::removeFocusedElementOfSubtree(Node* node, bool amongChildrenOnly)
3446 { 3446 {
3447 if (!m_focusedElement) 3447 if (!m_focusedElement)
3448 return; 3448 return;
3449 3449
3450 // We can't be focused if we're not in the document. 3450 // We can't be focused if we're not in the document.
3451 if (!node->inShadowIncludingDocument()) 3451 if (!node->isConnected())
3452 return; 3452 return;
3453 bool contains = node->isShadowIncludingInclusiveAncestorOf(m_focusedElement. get()); 3453 bool contains = node->isShadowIncludingInclusiveAncestorOf(m_focusedElement. get());
3454 if (contains && (m_focusedElement != node || !amongChildrenOnly)) 3454 if (contains && (m_focusedElement != node || !amongChildrenOnly))
3455 clearFocusedElement(); 3455 clearFocusedElement();
3456 } 3456 }
3457 3457
3458 void Document::hoveredNodeDetached(Element& element) 3458 void Document::hoveredNodeDetached(Element& element)
3459 { 3459 {
3460 if (!m_hoverNode) 3460 if (!m_hoverNode)
3461 return; 3461 return;
(...skipping 2554 matching lines...) Expand 10 before | Expand all | Expand 10 after
6016 } 6016 }
6017 6017
6018 void showLiveDocumentInstances() 6018 void showLiveDocumentInstances()
6019 { 6019 {
6020 WeakDocumentSet& set = liveDocumentSet(); 6020 WeakDocumentSet& set = liveDocumentSet();
6021 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6021 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6022 for (Document* document : set) 6022 for (Document* document : set)
6023 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6023 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6024 } 6024 }
6025 #endif 6025 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ContainerNode.cpp ('k') | third_party/WebKit/Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698