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

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

Issue 10763003: Merge 120761 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
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 | « LayoutTests/fast/block/positioning/insert-positioned-in-anonymous-crash-expected.txt ('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 122125)
+++ Source/WebCore/rendering/RenderObject.cpp (working copy)
@@ -724,7 +724,11 @@
if (!o && isRenderScrollbarPart())
o = toRenderScrollbarPart(this)->rendererOwningScrollbar();
if (!isText() && m_style->position() == FixedPosition) {
- while (o && !o->isRenderView() && !(o->hasTransform() && o->isRenderBlock())) {
+ while (o) {
+ if (o->isRenderView())
+ break;
+ if (o->hasTransform() && o->isRenderBlock())
+ break;
#if ENABLE(SVG)
// foreignObject is the containing block for its contents.
if (o->isSVGForeignObject())
@@ -732,18 +736,24 @@
#endif
o = o->parent();
}
+ ASSERT(!o->isAnonymousBlock());
} else if (!isText() && m_style->position() == AbsolutePosition) {
- while (o && (o->style()->position() == StaticPosition || (o->isInline() && !o->isReplaced())) && !o->isRenderView() && !(o->hasTransform() && o->isRenderBlock())) {
+ while (o) {
// 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() == StaticPosition && !(o->isInline() && !o->isReplaced()))
+ break;
+ if (o->isRenderView())
+ break;
+ if (o->hasTransform() && o->isRenderBlock())
+ break;
+
if (o->style()->position() == RelativePosition && o->isInline() && !o->isReplaced()) {
- RenderBlock* relPositionedInlineContainingBlock = o->containingBlock();
- while (relPositionedInlineContainingBlock->isAnonymousBlock())
- relPositionedInlineContainingBlock = relPositionedInlineContainingBlock->containingBlock();
- return relPositionedInlineContainingBlock;
+ o = o->containingBlock();
+ break;
}
#if ENABLE(SVG)
if (o->isSVGForeignObject()) //foreignObject is the containing block for contents inside it
@@ -752,6 +762,9 @@
o = o->parent();
}
+
+ while (o && o->isAnonymousBlock())
+ o = o->containingBlock();
} else {
while (o && ((o->isInline() && !o->isReplaced()) || !o->isRenderBlock()))
o = o->parent();
« no previous file with comments | « LayoutTests/fast/block/positioning/insert-positioned-in-anonymous-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698