LibWeb: Notify the PageClient when the children of <title> change

This commit is contained in:
Andreas Kling 2020-12-17 02:02:00 +01:00
parent 2a5877b02c
commit 4c8dbc908c
Notes: sideshowbarker 2024-07-19 00:46:52 +09:00
2 changed files with 12 additions and 0 deletions

View file

@ -24,7 +24,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/HTMLTitleElement.h>
#include <LibWeb/Page/Page.h>
namespace Web::HTML {
@ -37,4 +39,11 @@ HTMLTitleElement::~HTMLTitleElement()
{
}
void HTMLTitleElement::children_changed()
{
HTMLElement::children_changed();
if (auto* page = document().page())
page->client().page_did_change_title(document().title());
}
}

View file

@ -36,6 +36,9 @@ public:
HTMLTitleElement(DOM::Document&, const QualifiedName& qualified_name);
virtual ~HTMLTitleElement() override;
private:
virtual void children_changed() override;
};
}