OLD | NEW |
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 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 for (Node& node : NodeTraversal::inclusiveDescendantsOf(root)) { | 1771 for (Node& node : NodeTraversal::inclusiveDescendantsOf(root)) { |
1772 // We leave some nodes with dirty bits in the tree because they don't | 1772 // We leave some nodes with dirty bits in the tree because they don't |
1773 // matter like Comment and ProcessingInstruction nodes. | 1773 // matter like Comment and ProcessingInstruction nodes. |
1774 // TODO(esprehn): Don't even mark those nodes as needing recalcs in the | 1774 // TODO(esprehn): Don't even mark those nodes as needing recalcs in the |
1775 // first place. | 1775 // first place. |
1776 if (!node.isElementNode() && !node.isTextNode() && !node.isShadowRoot() && | 1776 if (!node.isElementNode() && !node.isTextNode() && !node.isShadowRoot() && |
1777 !node.isDocumentNode()) | 1777 !node.isDocumentNode()) |
1778 continue; | 1778 continue; |
1779 DCHECK(!node.needsStyleRecalc()); | 1779 DCHECK(!node.needsStyleRecalc()); |
1780 DCHECK(!node.childNeedsStyleRecalc()); | 1780 DCHECK(!node.childNeedsStyleRecalc()); |
| 1781 DCHECK(!node.needsReattachLayoutTree()); |
| 1782 DCHECK(!node.childNeedsReattachLayoutTree()); |
1781 DCHECK(!node.childNeedsDistributionRecalc()); | 1783 DCHECK(!node.childNeedsDistributionRecalc()); |
1782 DCHECK(!node.needsStyleInvalidation()); | 1784 DCHECK(!node.needsStyleInvalidation()); |
1783 DCHECK(!node.childNeedsStyleInvalidation()); | 1785 DCHECK(!node.childNeedsStyleInvalidation()); |
1784 for (ShadowRoot* shadowRoot = node.youngestShadowRoot(); shadowRoot; | 1786 for (ShadowRoot* shadowRoot = node.youngestShadowRoot(); shadowRoot; |
1785 shadowRoot = shadowRoot->olderShadowRoot()) | 1787 shadowRoot = shadowRoot->olderShadowRoot()) |
1786 assertLayoutTreeUpdated(*shadowRoot); | 1788 assertLayoutTreeUpdated(*shadowRoot); |
1787 } | 1789 } |
1788 } | 1790 } |
1789 #endif | 1791 #endif |
1790 | 1792 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1903 m_hasNodesWithPlaceholderStyle = false; | 1905 m_hasNodesWithPlaceholderStyle = false; |
1904 RefPtr<ComputedStyle> documentStyle = | 1906 RefPtr<ComputedStyle> documentStyle = |
1905 StyleResolver::styleForDocument(*this); | 1907 StyleResolver::styleForDocument(*this); |
1906 StyleRecalcChange localChange = ComputedStyle::stylePropagationDiff( | 1908 StyleRecalcChange localChange = ComputedStyle::stylePropagationDiff( |
1907 documentStyle.get(), layoutViewItem().style()); | 1909 documentStyle.get(), layoutViewItem().style()); |
1908 if (localChange != NoChange) | 1910 if (localChange != NoChange) |
1909 layoutViewItem().setStyle(documentStyle.release()); | 1911 layoutViewItem().setStyle(documentStyle.release()); |
1910 } | 1912 } |
1911 | 1913 |
1912 clearNeedsStyleRecalc(); | 1914 clearNeedsStyleRecalc(); |
| 1915 clearNeedsReattachLayoutTree(); |
1913 | 1916 |
1914 StyleResolver& resolver = ensureStyleResolver(); | 1917 StyleResolver& resolver = ensureStyleResolver(); |
1915 | 1918 |
1916 bool shouldRecordStats; | 1919 bool shouldRecordStats; |
1917 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats); | 1920 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats); |
1918 styleEngine().setStatsEnabled(shouldRecordStats); | 1921 styleEngine().setStatsEnabled(shouldRecordStats); |
1919 | 1922 |
1920 if (Element* documentElement = this->documentElement()) { | 1923 if (Element* documentElement = this->documentElement()) { |
1921 inheritHtmlAndBodyElementStyles(change); | 1924 inheritHtmlAndBodyElementStyles(change); |
1922 dirtyElementsForLayerUpdate(); | 1925 dirtyElementsForLayerUpdate(); |
1923 if (documentElement->shouldCallRecalcStyle(change)) | 1926 if (documentElement->shouldCallRecalcStyle(change)) |
1924 documentElement->recalcStyle(change); | 1927 documentElement->recalcStyle(change); |
1925 while (dirtyElementsForLayerUpdate()) | 1928 while (dirtyElementsForLayerUpdate()) |
1926 documentElement->recalcStyle(NoChange); | 1929 documentElement->recalcStyle(NoChange); |
1927 } | 1930 } |
1928 | 1931 |
1929 view()->recalcOverflowAfterStyleChange(); | 1932 view()->recalcOverflowAfterStyleChange(); |
1930 | 1933 |
1931 // Only retain the HashMap for the duration of StyleRecalc and | 1934 // Only retain the HashMap for the duration of StyleRecalc and |
1932 // LayoutTreeConstruction. | 1935 // LayoutTreeConstruction. |
1933 m_nonAttachedStyle.clear(); | 1936 m_nonAttachedStyle.clear(); |
1934 clearChildNeedsStyleRecalc(); | 1937 clearChildNeedsStyleRecalc(); |
| 1938 clearChildNeedsReattachLayoutTree(); |
1935 | 1939 |
1936 resolver.clearStyleSharingList(); | 1940 resolver.clearStyleSharingList(); |
1937 | 1941 |
1938 m_wasPrinting = m_printing; | 1942 m_wasPrinting = m_printing; |
1939 | 1943 |
1940 DCHECK(!needsStyleRecalc()); | 1944 DCHECK(!needsStyleRecalc()); |
1941 DCHECK(!childNeedsStyleRecalc()); | 1945 DCHECK(!childNeedsStyleRecalc()); |
| 1946 DCHECK(!needsReattachLayoutTree()); |
| 1947 DCHECK(!childNeedsReattachLayoutTree()); |
1942 DCHECK(inStyleRecalc()); | 1948 DCHECK(inStyleRecalc()); |
1943 DCHECK_EQ(styleResolver(), &resolver); | 1949 DCHECK_EQ(styleResolver(), &resolver); |
1944 DCHECK(m_nonAttachedStyle.isEmpty()); | 1950 DCHECK(m_nonAttachedStyle.isEmpty()); |
1945 m_lifecycle.advanceTo(DocumentLifecycle::StyleClean); | 1951 m_lifecycle.advanceTo(DocumentLifecycle::StyleClean); |
1946 if (shouldRecordStats) { | 1952 if (shouldRecordStats) { |
1947 TRACE_EVENT_END2("blink,blink_style", "Document::updateStyle", | 1953 TRACE_EVENT_END2("blink,blink_style", "Document::updateStyle", |
1948 "resolverAccessCount", | 1954 "resolverAccessCount", |
1949 styleEngine().styleForElementCount() - initialElementCount, | 1955 styleEngine().styleForElementCount() - initialElementCount, |
1950 "counters", styleEngine().stats()->toTracedValue()); | 1956 "counters", styleEngine().stats()->toTracedValue()); |
1951 } else { | 1957 } else { |
(...skipping 4448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6400 } | 6406 } |
6401 | 6407 |
6402 void showLiveDocumentInstances() { | 6408 void showLiveDocumentInstances() { |
6403 WeakDocumentSet& set = liveDocumentSet(); | 6409 WeakDocumentSet& set = liveDocumentSet(); |
6404 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6410 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6405 for (Document* document : set) | 6411 for (Document* document : set) |
6406 fprintf(stderr, "- Document %p URL: %s\n", document, | 6412 fprintf(stderr, "- Document %p URL: %s\n", document, |
6407 document->url().getString().utf8().data()); | 6413 document->url().getString().utf8().data()); |
6408 } | 6414 } |
6409 #endif | 6415 #endif |
OLD | NEW |