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

Unified Diff: Source/core/html/HTMLDialogElement.cpp

Issue 14373010: Make abspos <dialog>'s containing block be the ICB. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review comments Created 7 years, 7 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/core/html/HTMLDialogElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/html/HTMLDialogElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698