Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: Source/core/rendering/RenderObject.cpp

Issue 241113004: Incorrect invalidation on Google Forum (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1839 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // We need to set at least SimplifiedLayout, but if PositionedMoveme ntOnly is already set
1855 // then we actually need SimplifiedLayoutAndPositionedMovement. 1855 // then we actually need SimplifiedLayoutAndPositionedMovement.
1856 if (!hasLayer()) 1856 if (!hasLayer())
1857 diff = StyleDifferenceLayout; // FIXME: Do this for now since Si mplifiedLayout cannot handle updating floating objects lists. 1857 diff = StyleDifferenceLayout; // FIXME: Do this for now since Si mplifiedLayout cannot handle updating floating objects lists.
1858 else if (diff < StyleDifferenceLayoutPositionedMovementOnly) 1858 else if (diff < StyleDifferenceLayoutPositionedMovementOnly)
1859 diff = StyleDifferenceSimplifiedLayout; 1859 diff = StyleDifferenceSimplifiedLayout;
1860 else if (diff < StyleDifferenceSimplifiedLayout)
1861 diff = StyleDifferenceSimplifiedLayoutAndPositionedMovement;
1862 } else if (diff < StyleDifferenceRecompositeLayer) 1860 } else if (diff < StyleDifferenceRecompositeLayer)
1863 diff = StyleDifferenceRecompositeLayer; 1861 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 filters changed, and the layer does not paint into its own separate backing, then we need to repaint (also
1867 // ignoring text nodes) 1865 // ignoring text nodes)
1868 if (contextSensitiveProperties & ContextSensitivePropertyOpacity && diff <= StyleDifferenceRepaintLayer) { 1866 if (contextSensitiveProperties & ContextSensitivePropertyOpacity && diff <= StyleDifferenceRepaintLayer) {
1869 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer( )->hasDirectReasonsForCompositing())) 1867 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer( )->hasDirectReasonsForCompositing()))
1870 diff = StyleDifferenceRepaintLayer; 1868 diff = StyleDifferenceRepaintLayer;
1871 else if (diff < StyleDifferenceRecompositeLayer) 1869 else if (diff < StyleDifferenceRecompositeLayer)
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1980 1978
1981 // Now that the layer (if any) has been updated, we need to adjust the diff again, 1979 // 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. 1980 // check whether we should layout now, and decide if we need to repaint.
1983 StyleDifference updatedDiff = adjustStyleDifference(diff, contextSensitivePr operties); 1981 StyleDifference updatedDiff = adjustStyleDifference(diff, contextSensitivePr operties);
1984 1982
1985 if (diff <= StyleDifferenceLayoutPositionedMovementOnly) { 1983 if (diff <= StyleDifferenceLayoutPositionedMovementOnly) {
1986 if (updatedDiff == StyleDifferenceLayout) 1984 if (updatedDiff == StyleDifferenceLayout)
1987 setNeedsLayoutAndPrefWidthsRecalc(); 1985 setNeedsLayoutAndPrefWidthsRecalc();
1988 else if (updatedDiff == StyleDifferenceLayoutPositionedMovementOnly) 1986 else if (updatedDiff == StyleDifferenceLayoutPositionedMovementOnly)
1989 setNeedsPositionedMovementLayout(); 1987 setNeedsPositionedMovementLayout();
1990 else if (updatedDiff == StyleDifferenceSimplifiedLayoutAndPositionedMove ment) { 1988 else if (updatedDiff == StyleDifferenceSimplifiedLayout)
1991 setNeedsPositionedMovementLayout();
1992 setNeedsSimplifiedNormalFlowLayout();
1993 } else if (updatedDiff == StyleDifferenceSimplifiedLayout)
1994 setNeedsSimplifiedNormalFlowLayout(); 1989 setNeedsSimplifiedNormalFlowLayout();
1995 } 1990 }
1996 1991
1997 if (updatedDiff == StyleDifferenceRepaint || updatedDiff == StyleDifferenceR epaintLayer) { 1992 if (updatedDiff == StyleDifferenceRepaint || updatedDiff == StyleDifferenceR epaintLayer) {
1998 // Do a repaint with the new style now, e.g., for example if we go from 1993 // 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. 1994 // not having an outline to having an outline.
2000 repaint(); 1995 repaint();
2001 } 1996 }
2002 } 1997 }
2003 1998
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
2132 // to mark the new containing blocks for layout. The change that can 2127 // 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 2128 // directly affect the containing block of this object is a change to
2134 // the position style. 2129 // the position style.
2135 if (needsLayout() && oldStyle->position() != m_style->position()) 2130 if (needsLayout() && oldStyle->position() != m_style->position())
2136 markContainingBlocksForLayout(); 2131 markContainingBlocksForLayout();
2137 2132
2138 if (diff == StyleDifferenceLayout) 2133 if (diff == StyleDifferenceLayout)
2139 setNeedsLayoutAndPrefWidthsRecalc(); 2134 setNeedsLayoutAndPrefWidthsRecalc();
2140 else 2135 else
2141 setNeedsSimplifiedNormalFlowLayout(); 2136 setNeedsSimplifiedNormalFlowLayout();
2142 } else if (diff == StyleDifferenceSimplifiedLayoutAndPositionedMovement) {
2143 setNeedsPositionedMovementLayout();
2144 setNeedsSimplifiedNormalFlowLayout();
2145 } else if (diff == StyleDifferenceLayoutPositionedMovementOnly) 2137 } else if (diff == StyleDifferenceLayoutPositionedMovementOnly)
2146 setNeedsPositionedMovementLayout(); 2138 setNeedsPositionedMovementLayout();
2147 2139
2148 // Don't check for repaint here; we need to wait until the layer has been 2140 // 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() ). 2141 // updated by subclasses before we know if we have to repaint (in setStyle() ).
2150 2142
2151 if (oldStyle && !areCursorsEqual(oldStyle, style())) { 2143 if (oldStyle && !areCursorsEqual(oldStyle, style())) {
2152 if (LocalFrame* frame = this->frame()) 2144 if (LocalFrame* frame = this->frame())
2153 frame->eventHandler().scheduleCursorUpdate(); 2145 frame->eventHandler().scheduleCursorUpdate();
2154 } 2146 }
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after
3367 { 3359 {
3368 if (object1) { 3360 if (object1) {
3369 const WebCore::RenderObject* root = object1; 3361 const WebCore::RenderObject* root = object1;
3370 while (root->parent()) 3362 while (root->parent())
3371 root = root->parent(); 3363 root = root->parent();
3372 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3364 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3373 } 3365 }
3374 } 3366 }
3375 3367
3376 #endif 3368 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698