Revert Opera title fix
This commit is contained in:
parent
63bb172663
commit
6c38d84254
@ -1,5 +1,3 @@
|
||||
* Use feature testing in `Element#readAttribute` when taking care of Opera's `getAttribute('title')` quirk. (kangax)
|
||||
|
||||
* Use `Prototype.emptyFunction` consistently throughout unit tests. [#253 state:resolved] (Michael M Slusarz, John David Dalton, kangax)
|
||||
|
||||
* deprecation extension: mark Array#reduce() as removed. [#569 state:resolved] (Tobie Langel)
|
||||
|
@ -609,16 +609,6 @@ Element.Methods = {
|
||||
return isBuggy;
|
||||
})();
|
||||
|
||||
// Opera 9.25 returns `null` instead of "" for getAttribute('title')
|
||||
// when `title` attribute is empty
|
||||
var GET_ATTRIBUTE_TITLE_RETURNS_NULL = (function(){
|
||||
var el = document.createElement('div');
|
||||
el.title = '';
|
||||
var isBuggy = (el.getAttribute('title') === null);
|
||||
el = null;
|
||||
return isBuggy;
|
||||
})();
|
||||
|
||||
return function(element, name) {
|
||||
element = $(element);
|
||||
// check boolean first, to get out of expression faster
|
||||
@ -627,9 +617,6 @@ Element.Methods = {
|
||||
element.tagName.toUpperCase() == 'IFRAME') {
|
||||
return element.getAttribute('type');
|
||||
}
|
||||
if (GET_ATTRIBUTE_TITLE_RETURNS_NULL && name === 'title') {
|
||||
return element.title;
|
||||
}
|
||||
if (Prototype.Browser.IE) {
|
||||
var t = Element._attributeTranslations.read;
|
||||
if (t.values[name]) return t.values[name](element, name);
|
||||
@ -1243,6 +1230,13 @@ if (Prototype.Browser.Opera) {
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Element.Methods.readAttribute = Element.Methods.readAttribute.wrap(
|
||||
function(proceed, element, attribute) {
|
||||
if (attribute === 'title') return element.title;
|
||||
return proceed(element, attribute);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
else if (Prototype.Browser.IE) {
|
||||
|
Loading…
Reference in New Issue
Block a user