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

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

Issue 23890025: WIP (Introduce WTF::NonNullPtr<T>.) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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/dom/ContainerNode.cpp ('k') | Source/core/dom/Element.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 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after
1791 } 1791 }
1792 1792
1793 void Document::updateStyleIfNeeded() 1793 void Document::updateStyleIfNeeded()
1794 { 1794 {
1795 ASSERT(isMainThread()); 1795 ASSERT(isMainThread());
1796 ASSERT(!view() || (!view()->isInLayout() && !view()->isPainting())); 1796 ASSERT(!view() || (!view()->isInLayout() && !view()->isPainting()));
1797 1797
1798 if (!needsStyleRecalc() && !childNeedsStyleRecalc() && !childNeedsDistributi onRecalc()) 1798 if (!needsStyleRecalc() && !childNeedsStyleRecalc() && !childNeedsDistributi onRecalc())
1799 return; 1799 return;
1800 1800
1801 AnimationUpdateBlock animationUpdateBlock(m_frame ? m_frame->animation() : 0 ); 1801 AnimationUpdateBlock animationUpdateBlock(m_frame ? m_frame->animation().get () : 0);
1802 recalcStyle(NoChange); 1802 recalcStyle(NoChange);
1803 } 1803 }
1804 1804
1805 void Document::updateStyleForNodeIfNeeded(Node* node) 1805 void Document::updateStyleForNodeIfNeeded(Node* node)
1806 { 1806 {
1807 if (!hasPendingForcedStyleRecalc() && !childNeedsStyleRecalc() && !needsStyl eRecalc()) 1807 if (!hasPendingForcedStyleRecalc() && !childNeedsStyleRecalc() && !needsStyl eRecalc())
1808 return; 1808 return;
1809 1809
1810 bool needsStyleRecalc = hasPendingForcedStyleRecalc(); 1810 bool needsStyleRecalc = hasPendingForcedStyleRecalc();
1811 for (Node* ancestor = node; ancestor && !needsStyleRecalc; ancestor = ancest or->parentOrShadowHostNode()) 1811 for (Node* ancestor = node; ancestor && !needsStyleRecalc; ancestor = ancest or->parentOrShadowHostNode())
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after
3360 } 3360 }
3361 3361
3362 m_activeElement = newActiveElement; 3362 m_activeElement = newActiveElement;
3363 } 3363 }
3364 3364
3365 void Document::removeFocusedElementOfSubtree(Node* node, bool amongChildrenOnly) 3365 void Document::removeFocusedElementOfSubtree(Node* node, bool amongChildrenOnly)
3366 { 3366 {
3367 if (!m_focusedElement) 3367 if (!m_focusedElement)
3368 return; 3368 return;
3369 3369
3370 Element* focusedElement = node->treeScope().adjustedFocusedElement(); 3370 Element* focusedElement = node->treeScope()->adjustedFocusedElement();
3371 if (!focusedElement) 3371 if (!focusedElement)
3372 return; 3372 return;
3373 3373
3374 bool nodeInSubtree = false; 3374 bool nodeInSubtree = false;
3375 if (amongChildrenOnly) 3375 if (amongChildrenOnly)
3376 nodeInSubtree = focusedElement->isDescendantOf(node); 3376 nodeInSubtree = focusedElement->isDescendantOf(node);
3377 else 3377 else
3378 nodeInSubtree = (focusedElement == node) || focusedElement->isDescendant Of(node); 3378 nodeInSubtree = (focusedElement == node) || focusedElement->isDescendant Of(node);
3379 3379
3380 if (nodeInSubtree) 3380 if (nodeInSubtree)
(...skipping 2068 matching lines...) Expand 10 before | Expand all | Expand 10 after
5449 { 5449 {
5450 return DocumentLifecycleNotifier::create(this); 5450 return DocumentLifecycleNotifier::create(this);
5451 } 5451 }
5452 5452
5453 DocumentLifecycleNotifier* Document::lifecycleNotifier() 5453 DocumentLifecycleNotifier* Document::lifecycleNotifier()
5454 { 5454 {
5455 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier()); 5455 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier());
5456 } 5456 }
5457 5457
5458 } // namespace WebCore 5458 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/ContainerNode.cpp ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698