This commit is contained in:
2025-08-05 22:30:12 -04:00
parent 92e90f9233
commit 9c2225a633
3 changed files with 12 additions and 12 deletions

View File

@ -994,7 +994,7 @@ void DilloHtmlFormImpl::eventHandler(Resource *resource, EventButton *event)
{ {
_MSG("DilloHtmlFormImpl::eventHandler\n"); _MSG("DilloHtmlFormImpl::eventHandler\n");
if (event && (event->button == 3)) { if (event && (event->button == 3)) {
a_UIcmd_form_popup(html->bw, html->page_url, this, showing_hiddens); a_UIcmd_form_popup(html->bw, html->page_url.get(), this, showing_hiddens);
} else { } else {
auto input = getInput(resource); auto input = getInput(resource);
if (input) { if (input) {

View File

@ -445,7 +445,7 @@ DilloHtml::DilloHtml(BrowserWindow *p_bw, const DilloUrl *url,
{ {
/* Init main variables */ /* Init main variables */
bw = p_bw; bw = p_bw;
page_url = a_Url_dup(url).release(); page_url = a_Url_dup(url);
base_url = a_Url_dup(url).release(); base_url = a_Url_dup(url).release();
dw = NULL; dw = NULL;
@ -473,7 +473,7 @@ DilloHtml::DilloHtml(BrowserWindow *p_bw, const DilloUrl *url,
DocType = DT_NONE; /* assume Tag Soup 0.0! :-) */ DocType = DT_NONE; /* assume Tag Soup 0.0! :-) */
DocTypeVersion = 0.0f; DocTypeVersion = 0.0f;
styleEngine = std::make_unique< StyleEngine >(HT2LT (this), page_url, base_url, bw->zoom); styleEngine = std::make_unique< StyleEngine >(HT2LT (this), page_url.get(), base_url, bw->zoom);
stack = new misc::SimpleVector <DilloHtmlState> (16); stack = new misc::SimpleVector <DilloHtmlState> (16);
stack->increase(); stack->increase();
@ -548,7 +548,6 @@ DilloHtml::~DilloHtml()
a_Bw_remove_doc(bw, this); a_Bw_remove_doc(bw, this);
delete page_url;
delete base_url; delete base_url;
} }
@ -689,7 +688,7 @@ void DilloHtml::loadImages (const DilloUrl *pattern)
* If the possible patterns become more complex, it might be good to have * If the possible patterns become more complex, it might be good to have
* the caller supply the requester instead. * the caller supply the requester instead.
*/ */
const DilloUrl *requester = pattern ? NULL : this->page_url; const DilloUrl *requester = pattern ? NULL : this->page_url.get();
for (int i = 0; i < images.size(); i++) { for (int i = 0; i < images.size(); i++) {
DilloHtmlImage *hi = images.at(i).get(); DilloHtmlImage *hi = images.at(i).get();
@ -749,14 +748,14 @@ bool DilloHtml::HtmlLinkReceiver::press (Widget *widget, int link, int img,
linkurl = html->links.at(link).get(); linkurl = html->links.at(link).get();
const bool_t loaded_img = (html->images.at(img)->image == NULL); const bool_t loaded_img = (html->images.at(img)->image == NULL);
a_UIcmd_image_popup(bw, html->images.at(img)->url.get(), loaded_img, a_UIcmd_image_popup(bw, html->images.at(img)->url.get(), loaded_img,
html->page_url, linkurl); html->page_url.get(), linkurl);
ret = true; ret = true;
} else { } else {
if (link == -1) { if (link == -1) {
a_UIcmd_page_popup(bw, bw->num_page_bugs != 0, &html->cssUrls); a_UIcmd_page_popup(bw, bw->num_page_bugs != 0, &html->cssUrls);
ret = true; ret = true;
} else { } else {
a_UIcmd_link_popup(bw, html->links.at(link).get(), html->page_url); a_UIcmd_link_popup(bw, html->links.at(link).get(), html->page_url.get());
ret = true; ret = true;
} }
} }
@ -1689,7 +1688,7 @@ static void Html_tag_close_title(DilloHtml *html)
if (!title || title[0] == '\0') if (!title || title[0] == '\0')
return; return;
a_UIcmd_set_page_title(html->bw, title); a_UIcmd_set_page_title(html->bw, title);
a_History_set_title_by_url(html->page_url, title); a_History_set_title_by_url(html->page_url.get(), title);
} }
} }
@ -2131,7 +2130,7 @@ std::shared_ptr< DilloImage > a_Html_image_new(DilloHtml *html, const char *tag,
!dStrAsciiCasecmp(URL_SCHEME(hi->url.get()), "data") || !dStrAsciiCasecmp(URL_SCHEME(hi->url.get()), "data") ||
(a_Capi_get_flags_with_redirection(hi->url.get()) & CAPI_IsCached); (a_Capi_get_flags_with_redirection(hi->url.get()) & CAPI_IsCached);
if (load_now && Html_load_image(html->bw, hi->url.get(), html->page_url, image)) { if (load_now && Html_load_image(html->bw, hi->url.get(), html->page_url.get(), image)) {
// hi->image is NULL if dillo tries to load the image immediately // hi->image is NULL if dillo tries to load the image immediately
hi->image = nullptr; hi->image = nullptr;
} else { } else {
@ -3046,7 +3045,7 @@ static int Html_tag_pre_excludes(DilloHtml *html, int tag_idx)
*/ */
static void Html_update_content_type(DilloHtml *html, const char *content) static void Html_update_content_type(DilloHtml *html, const char *content)
{ {
const char *new_content = a_Capi_set_content_type(html->page_url, content, const char *new_content = a_Capi_set_content_type(html->page_url.get(), content,
"meta"); "meta");
/* Cannot ask cache whether the content type was changed, as /* Cannot ask cache whether the content type was changed, as
* this code in another bw might have already changed it for us. * this code in another bw might have already changed it for us.
@ -3227,7 +3226,7 @@ void a_Html_load_stylesheet(DilloHtml *html, DilloUrl *url)
} else { } else {
/* Fill a Web structure for the cache query */ /* Fill a Web structure for the cache query */
int ClientKey; int ClientKey;
DilloWeb *Web = a_Web_new(html->bw, url, html->page_url); DilloWeb *Web = a_Web_new(html->bw, url, html->page_url.get());
Web->flags |= WEB_Stylesheet; Web->flags |= WEB_Stylesheet;
if ((ClientKey = a_Capi_open_url(Web, Html_css_load_callback, NULL))) { if ((ClientKey = a_Capi_open_url(Web, Html_css_load_callback, NULL))) {
++html->bw->NumPendingStyleSheets; ++html->bw->NumPendingStyleSheets;

View File

@ -167,7 +167,8 @@ private:
public: //BUG: for now everything is public public: //BUG: for now everything is public
BrowserWindow *bw; BrowserWindow *bw;
DilloUrl *page_url, *base_url; std::unique_ptr< DilloUrl > page_url;
DilloUrl *base_url;
dw::core::Widget *dw; /* this is duplicated in the stack */ dw::core::Widget *dw; /* this is duplicated in the stack */
/* -------------------------------------------------------------------*/ /* -------------------------------------------------------------------*/