mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 623589 - Remove aCanBePercent parameter from nsAttrValue::ParseSpecialIntValue; r=peterv a=jst
--HG-- extra : rebase_source : 0347c1a1540267d64c09d27577f1c66c78d430c7
This commit is contained in:
parent
1976742cd2
commit
5e3f85aa9c
@ -1054,8 +1054,7 @@ nsAttrValue::ParseEnumValue(const nsAString& aValue,
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsAttrValue::ParseSpecialIntValue(const nsAString& aString,
|
||||
PRBool aCanBePercent)
|
||||
nsAttrValue::ParseSpecialIntValue(const nsAString& aString)
|
||||
{
|
||||
ResetIfSet();
|
||||
|
||||
@ -1063,7 +1062,7 @@ nsAttrValue::ParseSpecialIntValue(const nsAString& aString,
|
||||
PRBool strict;
|
||||
PRBool isPercent = PR_FALSE;
|
||||
nsAutoString tmp(aString);
|
||||
PRInt32 originalVal = StringToInteger(aString, &strict, &ec, aCanBePercent, &isPercent);
|
||||
PRInt32 originalVal = StringToInteger(aString, &strict, &ec, PR_TRUE, &isPercent);
|
||||
|
||||
if (NS_FAILED(ec)) {
|
||||
return PR_FALSE;
|
||||
@ -1072,7 +1071,7 @@ nsAttrValue::ParseSpecialIntValue(const nsAString& aString,
|
||||
PRInt32 val = NS_MAX(originalVal, 0);
|
||||
|
||||
// % (percent)
|
||||
if (aCanBePercent && (isPercent || tmp.RFindChar('%') >= 0)) {
|
||||
if (isPercent || tmp.RFindChar('%') >= 0) {
|
||||
isPercent = PR_TRUE;
|
||||
}
|
||||
|
||||
|
@ -229,13 +229,11 @@ public:
|
||||
* whether it be percent or raw integer.
|
||||
*
|
||||
* @param aString the string to parse
|
||||
* @param aCanBePercent PR_TRUE if it can be a percent value (%)
|
||||
* @return whether the value could be parsed
|
||||
*
|
||||
* @see http://www.whatwg.org/html/#rules-for-parsing-dimension-values
|
||||
*/
|
||||
PRBool ParseSpecialIntValue(const nsAString& aString,
|
||||
PRBool aCanBePercent);
|
||||
PRBool ParseSpecialIntValue(const nsAString& aString);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -1616,7 +1616,7 @@ nsGenericHTMLElement::ParseImageAttribute(nsIAtom* aAttribute,
|
||||
{
|
||||
if ((aAttribute == nsGkAtoms::width) ||
|
||||
(aAttribute == nsGkAtoms::height)) {
|
||||
return aResult.ParseSpecialIntValue(aString, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aString);
|
||||
}
|
||||
else if ((aAttribute == nsGkAtoms::hspace) ||
|
||||
(aAttribute == nsGkAtoms::vspace) ||
|
||||
|
@ -116,7 +116,7 @@ nsHTMLDivElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
if (mNodeInfo->Equals(nsGkAtoms::marquee)) {
|
||||
if ((aAttribute == nsGkAtoms::width) ||
|
||||
(aAttribute == nsGkAtoms::height)) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::bgcolor) {
|
||||
return aResult.ParseColor(aValue);
|
||||
|
@ -139,10 +139,10 @@ nsHTMLFrameElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
return ParseFrameborderValue(aValue, aResult);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::marginwidth) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::marginheight) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::scrolling) {
|
||||
return ParseScrollingValue(aValue, aResult);
|
||||
|
@ -134,7 +134,7 @@ nsHTMLHRElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
{
|
||||
if (aNamespaceID == kNameSpaceID_None) {
|
||||
if (aAttribute == nsGkAtoms::width) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::size) {
|
||||
return aResult.ParseIntWithBounds(aValue, 1, 1000);
|
||||
|
@ -162,16 +162,16 @@ nsHTMLIFrameElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
{
|
||||
if (aNamespaceID == kNameSpaceID_None) {
|
||||
if (aAttribute == nsGkAtoms::marginwidth) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::marginheight) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::width) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::height) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::frameborder) {
|
||||
return ParseFrameborderValue(aValue, aResult);
|
||||
|
@ -2698,10 +2698,10 @@ nsHTMLInputElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
return success;
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::width) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::height) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::maxlength) {
|
||||
return aResult.ParseNonNegativeIntValue(aValue);
|
||||
|
@ -305,10 +305,10 @@ nsHTMLTableCellElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
return res;
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::height) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::width) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::align) {
|
||||
return ParseTableCellHAlignValue(aValue, aResult);
|
||||
|
@ -128,14 +128,14 @@ nsHTMLTableColElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
if (aNamespaceID == kNameSpaceID_None) {
|
||||
/* ignore these attributes, stored simply as strings ch */
|
||||
if (aAttribute == nsGkAtoms::charoff) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::span) {
|
||||
/* protection from unrealistic large colspan values */
|
||||
return aResult.ParseIntWithBounds(aValue, 1, MAX_COLSPAN);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::width) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::align) {
|
||||
return ParseTableCellHAlignValue(aValue, aResult);
|
||||
|
@ -983,7 +983,7 @@ nsHTMLTableElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
if (aNamespaceID == kNameSpaceID_None) {
|
||||
if (aAttribute == nsGkAtoms::cellspacing ||
|
||||
aAttribute == nsGkAtoms::cellpadding) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::cols) {
|
||||
return aResult.ParseIntWithBounds(aValue, 0);
|
||||
@ -997,10 +997,10 @@ nsHTMLTableElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
return PR_TRUE;
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::height) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::width) {
|
||||
if (aResult.ParseSpecialIntValue(aValue, PR_TRUE)) {
|
||||
if (aResult.ParseSpecialIntValue(aValue)) {
|
||||
// treat 0 width as auto
|
||||
nsAttrValue::ValueType type = aResult.Type();
|
||||
if ((type == nsAttrValue::eInteger &&
|
||||
|
@ -383,10 +383,10 @@ nsHTMLTableRowElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
return aResult.ParseIntWithBounds(aValue, 0);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::height) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::width) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::align) {
|
||||
return ParseTableCellHAlignValue(aValue, aResult);
|
||||
|
@ -252,7 +252,7 @@ nsHTMLTableSectionElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
return aResult.ParseIntWithBounds(aValue, 0);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::height) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::align) {
|
||||
return ParseTableCellHAlignValue(aValue, aResult);
|
||||
|
@ -124,7 +124,7 @@ nsHTMLVideoElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
nsAttrValue& aResult)
|
||||
{
|
||||
if (aAttribute == nsGkAtoms::width || aAttribute == nsGkAtoms::height) {
|
||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
|
||||
return aResult.ParseSpecialIntValue(aValue);
|
||||
}
|
||||
|
||||
return nsHTMLMediaElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||
|
Loading…
Reference in New Issue
Block a user