<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[166532] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/166532">166532</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2014-03-31 14:53:42 -0700 (Mon, 31 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add variant of phone number parsing that use DocumentMarker in the current selection
&lt;rdar://problem/16379566&gt; and https://bugs.webkit.org/show_bug.cgi?id=130917

Reviewed by Darin Adler.

* dom/DocumentMarker.h:
(WebCore::DocumentMarker::AllMarkers::AllMarkers): Add a new TelephoneNumber document marker type.

* editing/Editor.cpp:
(WebCore::Editor::respondToChangedSelection):
(WebCore::Editor::scanSelectionForTelephoneNumbers): TextIterate over the selected range looking for numbers.
(WebCore::Editor::scanRangeForTelephoneNumbers): Scan the given range for a telephone number,
  adding the DocumentMarker to any that are found.
(WebCore::Editor::clearDataDetectedTelephoneNumbers):
* editing/Editor.h:

* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processCharacterBufferForInBody): Only linkify on iOS.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintTelephoneNumberMarker): Placeholder UI while the feature is developed.
(WebCore::InlineTextBox::paintDocumentMarkers):
* rendering/InlineTextBox.h:

* testing/Internals.cpp:
(WebCore::markerTypesFrom):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomDocumentMarkerh">trunk/Source/WebCore/dom/DocumentMarker.h</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorcpp">trunk/Source/WebCore/editing/Editor.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorh">trunk/Source/WebCore/editing/Editor.h</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLTreeBuildercpp">trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineTextBoxcpp">trunk/Source/WebCore/rendering/InlineTextBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineTextBoxh">trunk/Source/WebCore/rendering/InlineTextBox.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (166531 => 166532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-31 21:23:27 UTC (rev 166531)
+++ trunk/Source/WebCore/ChangeLog        2014-03-31 21:53:42 UTC (rev 166532)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2014-03-31  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Add variant of phone number parsing that use DocumentMarker in the current selection
+        &lt;rdar://problem/16379566&gt; and https://bugs.webkit.org/show_bug.cgi?id=130917
+
+        Reviewed by Darin Adler.
+
+        * dom/DocumentMarker.h:
+        (WebCore::DocumentMarker::AllMarkers::AllMarkers): Add a new TelephoneNumber document marker type.
+
+        * editing/Editor.cpp:
+        (WebCore::Editor::respondToChangedSelection):
+        (WebCore::Editor::scanSelectionForTelephoneNumbers): TextIterate over the selected range looking for numbers.
+        (WebCore::Editor::scanRangeForTelephoneNumbers): Scan the given range for a telephone number,
+          adding the DocumentMarker to any that are found.
+        (WebCore::Editor::clearDataDetectedTelephoneNumbers):
+        * editing/Editor.h:
+
+        * html/parser/HTMLTreeBuilder.cpp:
+        (WebCore::HTMLTreeBuilder::processCharacterBufferForInBody): Only linkify on iOS.
+
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::paintTelephoneNumberMarker): Placeholder UI while the feature is developed.
+        (WebCore::InlineTextBox::paintDocumentMarkers):
+        * rendering/InlineTextBox.h:
+
+        * testing/Internals.cpp:
+        (WebCore::markerTypesFrom):
+
</ins><span class="cx"> 2014-03-31  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS WK2] Hook up scroll events for accelerated overflow:scroll
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentMarkerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DocumentMarker.h (166531 => 166532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentMarker.h        2014-03-31 21:23:27 UTC (rev 166531)
+++ trunk/Source/WebCore/dom/DocumentMarker.h        2014-03-31 21:53:42 UTC (rev 166532)
</span><span class="lines">@@ -71,10 +71,13 @@
</span><span class="cx">         // This marker indicates that the range of text spanned by the marker is entered by voice dictation,
</span><span class="cx">         // and it has alternative text.
</span><span class="cx">         DictationAlternatives = 1 &lt;&lt; 9,
</span><ins>+#if ENABLE(TELEPHONE_NUMBER_DETECTION)
+        TelephoneNumber = 1 &lt;&lt; 10
+#endif
</ins><span class="cx"> #if PLATFORM(IOS)
</span><del>-        // FIXME: iOS has its own dictation marks. iOS should use OpenSource's.
-        DictationPhraseWithAlternatives = 1 &lt;&lt; 10,
-        DictationResult = 1 &lt;&lt; 11,
</del><ins>+        // FIXME: iOS should share the same Dictation marks as everyone else.
+        DictationPhraseWithAlternatives = 1 &lt;&lt; 11,
+        DictationResult = 1 &lt;&lt; 12,
</ins><span class="cx"> #endif
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="lines">@@ -98,9 +101,13 @@
</span><span class="cx">     public:
</span><span class="cx">         AllMarkers()
</span><span class="cx"> #if !PLATFORM(IOS)
</span><ins>+#if !ENABLE(TELEPHONE_NUMBER_DETECTION)
</ins><span class="cx">             : MarkerTypes(Spelling | Grammar | TextMatch | Replacement | CorrectionIndicator | RejectedCorrection | Autocorrected | SpellCheckingExemption | DeletedAutocorrection | DictationAlternatives)
</span><span class="cx"> #else
</span><del>-            : MarkerTypes(Spelling | Grammar | TextMatch | Replacement | CorrectionIndicator | RejectedCorrection | Autocorrected | SpellCheckingExemption | DeletedAutocorrection | DictationAlternatives | DictationPhraseWithAlternatives | DictationResult)
</del><ins>+            : MarkerTypes(Spelling | Grammar | TextMatch | Replacement | CorrectionIndicator | RejectedCorrection | Autocorrected | SpellCheckingExemption | DeletedAutocorrection | DictationAlternatives | TelephoneNumber)
+#endif // !ENABLE(TELEPHONE_NUMBER_DETECTION)
+#else
+            : MarkerTypes(Spelling | Grammar | TextMatch | Replacement | CorrectionIndicator | RejectedCorrection | Autocorrected | SpellCheckingExemption | DeletedAutocorrection | DictationAlternatives | TelephoneNumber | DictationPhraseWithAlternatives | DictationResult)
</ins><span class="cx"> #endif // !PLATFORM(IOS)
</span><span class="cx">         {
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (166531 => 166532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp        2014-03-31 21:23:27 UTC (rev 166531)
+++ trunk/Source/WebCore/editing/Editor.cpp        2014-03-31 21:53:42 UTC (rev 166532)
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx"> #include &quot;NodeTraversal.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;Pasteboard.h&quot;
</span><ins>+#include &quot;Range.h&quot;
</ins><span class="cx"> #include &quot;RemoveFormatCommand.h&quot;
</span><span class="cx"> #include &quot;RenderBlock.h&quot;
</span><span class="cx"> #include &quot;RenderTextControl.h&quot;
</span><span class="lines">@@ -78,6 +79,7 @@
</span><span class="cx"> #include &quot;SpellChecker.h&quot;
</span><span class="cx"> #include &quot;SpellingCorrectionCommand.h&quot;
</span><span class="cx"> #include &quot;StyleProperties.h&quot;
</span><ins>+#include &quot;TelephoneNumberDetector.h&quot;
</ins><span class="cx"> #include &quot;Text.h&quot;
</span><span class="cx"> #include &quot;TextCheckerClient.h&quot;
</span><span class="cx"> #include &quot;TextCheckingHelper.h&quot;
</span><span class="lines">@@ -3314,6 +3316,11 @@
</span><span class="cx"> 
</span><span class="cx">     if (client())
</span><span class="cx">         client()-&gt;respondToChangedSelection(&amp;m_frame);
</span><ins>+
+#if ENABLE(TELEPHONE_NUMBER_DETECTION) &amp;&amp; !PLATFORM(IOS)
+    scanSelectionForTelephoneNumbers();
+#endif
+
</ins><span class="cx">     setStartNewKillRingSequence(true);
</span><span class="cx"> 
</span><span class="cx">     if (m_editorUIUpdateTimer.isActive())
</span><span class="lines">@@ -3326,6 +3333,70 @@
</span><span class="cx">     m_editorUIUpdateTimer.startOneShot(0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(TELEPHONE_NUMBER_DETECTION) &amp;&amp; !PLATFORM(IOS)
+void Editor::scanSelectionForTelephoneNumbers()
+{
+    if (!TelephoneNumberDetector::isSupported())
+        return;
+
+    if (!m_frame.document())
+        return;
+
+    clearDataDetectedTelephoneNumbers();
+
+    RefPtr&lt;Range&gt; selectedRange = m_frame.selection().toNormalizedRange();
+    if (!selectedRange || selectedRange-&gt;startOffset() == selectedRange-&gt;endOffset())
+        return;
+
+    // FIXME: This won't work if a phone number spans multiple chunks of text from the perspective of the TextIterator
+    // (By a style change, image, line break, etc.)
+    // On idea to handle this would be a model like text search that uses a rotating window.
+    for (TextIterator textChunk(selectedRange.get()); !textChunk.atEnd(); textChunk.advance()) {
+        // TextIterator is supposed to never returns a Range that spans multiple Nodes.
+        ASSERT(textChunk.range()-&gt;startContainer() == textChunk.range()-&gt;endContainer());
+
+        scanRangeForTelephoneNumbers(*textChunk.range(), textChunk.text());
+    }
+}
+
+void Editor::scanRangeForTelephoneNumbers(Range&amp; range, const StringView&amp; stringView)
+{
+    // relativeStartPosition and relativeEndPosition are the endpoints of the phone number range,
+    // relative to the scannerPosition
+    unsigned length = stringView.length();
+    unsigned scannerPosition = 0;
+    int relativeStartPosition = 0;
+    int relativeEndPosition = 0;
+
+    auto characters = stringView.upconvertedCharacters();
+
+    while (scannerPosition &lt; length &amp;&amp; TelephoneNumberDetector::find(&amp;characters[scannerPosition], length - scannerPosition, &amp;relativeStartPosition, &amp;relativeEndPosition)) {
+        // The convention in the Data Detectors framework is that the end position is the first character NOT in the phone number
+        // (that is, the length of the range is relativeEndPosition - relativeStartPosition). So substract 1 to get the same
+        // convention as the old WebCore phone number parser (so that the rest of the code is still valid if we want to go back
+        // to the old parser).
+        --relativeEndPosition;
+
+        ASSERT(scannerPosition + relativeEndPosition &lt; length);
+
+        // It doesn't make sense to add the document marker to a match that's not in a text node.
+        if (!range.startContainer()-&gt;isTextNode())
+            continue;
+
+        range.ownerDocument().markers().addMarkerToNode(range.startContainer(), range.startOffset() + scannerPosition + relativeStartPosition, relativeEndPosition - relativeStartPosition + 1, DocumentMarker::TelephoneNumber);
+
+        scannerPosition += relativeEndPosition + 1;
+    }
+}
+
+void Editor::clearDataDetectedTelephoneNumbers()
+{
+    m_frame.document()-&gt;markers().removeMarkers(DocumentMarker::TelephoneNumber);
+
+    // FIXME: Do other UI cleanup here once we have other UI.
+}
+#endif // ENABLE(TELEPHONE_NUMBER_DETECTION) &amp;&amp; !PLATFORM(IOS)
+
</ins><span class="cx"> void Editor::updateEditorUINowIfScheduled()
</span><span class="cx"> {
</span><span class="cx">     if (!m_editorUIUpdateTimer.isActive())
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.h (166531 => 166532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.h        2014-03-31 21:23:27 UTC (rev 166531)
+++ trunk/Source/WebCore/editing/Editor.h        2014-03-31 21:53:42 UTC (rev 166532)
</span><span class="lines">@@ -473,6 +473,12 @@
</span><span class="cx"> 
</span><span class="cx">     bool unifiedTextCheckerEnabled() const;
</span><span class="cx"> 
</span><ins>+#if ENABLE(TELEPHONE_NUMBER_DETECTION) &amp;&amp; !PLATFORM(IOS)
+    void scanSelectionForTelephoneNumbers();
+    void scanRangeForTelephoneNumbers(Range&amp;, const StringView&amp;);
+    void clearDataDetectedTelephoneNumbers();
+#endif
+
</ins><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     PassRefPtr&lt;SharedBuffer&gt; selectionInWebArchiveFormat();
</span><span class="cx">     PassRefPtr&lt;Range&gt; adjustedSelectionRange();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLTreeBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp (166531 => 166532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp        2014-03-31 21:23:27 UTC (rev 166531)
+++ trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp        2014-03-31 21:53:42 UTC (rev 166532)
</span><span class="lines">@@ -2305,7 +2305,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // FIXME: Extract the following iOS-specific code into a separate file.
</span><del>-#if ENABLE(TELEPHONE_NUMBER_DETECTION)
</del><ins>+#if ENABLE(TELEPHONE_NUMBER_DETECTION) &amp;&amp; PLATFORM(IOS)
</ins><span class="cx"> // From the string 4089961010, creates a link of the form &lt;a href=&quot;tel:4089961010&quot;&gt;4089961010&lt;/a&gt; and inserts it.
</span><span class="cx"> void HTMLTreeBuilder::insertPhoneNumberLink(const String&amp; string)
</span><span class="cx"> {
</span><span class="lines">@@ -2389,7 +2389,7 @@
</span><span class="cx">     } while (currentNode);
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><del>-#endif
</del><ins>+#endif // ENABLE(TELEPHONE_NUMBER_DETECTION) &amp;&amp; PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> void HTMLTreeBuilder::processCharacterBuffer(ExternalCharacterTokenBuffer&amp; buffer)
</span><span class="cx"> {
</span><span class="lines">@@ -2566,7 +2566,7 @@
</span><span class="cx"> {
</span><span class="cx">     m_tree.reconstructTheActiveFormattingElements();
</span><span class="cx">     String characters = buffer.takeRemaining();
</span><del>-#if ENABLE(TELEPHONE_NUMBER_DETECTION)
</del><ins>+#if ENABLE(TELEPHONE_NUMBER_DETECTION) &amp;&amp; PLATFORM(IOS)
</ins><span class="cx">     if (!isParsingFragment() &amp;&amp; m_tree.isTelephoneNumberParsingEnabled() &amp;&amp; shouldParseTelephoneNumbersInNode(*m_tree.currentNode()) &amp;&amp; TelephoneNumberDetector::isSupported())
</span><span class="cx">         linkifyPhoneNumbers(characters);
</span><span class="cx">     else
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineTextBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (166531 => 166532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineTextBox.cpp        2014-03-31 21:23:27 UTC (rev 166531)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp        2014-03-31 21:53:42 UTC (rev 166532)
</span><span class="lines">@@ -1248,6 +1248,33 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(TELEPHONE_NUMBER_DETECTION)
+void InlineTextBox::paintTelephoneNumberMarker(GraphicsContext* ctx, const FloatPoint&amp; boxOrigin, DocumentMarker* marker, const RenderStyle&amp; style, const Font&amp; font)
+{
+    // FIXME: This is placeholder UI for development of the feature.
+
+    int startPosition = std::max&lt;int&gt;(marker-&gt;startOffset() - m_start, 0);
+    int endPosition = std::min&lt;int&gt;(marker-&gt;endOffset() - m_start, m_len);
+
+    if (m_truncation != cNoTruncation)
+        endPosition = std::min&lt;int&gt;(endPosition, m_truncation);
+
+    int deltaY = renderer().style().isFlippedLinesWritingMode() ? selectionBottom() - logicalBottom() : logicalTop() - selectionTop();
+    int selHeight = selectionHeight();
+    FloatPoint startPoint(boxOrigin.x(), boxOrigin.y() - deltaY);
+    TextRun run = constructTextRun(style, font);
+
+    IntRect markerRect = enclosingIntRect(font.selectionRectForText(run, startPoint, selHeight, startPosition, endPosition));
+
+    computeRectForReplacementMarker(marker, style, font);
+
+    Path outline;
+    outline.addRoundedRect(markerRect, FloatSize(4, 4));
+    ctx-&gt;setFillColor(Color(150, 150, 150, 255), ColorSpaceDeviceRGB);
+    ctx-&gt;fillPath(outline);
+}
+#endif // ENABLE(TELEPHONE_NUMBER_DETECTION)
+
</ins><span class="cx"> void InlineTextBox::computeRectForReplacementMarker(DocumentMarker* marker, const RenderStyle&amp; style, const Font&amp; font)
</span><span class="cx"> {
</span><span class="cx">     // Replacement markers are not actually drawn, but their rects need to be computed for hit testing.
</span><span class="lines">@@ -1293,6 +1320,9 @@
</span><span class="cx">                     continue;
</span><span class="cx">                 break;
</span><span class="cx">             case DocumentMarker::TextMatch:
</span><ins>+#if ENABLE(TELEPHONE_NUMBER_DETECTION)
+            case DocumentMarker::TelephoneNumber:
+#endif
</ins><span class="cx">                 if (!background)
</span><span class="cx">                     continue;
</span><span class="cx">                 break;
</span><span class="lines">@@ -1331,6 +1361,11 @@
</span><span class="cx">             case DocumentMarker::Replacement:
</span><span class="cx">                 computeRectForReplacementMarker(marker, style, font);
</span><span class="cx">                 break;
</span><ins>+#if ENABLE(TELEPHONE_NUMBER_DETECTION)
+            case DocumentMarker::TelephoneNumber:
+                paintTelephoneNumberMarker(pt, boxOrigin, marker, style, font);
+                break;
+#endif
</ins><span class="cx">             default:
</span><span class="cx">                 ASSERT_NOT_REACHED();
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineTextBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineTextBox.h (166531 => 166532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineTextBox.h        2014-03-31 21:23:27 UTC (rev 166531)
+++ trunk/Source/WebCore/rendering/InlineTextBox.h        2014-03-31 21:53:42 UTC (rev 166532)
</span><span class="lines">@@ -173,6 +173,11 @@
</span><span class="cx">     void paintSelection(GraphicsContext*, const FloatPoint&amp; boxOrigin, const RenderStyle&amp;, const Font&amp;, Color textColor);
</span><span class="cx">     void paintDocumentMarker(GraphicsContext*, const FloatPoint&amp; boxOrigin, DocumentMarker*, const RenderStyle&amp;, const Font&amp;, bool grammar);
</span><span class="cx">     void paintTextMatchMarker(GraphicsContext*, const FloatPoint&amp; boxOrigin, DocumentMarker*, const RenderStyle&amp;, const Font&amp;);
</span><ins>+
+#if ENABLE(TELEPHONE_NUMBER_DETECTION)
+    void paintTelephoneNumberMarker(GraphicsContext*, const FloatPoint&amp; boxOrigin, DocumentMarker*, const RenderStyle&amp;, const Font&amp;);
+#endif
+
</ins><span class="cx">     void computeRectForReplacementMarker(DocumentMarker*, const RenderStyle&amp;, const Font&amp;);
</span><span class="cx"> 
</span><span class="cx">     TextRun::ExpansionBehavior expansionBehavior() const
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (166531 => 166532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2014-03-31 21:23:27 UTC (rev 166531)
+++ trunk/Source/WebCore/testing/Internals.cpp        2014-03-31 21:53:42 UTC (rev 166532)
</span><span class="lines">@@ -245,6 +245,10 @@
</span><span class="cx">         result =  DocumentMarker::DeletedAutocorrection;
</span><span class="cx">     else if (equalIgnoringCase(markerType, &quot;DictationAlternatives&quot;))
</span><span class="cx">         result =  DocumentMarker::DictationAlternatives;
</span><ins>+#if ENABLE(TELEPHONE_NUMBER_DETECTION)
+    else if (equalIgnoringCase(markerType, &quot;TelephoneNumber&quot;))
+        result =  DocumentMarker::TelephoneNumber;
+#endif
</ins><span class="cx">     else
</span><span class="cx">         return false;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>