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

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: Created 7 years, 8 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 d2cc826e3f901716626efd72492a7fcc70976fb5..ae467125d2d1365bdd684c22a19e711e5f9e9452 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())->isReparentedByRenderView(renderer->style()))
return true;
return false;
}
@@ -90,7 +90,11 @@ RenderObject* NodeRenderingContext::nextRenderer() const
return renderer->nextSibling();
Element* element = m_node->isElementNode() ? toElement(m_node) : 0;
- if (element && element->isInTopLayer()) {
+
+ if (element && element->isReparentedByRenderView(m_style.get())) {
+ if (!element->isInTopLayer())
Julien - ping for review 2013/05/01 23:35:48 Why don't you just check isInTopLayer above instea
falken 2013/05/02 13:11:59 If the renderer is reparented, we don't want to ge
Julien - ping for review 2013/05/02 16:27:49 OK, this code is definitely confusing I would say.
falken 2013/05/08 08:13:29 Done.
+ return 0;
+
const Vector<RefPtr<Element> >& topLayerElements = element->document()->topLayerElements();
size_t position = topLayerElements.find(element);
ASSERT(position != notFound);
@@ -123,10 +127,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)->isReparentedByRenderView(m_style.get()));
if (m_parentFlowRenderer)
return m_parentFlowRenderer->previousRendererForNode(m_node);
@@ -147,8 +151,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)->isReparentedByRenderView(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