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

Side by Side Diff: Source/core/layout/LayoutObject.cpp

Issue 1155023002: Only notify the flowthread about style changes on actual descendants. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 | « no previous file | no next file » | 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) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after
1739 return; 1739 return;
1740 } 1740 }
1741 1741
1742 StyleDifference diff; 1742 StyleDifference diff;
1743 if (m_style) 1743 if (m_style)
1744 diff = m_style->visualInvalidationDiff(*style); 1744 diff = m_style->visualInvalidationDiff(*style);
1745 1745
1746 diff = adjustStyleDifference(diff); 1746 diff = adjustStyleDifference(diff);
1747 1747
1748 if (m_style) { 1748 if (m_style) {
1749 if (LayoutFlowThread* flowThread = flowThreadContainingBlock()) 1749 LayoutFlowThread* flowThread = flowThreadContainingBlock();
1750 if (flowThread && flowThread != this)
1750 flowThread->flowThreadDescendantStyleWillChange(this, diff, *style); 1751 flowThread->flowThreadDescendantStyleWillChange(this, diff, *style);
1751 } 1752 }
1752 styleWillChange(diff, *style); 1753 styleWillChange(diff, *style);
1753 1754
1754 RefPtr<ComputedStyle> oldStyle = m_style.release(); 1755 RefPtr<ComputedStyle> oldStyle = m_style.release();
1755 setStyleInternal(style); 1756 setStyleInternal(style);
1756 1757
1757 updateFillImages(oldStyle ? &oldStyle->backgroundLayers() : 0, m_style->back groundLayers()); 1758 updateFillImages(oldStyle ? &oldStyle->backgroundLayers() : 0, m_style->back groundLayers());
1758 updateFillImages(oldStyle ? &oldStyle->maskLayers() : 0, m_style->maskLayers ()); 1759 updateFillImages(oldStyle ? &oldStyle->maskLayers() : 0, m_style->maskLayers ());
1759 1760
1760 updateImage(oldStyle ? oldStyle->borderImage().image() : 0, m_style->borderI mage().image()); 1761 updateImage(oldStyle ? oldStyle->borderImage().image() : 0, m_style->borderI mage().image());
1761 updateImage(oldStyle ? oldStyle->maskBoxImage().image() : 0, m_style->maskBo xImage().image()); 1762 updateImage(oldStyle ? oldStyle->maskBoxImage().image() : 0, m_style->maskBo xImage().image());
1762 1763
1763 updateShapeImage(oldStyle ? oldStyle->shapeOutside() : 0, m_style->shapeOuts ide()); 1764 updateShapeImage(oldStyle ? oldStyle->shapeOutside() : 0, m_style->shapeOuts ide());
1764 1765
1765 bool doesNotNeedLayoutOrPaintInvalidation = !m_parent; 1766 bool doesNotNeedLayoutOrPaintInvalidation = !m_parent;
1766 1767
1767 styleDidChange(diff, oldStyle.get()); 1768 styleDidChange(diff, oldStyle.get());
1768 if (oldStyle.get()) { 1769 if (oldStyle.get()) {
1769 if (LayoutFlowThread* flowThread = flowThreadContainingBlock()) 1770 LayoutFlowThread* flowThread = flowThreadContainingBlock();
1771 if (flowThread && flowThread != this)
1770 flowThread->flowThreadDescendantStyleDidChange(this, diff, *oldStyle .get()); 1772 flowThread->flowThreadDescendantStyleDidChange(this, diff, *oldStyle .get());
1771 } 1773 }
1772 1774
1773 // FIXME: |this| might be destroyed here. This can currently happen for a La youtTextFragment when 1775 // FIXME: |this| might be destroyed here. This can currently happen for a La youtTextFragment when
1774 // its first-letter block gets an update in LayoutTextFragment::styleDidChan ge. For LayoutTextFragment(s), 1776 // its first-letter block gets an update in LayoutTextFragment::styleDidChan ge. For LayoutTextFragment(s),
1775 // we will safely bail out with the doesNotNeedLayoutOrPaintInvalidation fla g. We might want to broaden 1777 // we will safely bail out with the doesNotNeedLayoutOrPaintInvalidation fla g. We might want to broaden
1776 // this condition in the future as we move layoutObject changes out of layou t and into style changes. 1778 // this condition in the future as we move layoutObject changes out of layou t and into style changes.
1777 if (doesNotNeedLayoutOrPaintInvalidation) 1779 if (doesNotNeedLayoutOrPaintInvalidation)
1778 return; 1780 return;
1779 1781
(...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after
3298 const blink::LayoutObject* root = object1; 3300 const blink::LayoutObject* root = object1;
3299 while (root->parent()) 3301 while (root->parent())
3300 root = root->parent(); 3302 root = root->parent();
3301 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3303 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3302 } else { 3304 } else {
3303 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3305 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3304 } 3306 }
3305 } 3307 }
3306 3308
3307 #endif 3309 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698