Bug 1438026 - Part 3: Replace nsPresState with the new PresState type, r=baku

This commit is contained in:
Nika Layzell
2018-03-02 13:18:35 -05:00
parent 63df0ece5a
commit cccd4523db
21 changed files with 256 additions and 372 deletions

View File

@@ -28,7 +28,7 @@
#include "mozilla/TextEvents.h"
#include "nsUnicharUtils.h"
#include "nsLayoutUtils.h"
#include "nsPresState.h"
#include "mozilla/PresState.h"
#include "nsError.h"
#include "nsFocusManager.h"
#include "mozilla/dom/HTMLFormElement.h"
@@ -448,20 +448,21 @@ HTMLButtonElement::SaveState()
return NS_OK;
}
nsPresState* state = GetPrimaryPresState();
PresState* state = GetPrimaryPresState();
if (state) {
// We do not want to save the real disabled state but the disabled
// attribute.
state->SetDisabled(HasAttr(kNameSpaceID_None, nsGkAtoms::disabled));
state->disabled() = HasAttr(kNameSpaceID_None, nsGkAtoms::disabled);
state->disabledSet() = true;
}
return NS_OK;
}
bool
HTMLButtonElement::RestoreState(nsPresState* aState)
HTMLButtonElement::RestoreState(PresState* aState)
{
if (aState && aState->IsDisabledSet() && !aState->GetDisabled()) {
if (aState && aState->disabledSet() && !aState->disabled()) {
SetDisabled(false, IgnoreErrors());
}