| 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) 2004-2008, 2013, 2014 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004-2008, 2013, 2014 Apple Inc. All rights reserved. |
| 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 | 418 |
| 419 if (!text.contains('\n') && !text.contains('\r')) { | 419 if (!text.contains('\n') && !text.contains('\r')) { |
| 420 if (text.isEmpty()) { | 420 if (text.isEmpty()) { |
| 421 removeChildren(); | 421 removeChildren(); |
| 422 return; | 422 return; |
| 423 } | 423 } |
| 424 replaceChildrenWithText(this, text, exceptionState); | 424 replaceChildrenWithText(this, text, exceptionState); |
| 425 return; | 425 return; |
| 426 } | 426 } |
| 427 | 427 |
| 428 // FIXME: Do we need to be able to detect preserveNewline style even when th
ere's no renderer? | 428 // FIXME: Do we need to be able to detect preserveNewline style even when th
ere's no layoutObject? |
| 429 // FIXME: Can the renderer be out of date here? Do we need to call updateSty
leIfNeeded? | 429 // FIXME: Can the layoutObject be out of date here? Do we need to call updat
eStyleIfNeeded? |
| 430 // For example, for the contents of textarea elements that are display:none? | 430 // For example, for the contents of textarea elements that are display:none? |
| 431 LayoutObject* r = layoutObject(); | 431 LayoutObject* r = layoutObject(); |
| 432 if (r && r->style()->preserveNewline()) { | 432 if (r && r->style()->preserveNewline()) { |
| 433 if (!text.contains('\r')) { | 433 if (!text.contains('\r')) { |
| 434 replaceChildrenWithText(this, text, exceptionState); | 434 replaceChildrenWithText(this, text, exceptionState); |
| 435 return; | 435 return; |
| 436 } | 436 } |
| 437 String textWithConsistentLineBreaks = text; | 437 String textWithConsistentLineBreaks = text; |
| 438 textWithConsistentLineBreaks.replace("\r\n", "\n"); | 438 textWithConsistentLineBreaks.replace("\r\n", "\n"); |
| 439 textWithConsistentLineBreaks.replace('\r', '\n'); | 439 textWithConsistentLineBreaks.replace('\r', '\n'); |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 #ifndef NDEBUG | 1013 #ifndef NDEBUG |
| 1014 | 1014 |
| 1015 // For use in the debugger | 1015 // For use in the debugger |
| 1016 void dumpInnerHTML(blink::HTMLElement*); | 1016 void dumpInnerHTML(blink::HTMLElement*); |
| 1017 | 1017 |
| 1018 void dumpInnerHTML(blink::HTMLElement* element) | 1018 void dumpInnerHTML(blink::HTMLElement* element) |
| 1019 { | 1019 { |
| 1020 printf("%s\n", element->innerHTML().ascii().data()); | 1020 printf("%s\n", element->innerHTML().ascii().data()); |
| 1021 } | 1021 } |
| 1022 #endif | 1022 #endif |
| OLD | NEW |