Bug 1463511: Remove useless form.css rule and nsTextControlFrame anon class. r=heycam
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 22 May 2018 19:52:41 +0200
changeset 419683 54c568a69c3fc24e8d19a0a8d4b3e3719423b3c7
parent 419682 a214755e4e46f81a203eddc8fcf490177b831f9a
child 419684 4074e33bff660ef971ae8a442b752561fa0aaf9a
push id64381
push userecoal95@gmail.com
push dateThu, 24 May 2018 10:28:46 +0000
treeherderautoland@4074e33bff66 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1463511, 82711
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1463511: Remove useless form.css rule and nsTextControlFrame anon class. r=heycam Only <textarea> has GetWrapRows() > 0, and the rule for textarea disappeared in bug 82711. MozReview-Commit-ID: ERcoLVcufbH
layout/forms/nsTextControlFrame.cpp
layout/forms/nsTextControlFrame.h
layout/style/res/forms.css
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -459,19 +459,16 @@ nsTextControlFrame::CreateRootNode()
   // Make our root node editable
   mRootNode->SetFlags(NODE_IS_EDITABLE);
 
   // Set the necessary classes on the text control. We use class values instead
   // of a 'style' attribute so that the style comes from a user-agent style
   // sheet and is still applied even if author styles are disabled.
   nsAutoString classValue;
   classValue.AppendLiteral("anonymous-div");
-  if (GetWrapCols() > 0) {
-    classValue.AppendLiteral(" wrap");
-  }
 
   if (!IsSingleLineTextControl()) {
     // We can't just inherit the overflow because setting visible overflow will
     // crash when the number of lines exceeds the height of the textarea and
     // setting -moz-hidden-unscrollable overflow (NS_STYLE_OVERFLOW_CLIP)
     // doesn't paint the caret for some reason.
     const nsStyleDisplay* disp = StyleDisplay();
     if (disp->mOverflowX != NS_STYLE_OVERFLOW_VISIBLE &&
--- a/layout/forms/nsTextControlFrame.h
+++ b/layout/forms/nsTextControlFrame.h
@@ -204,17 +204,16 @@ public: //for methods who access nsTextC
     NS_ASSERTION(txtCtrl, "Content not a text control element");               \
     return txtCtrl->name();                                                    \
   }
 
   DEFINE_TEXTCTRL_CONST_FORWARDER(bool, IsSingleLineTextControl)
   DEFINE_TEXTCTRL_CONST_FORWARDER(bool, IsTextArea)
   DEFINE_TEXTCTRL_CONST_FORWARDER(bool, IsPasswordTextControl)
   DEFINE_TEXTCTRL_CONST_FORWARDER(int32_t, GetCols)
-  DEFINE_TEXTCTRL_CONST_FORWARDER(int32_t, GetWrapCols)
   DEFINE_TEXTCTRL_CONST_FORWARDER(int32_t, GetRows)
 
 #undef DEFINE_TEXTCTRL_CONST_FORWARDER
 
 protected:
   class EditorInitializer;
   friend class EditorInitializer;
   friend class nsTextEditorState; // needs access to UpdateValueDisplay
--- a/layout/style/res/forms.css
+++ b/layout/style/res/forms.css
@@ -170,19 +170,16 @@ textarea > .preview-div {
 }
 
 input > .anonymous-div,
 input::placeholder,
 input > .preview-div {
   white-space: pre;
 }
 
-input > .anonymous-div.wrap {
-  white-space: pre-wrap;
-}
 textarea > .anonymous-div.inherit-overflow,
 input > .anonymous-div.inherit-overflow {
   overflow: inherit;
 }
 textarea > .anonymous-div.inherit-scroll-behavior,
 input > .anonymous-div.inherit-scroll-behavior {
   scroll-behavior: inherit;
   overscroll-behavior: inherit;