Bug 976616 - Part 1: Call ProcessViewportInfo when meta viewport is changed. r=bholley

This commit is contained in:
Mike Taylor 2015-08-24 15:34:00 -04:00
parent 0553824ea4
commit 8e2cd23912

View File

@ -56,6 +56,13 @@ HTMLMetaElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
if (aNameSpaceID == kNameSpaceID_None) {
if (aName == nsGkAtoms::content) {
nsIDocument *document = GetUncomposedDoc();
if (document && AttrValueIs(kNameSpaceID_None, nsGkAtoms::name,
nsGkAtoms::viewport, eIgnoreCase)) {
nsAutoString content;
nsresult rv = GetContent(content);
NS_ENSURE_SUCCESS(rv, rv);
nsContentUtils::ProcessViewportInfo(document, content);
}
CreateAndDispatchEvent(document, NS_LITERAL_STRING("DOMMetaChanged"));
}
}