зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1767996 - Apply readability-make-member-function-const on dom/html r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D145627
This commit is contained in:
Родитель
1c1a9d5457
Коммит
b1653a09c7
|
@ -1102,7 +1102,7 @@ void HTMLCanvasElement::SetWriteOnly(
|
|||
}
|
||||
}
|
||||
|
||||
bool HTMLCanvasElement::CallerCanRead(JSContext* aCx) {
|
||||
bool HTMLCanvasElement::CallerCanRead(JSContext* aCx) const {
|
||||
if (!mWriteOnly) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -370,7 +370,7 @@ class HTMLCanvasElement final : public nsGenericHTMLElement,
|
|||
RefPtr<nsIPrincipal> mExpandedReader;
|
||||
|
||||
// Determines if the caller should be able to read the content.
|
||||
bool CallerCanRead(JSContext* aCx);
|
||||
bool CallerCanRead(JSContext* aCx) const;
|
||||
|
||||
bool IsPrintCallbackDone();
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ class ImageLoadTask final : public MicroTaskRunnable {
|
|||
return global && global->IsInSyncOperation();
|
||||
}
|
||||
|
||||
bool AlwaysLoad() { return mAlwaysLoad; }
|
||||
bool AlwaysLoad() const { return mAlwaysLoad; }
|
||||
|
||||
private:
|
||||
~ImageLoadTask() = default;
|
||||
|
|
|
@ -6826,7 +6826,7 @@ void HTMLMediaElement::OnVisibilityChange(Visibility aNewVisibility) {
|
|||
|
||||
MediaKeys* HTMLMediaElement::GetMediaKeys() const { return mMediaKeys; }
|
||||
|
||||
bool HTMLMediaElement::ContainsRestrictedContent() {
|
||||
bool HTMLMediaElement::ContainsRestrictedContent() const {
|
||||
return GetMediaKeys() != nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -419,7 +419,7 @@ class HTMLMediaElement : public nsGenericHTMLElement,
|
|||
* current when they were enqueued, and if it has changed when they come to
|
||||
* fire, they consider themselves cancelled, and don't fire.
|
||||
*/
|
||||
uint32_t GetCurrentLoadID() { return mCurrentLoadID; }
|
||||
uint32_t GetCurrentLoadID() const { return mCurrentLoadID; }
|
||||
|
||||
/**
|
||||
* Returns the load group for this media element's owner document.
|
||||
|
@ -700,7 +700,7 @@ class HTMLMediaElement : public nsGenericHTMLElement,
|
|||
|
||||
bool IsEventAttributeNameInternal(nsAtom* aName) override;
|
||||
|
||||
bool ContainsRestrictedContent();
|
||||
bool ContainsRestrictedContent() const;
|
||||
|
||||
void NotifyWaitingForKey() override;
|
||||
|
||||
|
@ -812,7 +812,7 @@ class HTMLMediaElement : public nsGenericHTMLElement,
|
|||
ErrorResult& aRv);
|
||||
// Get the sink id of the device that audio is being played. Initial value is
|
||||
// empty and the default device is being used.
|
||||
void GetSinkId(nsString& aSinkId) {
|
||||
void GetSinkId(nsString& aSinkId) const {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
aSinkId = mSink.first;
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ void HTMLMenuElement::SendShowEvent() {
|
|||
nullptr, &status);
|
||||
}
|
||||
|
||||
already_AddRefed<nsIMenuBuilder> HTMLMenuElement::CreateBuilder() {
|
||||
already_AddRefed<nsIMenuBuilder> HTMLMenuElement::CreateBuilder() const {
|
||||
if (mType != MENU_TYPE_CONTEXT) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ class HTMLMenuElement final : public nsGenericHTMLElement {
|
|||
|
||||
MOZ_CAN_RUN_SCRIPT void SendShowEvent();
|
||||
|
||||
already_AddRefed<nsIMenuBuilder> CreateBuilder();
|
||||
already_AddRefed<nsIMenuBuilder> CreateBuilder() const;
|
||||
|
||||
void Build(nsIMenuBuilder* aBuilder);
|
||||
|
||||
|
|
|
@ -545,7 +545,7 @@ void HTMLSelectElement::Add(nsGenericHTMLElement& aElement,
|
|||
parent->InsertBefore(aElement, refNode, aError);
|
||||
}
|
||||
|
||||
void HTMLSelectElement::Remove(int32_t aIndex) {
|
||||
void HTMLSelectElement::Remove(int32_t aIndex) const {
|
||||
if (aIndex < 0) {
|
||||
return;
|
||||
}
|
||||
|
@ -638,7 +638,7 @@ void HTMLSelectElement::SetSelectedIndexInternal(int32_t aIndex, bool aNotify) {
|
|||
SetSelectionChanged(true, aNotify);
|
||||
}
|
||||
|
||||
bool HTMLSelectElement::IsOptionSelectedByIndex(int32_t aIndex) {
|
||||
bool HTMLSelectElement::IsOptionSelectedByIndex(int32_t aIndex) const {
|
||||
HTMLOptionElement* option = Item(static_cast<uint32_t>(aIndex));
|
||||
return option && option->Selected();
|
||||
}
|
||||
|
@ -920,7 +920,7 @@ bool HTMLSelectElement::IsOptionDisabled(HTMLOptionElement* aOption) const {
|
|||
return false;
|
||||
}
|
||||
|
||||
void HTMLSelectElement::GetValue(DOMString& aValue) {
|
||||
void HTMLSelectElement::GetValue(DOMString& aValue) const {
|
||||
int32_t selectedIndex = SelectedIndex();
|
||||
if (selectedIndex < 0) {
|
||||
return;
|
||||
|
|
|
@ -164,7 +164,7 @@ class HTMLSelectElement final : public nsGenericHTMLFormControlElementWithState,
|
|||
}
|
||||
void Add(const HTMLOptionElementOrHTMLOptGroupElement& aElement,
|
||||
const Nullable<HTMLElementOrLong>& aBefore, ErrorResult& aRv);
|
||||
void Remove(int32_t aIndex);
|
||||
void Remove(int32_t aIndex) const;
|
||||
void IndexedSetter(uint32_t aIndex, HTMLOptionElement* aOption,
|
||||
ErrorResult& aRv) {
|
||||
mOptions->IndexedSetter(aIndex, aOption, aRv);
|
||||
|
@ -176,7 +176,7 @@ class HTMLSelectElement final : public nsGenericHTMLFormControlElementWithState,
|
|||
|
||||
int32_t SelectedIndex() const { return mSelectedIndex; }
|
||||
void SetSelectedIndex(int32_t aIdx) { SetSelectedIndexInternal(aIdx, true); }
|
||||
void GetValue(DOMString& aValue);
|
||||
void GetValue(DOMString& aValue) const;
|
||||
void SetValue(const nsAString& aValue);
|
||||
|
||||
// Override SetCustomValidity so we update our state properly when it's called
|
||||
|
@ -339,7 +339,7 @@ class HTMLSelectElement final : public nsGenericHTMLFormControlElementWithState,
|
|||
* @param aIndex the index
|
||||
* @return whether the option at the index is selected
|
||||
*/
|
||||
bool IsOptionSelectedByIndex(int32_t aIndex);
|
||||
bool IsOptionSelectedByIndex(int32_t aIndex) const;
|
||||
/**
|
||||
* Starting with (and including) aStartIndex, find the first selected index
|
||||
* and set mSelectedIndex to it.
|
||||
|
|
|
@ -84,7 +84,7 @@ class ImageDocument final : public MediaDocument,
|
|||
|
||||
void ScrollImageTo(int32_t aX, int32_t aY);
|
||||
|
||||
float GetRatio() {
|
||||
float GetRatio() const {
|
||||
return std::min(mVisibleWidth / mImageWidth, mVisibleHeight / mImageHeight);
|
||||
}
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ class SinkContext {
|
|||
nsresult GrowStack();
|
||||
nsresult FlushTags();
|
||||
|
||||
bool IsCurrentContainer(nsHTMLTag mType);
|
||||
bool IsCurrentContainer(nsHTMLTag aTag) const;
|
||||
|
||||
void DidAddContent(nsIContent* aContent);
|
||||
void UpdateChildCounts();
|
||||
|
@ -278,12 +278,8 @@ nsresult SinkContext::Begin(nsHTMLTag aNodeType, nsGenericHTMLElement* aRoot,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
bool SinkContext::IsCurrentContainer(nsHTMLTag aTag) {
|
||||
if (aTag == mStack[mStackPos - 1].mType) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
bool SinkContext::IsCurrentContainer(nsHTMLTag aTag) const {
|
||||
return aTag == mStack[mStackPos - 1].mType;
|
||||
}
|
||||
|
||||
void SinkContext::DidAddContent(nsIContent* aContent) {
|
||||
|
|
|
@ -550,7 +550,7 @@ void nsHTMLDocument::AddedForm() { ++mNumForms; }
|
|||
|
||||
void nsHTMLDocument::RemovedForm() { --mNumForms; }
|
||||
|
||||
int32_t nsHTMLDocument::GetNumFormsSynchronous() { return mNumForms; }
|
||||
int32_t nsHTMLDocument::GetNumFormsSynchronous() const { return mNumForms; }
|
||||
|
||||
bool nsHTMLDocument::ResolveName(JSContext* aCx, const nsAString& aName,
|
||||
JS::MutableHandle<JS::Value> aRetval,
|
||||
|
|
|
@ -89,7 +89,7 @@ class nsHTMLDocument : public mozilla::dom::Document {
|
|||
*/
|
||||
// XXXbz is this still needed now that we can flush just content,
|
||||
// not the rest?
|
||||
int32_t GetNumFormsSynchronous();
|
||||
int32_t GetNumFormsSynchronous() const;
|
||||
void SetIsXHTML(bool aXHTML) { mType = (aXHTML ? eXHTML : eHTML); }
|
||||
|
||||
virtual nsresult Clone(mozilla::dom::NodeInfo*,
|
||||
|
|
|
@ -38,7 +38,7 @@ mozilla::dom::ValidityState* nsIConstraintValidation::Validity() {
|
|||
}
|
||||
|
||||
bool nsIConstraintValidation::CheckValidity(nsIContent& aEventTarget,
|
||||
bool* aEventDefaultAction) {
|
||||
bool* aEventDefaultAction) const {
|
||||
if (!IsCandidateForConstraintValidation() || IsValid()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ class nsIConstraintValidation : public nsISupports {
|
|||
* @return whether it's valid.
|
||||
*/
|
||||
bool CheckValidity(nsIContent& aEventTarget,
|
||||
bool* aEventDefaultAction = nullptr);
|
||||
bool* aEventDefaultAction = nullptr) const;
|
||||
|
||||
// Web IDL binding methods
|
||||
bool WillValidate() const { return IsCandidateForConstraintValidation(); }
|
||||
|
|
Загрузка…
Ссылка в новой задаче