My favorites | Sign in
Project Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 24: Error: Permission denied to get property HTMLDivElement.parentNode
1 person starred this issue and may be notified of changes. Back to list
Status:  Verified
Owner:  johncurt...@gmail.com
Closed:  Jun 29
Type-Defect
Priority-Medium
Milestone-Release2.5


Sign in to add a comment
 
Reported by secnoc, Mar 23, 2009
What steps will reproduce the problem?
1. Use FireFox and bring up Error Console
2. Move your mouse from chart to or through the TextBox and back to chart
rapidly.
3.

What is the expected output? What do you see instead?

You'll see lots of Error: Permission denied to get property
HTMLDivElement.parentNode in the error console.


What version of the product are you using? On what operating system?

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7)
Gecko/2009021910 Firefox/3.0.7

Using gchart 2.41, gwt 1.5.3 on windows xp.  Javascript code compiled from
hosted mode browser.

Please provide any additional information below.

My guess is the code is hitting this problem 
https://bugzilla.mozilla.org/show_bug.cgi?id=208427.

Other possible helpful stuff
http://code.google.com/p/google-web-toolkit/issues/detail?id=671
http://code.google.com/p/google-web-toolkit/source/detail?r=921

This is inside my EntryPoint class:

    public void onModuleLoad() {

       
GChart.setBlankImageURL(GWT.getModuleBaseURL()+GChart.DEFAULT_BLANK_IMAGE_URL);

        GChart gchart = new GChartExample01();
        gchart.update();

        TextBox tb = new TextBox();

        RootPanel.get().add(gchart);
        RootPanel.get().add(tb);


    }

    static class GChartExample01 extends GChart {

        GChartExample01() {

            setChartSize(640, 200);
            //setHoverTouchingEnabled(false);

            long numberOfPoints = 20;

            addCurve();

            getCurve().getSymbol().setSymbolType(GChart.SymbolType.VBAR_SOUTH);
            getCurve().getSymbol().setBackgroundColor("green");
            getCurve().getSymbol().setModelWidth(1.0);
            getCurve().getSymbol().setBorderWidth(0);

            getCurve().getSymbol().setHovertextTemplate("");
           
getCurve().getSymbol().setHoverSelectionSymbolType(SymbolType.NONE);

            for (int i = 0; i < numberOfPoints; i++) {
                getCurve().addPoint(i, Random.nextInt(4000));
            }

            addCurve();
            getCurve().getSymbol().setSymbolType(GChart.SymbolType.VBAR_SOUTH);
            getCurve().getSymbol().setBackgroundColor("blue");
            getCurve().getSymbol().setModelWidth(1.0);
            getCurve().getSymbol().setBorderWidth(0);

            getCurve().getSymbol().setHovertextTemplate("");
           
getCurve().getSymbol().setHoverSelectionSymbolType(SymbolType.NONE);

            for (int i = 0; i < numberOfPoints; i++) {
                getCurve().addPoint(i, Random.nextInt(4000));
            }

            //setPadding("1px 1px 1px 5px");

            getXAxis().setHasGridlines(false);

        }
    }

Comment 1 by secnoc, Mar 23, 2009
Also, looking at stack trace of another module I can't provide source for it looks
like the stack is method takesUsCompletelyOutsideChart -> isContainedIn ->
getParentElement -> exception.

Comment 2 by johncurt...@gmail.com, Mar 24, 2009
Thanks much for the detailed report...makes it very easy to reproduce and to
understand what is happening and how likely to fix it.

I modified isContainedIn in GChart.java as follows, and added TestGChart44.java

       /*
        * Is the given part contained within the given container?
        * (tried isOrHasChild but was getting exceptions in FF2 I could
        *  not track to their source, so I just stuck with this)
        */  
     private boolean isContainedIn(Element container, Element part) {
        /*
         * In Chrome and FF2, the next line makes dropdown lists inside
         * hover widgets work more correctly when they click on the
         * dropdown part of the list. Otherwise, hover widget can close
         * inappropriately. As tested in GChartExample20a.java
         * 
         */ 
         if (null == part) return true;
         try {
           for (Element ancestor = part;
                ancestor != null && container != null;
                ancestor = ancestor.getParentElement()) 
              if (container == ancestor) return true;
         }
         catch (Exception e) {
/*
 * In FF2, we get the error "Error: uncaught exception: Permission
 * denied to get property HTMLDivElement.parentNode" if a TextBox is
 * placed into the chart x axis label and you mouse over that textbox
 * (as reported by secnoc in  issue #24 , which has additional useful info
 * about the likely cause of this problem; TestGChart44.java reproduces
 * this behavior if this try/catch is removed).
 *
 * Returning true, which will act as if the element is contained in the
 * GChart, has "cruft possibilities" as in some cases a hoverwidget may
 * not get closed when user mouses completely out of the GChart, onto a
 * TextBox, but should otherwise be a lesser evil than false or an
 * uncaught exception.
 * 
 */
           return true;

         }
         return false;
       }

It does make the error go away in TestGChart44.java, but I still need to test this
with existing test set to assure it doesn't cause a re-bug. 

Will go out with 2.5 but not sure when 2.5 will go out. 

John

John

Status: Accepted
Owner: johncurtisgunther
Comment 3 by johncurt...@gmail.com, Mar 24, 2009
(No comment was entered for this change.)
Labels: Milestone-Release2.5
Comment 4 by johncurt...@gmail.com, Jun 29, 2009
Version 2.5 was finally released today and fixes this problem using the method
described above. See the 2.5 release notes (bugfix list is at the end) for further
details:

http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/doc-files/gchart2p5features.html


Status: Verified
Sign in to add a comment

Hosted by Google Code