Catrope has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/179346

Change subject: Revert 370b375: don't use this.$.context in getElementDocument()
......................................................................

Revert 370b375: don't use this.$.context in getElementDocument()

Or any other cached value for that matter.

Reverts code change only, does not revert addition of tests.

Change-Id: I9fe6ccf7c77dfdaf2233f1ad296519330efeb090
---
M src/Element.js
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/46/179346/1

diff --git a/src/Element.js b/src/Element.js
index fe23221..b26e446 100644
--- a/src/Element.js
+++ b/src/Element.js
@@ -514,7 +514,9 @@
  * @return {HTMLDocument} Document object
  */
 OO.ui.Element.prototype.getElementDocument = function () {
-       return this.$.context;
+       // Don't use this.$.context because subclasses can rebind this.$
+       // Don't cache this in other ways either because subclasses could can 
change this.$element
+       return OO.ui.Element.static.getDocument( this.$element );
 };
 
 /**

-- 
To view, visit https://gerrit.wikimedia.org/r/179346
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9fe6ccf7c77dfdaf2233f1ad296519330efeb090
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to