Index: Source/core/editing/TextIterator.cpp |
diff --git a/Source/core/editing/TextIterator.cpp b/Source/core/editing/TextIterator.cpp |
index 115eaaa5f4954acee9cbae91f9d080c818c22a46..237be633f465f43ffbf38c30fd277f150584de8e 100644 |
--- a/Source/core/editing/TextIterator.cpp |
+++ b/Source/core/editing/TextIterator.cpp |
@@ -905,6 +905,11 @@ static bool shouldEmitNewlinesBeforeAndAfterNode(Node& node) |
|| node.hasTagName(ulTag)); |
} |
+ // Need to make an exception for option and optgroup, because we want to |
+ // keep the legacy behavior before we added renderers to them. |
+ if (isHTMLOptionElement(node) || isHTMLOptGroupElement(node)) |
+ return false; |
+ |
// Need to make an exception for table cells, because they are blocks, but we |
// want them tab-delimited rather than having newlines before and after. |
if (isTableCell(&node)) |