Index: Source/core/rendering/RenderView.cpp |
diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp |
index ce1337f524085b151bc79e5ad652c10ea8e81b9f..3ceb2faf9bbf3bfb16a088df82e005f10d5c1bb2 100644 |
--- a/Source/core/rendering/RenderView.cpp |
+++ b/Source/core/rendering/RenderView.cpp |
@@ -119,8 +119,7 @@ bool RenderView::isChildAllowed(RenderObject* child, RenderStyle*) const |
static bool canCenterDialog(const RenderStyle* style) |
{ |
- // FIXME: We must center for FixedPosition as well. |
- return style->position() == AbsolutePosition && style->hasAutoTopAndBottom(); |
+ return (style->position() == AbsolutePosition || style->position() == FixedPosition) && style->hasAutoTopAndBottom(); |
} |
void RenderView::positionDialog(RenderBox* box) |
@@ -140,9 +139,8 @@ void RenderView::positionDialog(RenderBox* box) |
return; |
} |
FrameView* frameView = document().view(); |
- int scrollTop = frameView->scrollOffset().height(); |
+ LayoutUnit top = (box->style()->position() == FixedPosition) ? 0 : frameView->scrollOffset().height(); |
int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(); |
- LayoutUnit top = scrollTop; |
if (box->height() < visibleHeight) |
top += (visibleHeight - box->height()) / 2; |
box->setY(top); |