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

Side by Side Diff: Source/core/dom/Text.cpp

Issue 1166653005: Don't create layout objects for pre-wrap text nodes in SVG (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/text/white-space-pre-wrap-whitespace-only-crash-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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 267
268 if (style.display() == NONE) 268 if (style.display() == NONE)
269 return false; 269 return false;
270 270
271 if (!containsOnlyWhitespace()) 271 if (!containsOnlyWhitespace())
272 return true; 272 return true;
273 273
274 if (!canHaveWhitespaceChildren(parent)) 274 if (!canHaveWhitespaceChildren(parent))
275 return false; 275 return false;
276 276
277 if (style.preserveNewline()) // pre/pre-wrap/pre-line always make layoutObje cts. 277 // pre-wrap in SVG never makes layoutObject.
278 if (style.whiteSpace() == PRE_WRAP && parent.isSVG())
279 return false;
280
281 // pre/pre-wrap/pre-line always make layoutObjects.
282 if (style.preserveNewline())
278 return true; 283 return true;
279 284
280 // childNeedsDistributionRecalc() here is rare, only happens JS calling surr oundContents() etc. from DOMNodeInsertedIntoDocument etc. 285 // childNeedsDistributionRecalc() here is rare, only happens JS calling surr oundContents() etc. from DOMNodeInsertedIntoDocument etc.
281 if (document().childNeedsDistributionRecalc()) 286 if (document().childNeedsDistributionRecalc())
282 return true; 287 return true;
283 288
284 const LayoutObject* prev = LayoutTreeBuilderTraversal::previousSiblingLayout Object(*this); 289 const LayoutObject* prev = LayoutTreeBuilderTraversal::previousSiblingLayout Object(*this);
285 if (prev && prev->isBR()) // <span><br/> <br/></span> 290 if (prev && prev->isBR()) // <span><br/> <br/></span>
286 return false; 291 return false;
287 292
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 result.appendLiteral("; "); 432 result.appendLiteral("; ");
428 result.appendLiteral("value="); 433 result.appendLiteral("value=");
429 result.append(s); 434 result.append(s);
430 } 435 }
431 436
432 strncpy(buffer, result.toString().utf8().data(), length - 1); 437 strncpy(buffer, result.toString().utf8().data(), length - 1);
433 } 438 }
434 #endif 439 #endif
435 440
436 } // namespace blink 441 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/svg/text/white-space-pre-wrap-whitespace-only-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698