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

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

Issue 2375293002: Set NeedsReattachLayoutTree and ChildNeedsReattachLayoutTree flags on Node (Closed)
Patch Set: Add ability to clear dirty bits and relevant call sites Created 4 years, 2 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 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 1894 matching lines...) Expand 10 before | Expand all | Expand 10 after
1905 m_hasNodesWithPlaceholderStyle = false; 1905 m_hasNodesWithPlaceholderStyle = false;
1906 RefPtr<ComputedStyle> documentStyle = 1906 RefPtr<ComputedStyle> documentStyle =
1907 StyleResolver::styleForDocument(*this); 1907 StyleResolver::styleForDocument(*this);
1908 StyleRecalcChange localChange = ComputedStyle::stylePropagationDiff( 1908 StyleRecalcChange localChange = ComputedStyle::stylePropagationDiff(
1909 documentStyle.get(), layoutViewItem().style()); 1909 documentStyle.get(), layoutViewItem().style());
1910 if (localChange != NoChange) 1910 if (localChange != NoChange)
1911 layoutViewItem().setStyle(documentStyle.release()); 1911 layoutViewItem().setStyle(documentStyle.release());
1912 } 1912 }
1913 1913
1914 clearNeedsStyleRecalc(); 1914 clearNeedsStyleRecalc();
1915 clearNeedsReattachLayoutTree();
1915 1916
1916 StyleResolver& resolver = ensureStyleResolver(); 1917 StyleResolver& resolver = ensureStyleResolver();
1917 1918
1918 bool shouldRecordStats; 1919 bool shouldRecordStats;
1919 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats); 1920 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats);
1920 styleEngine().setStatsEnabled(shouldRecordStats); 1921 styleEngine().setStatsEnabled(shouldRecordStats);
1921 1922
1922 if (Element* documentElement = this->documentElement()) { 1923 if (Element* documentElement = this->documentElement()) {
1923 inheritHtmlAndBodyElementStyles(change); 1924 inheritHtmlAndBodyElementStyles(change);
1924 dirtyElementsForLayerUpdate(); 1925 dirtyElementsForLayerUpdate();
1925 if (documentElement->shouldCallRecalcStyle(change)) 1926 if (documentElement->shouldCallRecalcStyle(change))
1926 documentElement->recalcStyle(change); 1927 documentElement->recalcStyle(change);
1927 while (dirtyElementsForLayerUpdate()) 1928 while (dirtyElementsForLayerUpdate())
1928 documentElement->recalcStyle(NoChange); 1929 documentElement->recalcStyle(NoChange);
1929 } 1930 }
1930 1931
1931 view()->recalcOverflowAfterStyleChange(); 1932 view()->recalcOverflowAfterStyleChange();
1932 1933
1933 // Only retain the HashMap for the duration of StyleRecalc and 1934 // Only retain the HashMap for the duration of StyleRecalc and
1934 // LayoutTreeConstruction. 1935 // LayoutTreeConstruction.
1935 m_nonAttachedStyle.clear(); 1936 m_nonAttachedStyle.clear();
1936 clearChildNeedsStyleRecalc(); 1937 clearChildNeedsStyleRecalc();
1938 clearChildNeedsReattachLayoutTree();
1937 1939
1938 resolver.clearStyleSharingList(); 1940 resolver.clearStyleSharingList();
1939 1941
1940 m_wasPrinting = m_printing; 1942 m_wasPrinting = m_printing;
1941 1943
1942 DCHECK(!needsStyleRecalc()); 1944 DCHECK(!needsStyleRecalc());
1943 DCHECK(!childNeedsStyleRecalc()); 1945 DCHECK(!childNeedsStyleRecalc());
1944 DCHECK(inStyleRecalc()); 1946 DCHECK(inStyleRecalc());
1945 DCHECK_EQ(styleResolver(), &resolver); 1947 DCHECK_EQ(styleResolver(), &resolver);
1946 DCHECK(m_nonAttachedStyle.isEmpty()); 1948 DCHECK(m_nonAttachedStyle.isEmpty());
(...skipping 4441 matching lines...) Expand 10 before | Expand all | Expand 10 after
6388 } 6390 }
6389 6391
6390 void showLiveDocumentInstances() { 6392 void showLiveDocumentInstances() {
6391 WeakDocumentSet& set = liveDocumentSet(); 6393 WeakDocumentSet& set = liveDocumentSet();
6392 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6394 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6393 for (Document* document : set) 6395 for (Document* document : set)
6394 fprintf(stderr, "- Document %p URL: %s\n", document, 6396 fprintf(stderr, "- Document %p URL: %s\n", document,
6395 document->url().getString().utf8().data()); 6397 document->url().getString().utf8().data());
6396 } 6398 }
6397 #endif 6399 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ContainerNode.cpp ('k') | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698