Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 renderers. | 277 if (style.preserveNewline()) // pre/pre-wrap/pre-line always make renderers. |
| 278 return true; | 278 return true; |
| 279 | 279 |
| 280 // childNeedsDistributionRecalc() here is rare, only happens JS calling surr oundContents() etc. from DOMNodeInsertedIntoDocument etc. | |
| 281 if (document().childNeedsDistributionRecalc()) | |
|
hayato
2015/01/23 04:06:30
Could you help me to understand why it is okay to
kojii
2015/01/23 04:23:13
In short, this fix disables a non-essential memory
| |
| 282 return true; | |
| 283 | |
| 280 const RenderObject* prev = NodeRenderingTraversal::previousSiblingRenderer(* this); | 284 const RenderObject* prev = NodeRenderingTraversal::previousSiblingRenderer(* this); |
| 281 if (prev && prev->isBR()) // <span><br/> <br/></span> | 285 if (prev && prev->isBR()) // <span><br/> <br/></span> |
| 282 return false; | 286 return false; |
| 283 | 287 |
| 284 if (parent.isRenderInline()) { | 288 if (parent.isRenderInline()) { |
| 285 // <span><div/> <div/></span> | 289 // <span><div/> <div/></span> |
| 286 if (prev && !prev->isInline()) | 290 if (prev && !prev->isInline()) |
| 287 return false; | 291 return false; |
| 288 } else { | 292 } else { |
| 289 if (parent.isRenderBlock() && !parent.childrenInline() && (!prev || !pre v->isInline())) | 293 if (parent.isRenderBlock() && !parent.childrenInline() && (!prev || !pre v->isInline())) |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 418 result.appendLiteral("; "); | 422 result.appendLiteral("; "); |
| 419 result.appendLiteral("value="); | 423 result.appendLiteral("value="); |
| 420 result.append(s); | 424 result.append(s); |
| 421 } | 425 } |
| 422 | 426 |
| 423 strncpy(buffer, result.toString().utf8().data(), length - 1); | 427 strncpy(buffer, result.toString().utf8().data(), length - 1); |
| 424 } | 428 } |
| 425 #endif | 429 #endif |
| 426 | 430 |
| 427 } // namespace blink | 431 } // namespace blink |
| OLD | NEW |