mirror of
https://github.com/webodf/WebODF.git
synced 2026-11-30 16:47:58 +01:00
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:
@@ -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")) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user