Bug 1850238 - Make BROKEN state non-intrinsic. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D187108
This commit is contained in:
Emilio Cobos Álvarez
2023-08-31 07:46:24 +00:00
parent a14c4a020b
commit 01b6773528
22 changed files with 80 additions and 184 deletions

View File

@@ -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 &&