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

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

Issue 9232034: Merge 104183 - Source/WebCore: Crash due to reparenting of relpositioned object under anonymous b... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/912/
Patch Set: Created 8 years, 11 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/RenderObject.cpp
===================================================================
--- Source/WebCore/rendering/RenderObject.cpp (revision 105335)
+++ Source/WebCore/rendering/RenderObject.cpp (working copy)
@@ -717,13 +717,17 @@
o = o->parent();
} else if (!isText() && m_style->position() == AbsolutePosition) {
while (o && (o->style()->position() == StaticPosition || (o->isInline() && !o->isReplaced())) && !o->isRenderView() && !(o->hasTransform() && o->isRenderBlock())) {
- // For relpositioned inlines, we return the nearest enclosing block. We don't try
+ // For relpositioned inlines, we return the nearest non-anonymous enclosing block. We don't try
// to return the inline itself. This allows us to avoid having a positioned objects
// list in all RenderInlines and lets us return a strongly-typed RenderBlock* result
// from this method. The container() method can actually be used to obtain the
// inline directly.
- if (o->style()->position() == RelativePosition && o->isInline() && !o->isReplaced())
- return o->containingBlock();
+ if (o->style()->position() == RelativePosition && o->isInline() && !o->isReplaced()) {
+ RenderBlock* relPositionedInlineContainingBlock = o->containingBlock();
+ while (relPositionedInlineContainingBlock->isAnonymousBlock())
+ relPositionedInlineContainingBlock = relPositionedInlineContainingBlock->containingBlock();
+ return relPositionedInlineContainingBlock;
+ }
#if ENABLE(SVG)
if (o->isSVGForeignObject()) //foreignObject is the containing block for contents inside it
break;
« 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