Bug 1850238 - Make BROKEN state non-intrinsic. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D187108
This commit is contained in:
@@ -3642,20 +3642,19 @@ static nsIFrame* NS_NewSubDocumentOrImageFrame(mozilla::PresShell* aPresShell,
|
||||
const nsCSSFrameConstructor::FrameConstructionData*
|
||||
nsCSSFrameConstructor::FindObjectData(const Element& aElement,
|
||||
ComputedStyle& aStyle) {
|
||||
// GetDisplayedType isn't necessarily nsIObjectLoadingContent::TYPE_NULL for
|
||||
// cases when the object is broken/suppressed/etc (e.g. a broken image), but
|
||||
// we want to treat those cases as TYPE_NULL
|
||||
uint32_t type;
|
||||
if (aElement.State().HasState(ElementState::BROKEN)) {
|
||||
nsCOMPtr<nsIObjectLoadingContent> objContent =
|
||||
do_QueryInterface(const_cast<Element*>(&aElement));
|
||||
NS_ASSERTION(objContent,
|
||||
"embed and object must implement "
|
||||
"nsIObjectLoadingContent!");
|
||||
objContent->GetDisplayedType(&type);
|
||||
if (type == nsIObjectLoadingContent::TYPE_IMAGE &&
|
||||
aElement.State().HasState(ElementState::BROKEN)) {
|
||||
// GetDisplayedType isn't necessarily nsIObjectLoadingContent::TYPE_NULL for
|
||||
// cases when the object is broken/suppressed/etc (e.g. a broken image), but
|
||||
// we want to treat those cases as TYPE_NULL
|
||||
type = nsIObjectLoadingContent::TYPE_NULL;
|
||||
} else {
|
||||
nsCOMPtr<nsIObjectLoadingContent> objContent =
|
||||
do_QueryInterface(const_cast<Element*>(&aElement));
|
||||
NS_ASSERTION(objContent,
|
||||
"embed and object must implement "
|
||||
"nsIObjectLoadingContent!");
|
||||
|
||||
objContent->GetDisplayedType(&type);
|
||||
}
|
||||
|
||||
if (type == nsIObjectLoadingContent::TYPE_FALLBACK &&
|
||||
|
||||
Reference in New Issue
Block a user