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

Side by Side Diff: Source/core/rendering/svg/RenderSVGRoot.cpp

Issue 99663004: Avoid layout/full-repaint on view height change if possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Protect the feature with a runtime flag Created 7 years 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) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. 5 * Copyright (C) 2009 Google, Inc.
6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 return m_containerSize.height(); 166 return m_containerSize.height();
167 167
168 if (style()->logicalHeight().isSpecified() || style()->logicalMaxHeight().is Specified()) 168 if (style()->logicalHeight().isSpecified() || style()->logicalMaxHeight().is Specified())
169 return RenderReplaced::computeReplacedLogicalHeight(); 169 return RenderReplaced::computeReplacedLogicalHeight();
170 170
171 if (svg->heightAttributeEstablishesViewport()) { 171 if (svg->heightAttributeEstablishesViewport()) {
172 Length height = svg->intrinsicHeight(SVGSVGElement::IgnoreCSSProperties) ; 172 Length height = svg->intrinsicHeight(SVGSVGElement::IgnoreCSSProperties) ;
173 if (height.isPercent()) { 173 if (height.isPercent()) {
174 RenderBlock* cb = containingBlock(); 174 RenderBlock* cb = containingBlock();
175 ASSERT(cb); 175 ASSERT(cb);
176 while (cb->isAnonymous()) { 176 while (cb->isAnonymous())
177 cb = cb->containingBlock(); 177 cb = cb->containingBlock();
178 cb->addPercentHeightDescendant(const_cast<RenderSVGRoot*>(this)) ; 178 cb->addPercentHeightDescendant(const_cast<RenderSVGRoot*>(this));
ojan 2013/12/18 00:48:20 Ditto the other comment. Don't see why this is cor
179 }
180 } else 179 } else
181 RenderBlock::removePercentHeightDescendant(const_cast<RenderSVGRoot* >(this)); 180 RenderBlock::removePercentHeightDescendant(const_cast<RenderSVGRoot* >(this));
182 181
183 return resolveLengthAttributeForSVG(height, style()->effectiveZoom(), co ntainingBlock()->availableLogicalHeight(IncludeMarginBorderPadding), view()); 182 return resolveLengthAttributeForSVG(height, style()->effectiveZoom(), co ntainingBlock()->availableLogicalHeight(IncludeMarginBorderPadding), view());
184 } 183 }
185 184
186 // SVG embedded through object/embed/iframe. 185 // SVG embedded through object/embed/iframe.
187 if (isEmbeddedThroughFrameContainingSVGDocument()) 186 if (isEmbeddedThroughFrameContainingSVGDocument())
188 return document().frame()->ownerRenderer()->availableLogicalHeight(Inclu deMarginBorderPadding); 187 return document().frame()->ownerRenderer()->availableLogicalHeight(Inclu deMarginBorderPadding);
189 188
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 444
446 bool RenderSVGRoot::hasRelativeLogicalHeight() const 445 bool RenderSVGRoot::hasRelativeLogicalHeight() const
447 { 446 {
448 SVGSVGElement* svg = toSVGSVGElement(node()); 447 SVGSVGElement* svg = toSVGSVGElement(node());
449 ASSERT(svg); 448 ASSERT(svg);
450 449
451 return svg->intrinsicHeight(SVGSVGElement::IgnoreCSSProperties).isPercent(); 450 return svg->intrinsicHeight(SVGSVGElement::IgnoreCSSProperties).isPercent();
452 } 451 }
453 452
454 } 453 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698