Bug 1463511: Remove useless form.css rule and nsTextControlFrame anon class. r?heycam draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 22 May 2018 19:52:41 +0200
changeset 798348 c8c9257de62a1d017d3762b77f05e20fd00dc85d
parent 798347 08ab34151073486fabdd4fb51a483346eeeabc9a
child 798349 9c6501932d2c603c2b33182f7ac1a7083e4fb913
push id110725
push userbmo:emilio@crisal.io
push dateTue, 22 May 2018 17:58:10 +0000
reviewersheycam
bugs1463511, 82711
milestone62.0a1
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
@@ -207,17 +207,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
@@ -168,19 +168,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;