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

Side by Side Diff: Source/WebCore/dom/NodeRenderingContext.cpp

Issue 13792002: Fix <dialog> centering (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
7 * Copyright (C) 2011 Google Inc. All rights reserved. 7 * Copyright (C) 2011 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 { 73 {
74 } 74 }
75 75
76 static bool isRendererReparented(const RenderObject* renderer) 76 static bool isRendererReparented(const RenderObject* renderer)
77 { 77 {
78 if (!renderer->node()->isElementNode()) 78 if (!renderer->node()->isElementNode())
79 return false; 79 return false;
80 if (renderer->style() && !renderer->style()->flowThread().isEmpty()) 80 if (renderer->style() && !renderer->style()->flowThread().isEmpty())
81 return true; 81 return true;
82 #if ENABLE(DIALOG_ELEMENT) 82 #if ENABLE(DIALOG_ELEMENT)
83 if (toElement(renderer->node())->isInTopLayer()) 83 if (renderer->isDialog())
84 return true; 84 return true;
85 #endif 85 #endif
86 return false; 86 return false;
87 } 87 }
88 88
89 RenderObject* NodeRenderingContext::nextRenderer() const 89 RenderObject* NodeRenderingContext::nextRenderer() const
90 { 90 {
91 if (RenderObject* renderer = m_node->renderer()) 91 if (RenderObject* renderer = m_node->renderer())
92 return renderer->nextSibling(); 92 return renderer->nextSibling();
93 93
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 return 0; 148 return 0;
149 } 149 }
150 150
151 RenderObject* NodeRenderingContext::parentRenderer() const 151 RenderObject* NodeRenderingContext::parentRenderer() const
152 { 152 {
153 if (RenderObject* renderer = m_node->renderer()) 153 if (RenderObject* renderer = m_node->renderer())
154 return renderer->parent(); 154 return renderer->parent();
155 155
156 #if ENABLE(DIALOG_ELEMENT) 156 #if ENABLE(DIALOG_ELEMENT)
157 if (m_node->isElementNode() && toElement(m_node)->isInTopLayer()) { 157 if (m_node->hasTagName(dialogTag)) {
esprehn 2013/04/09 02:24:31 This is just for testing right?
falken 2013/04/09 02:30:26 Kind of. There's an idea to make the containing bl
158 // The parent renderer of top layer elements is the RenderView, but only 158 // The parent renderer of top layer elements is the RenderView, but only
159 // if the normal parent would have had a renderer. 159 // if the normal parent would have had a renderer.
160 // FIXME: This behavior isn't quite right as the spec for top layer 160 // FIXME: This behavior isn't quite right as the spec for top layer
161 // only talks about display: none ancestors so putting a <dialog> inside 161 // only talks about display: none ancestors so putting a <dialog> inside
162 // an <optgroup> seems like it should still work even though this check 162 // an <optgroup> seems like it should still work even though this check
163 // will prevent it. 163 // will prevent it.
164 if (!m_renderingParent || !m_renderingParent->renderer()) 164 if (!m_renderingParent || !m_renderingParent->renderer())
165 return 0; 165 return 0;
166 return m_node->document()->renderView(); 166 return m_node->document()->renderView();
167 } 167 }
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 newRenderer->setFlowThreadState(parentRenderer->flowThreadState()); 314 newRenderer->setFlowThreadState(parentRenderer->flowThreadState());
315 315
316 RenderObject* nextRenderer = this->nextRenderer(); 316 RenderObject* nextRenderer = this->nextRenderer();
317 textNode->setRenderer(newRenderer); 317 textNode->setRenderer(newRenderer);
318 // Parent takes care of the animations, no need to call setAnimatableStyle. 318 // Parent takes care of the animations, no need to call setAnimatableStyle.
319 newRenderer->setStyle(m_style.release()); 319 newRenderer->setStyle(m_style.release());
320 parentRenderer->addChild(newRenderer, nextRenderer); 320 parentRenderer->addChild(newRenderer, nextRenderer);
321 } 321 }
322 322
323 } 323 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698