| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 1959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1970 if (m_smartReplace || fragment.hasInterchangeNewlineAtStart() || | 1970 if (m_smartReplace || fragment.hasInterchangeNewlineAtStart() || |
| 1971 fragment.hasInterchangeNewlineAtEnd()) | 1971 fragment.hasInterchangeNewlineAtEnd()) |
| 1972 return false; | 1972 return false; |
| 1973 | 1973 |
| 1974 // e.g. when "bar" is inserted after "foo" in <div><u>foo</u></div>, "bar" | 1974 // e.g. when "bar" is inserted after "foo" in <div><u>foo</u></div>, "bar" |
| 1975 // should not be underlined. | 1975 // should not be underlined. |
| 1976 if (elementToSplitToAvoidPastingIntoInlineElementsWithStyle( | 1976 if (elementToSplitToAvoidPastingIntoInlineElementsWithStyle( |
| 1977 endingSelection().start())) | 1977 endingSelection().start())) |
| 1978 return false; | 1978 return false; |
| 1979 | 1979 |
| 1980 // TODO(editing-dev): Use of updateStyleAndLayoutIgnorePendingStylesheets |
| 1981 // needs to be audited. See http://crbug.com/590369 for more details. |
| 1982 document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 1983 |
| 1980 Node* nodeAfterInsertionPos = | 1984 Node* nodeAfterInsertionPos = |
| 1981 mostForwardCaretPosition(endingSelection().end()).anchorNode(); | 1985 mostForwardCaretPosition(endingSelection().end()).anchorNode(); |
| 1982 Text* textNode = toText(fragment.firstChild()); | 1986 Text* textNode = toText(fragment.firstChild()); |
| 1983 // Our fragment creation code handles tabs, spaces, and newlines, so we don't | 1987 // Our fragment creation code handles tabs, spaces, and newlines, so we don't |
| 1984 // have to worry about those here. | 1988 // have to worry about those here. |
| 1985 | 1989 |
| 1986 Position start = endingSelection().start(); | 1990 Position start = endingSelection().start(); |
| 1987 Position end = replaceSelectedTextInNode(textNode->data()); | 1991 Position end = replaceSelectedTextInNode(textNode->data()); |
| 1988 if (end.isNull()) | 1992 if (end.isNull()) |
| 1989 return false; | 1993 return false; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 2020 visitor->trace(m_startOfInsertedContent); | 2024 visitor->trace(m_startOfInsertedContent); |
| 2021 visitor->trace(m_endOfInsertedContent); | 2025 visitor->trace(m_endOfInsertedContent); |
| 2022 visitor->trace(m_insertionStyle); | 2026 visitor->trace(m_insertionStyle); |
| 2023 visitor->trace(m_documentFragment); | 2027 visitor->trace(m_documentFragment); |
| 2024 visitor->trace(m_startOfInsertedRange); | 2028 visitor->trace(m_startOfInsertedRange); |
| 2025 visitor->trace(m_endOfInsertedRange); | 2029 visitor->trace(m_endOfInsertedRange); |
| 2026 CompositeEditCommand::trace(visitor); | 2030 CompositeEditCommand::trace(visitor); |
| 2027 } | 2031 } |
| 2028 | 2032 |
| 2029 } // namespace blink | 2033 } // namespace blink |
| OLD | NEW |