<!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>[197637] 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/197637">197637</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2016-03-06 02:17:52 -0800 (Sun, 06 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>RenderTextControlSingleLine shouldn't mutate placeholder element inline style
https://bugs.webkit.org/show_bug.cgi?id=155086

Reviewed by Andreas Kling.

Text field placeholder element is currently managed by changing its inline style
from the host renderer based on the host style and state. Rendering poking
into DOM is wrong.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setRangeText):
(WebCore::HTMLInputElement::shouldTruncateText):

    Add a helper.

(WebCore::HTMLInputElement::createInnerTextStyle):
* html/HTMLInputElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::HTMLTextAreaElement):
(WebCore::HTMLTextAreaElement::placeholderElement):
(WebCore::HTMLTextAreaElement::matchesReadWritePseudoClass):
(WebCore::HTMLTextAreaElement::updatePlaceholderText):

    Use the new shadow element.

* html/HTMLTextAreaElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility):

    No more poking to inline style.

(WebCore::HTMLTextFormControlElement::setSelectionStart):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::updatePlaceholderText):

    Use the new shadow element.

* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):

    Add a subclass for the placeholder element instead of just using div.

(WebCore::TextControlPlaceholderElement::customStyleForRenderer):

    Compute style base on the host state and style.

(WebCore::SearchFieldResultsButtonElement::SearchFieldResultsButtonElement):
* html/shadow/TextControlInnerElements.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::styleDidChange):

    No more setInlineStyleProperty.
    This now needs to trigger layout like it does with other inner elements.

(WebCore::RenderTextControlSingleLine::computeControlLogicalHeight):
(WebCore::RenderTextControlSingleLine::autoscroll):
(WebCore::RenderTextControlSingleLine::textShouldBeTruncated): Deleted.
* rendering/RenderTextControlSingleLine.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementcpp">trunk/Source/WebCore/html/HTMLInputElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementh">trunk/Source/WebCore/html/HTMLInputElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextAreaElementcpp">trunk/Source/WebCore/html/HTMLTextAreaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextAreaElementh">trunk/Source/WebCore/html/HTMLTextAreaElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextFormControlElementcpp">trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlTextFieldInputTypecpp">trunk/Source/WebCore/html/TextFieldInputType.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlshadowTextControlInnerElementscpp">trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlshadowTextControlInnerElementsh">trunk/Source/WebCore/html/shadow/TextControlInnerElements.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextControlSingleLinecpp">trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextControlSingleLineh">trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (197636 => 197637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-06 08:33:29 UTC (rev 197636)
+++ trunk/Source/WebCore/ChangeLog        2016-03-06 10:17:52 UTC (rev 197637)
</span><span class="lines">@@ -1,3 +1,64 @@
</span><ins>+2016-03-06  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        RenderTextControlSingleLine shouldn't mutate placeholder element inline style
+        https://bugs.webkit.org/show_bug.cgi?id=155086
+
+        Reviewed by Andreas Kling.
+
+        Text field placeholder element is currently managed by changing its inline style
+        from the host renderer based on the host style and state. Rendering poking
+        into DOM is wrong.
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::setRangeText):
+        (WebCore::HTMLInputElement::shouldTruncateText):
+
+            Add a helper.
+
+        (WebCore::HTMLInputElement::createInnerTextStyle):
+        * html/HTMLInputElement.h:
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::HTMLTextAreaElement):
+        (WebCore::HTMLTextAreaElement::placeholderElement):
+        (WebCore::HTMLTextAreaElement::matchesReadWritePseudoClass):
+        (WebCore::HTMLTextAreaElement::updatePlaceholderText):
+
+            Use the new shadow element.
+
+        * html/HTMLTextAreaElement.h:
+        * html/HTMLTextFormControlElement.cpp:
+        (WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility):
+
+            No more poking to inline style.
+
+        (WebCore::HTMLTextFormControlElement::setSelectionStart):
+        * html/TextFieldInputType.cpp:
+        (WebCore::TextFieldInputType::updatePlaceholderText):
+
+            Use the new shadow element.
+
+        * html/shadow/TextControlInnerElements.cpp:
+        (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):
+
+            Add a subclass for the placeholder element instead of just using div.
+
+        (WebCore::TextControlPlaceholderElement::customStyleForRenderer):
+
+            Compute style base on the host state and style.
+
+        (WebCore::SearchFieldResultsButtonElement::SearchFieldResultsButtonElement):
+        * html/shadow/TextControlInnerElements.h:
+        * rendering/RenderTextControlSingleLine.cpp:
+        (WebCore::RenderTextControlSingleLine::styleDidChange):
+
+            No more setInlineStyleProperty.
+            This now needs to trigger layout like it does with other inner elements.
+
+        (WebCore::RenderTextControlSingleLine::computeControlLogicalHeight):
+        (WebCore::RenderTextControlSingleLine::autoscroll):
+        (WebCore::RenderTextControlSingleLine::textShouldBeTruncated): Deleted.
+        * rendering/RenderTextControlSingleLine.h:
+
</ins><span class="cx"> 2016-03-05  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Add the support for upgrading custom elements in cloneNode
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (197636 => 197637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.cpp        2016-03-06 08:33:29 UTC (rev 197636)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp        2016-03-06 10:17:52 UTC (rev 197637)
</span><span class="lines">@@ -1859,6 +1859,13 @@
</span><span class="cx">     HTMLTextFormControlElement::setRangeText(replacement, start, end, selectionMode, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool HTMLInputElement::shouldTruncateText(const RenderStyle&amp; style) const
+{
+    if (!isTextField())
+        return false;
+    return document().focusedElement() != this &amp;&amp; style.textOverflow() == TextOverflowEllipsis;
+}
+
</ins><span class="cx"> Ref&lt;RenderStyle&gt; HTMLInputElement::createInnerTextStyle(const RenderStyle&amp; style) const
</span><span class="cx"> {
</span><span class="cx">     auto textBlockStyle = RenderStyle::create();
</span><span class="lines">@@ -1869,10 +1876,8 @@
</span><span class="cx">     textBlockStyle.get().setOverflowWrap(NormalOverflowWrap);
</span><span class="cx">     textBlockStyle.get().setOverflowX(OHIDDEN);
</span><span class="cx">     textBlockStyle.get().setOverflowY(OHIDDEN);
</span><ins>+    textBlockStyle.get().setTextOverflow(shouldTruncateText(style) ? TextOverflowEllipsis : TextOverflowClip);
</ins><span class="cx"> 
</span><del>-    bool textShouldBeTruncated = document().focusedElement() != this &amp;&amp; style.textOverflow() == TextOverflowEllipsis;
-    textBlockStyle.get().setTextOverflow(textShouldBeTruncated ? TextOverflowEllipsis : TextOverflowClip);
-
</del><span class="cx">     // Do not allow line-height to be smaller than our default.
</span><span class="cx">     if (textBlockStyle.get().fontMetrics().lineSpacing() &gt; style.computedLineHeight())
</span><span class="cx">         textBlockStyle.get().setLineHeight(RenderStyle::initialLineHeight());
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.h (197636 => 197637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.h        2016-03-06 08:33:29 UTC (rev 197636)
+++ trunk/Source/WebCore/html/HTMLInputElement.h        2016-03-06 10:17:52 UTC (rev 197637)
</span><span class="lines">@@ -321,6 +321,8 @@
</span><span class="cx"> 
</span><span class="cx">     void capsLockStateMayHaveChanged();
</span><span class="cx"> 
</span><ins>+    bool shouldTruncateText(const RenderStyle&amp;) const;
+
</ins><span class="cx"> protected:
</span><span class="cx">     HTMLInputElement(const QualifiedName&amp;, Document&amp;, HTMLFormElement*, bool createdByParser);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextAreaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.cpp (197636 => 197637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextAreaElement.cpp        2016-03-06 08:33:29 UTC (rev 197636)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.cpp        2016-03-06 10:17:52 UTC (rev 197637)
</span><span class="lines">@@ -92,10 +92,6 @@
</span><span class="cx">     : HTMLTextFormControlElement(tagName, document, form)
</span><span class="cx">     , m_rows(defaultRows)
</span><span class="cx">     , m_cols(defaultCols)
</span><del>-    , m_wrap(SoftWrap)
-    , m_placeholder(0)
-    , m_isDirty(false)
-    , m_wasModifiedByUser(false)
</del><span class="cx"> {
</span><span class="cx">     ASSERT(hasTagName(textareaTag));
</span><span class="cx">     setFormControlValueMatchesRenderer(true);
</span><span class="lines">@@ -497,7 +493,7 @@
</span><span class="cx"> 
</span><span class="cx"> HTMLElement* HTMLTextAreaElement::placeholderElement() const
</span><span class="cx"> {
</span><del>-    return m_placeholder;
</del><ins>+    return m_placeholder.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool HTMLTextAreaElement::matchesReadWritePseudoClass() const
</span><span class="lines">@@ -516,10 +512,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     if (!m_placeholder) {
</span><del>-        RefPtr&lt;HTMLDivElement&gt; placeholder = HTMLDivElement::create(document());
-        m_placeholder = placeholder.get();
-        m_placeholder-&gt;setPseudo(AtomicString(&quot;-webkit-input-placeholder&quot;, AtomicString::ConstructFromLiteral));
-        m_placeholder-&gt;setInlineStyleProperty(CSSPropertyDisplay, isPlaceholderVisible() ? CSSValueBlock : CSSValueNone, true);
</del><ins>+        m_placeholder = TextControlPlaceholderElement::create(document());
</ins><span class="cx">         userAgentShadowRoot()-&gt;insertBefore(*m_placeholder, innerTextElement()-&gt;nextSibling());
</span><span class="cx">     }
</span><span class="cx">     m_placeholder-&gt;setInnerText(placeholderText, ASSERT_NO_EXCEPTION);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextAreaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.h (197636 => 197637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextAreaElement.h        2016-03-06 08:33:29 UTC (rev 197636)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.h        2016-03-06 10:17:52 UTC (rev 197637)
</span><span class="lines">@@ -124,11 +124,11 @@
</span><span class="cx">     unsigned m_rows;
</span><span class="cx">     unsigned m_cols;
</span><span class="cx">     int m_maxLength { -1 };
</span><del>-    WrapMethod m_wrap;
-    HTMLElement* m_placeholder;
</del><ins>+    WrapMethod m_wrap { SoftWrap };
+    RefPtr&lt;HTMLElement&gt; m_placeholder;
</ins><span class="cx">     mutable String m_value;
</span><del>-    mutable bool m_isDirty;
-    mutable bool m_wasModifiedByUser;
</del><ins>+    mutable bool m_isDirty { false };
+    mutable bool m_wasModifiedByUser { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } //namespace
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextFormControlElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (197636 => 197637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp        2016-03-06 08:33:29 UTC (rev 197636)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp        2016-03-06 10:17:52 UTC (rev 197637)
</span><span class="lines">@@ -164,9 +164,6 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     setNeedsStyleRecalc();
</span><del>-
-    if (HTMLElement* placeholder = placeholderElement())
-        placeholder-&gt;setInlineStyleProperty(CSSPropertyDisplay, m_isPlaceholderVisible ? CSSValueBlock : CSSValueNone, true);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLTextFormControlElement::setSelectionStart(int start)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlTextFieldInputTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/TextFieldInputType.cpp (197636 => 197637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/TextFieldInputType.cpp        2016-03-06 08:33:29 UTC (rev 197636)
+++ trunk/Source/WebCore/html/TextFieldInputType.cpp        2016-03-06 10:17:52 UTC (rev 197637)
</span><span class="lines">@@ -494,11 +494,8 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     if (!m_placeholder) {
</span><del>-        m_placeholder = HTMLDivElement::create(element().document());
-        m_placeholder-&gt;setPseudo(AtomicString(&quot;-webkit-input-placeholder&quot;, AtomicString::ConstructFromLiteral));
-        m_placeholder-&gt;setInlineStyleProperty(CSSPropertyDisplay, element().isPlaceholderVisible() ? CSSValueBlock : CSSValueNone, true);
-        element().userAgentShadowRoot()-&gt;insertBefore(*m_placeholder, m_container ? m_container.get() : innerTextElement(), ASSERT_NO_EXCEPTION);
-        
</del><ins>+        m_placeholder = TextControlPlaceholderElement::create(element().document());
+        element().userAgentShadowRoot()-&gt;insertBefore(*m_placeholder, m_container ? m_container.get() : innerTextElement(), ASSERT_NO_EXCEPTION);        
</ins><span class="cx">     }
</span><span class="cx">     m_placeholder-&gt;setInnerText(placeholderText, ASSERT_NO_EXCEPTION);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlshadowTextControlInnerElementscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp (197636 => 197637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp        2016-03-06 08:33:29 UTC (rev 197636)
+++ trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp        2016-03-06 10:17:52 UTC (rev 197637)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #include &quot;RenderTextControl.h&quot;
</span><span class="cx"> #include &quot;RenderView.h&quot;
</span><span class="cx"> #include &quot;ScriptController.h&quot;
</span><ins>+#include &quot;ShadowRoot.h&quot;
</ins><span class="cx"> #include &quot;TextEvent.h&quot;
</span><span class="cx"> #include &quot;TextEventInputType.h&quot;
</span><span class="cx"> #include &lt;wtf/Ref.h&gt;
</span><span class="lines">@@ -139,6 +140,30 @@
</span><span class="cx"> 
</span><span class="cx"> // ----------------------------
</span><span class="cx"> 
</span><ins>+TextControlPlaceholderElement::TextControlPlaceholderElement(Document&amp; document)
+    : HTMLDivElement(divTag, document)
+{
+    setPseudo(AtomicString(&quot;-webkit-input-placeholder&quot;, AtomicString::ConstructFromLiteral));
+    setHasCustomStyleResolveCallbacks();
+}
+
+RefPtr&lt;RenderStyle&gt; TextControlPlaceholderElement::customStyleForRenderer(RenderStyle&amp; parentStyle, RenderStyle* shadowHostStyle)
+{
+    auto style = resolveStyle(&amp;parentStyle);
+
+    auto&amp; controlElement = downcast&lt;HTMLTextFormControlElement&gt;(*containingShadowRoot()-&gt;host());
+    style-&gt;setDisplay(controlElement.isPlaceholderVisible() ? BLOCK : NONE);
+
+    if (is&lt;HTMLInputElement&gt;(controlElement)) {
+        auto&amp; inputElement = downcast&lt;HTMLInputElement&gt;(controlElement);
+        style-&gt;setTextOverflow(inputElement.shouldTruncateText(*shadowHostStyle) ? TextOverflowEllipsis : TextOverflowClip);
+    }
+
+    return WTFMove(style);
+}
+
+// ----------------------------
+
</ins><span class="cx"> inline SearchFieldResultsButtonElement::SearchFieldResultsButtonElement(Document&amp; document)
</span><span class="cx">     : HTMLDivElement(divTag, document)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlshadowTextControlInnerElementsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/shadow/TextControlInnerElements.h (197636 => 197637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/shadow/TextControlInnerElements.h        2016-03-06 08:33:29 UTC (rev 197636)
+++ trunk/Source/WebCore/html/shadow/TextControlInnerElements.h        2016-03-06 10:17:52 UTC (rev 197637)
</span><span class="lines">@@ -70,6 +70,16 @@
</span><span class="cx">     bool isTextControlInnerTextElement() const override { return true; }
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+class TextControlPlaceholderElement final : public HTMLDivElement {
+public:
+    static Ref&lt;TextControlPlaceholderElement&gt; create(Document&amp; document) { return adoptRef(*new TextControlPlaceholderElement(document)); }
+
+private:
+    TextControlPlaceholderElement(Document&amp;);
+    
+    RefPtr&lt;RenderStyle&gt; customStyleForRenderer(RenderStyle&amp; parentStyle, RenderStyle* shadowHostStyle) override;
+};
+
</ins><span class="cx"> class SearchFieldResultsButtonElement final : public HTMLDivElement {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;SearchFieldResultsButtonElement&gt; create(Document&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextControlSingleLinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp (197636 => 197637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp        2016-03-06 08:33:29 UTC (rev 197636)
+++ trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp        2016-03-06 10:17:52 UTC (rev 197637)
</span><span class="lines">@@ -245,11 +245,14 @@
</span><span class="cx">         containerRenderer-&gt;style().setHeight(Length());
</span><span class="cx">         containerRenderer-&gt;style().setWidth(Length());
</span><span class="cx">     }
</span><del>-    RenderTextControlInnerBlock* innerTextRenderer = innerTextElement()-&gt;renderer();
-    if (innerTextRenderer &amp;&amp; diff == StyleDifferenceLayout)
-        innerTextRenderer-&gt;setNeedsLayout(MarkContainingBlockChain);
-    if (HTMLElement* placeholder = inputElement().placeholderElement())
-        placeholder-&gt;setInlineStyleProperty(CSSPropertyTextOverflow, textShouldBeTruncated() ? CSSValueEllipsis : CSSValueClip);
</del><ins>+    if (diff == StyleDifferenceLayout) {
+        if (auto* innerTextRenderer = innerTextElement()-&gt;renderer())
+            innerTextRenderer-&gt;setNeedsLayout(MarkContainingBlockChain);
+        if (auto* placeholder = inputElement().placeholderElement()) {
+            if (placeholder-&gt;renderer())
+                placeholder-&gt;renderer()-&gt;setNeedsLayout(MarkContainingBlockChain);
+        }
+    }
</ins><span class="cx">     setHasOverflowClip(false);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -321,11 +324,6 @@
</span><span class="cx">     return lineHeight + nonContentHeight;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderTextControlSingleLine::textShouldBeTruncated() const
-{
-    return document().focusedElement() != &amp;inputElement() &amp;&amp; style().textOverflow() == TextOverflowEllipsis;
-}
-
</del><span class="cx"> void RenderTextControlSingleLine::autoscroll(const IntPoint&amp; position)
</span><span class="cx"> {
</span><span class="cx">     RenderTextControlInnerBlock* renderer = innerTextElement()-&gt;renderer();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextControlSingleLineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h (197636 => 197637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h        2016-03-06 08:33:29 UTC (rev 197636)
+++ trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h        2016-03-06 10:17:52 UTC (rev 197637)
</span><span class="lines">@@ -73,8 +73,6 @@
</span><span class="cx">     
</span><span class="cx">     void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
</span><span class="cx"> 
</span><del>-    bool textShouldBeTruncated() const;
-
</del><span class="cx">     HTMLElement* innerSpinButtonElement() const;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>