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

Unified Diff: Source/WebCore/rendering/RenderBox.cpp

Issue 10756009: Merge 120862 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/rendering/RenderBlock.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderBox.cpp
===================================================================
--- Source/WebCore/rendering/RenderBox.cpp (revision 122126)
+++ Source/WebCore/rendering/RenderBox.cpp (working copy)
@@ -249,24 +249,17 @@
{
clearOverrideSize();
- RenderStyle* styleToUse = style();
- if (styleToUse && (styleToUse->logicalHeight().isPercent() || styleToUse->logicalMinHeight().isPercent() || styleToUse->logicalMaxHeight().isPercent()))
- RenderBlock::removePercentHeightDescendant(this);
+ if (style()) {
+ RenderBlock::removePercentHeightDescendantIfNeeded(this);
- if (styleToUse) {
if (RenderView* view = this->view()) {
if (FrameView* frameView = view->frameView()) {
- if (styleToUse->position() == FixedPosition)
+ if (style()->position() == FixedPosition)
frameView->removeFixedObject();
}
}
}
- // If the following assertion fails, logicalHeight()/logicalMinHeight()/
- // logicalMaxHeight() values are changed from a percent value to a non-percent
- // value during laying out. It causes a use-after-free bug.
- ASSERT(!RenderBlock::hasPercentHeightDescendant(this));
-
RenderBoxModelObject::willBeDestroyed();
}
@@ -347,12 +340,16 @@
void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
+ // Horizontal writing mode definition is updated in RenderBoxModelObject::updateBoxModelInfoFromStyle,
+ // (as part of the RenderBoxModelObject::styleDidChange call below). So, we can safely cache the horizontal
+ // writing mode value before style change here.
+ bool oldHorizontalWritingMode = isHorizontalWritingMode();
+
RenderBoxModelObject::styleDidChange(diff, oldStyle);
RenderStyle* newStyle = style();
if (needsLayout() && oldStyle) {
- if (oldStyle && (oldStyle->logicalHeight().isPercent() || oldStyle->logicalMinHeight().isPercent() || oldStyle->logicalMaxHeight().isPercent()))
- RenderBlock::removePercentHeightDescendant(this);
+ RenderBlock::removePercentHeightDescendantIfNeeded(this);
// Normally we can do optimized positioning layout for absolute/fixed positioned objects. There is one special case, however, which is
// when the positioned object's margin-before is changed. In this case the parent has to get a layout in order to run margin collapsing
@@ -362,6 +359,10 @@
parent()->setChildNeedsLayout(true);
}
+ if (RenderBlock::hasPercentHeightContainerMap() && firstChild()
+ && oldHorizontalWritingMode != isHorizontalWritingMode())
+ RenderBlock::clearPercentHeightDescendantsFrom(this);
+
// If our zoom factor changes and we have a defined scrollLeft/Top, we need to adjust that value into the
// new zoomed coordinate space.
if (hasOverflowClip() && oldStyle && newStyle && oldStyle->effectiveZoom() != newStyle->effectiveZoom()) {
« no previous file with comments | « Source/WebCore/rendering/RenderBlock.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698