 Chromium Code Reviews
 Chromium Code Reviews Issue 14373010:
  Make abspos <dialog>'s containing block be the ICB.  (Closed) 
  Base URL: svn://svn.chromium.org/blink/trunk
    
  
    Issue 14373010:
  Make abspos <dialog>'s containing block be the ICB.  (Closed) 
  Base URL: svn://svn.chromium.org/blink/trunk| Index: Source/core/html/HTMLDialogElement.cpp | 
| diff --git a/Source/core/html/HTMLDialogElement.cpp b/Source/core/html/HTMLDialogElement.cpp | 
| index 52718b342ab5b461b3d70542b19dc0b81c1d3652..6533aa2085fd494786219dc4253c1c937d1e15f2 100644 | 
| --- a/Source/core/html/HTMLDialogElement.cpp | 
| +++ b/Source/core/html/HTMLDialogElement.cpp | 
| @@ -92,13 +92,10 @@ void HTMLDialogElement::positionAndReattach() | 
| // FIXME: Figure out what to do in vertical writing mode. | 
| FrameView* frameView = document()->view(); | 
| int scrollTop = frameView->scrollOffset().height(); | 
| - FloatPoint absolutePoint(0, scrollTop); | 
| int visibleHeight = frameView->visibleContentRect(ScrollableArea::IncludeScrollbars).height(); | 
| + m_top = scrollTop; | 
| if (box->height() < visibleHeight) | 
| - absolutePoint.move(0, (visibleHeight - box->height()) / 2); | 
| - FloatPoint localPoint = box->containingBlock()->absoluteToLocal(absolutePoint); | 
| - | 
| - m_top = localPoint.y(); | 
| + m_top += (visibleHeight - box->height()) / 2; | 
| m_topIsValid = true; | 
| // FIXME: It's inefficient to reattach here. We could do better by mutating style directly and forcing another layout. | 
| @@ -134,4 +131,11 @@ bool HTMLDialogElement::isPresentationAttribute(const QualifiedName& name) const | 
| return HTMLElement::isPresentationAttribute(name); | 
| } | 
| +bool HTMLDialogElement::shouldBeReparentedUnderRenderView(const RenderStyle* style) const | 
| +{ | 
| + if (style && style->position() == AbsolutePosition) | 
| 
Julien - ping for review
2013/05/10 21:04:56
This should probably be needsCenteredPositioning t
 
falken
2013/05/13 03:04:56
needsCenteredPositioning only returns true for aut
 | 
| + return true; | 
| + return Element::shouldBeReparentedUnderRenderView(style); | 
| +} | 
| + | 
| } // namespace WebCore |