parentElement is not defined on non-Element nodes in IE10

To have a "blanket rule", just use parentNode everywhere to prevent future problems,
as it is equivalent to parentElement for all practical usages.
This commit is contained in:
Friedrich W. H. Kossebau
2014-07-16 15:15:13 +02:00
parent 85fff618af
commit 40c43e4d97
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -126,7 +126,7 @@ gui.AnnotationViewManager = function AnnotationViewManager(canvas, odfFragment,
* @return {!boolean}
*/
function isNodeWithinAnnotationHighlight(node, annotationName) {
var iteratingNode = node.parentElement;
var iteratingNode = node.parentNode;
while (!(iteratingNode.namespaceURI === odf.Namespaces.officens
&& iteratingNode.localName === "body")) {
+1 -1
View File
@@ -505,7 +505,7 @@
unregisterGestureListeners();
zoomableElement = element;
offsetParent = /**@type{!HTMLElement}*/(zoomableElement.offsetParent);
parentElement = /**@type{!HTMLElement}*/(zoomableElement.parentElement);
parentElement = /**@type{!HTMLElement}*/(zoomableElement.parentNode);
// Write out the current transform to the new element.
applyDetailedTransform();
registerGestureListeners();
+1 -1
View File
@@ -202,7 +202,7 @@ odf.OdfUtils = function OdfUtils() {
if (node.namespaceURI === odf.Namespaces.officens && node.localName === 'annotation') {
return /**@type{!Element}*/(node);
}
node = node.parentElement;
node = node.parentNode;
}
return null;
}
+1 -1
View File
@@ -537,7 +537,7 @@ odf.StyleCache = function (odfroot) {
*/
function getTextStyleChain(element, chain) {
var stylename = styleInfo.getStyleName("text", element),
parent = element.parentElement;
parent = /**@type{!Element}*/(element.parentNode);
if (stylename !== undefined) {
chain.push("text");
chain.push(stylename);