Bug 1512297 - Do not need to clear image broken state in BindToTree call; r=smaug

ImageLoadingContent will take care of updating element to correct state, we don't need to do this.
Especially for HTMLImageElement, because it may not reload the image after BindToTree (
e.g. the selected source isn't changed), clearing broken state may put element into
incorrect state.

The original code seems from https://bugzilla.mozilla.org/show_bug.cgi?id=491063#c32
for a performance reason, however I test the http://mozilla.pettay.fi/moztests/1x1image.html
again on recent codebase, I don't see difference with/without applying this patch.
This commit is contained in:
Edgar Chen
2018-12-20 13:59:34 +01:00
parent 83e8e14a74
commit 5a57a10f32
8 changed files with 23 additions and 19 deletions

View File

@@ -525,11 +525,6 @@ nsresult HTMLImageElement::BindToTree(Document* aDocument, nsIContent* aParent,
// initaiated by a user interaction.
mUseUrgentStartForChannel = EventStateManager::IsHandlingUserInput();
// FIXME: Bug 660963 it would be nice if we could just have
// ClearBrokenState update our state and do it fast...
ClearBrokenState();
RemoveStatesSilently(NS_EVENT_STATE_BROKEN);
// We still act synchronously for the non-responsive case (Bug
// 1076583), but still need to delay if it is unsafe to run
// script.