Chromium Code Reviews| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 | 91 |
| 92 RefPtr<Document> m_document; | 92 RefPtr<Document> m_document; |
| 93 RefPtr<DocumentFragment> m_fragment; | 93 RefPtr<DocumentFragment> m_fragment; |
| 94 bool m_hasInterchangeNewlineAtStart; | 94 bool m_hasInterchangeNewlineAtStart; |
| 95 bool m_hasInterchangeNewlineAtEnd; | 95 bool m_hasInterchangeNewlineAtEnd; |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 static bool isInterchangeNewlineNode(const Node *node) | 98 static bool isInterchangeNewlineNode(const Node *node) |
| 99 { | 99 { |
| 100 DEFINE_STATIC_LOCAL(String, interchangeNewlineClassString, (AppleInterchange Newline)); | 100 DEFINE_STATIC_LOCAL(String, interchangeNewlineClassString, (AppleInterchange Newline)); |
| 101 return node && node->hasTagName(brTag) && | 101 return node && node->hasTagName(brTag) && toElement(node)->getAttribute(clas sAttr) == interchangeNewlineClassString; |
|
yoshinori.sano
2013/06/22 01:07:55
Reluctantly combined them because I got the follow
abarth-chromium
2013/06/22 06:45:02
That's fine.
| |
| 102 static_cast<const Element *>(node)->getAttribute(classAttr) == interc hangeNewlineClassString; | |
| 103 } | 102 } |
| 104 | 103 |
| 105 static bool isInterchangeConvertedSpaceSpan(const Node *node) | 104 static bool isInterchangeConvertedSpaceSpan(const Node *node) |
| 106 { | 105 { |
| 107 DEFINE_STATIC_LOCAL(String, convertedSpaceSpanClassString, (AppleConvertedSp ace)); | 106 DEFINE_STATIC_LOCAL(String, convertedSpaceSpanClassString, (AppleConvertedSp ace)); |
| 108 return node->isHTMLElement() && | 107 return node->isHTMLElement() && |
| 109 static_cast<const HTMLElement *>(node)->getAttribute(classAttr) == co nvertedSpaceSpanClassString; | 108 static_cast<const HTMLElement *>(node)->getAttribute(classAttr) == co nvertedSpaceSpanClassString; |
| 110 } | 109 } |
| 111 | 110 |
| 112 static Position positionAvoidingPrecedingNodes(Position pos) | 111 static Position positionAvoidingPrecedingNodes(Position pos) |
| (...skipping 1371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1484 removeNodeAndPruneAncestors(nodeAfterInsertionPos.get()); | 1483 removeNodeAndPruneAncestors(nodeAfterInsertionPos.get()); |
| 1485 | 1484 |
| 1486 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d); | 1485 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d); |
| 1487 | 1486 |
| 1488 setEndingSelection(selectionAfterReplace); | 1487 setEndingSelection(selectionAfterReplace); |
| 1489 | 1488 |
| 1490 return true; | 1489 return true; |
| 1491 } | 1490 } |
| 1492 | 1491 |
| 1493 } // namespace WebCore | 1492 } // namespace WebCore |
| OLD | NEW |