+2015-03-04 Simon Fraser <simon.fraser@apple.com>
+
+ Clarify RenderElement::adjustStyleDifference()
+ https://bugs.webkit.org/show_bug.cgi?id=142256
+
+ Reviewed by David Hyatt.
+
+ Make RenderElement::adjustStyleDifference() clearer in two ways.
+
+ First, replace lots of if (diff < X) diff = X with
+ diff = std::max(diff, X). I did this even in cases where diff was
+ being set unconditionally, because it's never correct to change the diff
+ to a lesser value.
+
+ Second the "set at least SimplifiedLayout, but if we have PositionedMovementOnly
+ set it to SimplifiedLayoutAndPositionedMovement" was confusingly written.
+
+ * rendering/RenderElement.cpp:
+ (WebCore::RenderElement::adjustStyleDifference):
+
2015-03-04 David Kilzer <ddkilzer@apple.com>
Switch new soft-linking debug asserts to release asserts
{
// If transform changed, and we are not composited, need to do a layout.
if (contextSensitiveProperties & ContextSensitivePropertyTransform) {
- // Text nodes share style with their parents but transforms don't apply to them,
- // hence the !isText() check.
// FIXME: when transforms are taken into account for overflow, we will need to do a layout.
if (!hasLayer() || !downcast<RenderLayerModelObject>(*this).layer()->isComposited()) {
- // We need to set at least SimplifiedLayout, but if PositionedMovementOnly is already set
- // then we actually need SimplifiedLayoutAndPositionedMovement.
if (!hasLayer())
- diff = StyleDifferenceLayout; // FIXME: Do this for now since SimplifiedLayout cannot handle updating floating objects lists.
- else if (diff < StyleDifferenceLayoutPositionedMovementOnly)
- diff = StyleDifferenceSimplifiedLayout;
- else if (diff < StyleDifferenceSimplifiedLayout)
- diff = StyleDifferenceSimplifiedLayoutAndPositionedMovement;
- } else if (diff < StyleDifferenceRecompositeLayer)
- diff = StyleDifferenceRecompositeLayer;
+ diff = std::max(diff, StyleDifferenceLayout);
+ else {
+ // We need to set at least SimplifiedLayout, but if PositionedMovementOnly is already set
+ // then we actually need SimplifiedLayoutAndPositionedMovement.
+ diff = std::max(diff, (diff == StyleDifferenceLayoutPositionedMovementOnly) ? StyleDifferenceSimplifiedLayoutAndPositionedMovement : StyleDifferenceSimplifiedLayout);
+ }
+
+ } else
+ diff = std::max(diff, StyleDifferenceRecompositeLayer);
}
// If opacity changed, and we are not composited, need to repaint (also
// ignoring text nodes)
if (contextSensitiveProperties & ContextSensitivePropertyOpacity) {
if (!hasLayer() || !downcast<RenderLayerModelObject>(*this).layer()->isComposited())
- diff = StyleDifferenceRepaintLayer;
- else if (diff < StyleDifferenceRecompositeLayer)
- diff = StyleDifferenceRecompositeLayer;
+ diff = std::max(diff, StyleDifferenceRepaintLayer);
+ else
+ diff = std::max(diff, StyleDifferenceRecompositeLayer);
}
if ((contextSensitiveProperties & ContextSensitivePropertyFilter) && hasLayer()) {
RenderLayer* layer = downcast<RenderLayerModelObject>(*this).layer();
if (!layer->isComposited() || layer->paintsWithFilters())
- diff = StyleDifferenceRepaintLayer;
- else if (diff < StyleDifferenceRecompositeLayer)
- diff = StyleDifferenceRecompositeLayer;
+ diff = std::max(diff, StyleDifferenceRepaintLayer);
+ else
+ diff = std::max(diff, StyleDifferenceRecompositeLayer);
}
// The answer to requiresLayer() for plugins, iframes, and canvas can change without the actual