Bug 1932512 - Pass BrowsingContext to nsIColorPicker::Init; r=geckoview-reviewers,win-reviewers,mac-reviewers,emilio,spohl,m_kato,rkraesig

Differential Revision: https://phabricator.services.mozilla.com/D229682
This commit is contained in:
Edgar Chen
2024-11-25 14:03:25 +00:00
parent 4d1ec66bf7
commit 997fb832b3
14 changed files with 79 additions and 49 deletions

View File

@@ -736,8 +736,8 @@ nsresult HTMLInputElement::InitColorPicker() {
nsCOMPtr<Document> doc = OwnerDoc();
nsCOMPtr<nsPIDOMWindowOuter> win = doc->GetWindow();
if (!win) {
RefPtr<BrowsingContext> bc = doc->GetBrowsingContext();
if (!bc) {
return NS_ERROR_FAILURE;
}
@@ -759,7 +759,7 @@ nsresult HTMLInputElement::InitColorPicker() {
nsAutoString initialValue;
GetNonFileValueInternal(initialValue);
nsTArray<nsString> colors = GetColorsFromList();
nsresult rv = colorPicker->Init(win, title, initialValue, colors);
nsresult rv = colorPicker->Init(bc, title, initialValue, colors);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIColorPickerShownCallback> callback =