From 9d094a24641985c7d54307ac0cdde536f86c0618 Mon Sep 17 00:00:00 2001 From: Gijs Kruitbosch Date: Wed, 10 Jan 2018 19:37:29 +0000 Subject: [PATCH] Bug 1427302 - Stop supporting type=content-* on XUL s, r=bz Was: Backed out changeset 83fbff91e9d2 (bug 1328605). MozReview-Commit-ID: 2itUgw8Ogkl --HG-- extra : rebase_source : bad855f0292b28eb61b1549a1d96914a792c0fb6 --- dom/base/nsFrameLoader.cpp | 27 ++++--------------- dom/security/test/general/test_bug1277803.xul | 2 +- dom/xul/test/file_bug1271240.xul | 4 +-- 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/dom/base/nsFrameLoader.cpp b/dom/base/nsFrameLoader.cpp index e24c1539b314..16a3e4868802 100644 --- a/dom/base/nsFrameLoader.cpp +++ b/dom/base/nsFrameLoader.cpp @@ -1130,15 +1130,8 @@ nsFrameLoader::AddTreeItemToTreeOwner(nsIDocShellTreeItem* aItem, NS_PRECONDITION(mOwnerContent, "Must have owning content"); nsAutoString value; - bool isContent = false; - mOwnerContent->GetAttr(kNameSpaceID_None, TypeAttrName(), value); - - // we accept "content" and "content-xxx" values. - // We ignore anything that comes after 'content-'. - isContent = value.LowerCaseEqualsLiteral("content") || - StringBeginsWith(value, NS_LITERAL_STRING("content-"), - nsCaseInsensitiveStringComparator()); - + bool isContent = mOwnerContent->AttrValueIs( + kNameSpaceID_None, TypeAttrName(), nsGkAtoms::content, eIgnoreCase); // Force mozbrowser frames to always be typeContent, even if the // mozbrowser interfaces are disabled. @@ -3182,12 +3175,8 @@ nsFrameLoader::TryRemoteBrowser() return false; } - nsAutoString value; - mOwnerContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type, value); - - if (!value.LowerCaseEqualsLiteral("content") && - !StringBeginsWith(value, NS_LITERAL_STRING("content-"), - nsCaseInsensitiveStringComparator())) { + if (!mOwnerContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type, + nsGkAtoms::content, eIgnoreCase)) { return false; } @@ -3748,13 +3737,7 @@ nsFrameLoader::AttributeChanged(nsIDocument* aDocument, #endif parentTreeOwner->ContentShellRemoved(mDocShell); - - nsAutoString value; - aElement->GetAttr(kNameSpaceID_None, TypeAttrName(), value); - - if (value.LowerCaseEqualsLiteral("content") || - StringBeginsWith(value, NS_LITERAL_STRING("content-"), - nsCaseInsensitiveStringComparator())) { + if (aElement->AttrValueIs(kNameSpaceID_None, TypeAttrName(), nsGkAtoms::content, eIgnoreCase)) { parentTreeOwner->ContentShellAdded(mDocShell, is_primary); } } diff --git a/dom/security/test/general/test_bug1277803.xul b/dom/security/test/general/test_bug1277803.xul index 0f7e8a245de0..91cddd0adef2 100644 --- a/dom/security/test/general/test_bug1277803.xul +++ b/dom/security/test/general/test_bug1277803.xul @@ -95,5 +95,5 @@ }); ]]> - + diff --git a/dom/xul/test/file_bug1271240.xul b/dom/xul/test/file_bug1271240.xul index 26c9a6202dda..ad27f8609e66 100644 --- a/dom/xul/test/file_bug1271240.xul +++ b/dom/xul/test/file_bug1271240.xul @@ -77,6 +77,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1271240 ]]> - +