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

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

Issue 1858163002: Rename inDocument() to inShadowIncludingDocument() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1922 1922
1923 m_lifecycle.advanceTo(DocumentLifecycle::LayoutSubtreeChangeClean); 1923 m_lifecycle.advanceTo(DocumentLifecycle::LayoutSubtreeChangeClean);
1924 } 1924 }
1925 1925
1926 bool Document::needsLayoutTreeUpdateForNode(const Node& node) const 1926 bool Document::needsLayoutTreeUpdateForNode(const Node& node) const
1927 { 1927 {
1928 if (!node.canParticipateInFlatTree()) 1928 if (!node.canParticipateInFlatTree())
1929 return false; 1929 return false;
1930 if (!needsLayoutTreeUpdate()) 1930 if (!needsLayoutTreeUpdate())
1931 return false; 1931 return false;
1932 if (!node.inDocument()) 1932 if (!node.inShadowIncludingDocument())
1933 return false; 1933 return false;
1934 1934
1935 if (needsFullLayoutTreeUpdate() || node.needsStyleRecalc() || node.needsStyl eInvalidation()) 1935 if (needsFullLayoutTreeUpdate() || node.needsStyleRecalc() || node.needsStyl eInvalidation())
1936 return true; 1936 return true;
1937 for (const ContainerNode* ancestor = LayoutTreeBuilderTraversal::parent(node ); ancestor; ancestor = LayoutTreeBuilderTraversal::parent(*ancestor)) { 1937 for (const ContainerNode* ancestor = LayoutTreeBuilderTraversal::parent(node ); ancestor; ancestor = LayoutTreeBuilderTraversal::parent(*ancestor)) {
1938 if (ancestor->needsStyleRecalc() || ancestor->needsStyleInvalidation() | | ancestor->needsAdjacentStyleRecalc()) 1938 if (ancestor->needsStyleRecalc() || ancestor->needsStyleInvalidation() | | ancestor->needsAdjacentStyleRecalc())
1939 return true; 1939 return true;
1940 } 1940 }
1941 return false; 1941 return false;
1942 } 1942 }
(...skipping 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after
3535 3535
3536 m_activeHoverElement = newActiveElement; 3536 m_activeHoverElement = newActiveElement;
3537 } 3537 }
3538 3538
3539 void Document::removeFocusedElementOfSubtree(Node* node, bool amongChildrenOnly) 3539 void Document::removeFocusedElementOfSubtree(Node* node, bool amongChildrenOnly)
3540 { 3540 {
3541 if (!m_focusedElement) 3541 if (!m_focusedElement)
3542 return; 3542 return;
3543 3543
3544 // We can't be focused if we're not in the document. 3544 // We can't be focused if we're not in the document.
3545 if (!node->inDocument()) 3545 if (!node->inShadowIncludingDocument())
3546 return; 3546 return;
3547 bool contains = node->containsIncludingShadowDOM(m_focusedElement.get()); 3547 bool contains = node->containsIncludingShadowDOM(m_focusedElement.get());
3548 if (contains && (m_focusedElement != node || !amongChildrenOnly)) 3548 if (contains && (m_focusedElement != node || !amongChildrenOnly))
3549 clearFocusedElement(); 3549 clearFocusedElement();
3550 } 3550 }
3551 3551
3552 void Document::hoveredNodeDetached(Element& element) 3552 void Document::hoveredNodeDetached(Element& element)
3553 { 3553 {
3554 if (!m_hoverNode) 3554 if (!m_hoverNode)
3555 return; 3555 return;
(...skipping 2488 matching lines...) Expand 10 before | Expand all | Expand 10 after
6044 #ifndef NDEBUG 6044 #ifndef NDEBUG
6045 using namespace blink; 6045 using namespace blink;
6046 void showLiveDocumentInstances() 6046 void showLiveDocumentInstances()
6047 { 6047 {
6048 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 6048 Document::WeakDocumentSet& set = Document::liveDocumentSet();
6049 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6049 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6050 for (Document* document : set) 6050 for (Document* document : set)
6051 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6051 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6052 } 6052 }
6053 #endif 6053 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698