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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 bool onlyWS = containsOnlyWhitespace(); | 209 bool onlyWS = containsOnlyWhitespace(); |
210 if (!onlyWS) | 210 if (!onlyWS) |
211 return true; | 211 return true; |
212 | 212 |
213 RenderObject* parent = context.parentRenderer(); | 213 RenderObject* parent = context.parentRenderer(); |
214 if (parent->isTable() || parent->isTableRow() || parent->isTableSection() ||
parent->isRenderTableCol() || parent->isFrameSet()) | 214 if (parent->isTable() || parent->isTableRow() || parent->isTableSection() ||
parent->isRenderTableCol() || parent->isFrameSet()) |
215 return false; | 215 return false; |
216 | 216 |
217 if (context.style()->preserveNewline()) // pre/pre-wrap/pre-line always make
renderers. | 217 if (context.style()->preserveNewline()) // pre/pre-wrap/pre-line always make
renderers. |
218 return true; | 218 return true; |
219 | 219 |
| 220 // FIXME: We should resolve this function's dependencies on next and previou
s renderers |
| 221 // lazily to avoid potentially N^2 walks through the DOM. |
220 RenderObject* prev = context.previousRenderer(); | 222 RenderObject* prev = context.previousRenderer(); |
221 if (prev && prev->isBR()) // <span><br/> <br/></span> | 223 if (prev && prev->isBR()) // <span><br/> <br/></span> |
222 return false; | 224 return false; |
223 | 225 |
224 if (parent->isRenderInline()) { | 226 if (parent->isRenderInline()) { |
225 // <span><div/> <div/></span> | 227 // <span><div/> <div/></span> |
226 if (prev && !prev->isInline()) | 228 if (prev && !prev->isInline()) |
227 return false; | 229 return false; |
228 } else { | 230 } else { |
229 if (parent->isRenderBlock() && !parent->childrenInline() && (!prev || !p
rev->isInline())) | 231 if (parent->isRenderBlock() && !parent->childrenInline() && (!prev || !p
rev->isInline())) |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 result.appendLiteral("; "); | 343 result.appendLiteral("; "); |
342 result.appendLiteral("value="); | 344 result.appendLiteral("value="); |
343 result.append(s); | 345 result.append(s); |
344 } | 346 } |
345 | 347 |
346 strncpy(buffer, result.toString().utf8().data(), length - 1); | 348 strncpy(buffer, result.toString().utf8().data(), length - 1); |
347 } | 349 } |
348 #endif | 350 #endif |
349 | 351 |
350 } // namespace WebCore | 352 } // namespace WebCore |
OLD | NEW |