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

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

Issue 9250028: Merge 104328 - [CSSRegions]Crash while collecting svg elements in render flow thread. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 11 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
« no previous file with comments | « LayoutTests/fast/regions/svg-root-element-collected-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 18 matching lines...) Expand all
29 #include "ContainerNode.h" 29 #include "ContainerNode.h"
30 #include "Node.h" 30 #include "Node.h"
31 #include "RenderFlowThread.h" 31 #include "RenderFlowThread.h"
32 #include "RenderFullScreen.h" 32 #include "RenderFullScreen.h"
33 #include "RenderObject.h" 33 #include "RenderObject.h"
34 #include "RenderView.h" 34 #include "RenderView.h"
35 #include "ShadowContentElement.h" 35 #include "ShadowContentElement.h"
36 #include "ShadowInclusionSelector.h" 36 #include "ShadowInclusionSelector.h"
37 #include "ShadowRoot.h" 37 #include "ShadowRoot.h"
38 38
39 #if ENABLE(SVG)
40 #include "SVGNames.h"
41 #endif
42
39 namespace WebCore { 43 namespace WebCore {
40 44
41 NodeRenderingContext::NodeRenderingContext(Node* node) 45 NodeRenderingContext::NodeRenderingContext(Node* node)
42 : m_location(LocationNotInTree) 46 : m_location(LocationNotInTree)
43 , m_phase(AttachStraight) 47 , m_phase(AttachStraight)
44 , m_node(node) 48 , m_node(node)
45 , m_parentNodeForRenderingAndStyle(0) 49 , m_parentNodeForRenderingAndStyle(0)
46 , m_visualParentShadowRoot(0) 50 , m_visualParentShadowRoot(0)
47 , m_includer(0) 51 , m_includer(0)
48 , m_style(0) 52 , m_style(0)
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 return false; 274 return false;
271 275
272 return true; 276 return true;
273 } 277 }
274 278
275 void NodeRenderingContext::moveToFlowThreadIfNeeded() 279 void NodeRenderingContext::moveToFlowThreadIfNeeded()
276 { 280 {
277 if (!m_node->isElementNode() || !m_style || m_style->flowThread().isEmpty()) 281 if (!m_node->isElementNode() || !m_style || m_style->flowThread().isEmpty())
278 return; 282 return;
279 283
284 #if ENABLE(SVG)
285 // Allow only svg root elements to be directly collected by a render flow th read.
286 if (m_node->isSVGElement()
287 && (!(m_node->hasTagName(SVGNames::svgTag) && m_node->parentNode() && !m _node->parentNode()->isSVGElement())))
288 return;
289 #endif
290
280 m_flowThread = m_style->flowThread(); 291 m_flowThread = m_style->flowThread();
281 ASSERT(m_node->document()->renderView()); 292 ASSERT(m_node->document()->renderView());
282 m_parentFlowRenderer = m_node->document()->renderView()->renderFlowThreadWit hName(m_flowThread); 293 m_parentFlowRenderer = m_node->document()->renderView()->renderFlowThreadWit hName(m_flowThread);
283 } 294 }
284 295
285 NodeRendererFactory::NodeRendererFactory(Node* node) 296 NodeRendererFactory::NodeRendererFactory(Node* node)
286 : m_context(node) 297 : m_context(node)
287 { 298 {
288 } 299 }
289 300
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 #endif 355 #endif
345 356
346 if (!newRenderer) 357 if (!newRenderer)
347 return; 358 return;
348 359
349 // Note: Adding newRenderer instead of renderer(). renderer() may be a child of newRenderer. 360 // Note: Adding newRenderer instead of renderer(). renderer() may be a child of newRenderer.
350 parentRenderer->addChild(newRenderer, nextRenderer); 361 parentRenderer->addChild(newRenderer, nextRenderer);
351 } 362 }
352 363
353 } 364 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/regions/svg-root-element-collected-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698