Backout of 541618e4babd (bug 1263696) due to performance timeline test bustage

This commit is contained in:
Kyle Machulis 2016-04-28 14:48:14 -07:00
Родитель 26e648d170
Коммит bb87072fdb
8 изменённых файлов: 15 добавлений и 111 удалений

Просмотреть файл

@ -86,7 +86,6 @@
#include "mozilla/EventStates.h" #include "mozilla/EventStates.h"
#include "mozilla/Telemetry.h" #include "mozilla/Telemetry.h"
#include "mozilla/dom/HTMLObjectElementBinding.h" #include "mozilla/dom/HTMLObjectElementBinding.h"
#include "mozilla/dom/HTMLSharedObjectElement.h"
#ifdef XP_WIN #ifdef XP_WIN
// Thanks so much, Microsoft! :( // Thanks so much, Microsoft! :(
@ -3094,35 +3093,24 @@ nsObjectLoadingContent::LoadFallback(FallbackType aType, bool aNotify) {
aType = eFallbackAlternate; aType = eFallbackAlternate;
} }
// We'll set this to null no matter what now, doing it here means we'll load
// child embeds as we find them in the upcoming loop.
mType = eType_Null;
// Do a breadth-first traverse of node tree with the current element as root,
// looking for the first embed we can find.
nsTArray<nsINodeList*> childNodes;
if ((thisContent->IsHTMLElement(nsGkAtoms::object) || if ((thisContent->IsHTMLElement(nsGkAtoms::object) ||
thisContent->IsHTMLElement(nsGkAtoms::applet)) && thisContent->IsHTMLElement(nsGkAtoms::applet)) &&
(aType == eFallbackUnsupported || (aType == eFallbackUnsupported ||
aType == eFallbackDisabled || aType == eFallbackDisabled ||
aType == eFallbackBlocklisted)) aType == eFallbackBlocklisted))
{ {
for (nsIContent* child = thisContent->GetFirstChild(); child; // Show alternate content instead, if it exists
child = child->GetNextNode(thisContent)) { for (nsIContent* child = thisContent->GetFirstChild();
if (aType != eFallbackAlternate && child; child = child->GetNextSibling()) {
!child->IsHTMLElement(nsGkAtoms::param) && if (!child->IsHTMLElement(nsGkAtoms::param) &&
nsStyleUtil::IsSignificantChild(child, true, false)) { nsStyleUtil::IsSignificantChild(child, true, false)) {
aType = eFallbackAlternate; aType = eFallbackAlternate;
} break;
if (child->IsHTMLElement(nsGkAtoms::embed)) {
HTMLSharedObjectElement* object = static_cast<HTMLSharedObjectElement*>(child);
if (object) {
object->StartObjectLoad(true, true);
}
} }
} }
} }
mType = eType_Null;
mFallbackType = aType; mFallbackType = aType;
// Notify // Notify

Просмотреть файл

@ -1,12 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/REC-html401-19991224/strict.dtd">
<html>
<head>
<title>Bug 1263696 - iframe that should not be loaded</title>
</head>
<body>
<script>
parent.SimpleTest.ok(false, "this iframe should not load");
</script>
</body>
</html>

Просмотреть файл

@ -1,13 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/REC-html401-19991224/strict.dtd">
<html>
<head>
<title>Bug 1263696 - iframe that should be loaded</title>
</head>
<body>
<script>
parent.index = parent.index + 1;
parent.SimpleTest.ok(true, "this iframe should load");
</script>
</body>
</html>

Просмотреть файл

@ -157,8 +157,6 @@ support-files =
file_bug902350_frame.html file_bug902350_frame.html
file_bug907892.html file_bug907892.html
file_bug945152.jar file_bug945152.jar
file_bug1263696_frame_pass.html
file_bug1263696_frame_fail.html
file_general_document.html file_general_document.html
file_html_in_xhr.html file_html_in_xhr.html
file_html_in_xhr.sjs file_html_in_xhr.sjs
@ -896,4 +894,3 @@ skip-if = buildapp == 'b2g' #no ssl support
[test_document_register.html] [test_document_register.html]
[test_bug962251.html] [test_bug962251.html]
[test_bug1259588.html] [test_bug1259588.html]
[test_bug1263696.html]

Просмотреть файл

@ -1,45 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta><charset="utf-8"/>
<title>Test Embed/Object Node Conflicts</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
var index = 0;
function startTest() {
is(index, 7, "Should have loaded all fallbacks.");
SimpleTest.finish();
}
</script>
</head>
<body onload="startTest()">
<object data="https://mochitest.youtube.com/v/Xm5i5kbIXzc" style="width: 100px; height: 100px">
<embed type="text/html" src="file_bug1263696_frame_fail.html" />
</object>
<object style="width: 100px; height: 100px" data="data:application/x-does-not-exist,test">
<embed type="text/html" src="file_bug1263696_frame_pass.html" />
</object>
<object style="width: 100px; height: 100px" data="data:application/x-does-not-exist,test">
<div></div>
<embed type="text/html" src="file_bug1263696_frame_pass.html" />
</object>
<object style="width: 100px; height: 100px" data="data:application/x-does-not-exist,test">
<div>
<embed type="text/html" src="file_bug1263696_frame_pass.html" />
</div>
</object>
<object style="width: 100px; height: 100px" data="data:application/x-does-not-exist,test">
<embed type="text/html" src="file_bug1263696_frame_pass.html" />
<embed type="text/html" src="file_bug1263696_frame_pass.html" />
<object data="file_bug1263696_frame_pass.html">
<embed type="text/html" src="file_bug1263696_frame_fail.html" />
</object>
<object data="data:application/x-does-not-exist,test">
<embed type="text/html" src="file_bug1263696_frame_pass.html" />
</object>
</object>
</body>
</html>

Просмотреть файл

@ -20,8 +20,8 @@
#ifdef XP_MACOSX #ifdef XP_MACOSX
#include "mozilla/EventDispatcher.h" #include "mozilla/EventDispatcher.h"
#include "mozilla/dom/Event.h" #include "mozilla/dom/Event.h"
#endif
#include "mozilla/dom/HTMLObjectElement.h" #include "mozilla/dom/HTMLObjectElement.h"
#endif
NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(SharedObject) NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(SharedObject)
@ -85,7 +85,7 @@ HTMLSharedObjectElement::DoneAddingChildren(bool aHaveNotified)
// If we're already in a document, we need to trigger the load // If we're already in a document, we need to trigger the load
// Otherwise, BindToTree takes care of that. // Otherwise, BindToTree takes care of that.
if (IsInComposedDoc()) { if (IsInComposedDoc()) {
StartObjectLoad(aHaveNotified, false); StartObjectLoad(aHaveNotified);
} }
} }
} }
@ -322,7 +322,7 @@ HTMLSharedObjectElement::GetAttributeMappingFunction() const
} }
void void
HTMLSharedObjectElement::StartObjectLoad(bool aNotify, bool aForceLoad) HTMLSharedObjectElement::StartObjectLoad(bool aNotify)
{ {
// BindToTree can call us asynchronously, and we may be removed from the tree // BindToTree can call us asynchronously, and we may be removed from the tree
// in the interim // in the interim
@ -331,7 +331,7 @@ HTMLSharedObjectElement::StartObjectLoad(bool aNotify, bool aForceLoad)
return; return;
} }
LoadObject(aNotify, aForceLoad); LoadObject(aNotify);
SetIsNetworkCreated(false); SetIsNetworkCreated(false);
} }
@ -416,15 +416,6 @@ HTMLSharedObjectElement::BlockEmbedContentLoading()
if (parent->IsAnyOfHTMLElements(nsGkAtoms::video, nsGkAtoms::audio)) { if (parent->IsAnyOfHTMLElements(nsGkAtoms::video, nsGkAtoms::audio)) {
return true; return true;
} }
// If we have an ancestor that is an object with a source, it'll have an
// associated displayed type. If that type is not null, don't load content
// for the embed.
if (HTMLObjectElement* object = HTMLObjectElement::FromContent(parent)) {
uint32_t type = object->DisplayedType();
if (type != eType_Null) {
return true;
}
}
} }
return false; return false;
} }

Просмотреть файл

@ -80,7 +80,7 @@ public:
nsresult CopyInnerTo(Element* aDest); nsresult CopyInnerTo(Element* aDest);
void StartObjectLoad() { StartObjectLoad(true, false); } void StartObjectLoad() { StartObjectLoad(true); }
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(HTMLSharedObjectElement, NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(HTMLSharedObjectElement,
nsGenericHTMLElement) nsGenericHTMLElement)
@ -192,12 +192,13 @@ public:
return GetContentDocument(); return GetContentDocument();
} }
private:
virtual ~HTMLSharedObjectElement();
/** /**
* Calls LoadObject with the correct arguments to start the plugin load. * Calls LoadObject with the correct arguments to start the plugin load.
*/ */
void StartObjectLoad(bool aNotify, bool aForceLoad); void StartObjectLoad(bool aNotify);
private:
virtual ~HTMLSharedObjectElement();
nsIAtom *URIAttrName() const nsIAtom *URIAttrName() const
{ {
@ -227,8 +228,6 @@ private:
* the content: * the content:
* *
* - If the embed node is the child of a media element * - If the embed node is the child of a media element
* - If the embed node is the child of an object node that already has
* content being loaded.
* *
* In these cases, this function will return false, which will cause * In these cases, this function will return false, which will cause
* us to skip calling LoadObject. * us to skip calling LoadObject.

Просмотреть файл

@ -26,7 +26,6 @@
#undef GetBinaryType #undef GetBinaryType
#undef RemoveDirectory #undef RemoveDirectory
#undef LoadIcon #undef LoadIcon
#undef GetObject
#endif #endif
class nsPresContext; class nsPresContext;