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 1822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1833 else { | 1833 else { |
1834 // An anonymous block must be made to wrap this inline. | 1834 // An anonymous block must be made to wrap this inline. |
1835 RenderBlock* block = toRenderBlock(parent())->createAnonymousBlock()
; | 1835 RenderBlock* block = toRenderBlock(parent())->createAnonymousBlock()
; |
1836 RenderObjectChildList* childlist = parent()->virtualChildren(); | 1836 RenderObjectChildList* childlist = parent()->virtualChildren(); |
1837 childlist->insertChildNode(parent(), block, this); | 1837 childlist->insertChildNode(parent(), block, this); |
1838 block->children()->appendChildNode(block, childlist->removeChildNode
(parent(), this)); | 1838 block->children()->appendChildNode(block, childlist->removeChildNode
(parent(), this)); |
1839 } | 1839 } |
1840 } | 1840 } |
1841 } | 1841 } |
1842 | 1842 |
1843 StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff, unsign
ed contextSensitiveProperties) const | 1843 StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff) const |
1844 { | 1844 { |
1845 // If transform changed, and the layer does not paint into its own separate
backing, then we need to do a layout. | 1845 // If transform changed, and the layer does not paint into its own separate
backing, then we need to do a layout. |
1846 // FIXME: The comment above is what the code does, but it is technically not
following spec. This means we will | 1846 // FIXME: The comment above is what the code does, but it is technically not
following spec. This means we will |
1847 // not to layout for 3d transforms, but we should be invoking a simplified r
elayout. Is it possible we are avoiding | 1847 // not to layout for 3d transforms, but we should be invoking a simplified r
elayout. Is it possible we are avoiding |
1848 // doing this for some performance reason at this time? | 1848 // doing this for some performance reason at this time? |
1849 if (contextSensitiveProperties & ContextSensitivePropertyTransform) { | 1849 if (diff.transformChanged()) { |
1850 // Text nodes share style with their parents but transforms don't apply
to them, | 1850 // Text nodes share style with their parents but transforms don't apply
to them, |
1851 // hence the !isText() check. | 1851 // hence the !isText() check. |
1852 // FIXME: when transforms are taken into account for overflow, we will n
eed to do a layout. | 1852 // FIXME: when transforms are taken into account for overflow, we will n
eed to do a layout. |
1853 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer(
)->hasDirectReasonsForCompositing())) { | 1853 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer(
)->hasDirectReasonsForCompositing())) { |
1854 // We need to set at least SimplifiedLayout, but if PositionedMoveme
ntOnly is already set | 1854 diff.setNeedsRepaintLayer(); |
1855 // then we actually need SimplifiedLayoutAndPositionedMovement. | |
1856 if (!hasLayer()) | 1855 if (!hasLayer()) |
1857 diff = StyleDifferenceLayout; // FIXME: Do this for now since Si
mplifiedLayout cannot handle updating floating objects lists. | 1856 diff.setNeedsFullLayout(); // FIXME: Do this for now since Simpl
ifiedLayout cannot handle updating floating objects lists. |
1858 else if (diff < StyleDifferenceLayoutPositionedMovementOnly) | 1857 else |
1859 diff = StyleDifferenceSimplifiedLayout; | 1858 diff.setNeedsSimplifiedLayout(); |
1860 else if (diff < StyleDifferenceSimplifiedLayout) | 1859 } else { |
1861 diff = StyleDifferenceSimplifiedLayoutAndPositionedMovement; | 1860 diff.setNeedsRecompositeLayer(); |
1862 } else if (diff < StyleDifferenceRecompositeLayer) | 1861 } |
1863 diff = StyleDifferenceRecompositeLayer; | |
1864 } | 1862 } |
1865 | 1863 |
1866 // If opacity or filters changed, and the layer does not paint into its own
separate backing, then we need to repaint (also | 1864 // If opacity or zIndex changed, and the layer does not paint into its own s
eparate backing, then we need to repaint (also |
1867 // ignoring text nodes) | 1865 // ignoring text nodes) |
1868 if (contextSensitiveProperties & ContextSensitivePropertyOpacity && diff <=
StyleDifferenceRepaintLayer) { | 1866 if ((diff.opacityChanged() || diff.zIndexChanged()) && !diff.needsRepaintLay
er()) { |
1869 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer(
)->hasDirectReasonsForCompositing())) | 1867 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer(
)->hasDirectReasonsForCompositing())) |
1870 diff = StyleDifferenceRepaintLayer; | 1868 diff.setNeedsRepaintLayer(); |
1871 else if (diff < StyleDifferenceRecompositeLayer) | 1869 else |
1872 diff = StyleDifferenceRecompositeLayer; | 1870 diff.setNeedsRecompositeLayer(); |
1873 } | 1871 } |
1874 | 1872 |
1875 if ((contextSensitiveProperties & ContextSensitivePropertyFilter) && hasLaye
r() && diff <= StyleDifferenceRepaintLayer) { | 1873 // If filter changed, and the layer does not paint into its own separate bac
king or it paints with filters, then we need to repaint. |
| 1874 if (diff.filterChanged() && hasLayer() && !diff.needsRepaintLayer()) { |
1876 RenderLayer* layer = toRenderLayerModelObject(this)->layer(); | 1875 RenderLayer* layer = toRenderLayerModelObject(this)->layer(); |
1877 if (!layer->hasDirectReasonsForCompositing() || layer->paintsWithFilters
()) | 1876 if (!layer->hasDirectReasonsForCompositing() || layer->paintsWithFilters
()) |
1878 diff = StyleDifferenceRepaintLayer; | 1877 diff.setNeedsRepaintLayer(); |
1879 else if (diff < StyleDifferenceRecompositeLayer) | 1878 else |
1880 diff = StyleDifferenceRecompositeLayer; | 1879 diff.setNeedsRecompositeLayer(); |
1881 } | 1880 } |
1882 | 1881 |
1883 if ((contextSensitiveProperties & ContextSensitivePropertyTextOrColor) && di
ff < StyleDifferenceRepaint | 1882 if (!diff.needsRepaint() && diff.textOrColorChanged() && hasImmediateNonWhit
espaceTextChildOrPropertiesDependentOnColor()) |
1884 && hasImmediateNonWhitespaceTextChildOrPropertiesDependentOnColor()) | 1883 diff.setNeedsRepaintSelf(); |
1885 diff = StyleDifferenceRepaint; | 1884 |
| 1885 diff.resetContextSensitiveFlags(); |
1886 | 1886 |
1887 // The answer to layerTypeRequired() for plugins, iframes, and canvas can ch
ange without the actual | 1887 // The answer to layerTypeRequired() for plugins, iframes, and canvas can ch
ange without the actual |
1888 // style changing, since it depends on whether we decide to composite these
elements. When the | 1888 // style changing, since it depends on whether we decide to composite these
elements. When the |
1889 // layer status of one of these elements changes, we need to force a layout. | 1889 // layer status of one of these elements changes, we need to force a layout. |
1890 if (diff == StyleDifferenceEqual && style() && isLayerModelObject()) { | 1890 if (!diff.needsFullLayout() && style() && isLayerModelObject()) { |
1891 bool requiresLayer = toRenderLayerModelObject(this)->layerTypeRequired()
!= NoLayer; | 1891 bool requiresLayer = toRenderLayerModelObject(this)->layerTypeRequired()
!= NoLayer; |
1892 if (hasLayer() != requiresLayer) | 1892 if (hasLayer() != requiresLayer) |
1893 diff = StyleDifferenceLayout; | 1893 diff.setNeedsFullLayout(); |
1894 } | 1894 } |
1895 | 1895 |
1896 // If we have no layer(), just treat a RepaintLayer hint as a normal Repaint
. | 1896 // If we have no layer(), just treat a RepaintLayer hint as a normal Repaint
. |
1897 if (diff == StyleDifferenceRepaintLayer && !hasLayer()) | 1897 if (diff.needsRepaintLayer() && !hasLayer()) |
1898 diff = StyleDifferenceRepaint; | 1898 diff.setNeedsRepaintSelf(); |
1899 | 1899 |
1900 return diff; | 1900 return diff; |
1901 } | 1901 } |
1902 | 1902 |
1903 void RenderObject::setPseudoStyle(PassRefPtr<RenderStyle> pseudoStyle) | 1903 void RenderObject::setPseudoStyle(PassRefPtr<RenderStyle> pseudoStyle) |
1904 { | 1904 { |
1905 ASSERT(pseudoStyle->styleType() == BEFORE || pseudoStyle->styleType() == AFT
ER); | 1905 ASSERT(pseudoStyle->styleType() == BEFORE || pseudoStyle->styleType() == AFT
ER); |
1906 | 1906 |
1907 // FIXME: We should consider just making all pseudo items use an inherited s
tyle. | 1907 // FIXME: We should consider just making all pseudo items use an inherited s
tyle. |
1908 | 1908 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1940 { | 1940 { |
1941 ASSERT(style); | 1941 ASSERT(style); |
1942 | 1942 |
1943 if (m_style == style) { | 1943 if (m_style == style) { |
1944 // We need to run through adjustStyleDifference() for iframes, plugins,
and canvas so | 1944 // We need to run through adjustStyleDifference() for iframes, plugins,
and canvas so |
1945 // style sharing is disabled for them. That should ensure that we never
hit this code path. | 1945 // style sharing is disabled for them. That should ensure that we never
hit this code path. |
1946 ASSERT(!isRenderIFrame() && !isEmbeddedObject() && !isCanvas()); | 1946 ASSERT(!isRenderIFrame() && !isEmbeddedObject() && !isCanvas()); |
1947 return; | 1947 return; |
1948 } | 1948 } |
1949 | 1949 |
1950 StyleDifference diff = StyleDifferenceEqual; | 1950 StyleDifference diff; |
1951 unsigned contextSensitiveProperties = ContextSensitivePropertyNone; | |
1952 if (m_style) | 1951 if (m_style) |
1953 diff = m_style->visualInvalidationDiff(*style, contextSensitivePropertie
s); | 1952 diff = m_style->visualInvalidationDiff(*style); |
1954 | 1953 |
1955 diff = adjustStyleDifference(diff, contextSensitiveProperties); | 1954 diff = adjustStyleDifference(diff); |
1956 | 1955 |
1957 styleWillChange(diff, *style); | 1956 styleWillChange(diff, *style); |
1958 | 1957 |
1959 RefPtr<RenderStyle> oldStyle = m_style.release(); | 1958 RefPtr<RenderStyle> oldStyle = m_style.release(); |
1960 setStyleInternal(style); | 1959 setStyleInternal(style); |
1961 | 1960 |
1962 updateFillImages(oldStyle ? oldStyle->backgroundLayers() : 0, m_style ? m_st
yle->backgroundLayers() : 0); | 1961 updateFillImages(oldStyle ? oldStyle->backgroundLayers() : 0, m_style ? m_st
yle->backgroundLayers() : 0); |
1963 updateFillImages(oldStyle ? oldStyle->maskLayers() : 0, m_style ? m_style->m
askLayers() : 0); | 1962 updateFillImages(oldStyle ? oldStyle->maskLayers() : 0, m_style ? m_style->m
askLayers() : 0); |
1964 | 1963 |
1965 updateImage(oldStyle ? oldStyle->borderImage().image() : 0, m_style ? m_styl
e->borderImage().image() : 0); | 1964 updateImage(oldStyle ? oldStyle->borderImage().image() : 0, m_style ? m_styl
e->borderImage().image() : 0); |
1966 updateImage(oldStyle ? oldStyle->maskBoxImage().image() : 0, m_style ? m_sty
le->maskBoxImage().image() : 0); | 1965 updateImage(oldStyle ? oldStyle->maskBoxImage().image() : 0, m_style ? m_sty
le->maskBoxImage().image() : 0); |
1967 | 1966 |
1968 updateShapeImage(oldStyle ? oldStyle->shapeOutside() : 0, m_style ? m_style-
>shapeOutside() : 0); | 1967 updateShapeImage(oldStyle ? oldStyle->shapeOutside() : 0, m_style ? m_style-
>shapeOutside() : 0); |
1969 | 1968 |
1970 bool doesNotNeedLayout = !m_parent || isText(); | 1969 bool doesNotNeedLayout = !m_parent || isText(); |
1971 | 1970 |
1972 styleDidChange(diff, oldStyle.get()); | 1971 styleDidChange(diff, oldStyle.get()); |
1973 | 1972 |
1974 // FIXME: |this| might be destroyed here. This can currently happen for a Re
nderTextFragment when | 1973 // FIXME: |this| might be destroyed here. This can currently happen for a Re
nderTextFragment when |
1975 // its first-letter block gets an update in RenderTextFragment::styleDidChan
ge. For RenderTextFragment(s), | 1974 // its first-letter block gets an update in RenderTextFragment::styleDidChan
ge. For RenderTextFragment(s), |
1976 // we will safely bail out with the doesNotNeedLayout flag. We might want to
broaden this condition | 1975 // we will safely bail out with the doesNotNeedLayout flag. We might want to
broaden this condition |
1977 // in the future as we move renderer changes out of layout and into style ch
anges. | 1976 // in the future as we move renderer changes out of layout and into style ch
anges. |
1978 if (doesNotNeedLayout) | 1977 if (doesNotNeedLayout) |
1979 return; | 1978 return; |
1980 | 1979 |
1981 // Now that the layer (if any) has been updated, we need to adjust the diff
again, | 1980 // Now that the layer (if any) has been updated, we need to adjust the diff
again, |
1982 // check whether we should layout now, and decide if we need to repaint. | 1981 // check whether we should layout now, and decide if we need to repaint. |
1983 StyleDifference updatedDiff = adjustStyleDifference(diff, contextSensitivePr
operties); | 1982 StyleDifference updatedDiff = adjustStyleDifference(diff); |
1984 | 1983 |
1985 if (diff <= StyleDifferenceLayoutPositionedMovementOnly) { | 1984 if (updatedDiff.needsFullLayout()) { |
1986 if (updatedDiff == StyleDifferenceLayout) | 1985 if (!diff.needsFullLayout()) |
1987 setNeedsLayoutAndPrefWidthsRecalc(); | 1986 setNeedsLayoutAndPrefWidthsRecalc(); |
1988 else if (updatedDiff == StyleDifferenceLayoutPositionedMovementOnly) | 1987 } else { |
| 1988 if (updatedDiff.needsSimplifiedLayout() && !diff.needsSimplifiedLayout()
) |
| 1989 setNeedsSimplifiedNormalFlowLayout(); |
| 1990 if (updatedDiff.needsPositionedMovementLayout() && !diff.needsPositioned
MovementLayout()) |
1989 setNeedsPositionedMovementLayout(); | 1991 setNeedsPositionedMovementLayout(); |
1990 else if (updatedDiff == StyleDifferenceSimplifiedLayoutAndPositionedMove
ment) { | |
1991 setNeedsPositionedMovementLayout(); | |
1992 setNeedsSimplifiedNormalFlowLayout(); | |
1993 } else if (updatedDiff == StyleDifferenceSimplifiedLayout) | |
1994 setNeedsSimplifiedNormalFlowLayout(); | |
1995 } | 1992 } |
1996 | 1993 |
1997 if (updatedDiff == StyleDifferenceRepaint || updatedDiff == StyleDifferenceR
epaintLayer) { | 1994 // FIXME: For now if needsFullLayout() or needsSimplifiedLayout(), repaint i
s handled during layout(), |
| 1995 // so don't repaint here to avoid duplicate repaints. |
| 1996 // Need to optimize repaint during layout() to reduce unnecessary repaints a
nd duplicate code. |
| 1997 if (updatedDiff.needsRepaintSelf() && !updatedDiff.needsFullLayout() && !upd
atedDiff.needsSimplifiedLayout()) { |
1998 // Do a repaint with the new style now, e.g., for example if we go from | 1998 // Do a repaint with the new style now, e.g., for example if we go from |
1999 // not having an outline to having an outline. | 1999 // not having an outline to having an outline. |
2000 repaint(); | 2000 repaint(); |
2001 } | 2001 } |
2002 } | 2002 } |
2003 | 2003 |
2004 static inline bool rendererHasBackground(const RenderObject* renderer) | 2004 static inline bool rendererHasBackground(const RenderObject* renderer) |
2005 { | 2005 { |
2006 return renderer && renderer->hasBackground(); | 2006 return renderer && renderer->hasBackground(); |
2007 } | 2007 } |
(...skipping 13 matching lines...) Expand all Loading... |
2021 } | 2021 } |
2022 | 2022 |
2023 // Keep layer hierarchy visibility bits up to date if visibility changes
. | 2023 // Keep layer hierarchy visibility bits up to date if visibility changes
. |
2024 if (m_style->visibility() != newStyle.visibility()) { | 2024 if (m_style->visibility() != newStyle.visibility()) { |
2025 // We might not have an enclosing layer yet because we might not be
in the tree. | 2025 // We might not have an enclosing layer yet because we might not be
in the tree. |
2026 if (RenderLayer* layer = enclosingLayer()) { | 2026 if (RenderLayer* layer = enclosingLayer()) { |
2027 if (newStyle.visibility() == VISIBLE) { | 2027 if (newStyle.visibility() == VISIBLE) { |
2028 layer->setHasVisibleContent(); | 2028 layer->setHasVisibleContent(); |
2029 } else if (layer->hasVisibleContent() && (this == layer->rendere
r() || layer->renderer()->style()->visibility() != VISIBLE)) { | 2029 } else if (layer->hasVisibleContent() && (this == layer->rendere
r() || layer->renderer()->style()->visibility() != VISIBLE)) { |
2030 layer->dirtyVisibleContentStatus(); | 2030 layer->dirtyVisibleContentStatus(); |
2031 if (diff > StyleDifferenceRepaintLayer) | 2031 if (diff.needsLayout()) |
2032 repaint(); | 2032 repaint(); |
2033 } | 2033 } |
2034 } | 2034 } |
2035 } | 2035 } |
2036 | 2036 |
2037 if (m_parent && diff == StyleDifferenceRepaint) | 2037 // FIXME: For now if needsFullLayout() or needsSimplifiedLayout(), repai
nt is handled during layout(), |
| 2038 // so don't repaint here to avoid duplicate repaints. |
| 2039 // Need to optimize repaint during layout() to reduce unnecessary repain
ts and duplicate code. |
| 2040 if (m_parent && diff.needsRepaintSelf() && !diff.needsFullLayout() && !d
iff.needsSimplifiedLayout()) |
2038 repaint(); | 2041 repaint(); |
| 2042 |
2039 if (isFloating() && (m_style->floating() != newStyle.floating())) | 2043 if (isFloating() && (m_style->floating() != newStyle.floating())) |
2040 // For changes in float styles, we need to conceivably remove oursel
ves | 2044 // For changes in float styles, we need to conceivably remove oursel
ves |
2041 // from the floating objects list. | 2045 // from the floating objects list. |
2042 toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists(); | 2046 toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists(); |
2043 else if (isOutOfFlowPositioned() && (m_style->position() != newStyle.pos
ition())) | 2047 else if (isOutOfFlowPositioned() && (m_style->position() != newStyle.pos
ition())) |
2044 // For changes in positioning styles, we need to conceivably remove
ourselves | 2048 // For changes in positioning styles, we need to conceivably remove
ourselves |
2045 // from the positioned objects list. | 2049 // from the positioned objects list. |
2046 toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists(); | 2050 toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists(); |
2047 | 2051 |
2048 s_affectsParentBlock = isFloatingOrOutOfFlowPositioned() | 2052 s_affectsParentBlock = isFloatingOrOutOfFlowPositioned() |
2049 && (!newStyle.isFloating() && !newStyle.hasOutOfFlowPosition()) | 2053 && (!newStyle.isFloating() && !newStyle.hasOutOfFlowPosition()) |
2050 && parent() && (parent()->isRenderBlockFlow() || parent()->isRenderI
nline()); | 2054 && parent() && (parent()->isRenderBlockFlow() || parent()->isRenderI
nline()); |
2051 | 2055 |
2052 // Clearing these bits is required to avoid leaving stale renderers. | 2056 // Clearing these bits is required to avoid leaving stale renderers. |
2053 // FIXME: We shouldn't need that hack if our logic was totally correct. | 2057 // FIXME: We shouldn't need that hack if our logic was totally correct. |
2054 if (diff == StyleDifferenceLayout || diff == StyleDifferenceLayoutPositi
onedMovementOnly) { | 2058 if (diff.needsLayout()) { |
2055 setFloating(false); | 2059 setFloating(false); |
2056 clearPositionedState(); | 2060 clearPositionedState(); |
2057 } | 2061 } |
2058 } else | 2062 } else { |
2059 s_affectsParentBlock = false; | 2063 s_affectsParentBlock = false; |
| 2064 } |
2060 | 2065 |
2061 if (view()->frameView()) { | 2066 if (view()->frameView()) { |
2062 bool shouldBlitOnFixedBackgroundImage = false; | 2067 bool shouldBlitOnFixedBackgroundImage = false; |
2063 #if ENABLE(FAST_MOBILE_SCROLLING) | 2068 #if ENABLE(FAST_MOBILE_SCROLLING) |
2064 // On low-powered/mobile devices, preventing blitting on a scroll can ca
use noticeable delays | 2069 // On low-powered/mobile devices, preventing blitting on a scroll can ca
use noticeable delays |
2065 // when scrolling a page with a fixed background image. As an optimizati
on, assuming there are | 2070 // when scrolling a page with a fixed background image. As an optimizati
on, assuming there are |
2066 // no fixed positoned elements on the page, we can acclerate scrolling (
via blitting) if we | 2071 // no fixed positoned elements on the page, we can acclerate scrolling (
via blitting) if we |
2067 // ignore the CSS property "background-attachment: fixed". | 2072 // ignore the CSS property "background-attachment: fixed". |
2068 shouldBlitOnFixedBackgroundImage = true; | 2073 shouldBlitOnFixedBackgroundImage = true; |
2069 #endif | 2074 #endif |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2117 } | 2122 } |
2118 | 2123 |
2119 void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
yle) | 2124 void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
yle) |
2120 { | 2125 { |
2121 if (s_affectsParentBlock) | 2126 if (s_affectsParentBlock) |
2122 handleDynamicFloatPositionChange(); | 2127 handleDynamicFloatPositionChange(); |
2123 | 2128 |
2124 if (!m_parent) | 2129 if (!m_parent) |
2125 return; | 2130 return; |
2126 | 2131 |
2127 if (diff == StyleDifferenceLayout || diff == StyleDifferenceSimplifiedLayout
) { | 2132 if (diff.needsFullLayout() || diff.needsSimplifiedLayout()) { |
2128 RenderCounter::rendererStyleChanged(*this, oldStyle, m_style.get()); | 2133 RenderCounter::rendererStyleChanged(*this, oldStyle, m_style.get()); |
2129 | 2134 |
2130 // If the object already needs layout, then setNeedsLayout won't do | 2135 // If the object already needs layout, then setNeedsLayout won't do |
2131 // any work. But if the containing block has changed, then we may need | 2136 // any work. But if the containing block has changed, then we may need |
2132 // to mark the new containing blocks for layout. The change that can | 2137 // to mark the new containing blocks for layout. The change that can |
2133 // directly affect the containing block of this object is a change to | 2138 // directly affect the containing block of this object is a change to |
2134 // the position style. | 2139 // the position style. |
2135 if (needsLayout() && oldStyle->position() != m_style->position()) | 2140 if (needsLayout() && oldStyle->position() != m_style->position()) |
2136 markContainingBlocksForLayout(); | 2141 markContainingBlocksForLayout(); |
2137 | 2142 |
2138 if (diff == StyleDifferenceLayout) | 2143 if (diff.needsFullLayout()) |
2139 setNeedsLayoutAndPrefWidthsRecalc(); | 2144 setNeedsLayoutAndPrefWidthsRecalc(); |
2140 else | 2145 else |
2141 setNeedsSimplifiedNormalFlowLayout(); | 2146 setNeedsSimplifiedNormalFlowLayout(); |
2142 } else if (diff == StyleDifferenceSimplifiedLayoutAndPositionedMovement) { | 2147 } |
2143 setNeedsPositionedMovementLayout(); | 2148 if (diff.needsPositionedMovementLayout()) |
2144 setNeedsSimplifiedNormalFlowLayout(); | |
2145 } else if (diff == StyleDifferenceLayoutPositionedMovementOnly) | |
2146 setNeedsPositionedMovementLayout(); | 2149 setNeedsPositionedMovementLayout(); |
2147 | 2150 |
2148 // Don't check for repaint here; we need to wait until the layer has been | 2151 // Don't check for repaint here; we need to wait until the layer has been |
2149 // updated by subclasses before we know if we have to repaint (in setStyle()
). | 2152 // updated by subclasses before we know if we have to repaint (in setStyle()
). |
2150 | 2153 |
2151 if (oldStyle && !areCursorsEqual(oldStyle, style())) { | 2154 if (oldStyle && !areCursorsEqual(oldStyle, style())) { |
2152 if (LocalFrame* frame = this->frame()) | 2155 if (LocalFrame* frame = this->frame()) |
2153 frame->eventHandler().scheduleCursorUpdate(); | 2156 frame->eventHandler().scheduleCursorUpdate(); |
2154 } | 2157 } |
2155 } | 2158 } |
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3367 { | 3370 { |
3368 if (object1) { | 3371 if (object1) { |
3369 const WebCore::RenderObject* root = object1; | 3372 const WebCore::RenderObject* root = object1; |
3370 while (root->parent()) | 3373 while (root->parent()) |
3371 root = root->parent(); | 3374 root = root->parent(); |
3372 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3375 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3373 } | 3376 } |
3374 } | 3377 } |
3375 | 3378 |
3376 #endif | 3379 #endif |
OLD | NEW |