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) 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 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1783 ASSERT(!isLayoutIFrame() && !isEmbeddedObject() && !isCanvas()); | 1783 ASSERT(!isLayoutIFrame() && !isEmbeddedObject() && !isCanvas()); |
1784 return; | 1784 return; |
1785 } | 1785 } |
1786 | 1786 |
1787 StyleDifference diff; | 1787 StyleDifference diff; |
1788 if (m_style) | 1788 if (m_style) |
1789 diff = m_style->visualInvalidationDiff(*style); | 1789 diff = m_style->visualInvalidationDiff(*style); |
1790 | 1790 |
1791 diff = adjustStyleDifference(diff); | 1791 diff = adjustStyleDifference(diff); |
1792 | 1792 |
1793 if (m_style) { | |
1794 LayoutFlowThread* flowThread = flowThreadContainingBlock(); | |
1795 if (flowThread && flowThread != this) | |
1796 flowThread->flowThreadDescendantStyleWillChange(this, diff, *style); | |
1797 } | |
1798 styleWillChange(diff, *style); | 1793 styleWillChange(diff, *style); |
1799 | 1794 |
1800 RefPtr<ComputedStyle> oldStyle = m_style.release(); | 1795 RefPtr<ComputedStyle> oldStyle = m_style.release(); |
1801 setStyleInternal(style); | 1796 setStyleInternal(style); |
1802 | 1797 |
1803 updateFillImages(oldStyle ? &oldStyle->backgroundLayers() : 0, m_style->back
groundLayers()); | 1798 updateFillImages(oldStyle ? &oldStyle->backgroundLayers() : 0, m_style->back
groundLayers()); |
1804 updateFillImages(oldStyle ? &oldStyle->maskLayers() : 0, m_style->maskLayers
()); | 1799 updateFillImages(oldStyle ? &oldStyle->maskLayers() : 0, m_style->maskLayers
()); |
1805 | 1800 |
1806 updateImage(oldStyle ? oldStyle->borderImage().image() : 0, m_style->borderI
mage().image()); | 1801 updateImage(oldStyle ? oldStyle->borderImage().image() : 0, m_style->borderI
mage().image()); |
1807 updateImage(oldStyle ? oldStyle->maskBoxImage().image() : 0, m_style->maskBo
xImage().image()); | 1802 updateImage(oldStyle ? oldStyle->maskBoxImage().image() : 0, m_style->maskBo
xImage().image()); |
1808 | 1803 |
1809 updateShapeImage(oldStyle ? oldStyle->shapeOutside() : 0, m_style->shapeOuts
ide()); | 1804 updateShapeImage(oldStyle ? oldStyle->shapeOutside() : 0, m_style->shapeOuts
ide()); |
1810 | 1805 |
1811 bool doesNotNeedLayoutOrPaintInvalidation = !m_parent; | 1806 bool doesNotNeedLayoutOrPaintInvalidation = !m_parent; |
1812 | 1807 |
1813 styleDidChange(diff, oldStyle.get()); | 1808 styleDidChange(diff, oldStyle.get()); |
1814 if (oldStyle.get()) { | |
1815 LayoutFlowThread* flowThread = flowThreadContainingBlock(); | |
1816 if (flowThread && flowThread != this) | |
1817 flowThread->flowThreadDescendantStyleDidChange(this, diff, *oldStyle
.get()); | |
1818 } | |
1819 | 1809 |
1820 // FIXME: |this| might be destroyed here. This can currently happen for a La
youtTextFragment when | 1810 // FIXME: |this| might be destroyed here. This can currently happen for a La
youtTextFragment when |
1821 // its first-letter block gets an update in LayoutTextFragment::styleDidChan
ge. For LayoutTextFragment(s), | 1811 // its first-letter block gets an update in LayoutTextFragment::styleDidChan
ge. For LayoutTextFragment(s), |
1822 // we will safely bail out with the doesNotNeedLayoutOrPaintInvalidation fla
g. We might want to broaden | 1812 // we will safely bail out with the doesNotNeedLayoutOrPaintInvalidation fla
g. We might want to broaden |
1823 // this condition in the future as we move layoutObject changes out of layou
t and into style changes. | 1813 // this condition in the future as we move layoutObject changes out of layou
t and into style changes. |
1824 if (doesNotNeedLayoutOrPaintInvalidation) | 1814 if (doesNotNeedLayoutOrPaintInvalidation) |
1825 return; | 1815 return; |
1826 | 1816 |
1827 // Now that the layer (if any) has been updated, we need to adjust the diff
again, | 1817 // Now that the layer (if any) has been updated, we need to adjust the diff
again, |
1828 // check whether we should layout now, and decide if we need to invalidate p
aints. | 1818 // check whether we should layout now, and decide if we need to invalidate p
aints. |
(...skipping 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3384 const blink::LayoutObject* root = object1; | 3374 const blink::LayoutObject* root = object1; |
3385 while (root->parent()) | 3375 while (root->parent()) |
3386 root = root->parent(); | 3376 root = root->parent(); |
3387 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3377 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3388 } else { | 3378 } else { |
3389 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3379 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
3390 } | 3380 } |
3391 } | 3381 } |
3392 | 3382 |
3393 #endif | 3383 #endif |
OLD | NEW |