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

Side by Side Diff: Source/core/svg/SVGLengthContext.cpp

Issue 1166683003: Handle SVGLength resolving in an inactive document gracefully (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
« no previous file with comments | « LayoutTests/svg/dom/SVGLength-value-in-inactive-document-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) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2007 Apple Inc. All rights reserved.
5 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 if (!context) 58 if (!context)
59 return nullptr; 59 return nullptr;
60 60
61 const ContainerNode* currentContext = context; 61 const ContainerNode* currentContext = context;
62 do { 62 do {
63 if (currentContext->layoutObject()) 63 if (currentContext->layoutObject())
64 return currentContext->layoutObject()->style(); 64 return currentContext->layoutObject()->style();
65 currentContext = currentContext->parentNode(); 65 currentContext = currentContext->parentNode();
66 } while (currentContext); 66 } while (currentContext);
67 67
68 // There must be at least a LayoutSVGRoot layoutObject, carrying a style. 68 // We can end up here if trying to resolve values for elements in an
69 ASSERT_NOT_REACHED(); 69 // inactive document.
70 return nullptr; 70 return nullptr;
71 } 71 }
72 72
73 static const ComputedStyle* rootElementStyle(const Node* context) 73 static const ComputedStyle* rootElementStyle(const Node* context)
74 { 74 {
75 if (!context) 75 if (!context)
76 return nullptr; 76 return nullptr;
77 77
78 const Document& document = context->document(); 78 const Document& document = context->document();
79 Node* documentElement = document.documentElement(); 79 Node* documentElement = document.documentElement();
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 348
349 const SVGSVGElement& svg = toSVGSVGElement(*viewportElement); 349 const SVGSVGElement& svg = toSVGSVGElement(*viewportElement);
350 viewportSize = svg.currentViewBoxRect().size(); 350 viewportSize = svg.currentViewBoxRect().size();
351 if (viewportSize.isEmpty()) 351 if (viewportSize.isEmpty())
352 viewportSize = svg.currentViewportSize(); 352 viewportSize = svg.currentViewportSize();
353 353
354 return true; 354 return true;
355 } 355 }
356 356
357 } 357 }
OLDNEW
« no previous file with comments | « LayoutTests/svg/dom/SVGLength-value-in-inactive-document-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698