<!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>[197401] 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/197401">197401</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2016-03-01 09:33:47 -0800 (Tue, 01 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Text control shadow element style shouldn't depend on renderers
https://bugs.webkit.org/show_bug.cgi?id=154855

Reviewed by Andreas Kling.

Currently the code for computing style for text control shadow elements lives in render tree.
Style is the input for building a render tree and should be computable without having one.

Fix by moving virtual createInnerTextStyle() from RenderTextControl hierarchy to the DOM side
HTMLTextFormControlElement hierarchy.

* dom/Element.cpp:
(WebCore::Element::didDetachRenderers):
(WebCore::Element::customStyleForRenderer):

    Also pass shadow host style as it is needed for text controls.

* dom/Element.h:
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement):
(WebCore::PseudoElement::customStyleForRenderer):
* dom/PseudoElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setRangeText):
(WebCore::HTMLInputElement::createInnerTextStyle):
(WebCore::HTMLInputElement::setupDateTimeChooserParameters):
* html/HTMLInputElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::willRespondToMouseClickEvents):
(WebCore::HTMLTextAreaElement::createInnerTextStyle):
* html/HTMLTextAreaElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::directionForFormData):
(WebCore::HTMLTextFormControlElement::adjustInnerTextStyle):
* html/HTMLTextFormControlElement.h:
(WebCore::HTMLTextFormControlElement::cachedSelectionDirection):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerElement::create):
(WebCore::TextControlInnerElement::customStyleForRenderer):
(WebCore::TextControlInnerTextElement::renderer):
(WebCore::TextControlInnerTextElement::customStyleForRenderer):
* html/shadow/TextControlInnerElements.h:
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::styleDidChange):
(WebCore::RenderTextControl::textBlockLogicalHeight):
(WebCore::RenderTextControl::adjustInnerTextStyle): Deleted.
* rendering/RenderTextControl.h:
* rendering/RenderTextControlMultiLine.cpp:
(WebCore::RenderTextControlMultiLine::baselinePosition):
(WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild):
(WebCore::RenderTextControlMultiLine::createInnerTextStyle): Deleted.

    createInnerTextStyle moves to HTMLTextAreaElement::createInnerTextStyle

* rendering/RenderTextControlMultiLine.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):

    Remove m_desiredInnerTextLogicalHeight cache. It doesn't work, it is never valid when hit.

(WebCore::RenderTextControlSingleLine::layout):
(WebCore::RenderTextControlSingleLine::styleDidChange):
(WebCore::RenderTextControlSingleLine::computeControlLogicalHeight):
(WebCore::RenderTextControlSingleLine::textShouldBeTruncated):
(WebCore::RenderTextControlSingleLine::createInnerTextStyle): Deleted.
(WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Deleted.

    - createInnerTextStyle moves to HTMLInputElement::createInnerTextStyle
    - createInnerBlockStyle moves to TextControlInnerElement::customStyleForRenderer

* rendering/RenderTextControlSingleLine.h:
(WebCore::RenderTextControlSingleLine::centerContainerIfNeeded):
(WebCore::RenderTextControlSingleLine::containerElement):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::styleForElement):
* svg/SVGElement.cpp:
(WebCore::SVGElement::synchronizeSystemLanguage):
(WebCore::SVGElement::customStyleForRenderer):
* svg/SVGElement.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementh">trunk/Source/WebCore/dom/Element.h</a></li>
<li><a href="#trunkSourceWebCoredomPseudoElementcpp">trunk/Source/WebCore/dom/PseudoElement.cpp</a></li>
<li><a href="#trunkSourceWebCoredomPseudoElementh">trunk/Source/WebCore/dom/PseudoElement.h</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="#trunkSourceWebCorehtmlHTMLTextFormControlElementh">trunk/Source/WebCore/html/HTMLTextFormControlElement.h</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="#trunkSourceWebCorerenderingRenderTextControlcpp">trunk/Source/WebCore/rendering/RenderTextControl.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextControlh">trunk/Source/WebCore/rendering/RenderTextControl.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextControlMultiLinecpp">trunk/Source/WebCore/rendering/RenderTextControlMultiLine.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextControlMultiLineh">trunk/Source/WebCore/rendering/RenderTextControlMultiLine.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>
<li><a href="#trunkSourceWebCorestyleStyleTreeResolvercpp">trunk/Source/WebCore/style/StyleTreeResolver.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGElementcpp">trunk/Source/WebCore/svg/SVGElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGElementh">trunk/Source/WebCore/svg/SVGElement.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/ChangeLog        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -1,3 +1,85 @@
</span><ins>+2016-03-01  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        Text control shadow element style shouldn't depend on renderers
+        https://bugs.webkit.org/show_bug.cgi?id=154855
+
+        Reviewed by Andreas Kling.
+
+        Currently the code for computing style for text control shadow elements lives in render tree.
+        Style is the input for building a render tree and should be computable without having one.
+
+        Fix by moving virtual createInnerTextStyle() from RenderTextControl hierarchy to the DOM side
+        HTMLTextFormControlElement hierarchy.
+
+        * dom/Element.cpp:
+        (WebCore::Element::didDetachRenderers):
+        (WebCore::Element::customStyleForRenderer):
+
+            Also pass shadow host style as it is needed for text controls.
+
+        * dom/Element.h:
+        * dom/PseudoElement.cpp:
+        (WebCore::PseudoElement::clearHostElement):
+        (WebCore::PseudoElement::customStyleForRenderer):
+        * dom/PseudoElement.h:
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::setRangeText):
+        (WebCore::HTMLInputElement::createInnerTextStyle):
+        (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
+        * html/HTMLInputElement.h:
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::willRespondToMouseClickEvents):
+        (WebCore::HTMLTextAreaElement::createInnerTextStyle):
+        * html/HTMLTextAreaElement.h:
+        * html/HTMLTextFormControlElement.cpp:
+        (WebCore::HTMLTextFormControlElement::directionForFormData):
+        (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle):
+        * html/HTMLTextFormControlElement.h:
+        (WebCore::HTMLTextFormControlElement::cachedSelectionDirection):
+        * html/shadow/TextControlInnerElements.cpp:
+        (WebCore::TextControlInnerElement::create):
+        (WebCore::TextControlInnerElement::customStyleForRenderer):
+        (WebCore::TextControlInnerTextElement::renderer):
+        (WebCore::TextControlInnerTextElement::customStyleForRenderer):
+        * html/shadow/TextControlInnerElements.h:
+        * rendering/RenderTextControl.cpp:
+        (WebCore::RenderTextControl::styleDidChange):
+        (WebCore::RenderTextControl::textBlockLogicalHeight):
+        (WebCore::RenderTextControl::adjustInnerTextStyle): Deleted.
+        * rendering/RenderTextControl.h:
+        * rendering/RenderTextControlMultiLine.cpp:
+        (WebCore::RenderTextControlMultiLine::baselinePosition):
+        (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild):
+        (WebCore::RenderTextControlMultiLine::createInnerTextStyle): Deleted.
+
+            createInnerTextStyle moves to HTMLTextAreaElement::createInnerTextStyle
+
+        * rendering/RenderTextControlMultiLine.h:
+        * rendering/RenderTextControlSingleLine.cpp:
+        (WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):
+
+            Remove m_desiredInnerTextLogicalHeight cache. It doesn't work, it is never valid when hit.
+
+        (WebCore::RenderTextControlSingleLine::layout):
+        (WebCore::RenderTextControlSingleLine::styleDidChange):
+        (WebCore::RenderTextControlSingleLine::computeControlLogicalHeight):
+        (WebCore::RenderTextControlSingleLine::textShouldBeTruncated):
+        (WebCore::RenderTextControlSingleLine::createInnerTextStyle): Deleted.
+        (WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Deleted.
+
+            - createInnerTextStyle moves to HTMLInputElement::createInnerTextStyle
+            - createInnerBlockStyle moves to TextControlInnerElement::customStyleForRenderer
+
+        * rendering/RenderTextControlSingleLine.h:
+        (WebCore::RenderTextControlSingleLine::centerContainerIfNeeded):
+        (WebCore::RenderTextControlSingleLine::containerElement):
+        * style/StyleTreeResolver.cpp:
+        (WebCore::Style::TreeResolver::styleForElement):
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::synchronizeSystemLanguage):
+        (WebCore::SVGElement::customStyleForRenderer):
+        * svg/SVGElement.h:
+
</ins><span class="cx"> 2016-03-01  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [css-grid] Get rid of GridResolvedPosition
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/dom/Element.cpp        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -3265,7 +3265,7 @@
</span><span class="cx">     ASSERT(hasCustomStyleResolveCallbacks());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;RenderStyle&gt; Element::customStyleForRenderer(RenderStyle&amp;)
</del><ins>+RefPtr&lt;RenderStyle&gt; Element::customStyleForRenderer(RenderStyle&amp;, RenderStyle*)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(hasCustomStyleResolveCallbacks());
</span><span class="cx">     return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.h (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.h        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/dom/Element.h        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -476,7 +476,7 @@
</span><span class="cx">     virtual void didAttachRenderers();
</span><span class="cx">     virtual void willDetachRenderers();
</span><span class="cx">     virtual void didDetachRenderers();
</span><del>-    virtual RefPtr&lt;RenderStyle&gt; customStyleForRenderer(RenderStyle&amp; parentStyle);
</del><ins>+    virtual RefPtr&lt;RenderStyle&gt; customStyleForRenderer(RenderStyle&amp; parentStyle, RenderStyle* shadowHostStyle);
</ins><span class="cx"> 
</span><span class="cx">     LayoutRect absoluteEventHandlerBounds(bool&amp; includesFixedPositionElements) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomPseudoElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/PseudoElement.cpp (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/PseudoElement.cpp        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/dom/PseudoElement.cpp        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx">     m_hostElement = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;RenderStyle&gt; PseudoElement::customStyleForRenderer(RenderStyle&amp; parentStyle)
</del><ins>+RefPtr&lt;RenderStyle&gt; PseudoElement::customStyleForRenderer(RenderStyle&amp; parentStyle, RenderStyle*)
</ins><span class="cx"> {
</span><span class="cx">     return m_hostElement-&gt;renderer()-&gt;getCachedPseudoStyle(m_pseudoId, &amp;parentStyle);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomPseudoElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/PseudoElement.h (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/PseudoElement.h        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/dom/PseudoElement.h        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">     Element* hostElement() const { return m_hostElement; }
</span><span class="cx">     void clearHostElement();
</span><span class="cx"> 
</span><del>-    virtual RefPtr&lt;RenderStyle&gt; customStyleForRenderer(RenderStyle&amp; parentStyle) override;
</del><ins>+    virtual RefPtr&lt;RenderStyle&gt; customStyleForRenderer(RenderStyle&amp; parentStyle, RenderStyle* shadowHostStyle) override;
</ins><span class="cx">     virtual void didAttachRenderers() override;
</span><span class="cx">     virtual void didRecalcStyle(Style::Change) override;
</span><span class="cx">     virtual bool rendererIsNeeded(const RenderStyle&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.cpp        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -1867,6 +1867,29 @@
</span><span class="cx">     HTMLTextFormControlElement::setRangeText(replacement, start, end, selectionMode, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Ref&lt;RenderStyle&gt; HTMLInputElement::createInnerTextStyle(const RenderStyle&amp; style) const
+{
+    auto textBlockStyle = RenderStyle::create();
+    textBlockStyle.get().inheritFrom(&amp;style);
+    adjustInnerTextStyle(style, textBlockStyle.get());
+
+    textBlockStyle.get().setWhiteSpace(PRE);
+    textBlockStyle.get().setOverflowWrap(NormalOverflowWrap);
+    textBlockStyle.get().setOverflowX(OHIDDEN);
+    textBlockStyle.get().setOverflowY(OHIDDEN);
+
+    bool textShouldBeTruncated = document().focusedElement() != this &amp;&amp; style.textOverflow() == TextOverflowEllipsis;
+    textBlockStyle.get().setTextOverflow(textShouldBeTruncated ? TextOverflowEllipsis : TextOverflowClip);
+
+    // Do not allow line-height to be smaller than our default.
+    if (textBlockStyle.get().fontMetrics().lineSpacing() &gt; style.computedLineHeight())
+        textBlockStyle.get().setLineHeight(RenderStyle::initialLineHeight());
+
+    textBlockStyle.get().setDisplay(BLOCK);
+
+    return textBlockStyle;
+}
+
</ins><span class="cx"> #if ENABLE(DATE_AND_TIME_INPUT_TYPES)
</span><span class="cx"> bool HTMLInputElement::setupDateTimeChooserParameters(DateTimeChooserParameters&amp; parameters)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.h (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.h        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/html/HTMLInputElement.h        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -140,7 +140,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     HTMLElement* containerElement() const;
</span><ins>+    
</ins><span class="cx">     virtual TextControlInnerTextElement* innerTextElement() const override final;
</span><ins>+    virtual Ref&lt;RenderStyle&gt; createInnerTextStyle(const RenderStyle&amp;) const override;
+
</ins><span class="cx">     HTMLElement* innerBlockElement() const;
</span><span class="cx">     HTMLElement* innerSpinButtonElement() const;
</span><span class="cx">     HTMLElement* capsLockIndicatorElement() const;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextAreaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.cpp (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextAreaElement.cpp        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.cpp        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -540,4 +540,20 @@
</span><span class="cx">     return !isDisabledFormControl();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Ref&lt;RenderStyle&gt; HTMLTextAreaElement::createInnerTextStyle(const RenderStyle&amp; style) const
+{
+    auto textBlockStyle = RenderStyle::create();
+    textBlockStyle.get().inheritFrom(&amp;style);
+    adjustInnerTextStyle(style, textBlockStyle.get());
+    textBlockStyle.get().setDisplay(BLOCK);
+
+#if PLATFORM(IOS)
+    // We're adding three extra pixels of padding to line textareas up with text fields.  
+    textBlockStyle.get().setPaddingLeft(Length(3, Fixed));
+    textBlockStyle.get().setPaddingRight(Length(3, Fixed));
+#endif
+
+    return textBlockStyle;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextAreaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.h (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextAreaElement.h        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.h        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx">     bool isValidValue(const String&amp;) const;
</span><span class="cx">     
</span><span class="cx">     virtual TextControlInnerTextElement* innerTextElement() const override;
</span><ins>+    virtual Ref&lt;RenderStyle&gt; createInnerTextStyle(const RenderStyle&amp;) const override;
</ins><span class="cx"> 
</span><span class="cx">     void rendererWillBeDestroyed();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextFormControlElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;HTMLTextFormControlElement.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;AXObjectCache.h&quot;
</span><ins>+#include &quot;CSSPrimitiveValueMappings.h&quot;
</ins><span class="cx"> #include &quot;ChromeClient.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;Event.h&quot;
</span><span class="lines">@@ -758,4 +759,48 @@
</span><span class="cx">     return &quot;ltr&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void HTMLTextFormControlElement::adjustInnerTextStyle(const RenderStyle&amp; parentStyle, RenderStyle&amp; textBlockStyle) const
+{
+    // The inner block, if present, always has its direction set to LTR,
+    // so we need to inherit the direction and unicode-bidi style from the element.
+    textBlockStyle.setDirection(parentStyle.direction());
+    textBlockStyle.setUnicodeBidi(parentStyle.unicodeBidi());
+
+    if (HTMLElement* innerText = innerTextElement()) {
+        if (const StyleProperties* properties = innerText-&gt;presentationAttributeStyle()) {
+            RefPtr&lt;CSSValue&gt; value = properties-&gt;getPropertyCSSValue(CSSPropertyWebkitUserModify);
+            if (is&lt;CSSPrimitiveValue&gt;(value.get()))
+                textBlockStyle.setUserModify(downcast&lt;CSSPrimitiveValue&gt;(*value));
+        }
+    }
+
+    if (isDisabledFormControl())
+        textBlockStyle.setColor(document().page()-&gt;theme().disabledTextColor(textBlockStyle.visitedDependentColor(CSSPropertyColor), parentStyle.visitedDependentColor(CSSPropertyBackgroundColor)));
+#if PLATFORM(IOS)
+    if (textBlockStyle.textSecurity() != TSNONE &amp;&amp; !textBlockStyle.isLeftToRightDirection()) {
+        // Preserve the alignment but force the direction to LTR so that the last-typed, unmasked character
+        // (which cannot have RTL directionality) will appear to the right of the masked characters. See &lt;rdar://problem/7024375&gt;.
+        
+        switch (textBlockStyle.textAlign()) {
+        case TASTART:
+        case JUSTIFY:
+            textBlockStyle.setTextAlign(RIGHT);
+            break;
+        case TAEND:
+            textBlockStyle.setTextAlign(LEFT);
+            break;
+        case LEFT:
+        case RIGHT:
+        case CENTER:
+        case WEBKIT_LEFT:
+        case WEBKIT_RIGHT:
+        case WEBKIT_CENTER:
+            break;
+        }
+
+        textBlockStyle.setDirection(LTR);
+    }
+#endif
+}
+
</ins><span class="cx"> } // namespace Webcore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextFormControlElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.h (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextFormControlElement.h        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.h        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -79,6 +79,7 @@
</span><span class="cx">     virtual String value() const = 0;
</span><span class="cx"> 
</span><span class="cx">     virtual TextControlInnerTextElement* innerTextElement() const = 0;
</span><ins>+    virtual Ref&lt;RenderStyle&gt; createInnerTextStyle(const RenderStyle&amp;) const = 0;
</ins><span class="cx"> 
</span><span class="cx">     void selectionChanged(bool shouldFireSelectEvent);
</span><span class="cx">     WEBCORE_EXPORT bool lastChangeWasUserEdit() const;
</span><span class="lines">@@ -120,6 +121,8 @@
</span><span class="cx"> 
</span><span class="cx">     String valueWithHardLineBreaks() const;
</span><span class="cx"> 
</span><ins>+    void adjustInnerTextStyle(const RenderStyle&amp; parentStyle, RenderStyle&amp; textBlockStyle) const;
+
</ins><span class="cx"> private:
</span><span class="cx">     TextFieldSelectionDirection cachedSelectionDirection() const { return static_cast&lt;TextFieldSelectionDirection&gt;(m_cachedSelectionDirection); }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlshadowTextControlInnerElementscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -73,10 +73,21 @@
</span><span class="cx">     return adoptRef(*new TextControlInnerElement(document));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;RenderStyle&gt; TextControlInnerElement::customStyleForRenderer(RenderStyle&amp;)
</del><ins>+RefPtr&lt;RenderStyle&gt; TextControlInnerElement::customStyleForRenderer(RenderStyle&amp;, RenderStyle* shadowHostStyle)
</ins><span class="cx"> {
</span><del>-    RenderTextControlSingleLine&amp; parentRenderer = downcast&lt;RenderTextControlSingleLine&gt;(*shadowHost()-&gt;renderer());
-    return parentRenderer.createInnerBlockStyle(&amp;parentRenderer.style());
</del><ins>+    auto innerContainerStyle = RenderStyle::create();
+    innerContainerStyle.get().inheritFrom(shadowHostStyle);
+
+    innerContainerStyle.get().setFlexGrow(1);
+    // min-width: 0; is needed for correct shrinking.
+    innerContainerStyle.get().setMinWidth(Length(0, Fixed));
+    innerContainerStyle.get().setDisplay(BLOCK);
+    innerContainerStyle.get().setDirection(LTR);
+
+    // We don't want the shadow dom to be editable, so we set this block to read-only in case the input itself is editable.
+    innerContainerStyle.get().setUserModify(READ_ONLY);
+
+    return WTFMove(innerContainerStyle);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // ---------------------------
</span><span class="lines">@@ -121,10 +132,9 @@
</span><span class="cx">     return downcast&lt;RenderTextControlInnerBlock&gt;(HTMLDivElement::renderer());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;RenderStyle&gt; TextControlInnerTextElement::customStyleForRenderer(RenderStyle&amp;)
</del><ins>+RefPtr&lt;RenderStyle&gt; TextControlInnerTextElement::customStyleForRenderer(RenderStyle&amp;, RenderStyle* shadowHostStyle)
</ins><span class="cx"> {
</span><del>-    RenderTextControl&amp; parentRenderer = downcast&lt;RenderTextControl&gt;(*shadowHost()-&gt;renderer());
-    return parentRenderer.createInnerTextStyle(&amp;parentRenderer.style());
</del><ins>+    return downcast&lt;HTMLTextFormControlElement&gt;(*shadowHost()).createInnerTextStyle(*shadowHostStyle);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // ----------------------------
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlshadowTextControlInnerElementsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/shadow/TextControlInnerElements.h (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/shadow/TextControlInnerElements.h        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/html/shadow/TextControlInnerElements.h        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     TextControlInnerElement(Document&amp;);
</span><del>-    virtual RefPtr&lt;RenderStyle&gt; customStyleForRenderer(RenderStyle&amp; parentStyle) override;
</del><ins>+    virtual RefPtr&lt;RenderStyle&gt; customStyleForRenderer(RenderStyle&amp; parentStyle, RenderStyle* shadowHostStyle) override;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     virtual bool isMouseFocusable() const override { return false; }
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> private:
</span><span class="cx">     TextControlInnerTextElement(Document&amp;);
</span><span class="cx">     virtual RenderPtr&lt;RenderElement&gt; createElementRenderer(Ref&lt;RenderStyle&gt;&amp;&amp;, const RenderTreePosition&amp;) override;
</span><del>-    virtual RefPtr&lt;RenderStyle&gt; customStyleForRenderer(RenderStyle&amp; parentStyle) override;
</del><ins>+    virtual RefPtr&lt;RenderStyle&gt; customStyleForRenderer(RenderStyle&amp; parentStyle, RenderStyle* shadowHostStyle) override;
</ins><span class="cx">     virtual bool isMouseFocusable() const override { return false; }
</span><span class="cx">     virtual bool isTextControlInnerTextElement() const override { return true; }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextControlcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTextControl.cpp (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTextControl.cpp        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/rendering/RenderTextControl.cpp        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -22,7 +22,6 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;RenderTextControl.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;CSSPrimitiveValueMappings.h&quot;
</del><span class="cx"> #include &quot;HTMLTextFormControlElement.h&quot;
</span><span class="cx"> #include &quot;HitTestResult.h&quot;
</span><span class="cx"> #include &quot;RenderText.h&quot;
</span><span class="lines">@@ -68,56 +67,11 @@
</span><span class="cx">         // Reset them now to avoid getting a spurious layout hint.
</span><span class="cx">         innerTextRenderer-&gt;style().setHeight(Length());
</span><span class="cx">         innerTextRenderer-&gt;style().setWidth(Length());
</span><del>-        innerTextRenderer-&gt;setStyle(createInnerTextStyle(&amp;style()));
</del><ins>+        innerTextRenderer-&gt;setStyle(textFormControlElement().createInnerTextStyle(style()));
</ins><span class="cx">     }
</span><span class="cx">     textFormControlElement().updatePlaceholderVisibility();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderTextControl::adjustInnerTextStyle(const RenderStyle* startStyle, RenderStyle&amp; textBlockStyle) const
-{
-    // The inner block, if present, always has its direction set to LTR,
-    // so we need to inherit the direction and unicode-bidi style from the element.
-    textBlockStyle.setDirection(style().direction());
-    textBlockStyle.setUnicodeBidi(style().unicodeBidi());
-
-    HTMLTextFormControlElement&amp; control = textFormControlElement();
-    if (HTMLElement* innerText = control.innerTextElement()) {
-        if (const StyleProperties* properties = innerText-&gt;presentationAttributeStyle()) {
-            RefPtr&lt;CSSValue&gt; value = properties-&gt;getPropertyCSSValue(CSSPropertyWebkitUserModify);
-            if (is&lt;CSSPrimitiveValue&gt;(value.get()))
-                textBlockStyle.setUserModify(downcast&lt;CSSPrimitiveValue&gt;(*value));
-        }
-    }
-
-    if (control.isDisabledFormControl())
-        textBlockStyle.setColor(theme().disabledTextColor(textBlockStyle.visitedDependentColor(CSSPropertyColor), startStyle-&gt;visitedDependentColor(CSSPropertyBackgroundColor)));
-#if PLATFORM(IOS)
-    if (textBlockStyle.textSecurity() != TSNONE &amp;&amp; !textBlockStyle.isLeftToRightDirection()) {
-        // Preserve the alignment but force the direction to LTR so that the last-typed, unmasked character
-        // (which cannot have RTL directionality) will appear to the right of the masked characters. See &lt;rdar://problem/7024375&gt;.
-        
-        switch (textBlockStyle.textAlign()) {
-        case TASTART:
-        case JUSTIFY:
-            textBlockStyle.setTextAlign(RIGHT);
-            break;
-        case TAEND:
-            textBlockStyle.setTextAlign(LEFT);
-            break;
-        case LEFT:
-        case RIGHT:
-        case CENTER:
-        case WEBKIT_LEFT:
-        case WEBKIT_RIGHT:
-        case WEBKIT_CENTER:
-            break;
-        }
-
-        textBlockStyle.setDirection(LTR);
-    }
-#endif
-}
-
</del><span class="cx"> int RenderTextControl::textBlockLogicalHeight() const
</span><span class="cx"> {
</span><span class="cx">     return logicalHeight() - borderAndPaddingLogicalHeight();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextControlh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTextControl.h (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTextControl.h        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/rendering/RenderTextControl.h        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -35,7 +35,6 @@
</span><span class="cx">     virtual ~RenderTextControl();
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT HTMLTextFormControlElement&amp; textFormControlElement() const;
</span><del>-    virtual Ref&lt;RenderStyle&gt; createInnerTextStyle(const RenderStyle* startStyle) const = 0;
</del><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     bool canScroll() const;
</span><span class="lines">@@ -51,7 +50,6 @@
</span><span class="cx">     TextControlInnerTextElement* innerTextElement() const;
</span><span class="cx"> 
</span><span class="cx">     int scrollbarThickness() const;
</span><del>-    void adjustInnerTextStyle(const RenderStyle* startStyle, RenderStyle&amp; textBlockStyle) const;
</del><span class="cx"> 
</span><span class="cx">     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextControlMultiLinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTextControlMultiLine.cpp (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTextControlMultiLine.cpp        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/rendering/RenderTextControlMultiLine.cpp        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -87,22 +87,6 @@
</span><span class="cx">     return RenderBox::baselinePosition(baselineType, firstLine, direction, linePositionMode);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref&lt;RenderStyle&gt; RenderTextControlMultiLine::createInnerTextStyle(const RenderStyle* startStyle) const
-{
-    auto textBlockStyle = RenderStyle::create();
-    textBlockStyle.get().inheritFrom(startStyle);
-    adjustInnerTextStyle(startStyle, textBlockStyle.get());
-    textBlockStyle.get().setDisplay(BLOCK);
-
-#if PLATFORM(IOS)
-    // We're adding three extra pixels of padding to line textareas up with text fields.  
-    textBlockStyle.get().setPaddingLeft(Length(3, Fixed));
-    textBlockStyle.get().setPaddingRight(Length(3, Fixed));
-#endif
-
-    return textBlockStyle;
-}
-
</del><span class="cx"> RenderObject* RenderTextControlMultiLine::layoutSpecialExcludedChild(bool relayoutChildren)
</span><span class="cx"> {
</span><span class="cx">     RenderObject* placeholderRenderer = RenderTextControl::layoutSpecialExcludedChild(relayoutChildren);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextControlMultiLineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTextControlMultiLine.h (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTextControlMultiLine.h        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/rendering/RenderTextControlMultiLine.h        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -47,7 +47,6 @@
</span><span class="cx">     virtual LayoutUnit computeControlLogicalHeight(LayoutUnit lineHeight, LayoutUnit nonContentHeight) const override;
</span><span class="cx">     virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const override;
</span><span class="cx"> 
</span><del>-    virtual Ref&lt;RenderStyle&gt; createInnerTextStyle(const RenderStyle* startStyle) const override;
</del><span class="cx">     virtual RenderObject* layoutSpecialExcludedChild(bool relayoutChildren) override;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextControlSingleLinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -55,7 +55,6 @@
</span><span class="cx"> 
</span><span class="cx"> RenderTextControlSingleLine::RenderTextControlSingleLine(HTMLInputElement&amp; element, Ref&lt;RenderStyle&gt;&amp;&amp; style)
</span><span class="cx">     : RenderTextControl(element, WTFMove(style))
</span><del>-    , m_desiredInnerTextLogicalHeight(-1)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -129,8 +128,6 @@
</span><span class="cx">         if (desiredLogicalHeight != innerTextRenderer-&gt;logicalHeight())
</span><span class="cx">             setNeedsLayout(MarkOnlyThis);
</span><span class="cx"> 
</span><del>-        m_desiredInnerTextLogicalHeight = desiredLogicalHeight;
-
</del><span class="cx">         innerTextRenderer-&gt;style().setLogicalHeight(Length(desiredLogicalHeight, Fixed));
</span><span class="cx">         innerTextRenderer-&gt;setNeedsLayout(MarkOnlyThis);
</span><span class="cx">         if (innerBlockRenderer) {
</span><span class="lines">@@ -234,7 +231,6 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderTextControlSingleLine::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
</span><span class="cx"> {
</span><del>-    m_desiredInnerTextLogicalHeight = -1;
</del><span class="cx">     RenderTextControl::styleDidChange(diff, oldStyle);
</span><span class="cx"> 
</span><span class="cx">     // We may have set the width and the height in the old style in layout().
</span><span class="lines">@@ -325,46 +321,6 @@
</span><span class="cx">     return lineHeight + nonContentHeight;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref&lt;RenderStyle&gt; RenderTextControlSingleLine::createInnerTextStyle(const RenderStyle* startStyle) const
-{
-    auto textBlockStyle = RenderStyle::create();
-    textBlockStyle.get().inheritFrom(startStyle);
-    adjustInnerTextStyle(startStyle, textBlockStyle.get());
-
-    textBlockStyle.get().setWhiteSpace(PRE);
-    textBlockStyle.get().setOverflowWrap(NormalOverflowWrap);
-    textBlockStyle.get().setOverflowX(OHIDDEN);
-    textBlockStyle.get().setOverflowY(OHIDDEN);
-    textBlockStyle.get().setTextOverflow(textShouldBeTruncated() ? TextOverflowEllipsis : TextOverflowClip);
-
-    if (m_desiredInnerTextLogicalHeight &gt;= 0)
-        textBlockStyle.get().setLogicalHeight(Length(m_desiredInnerTextLogicalHeight, Fixed));
-    // Do not allow line-height to be smaller than our default.
-    if (textBlockStyle.get().fontMetrics().lineSpacing() &gt; lineHeight(true, HorizontalLine, PositionOfInteriorLineBoxes))
-        textBlockStyle.get().setLineHeight(RenderStyle::initialLineHeight());
-
-    textBlockStyle.get().setDisplay(BLOCK);
-
-    return textBlockStyle;
-}
-
-Ref&lt;RenderStyle&gt; RenderTextControlSingleLine::createInnerBlockStyle(const RenderStyle* startStyle) const
-{
-    auto innerBlockStyle = RenderStyle::create();
-    innerBlockStyle.get().inheritFrom(startStyle);
-
-    innerBlockStyle.get().setFlexGrow(1);
-    // min-width: 0; is needed for correct shrinking.
-    innerBlockStyle.get().setMinWidth(Length(0, Fixed));
-    innerBlockStyle.get().setDisplay(BLOCK);
-    innerBlockStyle.get().setDirection(LTR);
-
-    // We don't want the shadow dom to be editable, so we set this block to read-only in case the input itself is editable.
-    innerBlockStyle.get().setUserModify(READ_ONLY);
-
-    return innerBlockStyle;
-}
-
</del><span class="cx"> bool RenderTextControlSingleLine::textShouldBeTruncated() const
</span><span class="cx"> {
</span><span class="cx">     return document().focusedElement() != &amp;inputElement() &amp;&amp; style().textOverflow() == TextOverflowEllipsis;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextControlSingleLineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -34,9 +34,6 @@
</span><span class="cx"> public:
</span><span class="cx">     RenderTextControlSingleLine(HTMLInputElement&amp;, Ref&lt;RenderStyle&gt;&amp;&amp;);
</span><span class="cx">     virtual ~RenderTextControlSingleLine();
</span><del>-    // FIXME: Move create*Style() to their classes.
-    virtual Ref&lt;RenderStyle&gt; createInnerTextStyle(const RenderStyle* startStyle) const override;
-    Ref&lt;RenderStyle&gt; createInnerBlockStyle(const RenderStyle* startStyle) const;
</del><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     virtual void centerContainerIfNeeded(RenderBox*) const { }
</span><span class="lines">@@ -79,8 +76,6 @@
</span><span class="cx">     bool textShouldBeTruncated() const;
</span><span class="cx"> 
</span><span class="cx">     HTMLElement* innerSpinButtonElement() const;
</span><del>-
-    LayoutUnit m_desiredInnerTextLogicalHeight;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline HTMLElement* RenderTextControlSingleLine::containerElement() const
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleTreeResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleTreeResolver.cpp (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleTreeResolver.cpp        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/style/StyleTreeResolver.cpp        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -179,7 +179,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (element.hasCustomStyleResolveCallbacks()) {
</span><del>-        if (RefPtr&lt;RenderStyle&gt; style = element.customStyleForRenderer(inheritedStyle))
</del><ins>+        RenderStyle* shadowHostStyle = nullptr;
+        if (auto* shadowRoot = scope().shadowRoot)
+            shadowHostStyle = shadowRoot-&gt;host()-&gt;renderStyle();
+        if (RefPtr&lt;RenderStyle&gt; style = element.customStyleForRenderer(inheritedStyle, shadowHostStyle))
</ins><span class="cx">             return style.releaseNonNull();
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGElement.cpp (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGElement.cpp        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/svg/SVGElement.cpp        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -788,7 +788,7 @@
</span><span class="cx">     contextElement-&gt;synchronizeSystemLanguage();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;RenderStyle&gt; SVGElement::customStyleForRenderer(RenderStyle&amp; parentStyle)
</del><ins>+RefPtr&lt;RenderStyle&gt; SVGElement::customStyleForRenderer(RenderStyle&amp; parentStyle, RenderStyle*)
</ins><span class="cx"> {
</span><span class="cx">     // If the element is in a &lt;use&gt; tree we get the style from the definition tree.
</span><span class="cx">     if (auto* styleElement = this-&gt;correspondingElement())
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGElement.h (197400 => 197401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGElement.h        2016-03-01 16:54:19 UTC (rev 197400)
+++ trunk/Source/WebCore/svg/SVGElement.h        2016-03-01 17:33:47 UTC (rev 197401)
</span><span class="lines">@@ -119,7 +119,7 @@
</span><span class="cx">     void synchronizeAnimatedSVGAttribute(const QualifiedName&amp;) const;
</span><span class="cx">     static void synchronizeAllAnimatedSVGAttribute(SVGElement*);
</span><span class="cx">  
</span><del>-    virtual RefPtr&lt;RenderStyle&gt; customStyleForRenderer(RenderStyle&amp; parentStyle) override;
</del><ins>+    virtual RefPtr&lt;RenderStyle&gt; customStyleForRenderer(RenderStyle&amp; parentStyle, RenderStyle* shadowHostStyle) override;
</ins><span class="cx"> 
</span><span class="cx">     static void synchronizeRequiredFeatures(SVGElement* contextElement);
</span><span class="cx">     static void synchronizeRequiredExtensions(SVGElement* contextElement);
</span></span></pre>
</div>
</div>

</body>
</html>