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

Side by Side Diff: Source/core/rendering/svg/RenderSVGText.cpp

Issue 176853009: Fix crash in SVGFontFaceElement::associatedFontElement crash when removing SVGFontFaceElement. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed patch conflict Created 6 years, 9 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 | « Source/core/rendering/svg/RenderSVGText.h ('k') | Source/core/svg/SVGFontFaceElement.cpp » ('j') | 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) 2006 Apple Computer, Inc. 2 * Copyright (C) 2006 Apple Computer, Inc.
3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>
4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> 4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
6 * Copyright (C) 2008 Rob Buis <buis@kde.org> 6 * Copyright (C) 2008 Rob Buis <buis@kde.org>
7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved.
9 * Copyright (C) 2012 Google Inc. 9 * Copyright (C) 2012 Google Inc.
10 * 10 *
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 return; 259 return;
260 } 260 }
261 261
262 // This is called immediately after subtreeChildWillBeDestroyed, once the Re nderSVGInlineText::willBeDestroyed() method 262 // This is called immediately after subtreeChildWillBeDestroyed, once the Re nderSVGInlineText::willBeDestroyed() method
263 // passes on to the base class, which removes us from the render tree. At th is point we can update the layout attributes. 263 // passes on to the base class, which removes us from the render tree. At th is point we can update the layout attributes.
264 unsigned size = affectedAttributes.size(); 264 unsigned size = affectedAttributes.size();
265 for (unsigned i = 0; i < size; ++i) 265 for (unsigned i = 0; i < size; ++i)
266 m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(affectedA ttributes[i]->context()); 266 m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(affectedA ttributes[i]->context());
267 } 267 }
268 268
269 void RenderSVGText::subtreeStyleDidChange(RenderSVGInlineText* text) 269 void RenderSVGText::subtreeStyleDidChange()
270 { 270 {
271 ASSERT(text);
272 if (!shouldHandleSubtreeMutations() || documentBeingDestroyed()) 271 if (!shouldHandleSubtreeMutations() || documentBeingDestroyed())
273 return; 272 return;
274 273
275 checkLayoutAttributesConsistency(this, m_layoutAttributes); 274 checkLayoutAttributesConsistency(this, m_layoutAttributes);
276 275
277 // Only update the metrics cache, but not the text positioning element cache 276 // Only update the metrics cache, but not the text positioning element cache
278 // nor the layout attributes cached in the leaf #text renderers. 277 // nor the layout attributes cached in the leaf #text renderers.
279 FontCachePurgePreventer fontCachePurgePreventer; 278 FontCachePurgePreventer fontCachePurgePreventer;
280 for (RenderObject* descendant = text; descendant; descendant = descendant->n extInPreOrder(text)) { 279 for (RenderObject* descendant = firstChild(); descendant; descendant = desce ndant->nextInPreOrder(this)) {
281 if (descendant->isSVGInlineText()) 280 if (descendant->isSVGInlineText())
282 m_layoutAttributesBuilder.rebuildMetricsForTextRenderer(toRenderSVGI nlineText(descendant)); 281 m_layoutAttributesBuilder.rebuildMetricsForTextRenderer(toRenderSVGI nlineText(descendant));
283 } 282 }
284 } 283 }
285 284
286 void RenderSVGText::subtreeTextDidChange(RenderSVGInlineText* text) 285 void RenderSVGText::subtreeTextDidChange(RenderSVGInlineText* text)
287 { 286 {
288 ASSERT(text); 287 ASSERT(text);
289 ASSERT(!beingDestroyed()); 288 ASSERT(!beingDestroyed());
290 if (!everHadLayout()) { 289 if (!everHadLayout()) {
(...skipping 24 matching lines...) Expand all
315 RenderSVGInlineText* text = toRenderSVGInlineText(descendant); 314 RenderSVGInlineText* text = toRenderSVGInlineText(descendant);
316 text->updateScaledFont(); 315 text->updateScaledFont();
317 if (builder) 316 if (builder)
318 builder->rebuildMetricsForTextRenderer(text); 317 builder->rebuildMetricsForTextRenderer(text);
319 } 318 }
320 } 319 }
321 320
322 void RenderSVGText::layout() 321 void RenderSVGText::layout()
323 { 322 {
324 ASSERT(needsLayout()); 323 ASSERT(needsLayout());
324
325 subtreeStyleDidChange();
326
325 LayoutRectRecorder recorder(*this); 327 LayoutRectRecorder recorder(*this);
326 LayoutRepainter repainter(*this, SVGRenderSupport::checkForSVGRepaintDuringL ayout(this)); 328 LayoutRepainter repainter(*this, SVGRenderSupport::checkForSVGRepaintDuringL ayout(this));
327 329
328 bool updateCachedBoundariesInParents = false; 330 bool updateCachedBoundariesInParents = false;
329 if (m_needsTransformUpdate) { 331 if (m_needsTransformUpdate) {
330 m_localTransform = toSVGTextElement(node())->animatedLocalTransform(); 332 m_localTransform = toSVGTextElement(node())->animatedLocalTransform();
331 m_needsTransformUpdate = false; 333 m_needsTransformUpdate = false;
332 updateCachedBoundariesInParents = true; 334 updateCachedBoundariesInParents = true;
333 } 335 }
334 336
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 return 0; 539 return 0;
538 } 540 }
539 541
540 // Fix for <rdar://problem/8048875>. We should not render :first-letter CSS Styl e 542 // Fix for <rdar://problem/8048875>. We should not render :first-letter CSS Styl e
541 // in a SVG text element context. 543 // in a SVG text element context.
542 void RenderSVGText::updateFirstLetter() 544 void RenderSVGText::updateFirstLetter()
543 { 545 {
544 } 546 }
545 547
546 } 548 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGText.h ('k') | Source/core/svg/SVGFontFaceElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698