Bug 890516 - Backout patch from bug 614825. r=bz

This commit is contained in:
Mounir Lamouri 2013-07-11 10:39:18 -04:00
parent 17de8eb070
commit cd4eec0c91
4 changed files with 41 additions and 7 deletions

View File

@ -244,13 +244,28 @@ HTMLSharedObjectElement::ParseAttribute(int32_t aNamespaceID,
}
static void
MapAttributesIntoRule(const nsMappedAttributes *aAttributes,
nsRuleData *aData)
MapAttributesIntoRuleBase(const nsMappedAttributes *aAttributes,
nsRuleData *aData)
{
nsGenericHTMLElement::MapImageBorderAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aData);
}
static void
MapAttributesIntoRuleExceptHidden(const nsMappedAttributes *aAttributes,
nsRuleData *aData)
{
MapAttributesIntoRuleBase(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesIntoExceptHidden(aAttributes, aData);
}
static void
MapAttributesIntoRule(const nsMappedAttributes *aAttributes,
nsRuleData *aData)
{
MapAttributesIntoRuleBase(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
}
@ -271,6 +286,10 @@ HTMLSharedObjectElement::IsAttributeMapped(const nsIAtom *aAttribute) const
nsMapRuleToAttributesFunc
HTMLSharedObjectElement::GetAttributeMappingFunction() const
{
if (mNodeInfo->Equals(nsGkAtoms::embed)) {
return &MapAttributesIntoRuleExceptHidden;
}
return &MapAttributesIntoRule;
}

View File

@ -1435,8 +1435,8 @@ nsGenericHTMLElement::ParseScrollingValue(const nsAString& aString,
* Handle attributes common to all html elements
*/
void
nsGenericHTMLElement::MapCommonAttributesInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
nsGenericHTMLElement::MapCommonAttributesIntoExceptHidden(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
{
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(UserInterface)) {
nsCSSValue* userModify = aData->ValueForUserModify();
@ -1466,6 +1466,13 @@ nsGenericHTMLElement::MapCommonAttributesInto(const nsMappedAttributes* aAttribu
}
}
}
}
void
nsGenericHTMLElement::MapCommonAttributesInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
{
MapCommonAttributesIntoExceptHidden(aAttributes, aData);
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Display)) {
nsCSSValue* display = aData->ValueForDisplay();
@ -1477,7 +1484,6 @@ nsGenericHTMLElement::MapCommonAttributesInto(const nsMappedAttributes* aAttribu
}
}
/* static */ const nsGenericHTMLElement::MappedAttributeEntry
nsGenericHTMLElement::sCommonAttributeMap[] = {
{ &nsGkAtoms::contenteditable },

View File

@ -509,7 +509,7 @@ public:
/**
* A style attribute mapping function for the most common attributes, to be
* called by subclasses' attribute mapping functions. Currently handles
* dir and lang, could handle others.
* dir, lang and hidden, could handle others.
*
* @param aAttributes the list of attributes to map
* @param aData the returned rule data [INOUT]
@ -517,6 +517,15 @@ public:
*/
static void MapCommonAttributesInto(const nsMappedAttributes* aAttributes,
nsRuleData* aRuleData);
/**
* Same as MapCommonAttributesInto except that it does not handle hidden.
*
* @param aAttributes the list of attributes to map
* @param aData the returned rule data [INOUT]
* @see GetAttributeMappingFunction
*/
static void MapCommonAttributesIntoExceptHidden(const nsMappedAttributes* aAttributes,
nsRuleData* aRuleData);
static const MappedAttributeEntry sCommonAttributeMap[];
static const MappedAttributeEntry sImageMarginSizeAttributeMap[];

View File

@ -24,7 +24,7 @@ var rect = document.getElementsByTagName('embed')[0].getBoundingClientRect();
var hasFrame = rect.left != 0 || rect.right != 0 || rect.top != 0 ||
rect.bottom != 0;
ok(!hasFrame, "embed should not have a frame with hidden set");
ok(hasFrame, "embed should have a frame with hidden set");
</script>
</pre>