Bug 949879 - Drop support for the "cols" attribute of <pre> elements. r=dbaron
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Tue, 17 Dec 2013 01:56:20 +0900
changeset 160637 4b78a373acbdf0394490aaed7eeca13c1700d537
parent 160636 b14f5674b64b16f6aae35230fd031c0003c1f084
child 160638 bf56e107bb07c919298f50c5ed036f29e840d053
push id37657
push userVYV03354@nifty.ne.jp
push dateMon, 16 Dec 2013 16:56:45 +0000
treeherdermozilla-inbound@4b78a373acbd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs949879
milestone29.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 949879 - Drop support for the "cols" attribute of <pre> elements. r=dbaron
content/html/content/src/HTMLPreElement.cpp
--- a/content/html/content/src/HTMLPreElement.cpp
+++ b/content/html/content/src/HTMLPreElement.cpp
@@ -30,77 +30,63 @@ NS_IMPL_INT_ATTR(HTMLPreElement, Width, 
 
 bool
 HTMLPreElement::ParseAttribute(int32_t aNamespaceID,
                                nsIAtom* aAttribute,
                                const nsAString& aValue,
                                nsAttrValue& aResult)
 {
   if (aNamespaceID == kNameSpaceID_None) {
-    if (aAttribute == nsGkAtoms::cols) {
-      return aResult.ParseIntWithBounds(aValue, 0);
-    }
     if (aAttribute == nsGkAtoms::width) {
       return aResult.ParseIntWithBounds(aValue, 0);
     }
   }
 
   return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
                                               aResult);
 }
 
 void
 HTMLPreElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
                                       nsRuleData* aData)
 {
   if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Position)) {
     nsCSSValue* width = aData->ValueForWidth();
     if (width->GetUnit() == eCSSUnit_Null) {
-      // width: int (html4 attribute == nav4 cols)
+      // width: int (html4 attribute)
       const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
-      if (!value || value->Type() != nsAttrValue::eInteger) {
-        // cols: int (nav4 attribute)
-        value = aAttributes->GetAttr(nsGkAtoms::cols);
-      }
-
       if (value && value->Type() == nsAttrValue::eInteger)
         width->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Char);
     }
   }
   if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Text)) {
     nsCSSValue* whiteSpace = aData->ValueForWhiteSpace();
     if (whiteSpace->GetUnit() == eCSSUnit_Null) {
       // wrap: empty
       if (aAttributes->GetAttr(nsGkAtoms::wrap))
         whiteSpace->SetIntValue(NS_STYLE_WHITESPACE_PRE_WRAP, eCSSUnit_Enumerated);
 
-      // width: int (html4 attribute == nav4 cols)
+      // width: int (html4 attribute)
       const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
-      if (!value || value->Type() != nsAttrValue::eInteger) {
-        // cols: int (nav4 attribute)
-        value = aAttributes->GetAttr(nsGkAtoms::cols);
-      }
-
       if (value && value->Type() == nsAttrValue::eInteger) {
         // Force wrap property on since we want to wrap at a width
         // boundary not just a newline.
         whiteSpace->SetIntValue(NS_STYLE_WHITESPACE_PRE_WRAP, eCSSUnit_Enumerated);
       }
     }
   }
 
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
 HTMLPreElement::IsAttributeMapped(const nsIAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
     { &nsGkAtoms::wrap },
-    { &nsGkAtoms::cols },
     { &nsGkAtoms::width },
     { nullptr },
   };
   
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sCommonAttributeMap,
   };