Bug 1427302 - Stop supporting type=content-* on XUL <browser>s, r?bz
Was: Backed out changeset 83fbff91e9d2 (
bug 1328605).
MozReview-Commit-ID: 2itUgw8Ogkl
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -1118,25 +1118,18 @@ nsFrameLoader::AddTreeItemToTreeOwner(ns
nsIDocShellTreeOwner* aOwner,
int32_t aParentType,
nsIDocShell* aParentNode)
{
NS_PRECONDITION(aItem, "Must have docshell treeitem");
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.
nsCOMPtr<nsIDOMMozBrowserFrame> mozbrowser =
do_QueryInterface(mOwnerContent);
if (mozbrowser) {
bool isMozbrowser = false;
mozbrowser->GetMozbrowser(&isMozbrowser);
@@ -3170,22 +3163,18 @@ nsFrameLoader::TryRemoteBrowser()
return false;
}
}
if (!mOwnerContent->IsXULElement()) {
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;
}
// Try to get the related content parent from our browser element.
Tie(openerContentParent, sameTabGroupAs) = GetContentParent(mOwnerContent);
}
uint32_t chromeFlags = 0;
@@ -3736,23 +3725,17 @@ nsFrameLoader::AttributeChanged(nsIDocum
if (!is_primary) {
nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
if (pm)
pm->HidePopupsInDocShell(mDocShell);
}
#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);
}
}
/**
* Send the RequestNotifyAfterRemotePaint message to the current Tab.
*/
void
--- a/dom/security/test/general/test_bug1277803.xul
+++ b/dom/security/test/general/test_bug1277803.xul
@@ -90,10 +90,10 @@
SimpleTest.waitForExplicitFinish();
SimpleTest.registerCleanupFunction(function() {
if (testWindow) {
testWindow.close();
}
});
]]></script>
- <browser type="content-primary" flex="1" id="content" src="about:blank"/>
+ <browser type="content" primary="true" flex="1" id="content" src="about:blank"/>
</window>
--- a/dom/xul/test/file_bug1271240.xul
+++ b/dom/xul/test/file_bug1271240.xul
@@ -72,11 +72,11 @@ https://bugzilla.mozilla.org/show_bug.cg
function makePrerenderedBrowserActive(browser) {
browser.frameLoader.makePrerenderedLoaderActive();
return browser;
}
]]>
</script>
- <!-- <browser type="content-primary" flex="1" id="content" />
- <browser type="content-primary" flex="1" id="content-remote" remote="true" /> -->
+ <!-- <browser type="content" flex="1" id="content" />
+ <browser type="content" flex="1" id="content-remote" remote="true" /> -->
</window>