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

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

Issue 211613002: [repaint-after-layout] Skip full repaint if the style difference is layout. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 138 }
139 139
140 void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyl e) 140 void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyl e)
141 { 141 {
142 RenderStyle* oldStyle = style(); 142 RenderStyle* oldStyle = style();
143 if (oldStyle) { 143 if (oldStyle) {
144 // The background of the root element or the body element could propagat e up to 144 // The background of the root element or the body element could propagat e up to
145 // the canvas. Just dirty the entire canvas when our style changes subs tantially. 145 // the canvas. Just dirty the entire canvas when our style changes subs tantially.
146 if (diff >= StyleDifferenceRepaint && node() && 146 if (diff >= StyleDifferenceRepaint && node() &&
147 (isHTMLHtmlElement(*node()) || isHTMLBodyElement(*node()))) { 147 (isHTMLHtmlElement(*node()) || isHTMLBodyElement(*node()))) {
148 view()->repaint(); 148
149 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled() || diff != StyleDifferenceLayout)
150 view()->repaint();
149 151
150 if (oldStyle->hasEntirelyFixedBackground() != newStyle->hasEntirelyF ixedBackground()) 152 if (oldStyle->hasEntirelyFixedBackground() != newStyle->hasEntirelyF ixedBackground())
151 view()->compositor()->rootFixedBackgroundsChanged(); 153 view()->compositor()->rootFixedBackgroundsChanged();
152 } 154 }
153 155
154 // When a layout hint happens and an object's position style changes, we have to do a layout 156 // When a layout hint happens and an object's position style changes, we have to do a layout
155 // to dirty the render tree using the old position value now. 157 // to dirty the render tree using the old position value now.
156 if (diff == StyleDifferenceLayout && parent() && oldStyle->position() != newStyle->position()) { 158 if (diff == StyleDifferenceLayout && parent() && oldStyle->position() != newStyle->position()) {
157 markContainingBlocksForLayout(); 159 markContainingBlocksForLayout();
158 if (oldStyle->position() == StaticPosition) 160 if (oldStyle->position() == StaticPosition)
(...skipping 4531 matching lines...) Expand 10 before | Expand all | Expand 10 after
4690 return 0; 4692 return 0;
4691 4693
4692 if (!layoutState && !flowThreadContainingBlock()) 4694 if (!layoutState && !flowThreadContainingBlock())
4693 return 0; 4695 return 0;
4694 4696
4695 RenderBlock* containerBlock = containingBlock(); 4697 RenderBlock* containerBlock = containingBlock();
4696 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); 4698 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop();
4697 } 4699 }
4698 4700
4699 } // namespace WebCore 4701 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698