OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. |
4 * Copyright (C) 2011 Igalia S.L. | 4 * Copyright (C) 2011 Igalia S.L. |
5 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 5 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
6 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
9 * are met: | 9 * are met: |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 if (string.find('\n') == kNotFound) { | 481 if (string.find('\n') == kNotFound) { |
482 fillContainerFromString(fragment.get(), string); | 482 fillContainerFromString(fragment.get(), string); |
483 return fragment.release(); | 483 return fragment.release(); |
484 } | 484 } |
485 | 485 |
486 // Break string into paragraphs. Extra line breaks turn into empty paragraph
s. | 486 // Break string into paragraphs. Extra line breaks turn into empty paragraph
s. |
487 Element* block = enclosingBlock(context.startPosition().nodeAsRangeFirstNode
()); | 487 Element* block = enclosingBlock(context.startPosition().nodeAsRangeFirstNode
()); |
488 bool useClonesOfEnclosingBlock = block | 488 bool useClonesOfEnclosingBlock = block |
489 && !isHTMLBodyElement(*block) | 489 && !isHTMLBodyElement(*block) |
490 && !isHTMLHtmlElement(*block) | 490 && !isHTMLHtmlElement(*block) |
491 && block != editableRootElementForPosition(context.startPosition()); | 491 && block != rootEditableElementOf(context.startPosition()); |
492 bool useLineBreak = enclosingTextFormControl(context.startPosition()); | 492 bool useLineBreak = enclosingTextFormControl(context.startPosition()); |
493 | 493 |
494 Vector<String> list; | 494 Vector<String> list; |
495 string.split('\n', true, list); // true gets us empty strings in the list | 495 string.split('\n', true, list); // true gets us empty strings in the list |
496 size_t numLines = list.size(); | 496 size_t numLines = list.size(); |
497 for (size_t i = 0; i < numLines; ++i) { | 497 for (size_t i = 0; i < numLines; ++i) { |
498 const String& s = list[i]; | 498 const String& s = list[i]; |
499 | 499 |
500 RefPtrWillBeRawPtr<Element> element = nullptr; | 500 RefPtrWillBeRawPtr<Element> element = nullptr; |
501 if (s.isEmpty() && i + 1 == numLines) { | 501 if (s.isEmpty() && i + 1 == numLines) { |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 RefPtrWillBeRawPtr<Text> textNext = toText(next); | 698 RefPtrWillBeRawPtr<Text> textNext = toText(next); |
699 textNode->appendData(textNext->data()); | 699 textNode->appendData(textNext->data()); |
700 if (textNext->parentNode()) // Might have been removed by mutation event. | 700 if (textNext->parentNode()) // Might have been removed by mutation event. |
701 textNext->remove(exceptionState); | 701 textNext->remove(exceptionState); |
702 } | 702 } |
703 | 703 |
704 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingStrategy>; | 704 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingStrategy>; |
705 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingInComposedTreeS
trategy>; | 705 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingInComposedTreeS
trategy>; |
706 | 706 |
707 } | 707 } |
OLD | NEW |