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 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1875 // Text nodes share style with their parents but transforms don't apply
to them, | 1875 // Text nodes share style with their parents but transforms don't apply
to them, |
1876 // hence the !isText() check. | 1876 // hence the !isText() check. |
1877 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer(
)->hasDirectReasonsForCompositing())) | 1877 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer(
)->hasDirectReasonsForCompositing())) |
1878 diff.setNeedsRepaintLayer(); | 1878 diff.setNeedsRepaintLayer(); |
1879 else | 1879 else |
1880 diff.setNeedsRecompositeLayer(); | 1880 diff.setNeedsRecompositeLayer(); |
1881 } | 1881 } |
1882 | 1882 |
1883 // If opacity or zIndex changed, and the layer does not paint into its own s
eparate backing, then we need to repaint (also | 1883 // If opacity or zIndex changed, and the layer does not paint into its own s
eparate backing, then we need to repaint (also |
1884 // ignoring text nodes) | 1884 // ignoring text nodes) |
1885 if ((contextSensitiveProperties & (ContextSensitivePropertyOpacity | Context
SensitivePropertyZIndex)) && !diff.needsLayout()) { | 1885 if (contextSensitiveProperties & (ContextSensitivePropertyOpacity | ContextS
ensitivePropertyZIndex)) { |
1886 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer(
)->hasDirectReasonsForCompositing())) | 1886 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer(
)->hasDirectReasonsForCompositing())) |
1887 diff.setNeedsRepaintLayer(); | 1887 diff.setNeedsRepaintLayer(); |
1888 else | 1888 else |
1889 diff.setNeedsRecompositeLayer(); | 1889 diff.setNeedsRecompositeLayer(); |
1890 } | 1890 } |
1891 | 1891 |
1892 // 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. | 1892 // 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. |
1893 if ((contextSensitiveProperties & ContextSensitivePropertyFilter) && hasLaye
r() && !diff.needsLayout()) { | 1893 if ((contextSensitiveProperties & ContextSensitivePropertyFilter) && hasLaye
r()) { |
1894 RenderLayer* layer = toRenderLayerModelObject(this)->layer(); | 1894 RenderLayer* layer = toRenderLayerModelObject(this)->layer(); |
1895 if (!layer->hasDirectReasonsForCompositing() || layer->paintsWithFilters
()) | 1895 if (!layer->hasDirectReasonsForCompositing() || layer->paintsWithFilters
()) |
1896 diff.setNeedsRepaintLayer(); | 1896 diff.setNeedsRepaintLayer(); |
1897 else | 1897 else |
1898 diff.setNeedsRecompositeLayer(); | 1898 diff.setNeedsRecompositeLayer(); |
1899 } | 1899 } |
1900 | 1900 |
1901 if ((contextSensitiveProperties & ContextSensitivePropertyTextOrColor) && !d
iff.needsRepaint() && !diff.needsLayout() | 1901 if ((contextSensitiveProperties & ContextSensitivePropertyTextOrColor) && !d
iff.needsRepaint() |
1902 && hasImmediateNonWhitespaceTextChildOrPropertiesDependentOnColor()) | 1902 && hasImmediateNonWhitespaceTextChildOrPropertiesDependentOnColor()) |
1903 diff.setNeedsRepaintObject(); | 1903 diff.setNeedsRepaintObject(); |
1904 | 1904 |
1905 // The answer to layerTypeRequired() for plugins, iframes, and canvas can ch
ange without the actual | 1905 // The answer to layerTypeRequired() for plugins, iframes, and canvas can ch
ange without the actual |
1906 // style changing, since it depends on whether we decide to composite these
elements. When the | 1906 // style changing, since it depends on whether we decide to composite these
elements. When the |
1907 // layer status of one of these elements changes, we need to force a layout. | 1907 // layer status of one of these elements changes, we need to force a layout. |
1908 if (diff.hasNoChange() && style() && isLayerModelObject()) { | 1908 if (!diff.needsFullLayout() && style() && isLayerModelObject()) { |
1909 bool requiresLayer = toRenderLayerModelObject(this)->layerTypeRequired()
!= NoLayer; | 1909 bool requiresLayer = toRenderLayerModelObject(this)->layerTypeRequired()
!= NoLayer; |
1910 if (hasLayer() != requiresLayer) | 1910 if (hasLayer() != requiresLayer) |
1911 diff.setNeedsFullLayout(); | 1911 diff.setNeedsFullLayout(); |
1912 } | 1912 } |
1913 | 1913 |
1914 // If we have no layer(), just treat a RepaintLayer hint as a normal Repaint
. | 1914 // If we have no layer(), just treat a RepaintLayer hint as a normal Repaint
. |
1915 if (diff.needsRepaintLayer() && !hasLayer()) { | 1915 if (diff.needsRepaintLayer() && !hasLayer()) { |
1916 diff.clearNeedsRepaint(); | 1916 diff.clearNeedsRepaint(); |
1917 diff.setNeedsRepaintObject(); | 1917 diff.setNeedsRepaintObject(); |
1918 } | 1918 } |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2023 setNeedsPositionedMovementLayout(); | 2023 setNeedsPositionedMovementLayout(); |
2024 } | 2024 } |
2025 | 2025 |
2026 if (contextSensitiveProperties & ContextSensitivePropertyTransform && !needs
Layout()) { | 2026 if (contextSensitiveProperties & ContextSensitivePropertyTransform && !needs
Layout()) { |
2027 if (RenderBlock* container = containingBlock()) | 2027 if (RenderBlock* container = containingBlock()) |
2028 container->setNeedsOverflowRecalcAfterStyleChange(); | 2028 container->setNeedsOverflowRecalcAfterStyleChange(); |
2029 if (isBox()) | 2029 if (isBox()) |
2030 toRenderBox(this)->updateLayerTransform(); | 2030 toRenderBox(this)->updateLayerTransform(); |
2031 } | 2031 } |
2032 | 2032 |
2033 if (updatedDiff.needsRepaint()) { | 2033 // FIXME: The !needsFullLayout() check is temporary to keep the original Sty
leDifference |
| 2034 // behavior that we did't repaint here on StyleDifferenceLayout. |
| 2035 // In the next steps we will not always repaint on selfNeedsLayout(), and sh
ould force |
| 2036 // repaint here if needsRepaint is set. |
| 2037 if (updatedDiff.needsRepaint() && !updatedDiff.needsFullLayout()) { |
2034 // Do a repaint with the new style now, e.g., for example if we go from | 2038 // Do a repaint with the new style now, e.g., for example if we go from |
2035 // not having an outline to having an outline. | 2039 // not having an outline to having an outline. |
2036 repaint(); | 2040 repaint(); |
2037 } | 2041 } |
2038 } | 2042 } |
2039 | 2043 |
2040 static inline bool rendererHasBackground(const RenderObject* renderer) | 2044 static inline bool rendererHasBackground(const RenderObject* renderer) |
2041 { | 2045 { |
2042 return renderer && renderer->hasBackground(); | 2046 return renderer && renderer->hasBackground(); |
2043 } | 2047 } |
(...skipping 19 matching lines...) Expand all Loading... |
2063 if (newStyle.visibility() == VISIBLE) { | 2067 if (newStyle.visibility() == VISIBLE) { |
2064 layer->setHasVisibleContent(); | 2068 layer->setHasVisibleContent(); |
2065 } else if (layer->hasVisibleContent() && (this == layer->rendere
r() || layer->renderer()->style()->visibility() != VISIBLE)) { | 2069 } else if (layer->hasVisibleContent() && (this == layer->rendere
r() || layer->renderer()->style()->visibility() != VISIBLE)) { |
2066 layer->dirtyVisibleContentStatus(); | 2070 layer->dirtyVisibleContentStatus(); |
2067 if (diff.needsLayout()) | 2071 if (diff.needsLayout()) |
2068 repaint(); | 2072 repaint(); |
2069 } | 2073 } |
2070 } | 2074 } |
2071 } | 2075 } |
2072 | 2076 |
2073 if (m_parent && diff.needsRepaintObjectOnly()) | 2077 // FIXME: The !needsFullLayout() check is temporary to keep the original
StyleDifference |
| 2078 // behavior that we did't repaint here on StyleDifferenceLayout. |
| 2079 // In the next steps we will not always repaint on selfNeedsLayout(), an
d should force |
| 2080 // repaint here if needsRepaintObject is set. |
| 2081 if (m_parent && diff.needsRepaintObject() && !diff.needsFullLayout()) |
2074 repaint(); | 2082 repaint(); |
| 2083 |
2075 if (isFloating() && (m_style->floating() != newStyle.floating())) | 2084 if (isFloating() && (m_style->floating() != newStyle.floating())) |
2076 // For changes in float styles, we need to conceivably remove oursel
ves | 2085 // For changes in float styles, we need to conceivably remove oursel
ves |
2077 // from the floating objects list. | 2086 // from the floating objects list. |
2078 toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists(); | 2087 toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists(); |
2079 else if (isOutOfFlowPositioned() && (m_style->position() != newStyle.pos
ition())) | 2088 else if (isOutOfFlowPositioned() && (m_style->position() != newStyle.pos
ition())) |
2080 // For changes in positioning styles, we need to conceivably remove
ourselves | 2089 // For changes in positioning styles, we need to conceivably remove
ourselves |
2081 // from the positioned objects list. | 2090 // from the positioned objects list. |
2082 toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists(); | 2091 toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists(); |
2083 | 2092 |
2084 s_affectsParentBlock = isFloatingOrOutOfFlowPositioned() | 2093 s_affectsParentBlock = isFloatingOrOutOfFlowPositioned() |
2085 && (!newStyle.isFloating() && !newStyle.hasOutOfFlowPosition()) | 2094 && (!newStyle.isFloating() && !newStyle.hasOutOfFlowPosition()) |
2086 && parent() && (parent()->isRenderBlockFlow() || parent()->isRenderI
nline()); | 2095 && parent() && (parent()->isRenderBlockFlow() || parent()->isRenderI
nline()); |
2087 | 2096 |
2088 // Clearing these bits is required to avoid leaving stale renderers. | 2097 // Clearing these bits is required to avoid leaving stale renderers. |
2089 // FIXME: We shouldn't need that hack if our logic was totally correct. | 2098 // FIXME: We shouldn't need that hack if our logic was totally correct. |
2090 if (diff.needsFullLayout() || diff.needsPositionedMovementLayout()) { | 2099 if (diff.needsLayout()) { |
2091 setFloating(false); | 2100 setFloating(false); |
2092 clearPositionedState(); | 2101 clearPositionedState(); |
2093 } | 2102 } |
2094 } else { | 2103 } else { |
2095 s_affectsParentBlock = false; | 2104 s_affectsParentBlock = false; |
2096 } | 2105 } |
2097 | 2106 |
2098 if (view()->frameView()) { | 2107 if (view()->frameView()) { |
2099 bool shouldBlitOnFixedBackgroundImage = false; | 2108 bool shouldBlitOnFixedBackgroundImage = false; |
2100 #if ENABLE(FAST_MOBILE_SCROLLING) | 2109 #if ENABLE(FAST_MOBILE_SCROLLING) |
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3409 { | 3418 { |
3410 if (object1) { | 3419 if (object1) { |
3411 const WebCore::RenderObject* root = object1; | 3420 const WebCore::RenderObject* root = object1; |
3412 while (root->parent()) | 3421 while (root->parent()) |
3413 root = root->parent(); | 3422 root = root->parent(); |
3414 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3423 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3415 } | 3424 } |
3416 } | 3425 } |
3417 | 3426 |
3418 #endif | 3427 #endif |
OLD | NEW |