Remove EditingAppleTabSpan class handling

EditingAppleTabSpan class is non-standard CSS class name
that is produced while creating a span element with tab
in editing, but the usage is low(<=0.0001%).

This CL removes the code that handles EditingAppleTabSpan class
from Blink.

Intent to remove: https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/OlgmGUvnMU4/9HMNXMjGCQAJ

BUG=383677

Review-Url: https://codereview.chromium.org/2718543003
Cr-Commit-Position: refs/heads/master@{#455645}
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/5549929-2.html b/third_party/WebKit/LayoutTests/editing/inserting/5549929-2.html
index aa98ad0..28edda6 100644
--- a/third_party/WebKit/LayoutTests/editing/inserting/5549929-2.html
+++ b/third_party/WebKit/LayoutTests/editing/inserting/5549929-2.html
@@ -1,7 +1,7 @@
 <p>This tests to make sure that a br isn't inserted into a tab span during an InsertLineBreak operation.  You can test for its existence with the DOM inspector or you can look at the render tree.</p>
 <div id="div" contenteditable="true">
-<div><span class="Apple-tab-span" style="white-space:pre">	</span>foo</div>
-<div><span class="Apple-tab-span" style="white-space:pre">	</span>bar</div>
+<div><span style="white-space:pre">&#9;</span>foo</div>
+<div><span style="white-space:pre">&#9;</span>bar</div>
 </div>
 
 <script>
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-after-tab-span-and-text.html b/third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-after-tab-span-and-text.html
deleted file mode 100644
index 457d8c5..0000000
--- a/third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-after-tab-span-and-text.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<div id="test" contenteditable>
-<span class="Apple-tab-span" style="white-space:pre">    hello</span><br>
-<span class="Apple-style-span"><span class="Apple-tab-span" style="white-space: pre; ">    </span>world</span></div>
-<script src="../../resources/dump-as-markup.js"></script>
-<script>
-
-document.body.focus();
-var span = document.getElementsByClassName('Apple-tab-span')[0];
-window.getSelection().collapse(span, 1);
-document.execCommand('InsertParagraph', false, null);
-
-Markup.description('This test ensures WebKit inserts a paragraph separator properly at the end of a tab span.')
-Markup.dump('test');
-
-</script>
-</body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/insert_tab.html b/third_party/WebKit/LayoutTests/editing/inserting/insert_tab.html
index 5aff7a3..09ab41e 100644
--- a/third_party/WebKit/LayoutTests/editing/inserting/insert_tab.html
+++ b/third_party/WebKit/LayoutTests/editing/inserting/insert_tab.html
@@ -13,7 +13,7 @@
     [
         '<div contenteditable>',
             '<span>',
-                '<span class="Apple-tab-span" style="white-space:pre">\t|</span>',
+                '<span style="white-space:pre">\t|</span>',
                 'foo',
              '</span>',
         '</div>'
@@ -31,7 +31,7 @@
         '<div contenteditable>',
             '<span>',
                 'foo',
-                '<span class="Apple-tab-span" style="white-space:pre">\t|</span>',
+                '<span style="white-space:pre">\t|</span>',
              '</span>',
         '</div>'
     ].join('')),
@@ -48,7 +48,7 @@
         '<div contenteditable>',
             '<span>',
                 'fo',
-                '<span class="Apple-tab-span" style="white-space:pre">\t|</span>',
+                '<span style="white-space:pre">\t|</span>',
                 'o',
              '</span>',
         '</div>'
@@ -69,7 +69,7 @@
         '<div contenteditable>',
             '<span>',
                 '<br>',
-                '<span class="Apple-tab-span" style="white-space:pre">\t|</span>',
+                '<span style="white-space:pre">\t|</span>',
                 'foo',
              '</span>',
         '</div>'
diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/5761530-1-expected.txt b/third_party/WebKit/LayoutTests/editing/pasteboard/5761530-1-expected.txt
index 90085db..371a9906 100644
--- a/third_party/WebKit/LayoutTests/editing/pasteboard/5761530-1-expected.txt
+++ b/third_party/WebKit/LayoutTests/editing/pasteboard/5761530-1-expected.txt
@@ -1,3 +1,3 @@
 This tests to see that tabs are put into tab spans when they are copied individually. The pasted tab should be inside of a tab span, not a style span. To run the test manually, paste and then inspect the editable region, and ensure that there is a tab span at the beginning of the editable div.
 
-<span class="Apple-tab-span" style="white-space: pre;">	</span><span class="Apple-tab-span" style="white-space:pre;">	</span>xxx
+<span style="white-space: pre;">	</span><span style="white-space:pre;">	</span>xxx
diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/5761530-1.html b/third_party/WebKit/LayoutTests/editing/pasteboard/5761530-1.html
index b7b3004f..87844a0 100644
--- a/third_party/WebKit/LayoutTests/editing/pasteboard/5761530-1.html
+++ b/third_party/WebKit/LayoutTests/editing/pasteboard/5761530-1.html
@@ -1,5 +1,5 @@
 <div id="description">This tests to see that tabs are put into tab spans when they are copied individually.  The pasted tab should be inside of a tab span, not a style span.  To run the test manually, paste and then inspect the editable region, and ensure that there is a tab span at the beginning of the editable div.</div>
-<div id="edit" contenteditable="true"><span class="Apple-tab-span" style="white-space:pre;">	</span>xxx</div>
+<div id="edit" contenteditable="true"><span style="white-space:pre;">	</span>xxx</div>
 <script>
 if (window.testRunner)
 	window.testRunner.dumpAsText();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/editing/run/inserttext-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/editing/run/inserttext-expected.txt
index 107b148..1d4e1d92 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/editing/run/inserttext-expected.txt
+++ b/third_party/WebKit/LayoutTests/external/wpt/editing/run/inserttext-expected.txt
@@ -20,7 +20,7 @@
 PASS [["inserttext",""]] "foo[bar]baz" queryCommandValue("inserttext") after 
 PASS [["inserttext","\t"]] "foo[]bar": execCommand("inserttext", false, "\t") return value 
 PASS [["inserttext","\t"]] "foo[]bar" checks for modifications to non-editable content 
-FAIL [["inserttext","\t"]] "foo[]bar" compare innerHTML assert_equals: Unexpected innerHTML (after normalizing inline style) expected "foo\tbar" but got "foo<span class=\"Apple-tab-span\" style=\"white-space:pre\">\t</span>bar"
+FAIL [["inserttext","\t"]] "foo[]bar" compare innerHTML assert_equals: Unexpected innerHTML (after normalizing inline style) expected "foo\tbar" but got "foo<span style=\"white-space:pre\">\t</span>bar"
 PASS [["inserttext","\t"]] "foo[]bar" queryCommandIndeterm("inserttext") before 
 PASS [["inserttext","\t"]] "foo[]bar" queryCommandState("inserttext") before 
 PASS [["inserttext","\t"]] "foo[]bar" queryCommandValue("inserttext") before 
@@ -1038,7 +1038,7 @@
 PASS [["inserttext","a"]] "http://a[]" queryCommandValue("inserttext") after 
 PASS [["inserttext","\t"]] "http://a[]": execCommand("inserttext", false, "\t") return value 
 PASS [["inserttext","\t"]] "http://a[]" checks for modifications to non-editable content 
-FAIL [["inserttext","\t"]] "http://a[]" compare innerHTML assert_equals: Unexpected innerHTML (after normalizing inline style) expected "<a href=\"http://a\">http://a</a>\t" but got "http://a<span class=\"Apple-tab-span\" style=\"white-space:pre\">\t</span>"
+FAIL [["inserttext","\t"]] "http://a[]" compare innerHTML assert_equals: Unexpected innerHTML (after normalizing inline style) expected "<a href=\"http://a\">http://a</a>\t" but got "http://a<span style=\"white-space:pre\">\t</span>"
 PASS [["inserttext","\t"]] "http://a[]" queryCommandIndeterm("inserttext") before 
 PASS [["inserttext","\t"]] "http://a[]" queryCommandState("inserttext") before 
 PASS [["inserttext","\t"]] "http://a[]" queryCommandValue("inserttext") before 
diff --git a/third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/5761530-1-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/5761530-1-expected.txt
deleted file mode 100644
index 619924e..0000000
--- a/third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/5761530-1-expected.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-This tests to see that tabs are put into tab spans when they are copied individually. The pasted tab should be inside of a tab span, not a style span. To run the test manually, paste and then inspect the editable region, and ensure that there is a tab span at the beginning of the editable div.
-
-<span class="Apple-tab-span" style="white-space: pre;">	</span><span class="Apple-tab-span" style="white-space:pre;"> </span>xxx
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
index c4fd9c0..b0e8ece82 100644
--- a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
+++ b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
@@ -1572,11 +1572,12 @@
 }
 
 bool isTabHTMLSpanElement(const Node* node) {
-  if (!isHTMLSpanElement(node) ||
-      toHTMLSpanElement(node)->getAttribute(classAttr) != AppleTabSpanClass)
+  if (!isHTMLSpanElement(node) || !node->firstChild())
     return false;
-  UseCounter::count(node->document(), UseCounter::EditingAppleTabSpanClass);
-  return true;
+  if (node->firstChild()->isCharacterDataNode() &&
+      toCharacterData(node->firstChild())->data().contains('\t'))
+    return true;
+  return false;
 }
 
 bool isTabHTMLSpanElementTextNode(const Node* node) {
@@ -1594,7 +1595,6 @@
                                              Text* tabTextNode) {
   // Make the span to hold the tab.
   HTMLSpanElement* spanElement = HTMLSpanElement::create(document);
-  spanElement->setAttribute(classAttr, AppleTabSpanClass);
   spanElement->setAttribute(styleAttr, "white-space:pre");
 
   // Add tab text to that span.
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
index a0a4b7a..a0dcc9c2 100644
--- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
@@ -997,11 +997,6 @@
   // one of our internal classes.
   const HTMLElement* element = toHTMLElement(node);
   const AtomicString& classAttributeValue = element->getAttribute(classAttr);
-  if (classAttributeValue == AppleTabSpanClass) {
-    UseCounter::count(element->document(),
-                      UseCounter::EditingAppleTabSpanClass);
-    return true;
-  }
   if (classAttributeValue == AppleConvertedSpace) {
     UseCounter::count(element->document(),
                       UseCounter::EditingAppleConvertedSpace);
diff --git a/third_party/WebKit/Source/core/editing/serializers/HTMLInterchange.h b/third_party/WebKit/Source/core/editing/serializers/HTMLInterchange.h
index 5addf94..baaa58f 100644
--- a/third_party/WebKit/Source/core/editing/serializers/HTMLInterchange.h
+++ b/third_party/WebKit/Source/core/editing/serializers/HTMLInterchange.h
@@ -34,7 +34,6 @@
 
 #define AppleInterchangeNewline "Apple-interchange-newline"
 #define AppleConvertedSpace "Apple-converted-space"
-#define AppleTabSpanClass "Apple-tab-span"
 
 enum EAnnotateForInterchange {
   DoNotAnnotateForInterchange,
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.h b/third_party/WebKit/Source/core/frame/UseCounter.h
index c36bfab..7f4d5aa3 100644
--- a/third_party/WebKit/Source/core/frame/UseCounter.h
+++ b/third_party/WebKit/Source/core/frame/UseCounter.h
@@ -333,7 +333,6 @@
     EditingAppleConvertedSpace = 459,
     EditingApplePasteAsQuotation = 460,
     EditingAppleStyleSpanClass = 461,
-    EditingAppleTabSpanClass = 462,
     HTMLImportsAsyncAttribute = 463,
     XMLHttpRequestSynchronous = 465,
     CSSSelectorPseudoUnresolved = 466,