| 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 1926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1937 StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff) const | 1937 StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff) const |
| 1938 { | 1938 { |
| 1939 if (diff.transformChanged() && isSVG()) | 1939 if (diff.transformChanged() && isSVG()) |
| 1940 diff.setNeedsFullLayout(); | 1940 diff.setNeedsFullLayout(); |
| 1941 | 1941 |
| 1942 // If transform changed, and the layer does not paint into its own separate
backing, then we need to invalidate paints. | 1942 // If transform changed, and the layer does not paint into its own separate
backing, then we need to invalidate paints. |
| 1943 if (diff.transformChanged()) { | 1943 if (diff.transformChanged()) { |
| 1944 // Text nodes share style with their parents but transforms don't apply
to them, | 1944 // Text nodes share style with their parents but transforms don't apply
to them, |
| 1945 // hence the !isText() check. | 1945 // hence the !isText() check. |
| 1946 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer(
)->hasStyleDeterminedDirectCompositingReasons())) | 1946 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer(
)->hasStyleDeterminedDirectCompositingReasons())) |
| 1947 diff.setNeedsRepaintLayer(); | 1947 diff.setNeedsPaintInvalidationLayer(); |
| 1948 } | 1948 } |
| 1949 | 1949 |
| 1950 // If opacity or zIndex changed, and the layer does not paint into its own s
eparate backing, then we need to invalidate paints (also | 1950 // If opacity or zIndex changed, and the layer does not paint into its own s
eparate backing, then we need to invalidate paints (also |
| 1951 // ignoring text nodes) | 1951 // ignoring text nodes) |
| 1952 if (diff.opacityChanged() || diff.zIndexChanged()) { | 1952 if (diff.opacityChanged() || diff.zIndexChanged()) { |
| 1953 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer(
)->hasStyleDeterminedDirectCompositingReasons())) | 1953 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer(
)->hasStyleDeterminedDirectCompositingReasons())) |
| 1954 diff.setNeedsRepaintLayer(); | 1954 diff.setNeedsPaintInvalidationLayer(); |
| 1955 } | 1955 } |
| 1956 | 1956 |
| 1957 // If filter changed, and the layer does not paint into its own separate bac
king or it paints with filters, then we need to invalidate paints. | 1957 // If filter changed, and the layer does not paint into its own separate bac
king or it paints with filters, then we need to invalidate paints. |
| 1958 if (diff.filterChanged() && hasLayer()) { | 1958 if (diff.filterChanged() && hasLayer()) { |
| 1959 RenderLayer* layer = toRenderLayerModelObject(this)->layer(); | 1959 RenderLayer* layer = toRenderLayerModelObject(this)->layer(); |
| 1960 if (!layer->hasStyleDeterminedDirectCompositingReasons() || layer->paint
sWithFilters()) | 1960 if (!layer->hasStyleDeterminedDirectCompositingReasons() || layer->paint
sWithFilters()) |
| 1961 diff.setNeedsRepaintLayer(); | 1961 diff.setNeedsPaintInvalidationLayer(); |
| 1962 } | 1962 } |
| 1963 | 1963 |
| 1964 if (diff.textOrColorChanged() && !diff.needsRepaint() | 1964 if (diff.textOrColorChanged() && !diff.needsPaintInvalidation() |
| 1965 && hasImmediateNonWhitespaceTextChildOrPropertiesDependentOnColor()) | 1965 && hasImmediateNonWhitespaceTextChildOrPropertiesDependentOnColor()) |
| 1966 diff.setNeedsRepaintObject(); | 1966 diff.setNeedsPaintInvalidationObject(); |
| 1967 | 1967 |
| 1968 // The answer to layerTypeRequired() for plugins, iframes, and canvas can ch
ange without the actual | 1968 // The answer to layerTypeRequired() for plugins, iframes, and canvas can ch
ange without the actual |
| 1969 // style changing, since it depends on whether we decide to composite these
elements. When the | 1969 // style changing, since it depends on whether we decide to composite these
elements. When the |
| 1970 // layer status of one of these elements changes, we need to force a layout. | 1970 // layer status of one of these elements changes, we need to force a layout. |
| 1971 if (!diff.needsFullLayout() && style() && isLayerModelObject()) { | 1971 if (!diff.needsFullLayout() && style() && isLayerModelObject()) { |
| 1972 bool requiresLayer = toRenderLayerModelObject(this)->layerTypeRequired()
!= NoLayer; | 1972 bool requiresLayer = toRenderLayerModelObject(this)->layerTypeRequired()
!= NoLayer; |
| 1973 if (hasLayer() != requiresLayer) | 1973 if (hasLayer() != requiresLayer) |
| 1974 diff.setNeedsFullLayout(); | 1974 diff.setNeedsFullLayout(); |
| 1975 } | 1975 } |
| 1976 | 1976 |
| 1977 // If we have no layer(), just treat a RepaintLayer hint as a normal paint i
nvalidation. | 1977 // If we have no layer(), just treat a PaintInvalidationLayer hint as a norm
al paint invalidation. |
| 1978 if (diff.needsRepaintLayer() && !hasLayer()) { | 1978 if (diff.needsPaintInvalidationLayer() && !hasLayer()) { |
| 1979 diff.clearNeedsRepaint(); | 1979 diff.clearNeedsPaintInvalidation(); |
| 1980 diff.setNeedsRepaintObject(); | 1980 diff.setNeedsPaintInvalidationObject(); |
| 1981 } | 1981 } |
| 1982 | 1982 |
| 1983 return diff; | 1983 return diff; |
| 1984 } | 1984 } |
| 1985 | 1985 |
| 1986 void RenderObject::setPseudoStyle(PassRefPtr<RenderStyle> pseudoStyle) | 1986 void RenderObject::setPseudoStyle(PassRefPtr<RenderStyle> pseudoStyle) |
| 1987 { | 1987 { |
| 1988 ASSERT(pseudoStyle->styleType() == BEFORE || pseudoStyle->styleType() == AFT
ER); | 1988 ASSERT(pseudoStyle->styleType() == BEFORE || pseudoStyle->styleType() == AFT
ER); |
| 1989 | 1989 |
| 1990 // FIXME: We should consider just making all pseudo items use an inherited s
tyle. | 1990 // FIXME: We should consider just making all pseudo items use an inherited s
tyle. |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2083 setNeedsLayoutAndPrefWidthsRecalc(); | 2083 setNeedsLayoutAndPrefWidthsRecalc(); |
| 2084 else if (updatedDiff.needsPositionedMovementLayout()) | 2084 else if (updatedDiff.needsPositionedMovementLayout()) |
| 2085 setNeedsPositionedMovementLayout(); | 2085 setNeedsPositionedMovementLayout(); |
| 2086 } | 2086 } |
| 2087 | 2087 |
| 2088 if (diff.transformChanged() && !needsLayout()) { | 2088 if (diff.transformChanged() && !needsLayout()) { |
| 2089 if (RenderBlock* container = containingBlock()) | 2089 if (RenderBlock* container = containingBlock()) |
| 2090 container->setNeedsOverflowRecalcAfterStyleChange(); | 2090 container->setNeedsOverflowRecalcAfterStyleChange(); |
| 2091 } | 2091 } |
| 2092 | 2092 |
| 2093 if (updatedDiff.needsRepaintLayer()) | 2093 if (updatedDiff.needsPaintInvalidationLayer()) |
| 2094 toRenderLayerModelObject(this)->layer()->setShouldDoFullPaintInvalidatio
nIncludingNonCompositingDescendants(); | 2094 toRenderLayerModelObject(this)->layer()->setShouldDoFullPaintInvalidatio
nIncludingNonCompositingDescendants(); |
| 2095 else if (diff.needsRepaintObject() || updatedDiff.needsRepaintObject()) | 2095 else if (diff.needsPaintInvalidationObject() || updatedDiff.needsPaintInvali
dationObject()) |
| 2096 setShouldDoFullPaintInvalidation(true); | 2096 setShouldDoFullPaintInvalidation(true); |
| 2097 } | 2097 } |
| 2098 | 2098 |
| 2099 static inline bool rendererHasBackground(const RenderObject* renderer) | 2099 static inline bool rendererHasBackground(const RenderObject* renderer) |
| 2100 { | 2100 { |
| 2101 return renderer && renderer->hasBackground(); | 2101 return renderer && renderer->hasBackground(); |
| 2102 } | 2102 } |
| 2103 | 2103 |
| 2104 void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle& newS
tyle) | 2104 void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle& newS
tyle) |
| 2105 { | 2105 { |
| (...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3470 { | 3470 { |
| 3471 if (object1) { | 3471 if (object1) { |
| 3472 const blink::RenderObject* root = object1; | 3472 const blink::RenderObject* root = object1; |
| 3473 while (root->parent()) | 3473 while (root->parent()) |
| 3474 root = root->parent(); | 3474 root = root->parent(); |
| 3475 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3475 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
| 3476 } | 3476 } |
| 3477 } | 3477 } |
| 3478 | 3478 |
| 3479 #endif | 3479 #endif |
| OLD | NEW |