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

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

Issue 232013002: Rewind the DocumentLifecycle when dirtying state (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
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 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 return true; 1573 return true;
1574 } 1574 }
1575 1575
1576 void Document::scheduleRenderTreeUpdate() 1576 void Document::scheduleRenderTreeUpdate()
1577 { 1577 {
1578 ASSERT(!hasPendingStyleRecalc()); 1578 ASSERT(!hasPendingStyleRecalc());
1579 ASSERT(shouldScheduleRenderTreeUpdate()); 1579 ASSERT(shouldScheduleRenderTreeUpdate());
1580 ASSERT(needsRenderTreeUpdate()); 1580 ASSERT(needsRenderTreeUpdate());
1581 1581
1582 page()->animator().scheduleVisualUpdate(); 1582 page()->animator().scheduleVisualUpdate();
1583 m_lifecycle.advanceTo(DocumentLifecycle::StyleRecalcPending); 1583 m_lifecycle.ensureStateAtMost(DocumentLifecycle::UpdatePending);
1584 1584
1585 InspectorInstrumentation::didScheduleStyleRecalculation(this); 1585 InspectorInstrumentation::didScheduleStyleRecalculation(this);
1586 } 1586 }
1587 1587
1588 bool Document::hasPendingForcedStyleRecalc() const 1588 bool Document::hasPendingForcedStyleRecalc() const
1589 { 1589 {
1590 return hasPendingStyleRecalc() && !inStyleRecalc() && styleChangeType() >= S ubtreeStyleChange; 1590 return hasPendingStyleRecalc() && !inStyleRecalc() && styleChangeType() >= S ubtreeStyleChange;
1591 } 1591 }
1592 1592
1593 void Document::updateDistributionIfNeeded() 1593 void Document::updateDistributionIfNeeded()
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
2623 m_elementDataCache = ElementDataCache::create(); 2623 m_elementDataCache = ElementDataCache::create();
2624 } 2624 }
2625 2625
2626 bool Document::shouldScheduleLayout() const 2626 bool Document::shouldScheduleLayout() const
2627 { 2627 {
2628 // This function will only be called when FrameView thinks a layout is neede d. 2628 // This function will only be called when FrameView thinks a layout is neede d.
2629 // This enforces a couple extra rules. 2629 // This enforces a couple extra rules.
2630 // 2630 //
2631 // (a) Only schedule a layout once the stylesheets are loaded. 2631 // (a) Only schedule a layout once the stylesheets are loaded.
2632 // (b) Only schedule layout once we have a body element. 2632 // (b) Only schedule layout once we have a body element.
2633 2633 if (!isActive())
2634 return false;
2634 return (isRenderingReady() && body()) 2635 return (isRenderingReady() && body())
2635 || (documentElement() && !isHTMLHtmlElement(*documentElement())); 2636 || (documentElement() && !isHTMLHtmlElement(*documentElement()));
esprehn 2014/04/09 21:32:25 Can we split these too so it's easier to read? if
abarth-chromium 2014/04/09 21:41:26 Done.
2636 } 2637 }
2637 2638
2638 int Document::elapsedTime() const 2639 int Document::elapsedTime() const
2639 { 2640 {
2640 return static_cast<int>((currentTime() - m_startTime) * 1000); 2641 return static_cast<int>((currentTime() - m_startTime) * 1000);
2641 } 2642 }
2642 2643
2643 void Document::write(const SegmentedString& text, Document* ownerDocument) 2644 void Document::write(const SegmentedString& text, Document* ownerDocument)
2644 { 2645 {
2645 NestingLevelIncrementer nestingLevelIncrementer(m_writeRecursionDepth); 2646 NestingLevelIncrementer nestingLevelIncrementer(m_writeRecursionDepth);
(...skipping 2861 matching lines...) Expand 10 before | Expand all | Expand 10 after
5507 (*it)->invalidateCache(attrName); 5508 (*it)->invalidateCache(attrName);
5508 } 5509 }
5509 5510
5510 void Document::trace(Visitor* visitor) 5511 void Document::trace(Visitor* visitor)
5511 { 5512 {
5512 Supplementable<Document>::trace(visitor); 5513 Supplementable<Document>::trace(visitor);
5513 ContainerNode::trace(visitor); 5514 ContainerNode::trace(visitor);
5514 } 5515 }
5515 5516
5516 } // namespace WebCore 5517 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698