In the context of mw.widgets.TitleInputWidget#setTitle(), mw.widgets.TitleWidget.prototype.getTitle() is used instead of OO.ui.mixin.TitledElement.prototype.getTitle() and that produces a wrong value for the HTML title attribute.
Description
Details
Related Objects
Event Timeline
Change 402073 had a related patch set uploaded (by Sbisson; owner: Sbisson):
[oojs/ui@master] Ensure TitledElement mixin uses the right getTitle() function
TitleWidget should be the one that adjusts here, in my opinion, since 'title' in this case is for HTML properties, rather than having the mixin allow for things it wasn't designed for.
The TitleWidget is mixing two concepts -- title as in Mediawiki Title object, and title as in the HTML property (which is what the mixin if for). I agree with the mixin internally using this.title instead of this.getTitle() but honestly, the TitleWidget -- since it's using TitledElement, should know better, and use a different definition of the MW Title or it should call it something else, OR it should not use TitledElement.
The term "title" having 2 different meanings is the problem here; I don't think the solution is necessarily changing the mixin.
(Sidepoint that I also wrote in the patch -- if we do remove the method, we must deprecate it first, since it's heavily used everywhere else)
Change 402112 had a related patch set uploaded (by Sbisson; owner: Sbisson):
[mediawiki/core@master] Rename TitleWidget#getTitle so it won't clash with TitledElement#getTitle
Change 402112 merged by jenkins-bot:
[mediawiki/core@master] [BREAKING CHANGE] Rename TitleWidget#getTitle to TitleWidget#getMWTitle
@Etonkovidova to test this, refer to the mentioned task (that's closed, but is relevant) - T183484: Related Changes page-name entry box does not show the entirety of long pagenames
Checked in betalabs - the tooltip displays the white spaces in page titles correctly.

