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

Unified Diff: Source/core/dom/NodeRenderingContext.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
Index: Source/core/dom/NodeRenderingContext.cpp
diff --git a/Source/core/dom/NodeRenderingContext.cpp b/Source/core/dom/NodeRenderingContext.cpp
index aca7e5f678957806584ebd4a7f6f2f5bb89b0497..e871b8958c1fd95233c176c20071f8c6da4c634a 100644
--- a/Source/core/dom/NodeRenderingContext.cpp
+++ b/Source/core/dom/NodeRenderingContext.cpp
@@ -79,7 +79,7 @@ static bool isRendererReparented(const RenderObject* renderer)
return false;
if (renderer->style() && !renderer->style()->flowThread().isEmpty())
return true;
- if (toElement(renderer->node())->isInTopLayer())
+ if (toElement(renderer->node())->shouldBeReparentedUnderRenderView(renderer->style()))
return true;
return false;
}
@@ -90,6 +90,8 @@ RenderObject* NodeRenderingContext::nextRenderer() const
return renderer->nextSibling();
Element* element = m_node->isElementNode() ? toElement(m_node) : 0;
+ if (element && element->shouldBeReparentedUnderRenderView(m_style.get()) && !element->isInTopLayer())
Julien - ping for review 2013/05/09 18:46:58 I misled you here. I was thinking about checking e
falken 2013/05/10 05:50:25 I see now how the code is confusing and probably d
+ return 0;
if (element && element->isInTopLayer()) {
const Vector<RefPtr<Element> >& topLayerElements = element->document()->topLayerElements();
size_t position = topLayerElements.find(element);
@@ -123,10 +125,10 @@ RenderObject* NodeRenderingContext::previousRenderer() const
if (RenderObject* renderer = m_node->renderer())
return renderer->previousSibling();
- // FIXME: This doesn't work correctly for things in the top layer that are
+ // FIXME: This doesn't work correctly for reparented elements that are
// display: none. We'd need to duplicate the logic in nextRenderer, but since
// nothing needs that yet just assert.
- ASSERT(!m_node->isElementNode() || !toElement(m_node)->isInTopLayer());
+ ASSERT(!m_node->isElementNode() || !toElement(m_node)->shouldBeReparentedUnderRenderView(m_style.get()));
if (m_parentFlowRenderer)
return m_parentFlowRenderer->previousRendererForNode(m_node);
@@ -147,8 +149,8 @@ RenderObject* NodeRenderingContext::parentRenderer() const
if (RenderObject* renderer = m_node->renderer())
return renderer->parent();
- if (m_node->isElementNode() && toElement(m_node)->isInTopLayer()) {
- // The parent renderer of top layer elements is the RenderView, but only
+ if (m_node->isElementNode() && toElement(m_node)->shouldBeReparentedUnderRenderView(m_style.get())) {
+ // The parent renderer of reparented elements is the RenderView, but only
// if the normal parent would have had a renderer.
// FIXME: This behavior isn't quite right as the spec for top layer
// only talks about display: none ancestors so putting a <dialog> inside

Powered by Google App Engine
This is Rietveld 408576698