<commit_before>/*
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.xwiki.gwt.dom.client;

/**
 * In-line sub-windows.
 * 
 * @version $Id$
 * @see <a href="http://www.w3.org/TR/1999/REC-html401-19991224/present/frames.html#edef-IFRAME">W3C HTML
 *      Specification</a>
 */
public class IFrameElement extends com.google.gwt.dom.client.IFrameElement
{
    /**
     * Default constructor. Needs to be protected because all instances are created from JavaScript.
     */
    protected IFrameElement()
    {
    }

    /**
     * @return a reference to the content window
     */
    public final native Window getContentWindow()
    /*-{
        return this.contentWindow;
    }-*/;
}
<commit_msg>Added a utility method to be able to access the content document of an iframe element from JSNI.<commit_after>/*
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.xwiki.gwt.dom.client;

/**
 * In-line sub-windows.
 * 
 * @version $Id$
 * @see <a href="http://www.w3.org/TR/1999/REC-html401-19991224/present/frames.html#edef-IFRAME">W3C HTML
 *      Specification</a>
 */
public class IFrameElement extends com.google.gwt.dom.client.IFrameElement
{
    /**
     * Default constructor. Needs to be protected because all instances are created from JavaScript.
     */
    protected IFrameElement()
    {
    }

    /**
     * @return a reference to the content window
     */
    public final native Window getContentWindow()
    /*-{
        return this.contentWindow;
    }-*/;

    /**
     * This is a utility method for accessing the content document of an in-line frame in a static way. This method is
     * solely useful when called from native code. As we know, only static references to overlay types are allowed from
     * JSNI.
     * 
     * @param iframe an in-line frame element
     * @return the content document of the given in-line element
     */
    public static Document getContentDocument(IFrameElement iframe)
    {
        return (Document) iframe.getContentDocument();
    }
}

{'fraction_non_alphanumeric': 0.08288336933045357, 'fraction_numerical': 0.016198704103671708, 'mean_word_length': 3.1582491582491583, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2566507', 'n_tokens_mistral': 1038, 'n_tokens_neox': 977, 'n_words': 443}