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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
195 Node::NodeType Text::nodeType() const | 195 Node::NodeType Text::nodeType() const |
196 { | 196 { |
197 return TEXT_NODE; | 197 return TEXT_NODE; |
198 } | 198 } |
199 | 199 |
200 PassRefPtr<Node> Text::cloneNode(bool /*deep*/) | 200 PassRefPtr<Node> Text::cloneNode(bool /*deep*/) |
201 { | 201 { |
202 return cloneWithData(data()); | 202 return cloneWithData(data()); |
203 } | 203 } |
204 | 204 |
205 bool Text::textRendererIsNeeded(const NodeRenderingContext& context) | 205 bool Text::textRendererIsNeeded(NodeRenderingContext& context) |
Julien - ping for review
2013/05/09 15:30:18
Again, losing const-ness makes me sad.
Mihai Maerean
2013/05/09 16:25:55
Me too, but there's no other way to make the compi
| |
206 { | 206 { |
207 if (isEditingText()) | 207 if (isEditingText()) |
208 return true; | 208 return true; |
209 | 209 |
210 if (!length()) | 210 if (!length()) |
211 return false; | 211 return false; |
212 | 212 |
213 if (context.style()->display() == NONE) | 213 if (context.style()->display() == NONE) |
214 return false; | 214 return false; |
215 | 215 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
300 reattach(); | 300 reattach(); |
301 } | 301 } |
302 clearNeedsStyleRecalc(); | 302 clearNeedsStyleRecalc(); |
303 } | 303 } |
304 | 304 |
305 void Text::updateTextRenderer(unsigned offsetOfReplacedData, unsigned lengthOfRe placedData) | 305 void Text::updateTextRenderer(unsigned offsetOfReplacedData, unsigned lengthOfRe placedData) |
306 { | 306 { |
307 if (!attached()) | 307 if (!attached()) |
308 return; | 308 return; |
309 RenderText* textRenderer = toRenderText(renderer()); | 309 RenderText* textRenderer = toRenderText(renderer()); |
310 if (!textRenderer || !textRendererIsNeeded(NodeRenderingContext(this, textRe nderer->style()))) { | 310 if (!textRenderer) { |
311 reattach(); | 311 reattach(); |
312 return; | 312 return; |
313 } | 313 } |
314 NodeRenderingContext renderingContext(this, textRenderer->style()); | |
315 if (!textRendererIsNeeded(renderingContext)) { | |
316 reattach(); | |
317 return; | |
318 } | |
314 textRenderer->setTextWithOffset(dataImpl(), offsetOfReplacedData, lengthOfRe placedData); | 319 textRenderer->setTextWithOffset(dataImpl(), offsetOfReplacedData, lengthOfRe placedData); |
315 } | 320 } |
316 | 321 |
317 bool Text::childTypeAllowed(NodeType) const | 322 bool Text::childTypeAllowed(NodeType) const |
318 { | 323 { |
319 return false; | 324 return false; |
320 } | 325 } |
321 | 326 |
322 PassRefPtr<Text> Text::cloneWithData(const String& data) | 327 PassRefPtr<Text> Text::cloneWithData(const String& data) |
323 { | 328 { |
(...skipping 27 matching lines...) Expand all Loading... | |
351 result.appendLiteral("; "); | 356 result.appendLiteral("; "); |
352 result.appendLiteral("value="); | 357 result.appendLiteral("value="); |
353 result.append(s); | 358 result.append(s); |
354 } | 359 } |
355 | 360 |
356 strncpy(buffer, result.toString().utf8().data(), length - 1); | 361 strncpy(buffer, result.toString().utf8().data(), length - 1); |
357 } | 362 } |
358 #endif | 363 #endif |
359 | 364 |
360 } // namespace WebCore | 365 } // namespace WebCore |
OLD | NEW |