From: <mgu...@us...> - 2013-01-08 09:03:15
|
Revision: 7955 http://sourceforge.net/p/htmlunit/code/7955 Author: mguillem Date: 2013-01-08 09:03:12 +0000 (Tue, 08 Jan 2013) Log Message: ----------- window.globalStorage is not defined for FF17 Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2013-01-08 08:52:59 UTC (rev 7954) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2013-01-08 09:03:12 UTC (rev 7955) @@ -572,7 +572,7 @@ * Returns the globalStorage property. * @return the globalStorage property */ - @JsxGetter(@WebBrowser(FF)) + @JsxGetter(@WebBrowser(value = FF, maxVersion = 10)) public StorageList getGlobalStorage() { if (storageList_ == null) { storageList_ = new StorageList(); |
From: <rb...@us...> - 2013-02-18 23:00:39
|
Revision: 8119 http://sourceforge.net/p/htmlunit/code/8119 Author: rbri Date: 2013-02-18 23:00:36 +0000 (Mon, 18 Feb 2013) Log Message: ----------- unified code and minor cleanup Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2013-02-16 13:00:26 UTC (rev 8118) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2013-02-18 23:00:36 UTC (rev 8119) @@ -348,7 +348,7 @@ if (features != Undefined.instance) { featuresString = Context.toString(features); } - final WebClient webClient = webWindow_.getWebClient(); + final WebClient webClient = getWebWindow().getWebClient(); if (webClient.getOptions().isPopupBlockerEnabled()) { if (LOG.isDebugEnabled()) { @@ -375,9 +375,8 @@ // if specified name is the name of an existing window, then hold it if (StringUtils.isEmpty(urlString) && !"".equals(windowName)) { - final WebWindow webWindow; try { - webWindow = webClient.getWebWindowByName(windowName); + final WebWindow webWindow = webClient.getWebWindowByName(windowName); return getProxy(webWindow); } catch (final WebWindowNotFoundException e) { @@ -409,7 +408,7 @@ } try { - final Page page = webWindow_.getEnclosedPage(); + final Page page = getWebWindow().getEnclosedPage(); if (page != null && page instanceof HtmlPage) { return ((HtmlPage) page).getFullyQualifiedUrl(urlString); } @@ -437,19 +436,19 @@ if (timeout < MIN_TIMER_DELAY) { timeout = MIN_TIMER_DELAY; } - final int id; - final WebWindow w = getWebWindow(); - final Page page = (Page) getDomNodeOrNull(); if (code == null) { throw Context.reportRuntimeError("Function not provided."); } + final int id; + final WebWindow webWindow = getWebWindow(); + final Page page = (Page) getDomNodeOrNull(); if (code instanceof String) { final String s = (String) code; final String description = "window.setTimeout(" + s + ", " + timeout + ")"; final JavaScriptJob job = BackgroundJavaScriptFactory.theFactory(). - createJavaScriptJob(timeout, null, description, w, s); - id = getWebWindow().getJobManager().addJob(job, page); + createJavaScriptJob(timeout, null, description, webWindow, s); + id = webWindow.getJobManager().addJob(job, page); } else if (code instanceof Function) { final Function f = (Function) code; @@ -463,8 +462,8 @@ final String description = "window.setTimeout(" + functionName + ", " + timeout + ")"; final JavaScriptJob job = BackgroundJavaScriptFactory.theFactory(). - createJavaScriptJob(timeout, null, description, w, f); - id = getWebWindow().getJobManager().addJob(job, page); + createJavaScriptJob(timeout, null, description, webWindow, f); + id = webWindow.getJobManager().addJob(job, page); } else { throw Context.reportRuntimeError("Unknown type for function."); @@ -673,7 +672,8 @@ windowProxy_ = new WindowProxy(webWindow_); - if (webWindow.getEnclosedPage() instanceof XmlPage) { + final Page enclosedPage = webWindow.getEnclosedPage(); + if (enclosedPage instanceof XmlPage) { document_ = new XMLDocument(); } else { @@ -683,8 +683,8 @@ document_.setPrototype(getPrototype(document_.getClass())); document_.setWindow(this); - if (webWindow.getEnclosedPage() instanceof SgmlPage) { - final SgmlPage page = (SgmlPage) webWindow.getEnclosedPage(); + if (enclosedPage instanceof SgmlPage) { + final SgmlPage page = (SgmlPage) enclosedPage; document_.setDomNode(page); final DomHtmlAttributeChangeListenerImpl listener = new DomHtmlAttributeChangeListenerImpl(); @@ -771,7 +771,7 @@ return top_; } - final WebWindow top = webWindow_.getTopWindow(); + final WebWindow top = getWebWindow().getTopWindow(); return getProxy(top); } @@ -790,7 +790,7 @@ */ @JsxGetter public WindowProxy getParent() { - final WebWindow parent = webWindow_.getParentWindow(); + final WebWindow parent = getWebWindow().getParentWindow(); return getProxy(parent); } @@ -880,7 +880,8 @@ */ @JsxFunction public void focus() { - webWindow_.getWebClient().setCurrentWindow(webWindow_); + final WebWindow window = getWebWindow(); + window.getWebClient().setCurrentWindow(window); } /** @@ -914,7 +915,8 @@ @JsxGetter @CanSetReadOnly(CanSetReadOnlyStatus.IGNORE) public boolean getClosed() { - return !getWebWindow().getWebClient().getWebWindows().contains(getWebWindow()); + final WebWindow webWindow = getWebWindow(); + return !webWindow.getWebClient().getWebWindows().contains(webWindow); } /** @@ -1083,7 +1085,7 @@ final Object onload = getEventListenersContainer().getEventHandlerProp("load"); if (onload == null) { // NB: for IE, the onload of window is the one of the body element but not for Mozilla. - final HtmlPage page = (HtmlPage) webWindow_.getEnclosedPage(); + final HtmlPage page = (HtmlPage) getWebWindow().getEnclosedPage(); final HtmlElement body = page.getBody(); if (body != null) { final HTMLBodyElement b = (HTMLBodyElement) body.getScriptObject(); @@ -1178,7 +1180,7 @@ */ @JsxGetter public String getName() { - return webWindow_.getName(); + return getWebWindow().getName(); } /** @@ -1187,7 +1189,7 @@ */ @JsxSetter public void setName(final String name) { - webWindow_.setName(name); + getWebWindow().setName(name); } /** @@ -1251,7 +1253,7 @@ } private void setHandlerForJavaScript(final String eventName, final Object handler) { - if (handler instanceof Function || handler == null) { + if (handler == null || handler instanceof Function) { getEventListenersContainer().setEventHandlerProp(eventName, handler); } // Otherwise, fail silently. @@ -1269,7 +1271,7 @@ if (arg instanceof String) { return ScriptableObject.getProperty(this, (String) arg); } - else if (arg instanceof Number) { + if (arg instanceof Number) { return ScriptableObject.getProperty(this, ((Number) arg).intValue()); } } @@ -1615,9 +1617,10 @@ */ @JsxFunction(@WebBrowser(FF)) public Selection getSelection() { + final WebWindow webWindow = getWebWindow(); // return null if the window is in a frame that is not displayed - if (webWindow_ instanceof FrameWindow) { - final FrameWindow frameWindow = (FrameWindow) webWindow_; + if (webWindow instanceof FrameWindow) { + final FrameWindow frameWindow = (FrameWindow) webWindow; if (!frameWindow.getFrameElement().isDisplayed()) { return null; } @@ -1649,11 +1652,11 @@ */ @JsxFunction({ @WebBrowser(IE), @WebBrowser(FF) }) public Object showModalDialog(final String url, final Object arguments, final String features) { - final WebWindow ww = getWebWindow(); - final WebClient client = ww.getWebClient(); + final WebWindow webWindow = getWebWindow(); + final WebClient client = webWindow.getWebClient(); try { final URL completeUrl = ((HtmlPage) getDomNodeOrDie()).getFullyQualifiedUrl(url); - final DialogWindow dialog = client.openDialogWindow(completeUrl, ww, arguments); + final DialogWindow dialog = client.openDialogWindow(completeUrl, webWindow, arguments); // TODO: Theoretically, we shouldn't return until the dialog window has been close()'ed... // But we have to return so that the window can be close()'ed... // Maybe we can use Rhino's continuation support to save state and restart when @@ -1676,11 +1679,11 @@ */ @JsxFunction(@WebBrowser(IE)) public Object showModelessDialog(final String url, final Object arguments, final String features) { - final WebWindow ww = getWebWindow(); - final WebClient client = ww.getWebClient(); + final WebWindow webWindow = getWebWindow(); + final WebClient client = webWindow.getWebClient(); try { final URL completeUrl = ((HtmlPage) getDomNodeOrDie()).getFullyQualifiedUrl(url); - final DialogWindow dialog = client.openDialogWindow(completeUrl, ww, arguments); + final DialogWindow dialog = client.openDialogWindow(completeUrl, webWindow, arguments); final Window jsDialog = (Window) dialog.getScriptObject(); return jsDialog; } @@ -2007,6 +2010,16 @@ final ScriptResult result = Node.fireEvent(this, event); return !event.isAborted(result); } + + @JsxGetter({ @WebBrowser(FF), @WebBrowser(CHROME) }) + public Object getOnchange() { + return getHandlerForJavaScript(Event.TYPE_CHANGE); + } + + @JsxSetter({ @WebBrowser(FF), @WebBrowser(CHROME) }) + public void setOnchange(final Object onchange) { + setHandlerForJavaScript(Event.TYPE_CHANGE, onchange); + } } class HTMLCollectionFrames extends HTMLCollection { |
From: <rb...@us...> - 2013-02-18 23:02:19
|
Revision: 8120 http://sourceforge.net/p/htmlunit/code/8120 Author: rbri Date: 2013-02-18 23:02:16 +0000 (Mon, 18 Feb 2013) Log Message: ----------- upps Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2013-02-18 23:00:36 UTC (rev 8119) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2013-02-18 23:02:16 UTC (rev 8120) @@ -2010,16 +2010,6 @@ final ScriptResult result = Node.fireEvent(this, event); return !event.isAborted(result); } - - @JsxGetter({ @WebBrowser(FF), @WebBrowser(CHROME) }) - public Object getOnchange() { - return getHandlerForJavaScript(Event.TYPE_CHANGE); - } - - @JsxSetter({ @WebBrowser(FF), @WebBrowser(CHROME) }) - public void setOnchange(final Object onchange) { - setHandlerForJavaScript(Event.TYPE_CHANGE, onchange); - } } class HTMLCollectionFrames extends HTMLCollection { |
From: <rb...@us...> - 2013-11-15 16:14:12
|
Revision: 8786 http://sourceforge.net/p/htmlunit/code/8786 Author: rbri Date: 2013-11-15 16:14:08 +0000 (Fri, 15 Nov 2013) Log Message: ----------- removing some dead code; this code was introduces in 02/2008 to 'Add support of having XML inside Html (IE only).' The associated test is still there and works. So this strange piece of code can go away. (hi Frank, hope this helps a bit with IE10) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2013-11-15 12:28:24 UTC (rev 8785) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2013-11-15 16:14:08 UTC (rev 8786) @@ -22,7 +22,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_POST_MESSAGE_ALLOW_INVALID_PORT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_POST_MESSAGE_CANCELABLE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_POST_MESSAGE_SYNCHRONOUS; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_XML_SUPPORT_VIA_ACTIVEXOBJECT; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.IE; @@ -104,7 +103,6 @@ import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLCollection; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement; -import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLUnknownElement; import com.gargoylesoftware.htmlunit.javascript.host.xml.XMLDocument; import com.gargoylesoftware.htmlunit.xml.XmlPage; @@ -1331,20 +1329,6 @@ final WebWindow webWindow = ((Window) result).getWebWindow(); result = getProxy(webWindow); } - else if (result instanceof HTMLUnknownElement && getBrowserVersion() - .hasFeature(JS_XML_SUPPORT_VIA_ACTIVEXOBJECT)) { - final HtmlElement unknownElement = ((HTMLUnknownElement) result).getDomNodeOrDie(); - if ("xml".equals(unknownElement.getNodeName())) { - final XMLDocument document = ActiveXObject.buildXMLDocument(getWebWindow()); - document.setParentScope(this); - final Iterator<HtmlElement> children = unknownElement.getHtmlElementDescendants().iterator(); - if (children.hasNext()) { - final HtmlElement root = children.next(); - document.loadXML(root.asXml().trim()); - } - result = document; - } - } } return result; |
From: <rb...@us...> - 2013-11-15 17:54:13
|
Revision: 8787 http://sourceforge.net/p/htmlunit/code/8787 Author: rbri Date: 2013-11-15 17:54:08 +0000 (Fri, 15 Nov 2013) Log Message: ----------- revert my last commit, i'm blind Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2013-11-15 16:14:08 UTC (rev 8786) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2013-11-15 17:54:08 UTC (rev 8787) @@ -22,6 +22,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_POST_MESSAGE_ALLOW_INVALID_PORT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_POST_MESSAGE_CANCELABLE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_POST_MESSAGE_SYNCHRONOUS; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_XML_SUPPORT_VIA_ACTIVEXOBJECT; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.IE; @@ -103,6 +104,7 @@ import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLCollection; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement; +import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLUnknownElement; import com.gargoylesoftware.htmlunit.javascript.host.xml.XMLDocument; import com.gargoylesoftware.htmlunit.xml.XmlPage; @@ -1329,6 +1331,20 @@ final WebWindow webWindow = ((Window) result).getWebWindow(); result = getProxy(webWindow); } + else if (result instanceof HTMLUnknownElement && getBrowserVersion() + .hasFeature(JS_XML_SUPPORT_VIA_ACTIVEXOBJECT)) { + final HtmlElement unknownElement = ((HTMLUnknownElement) result).getDomNodeOrDie(); + if ("xml".equals(unknownElement.getNodeName())) { + final XMLDocument document = ActiveXObject.buildXMLDocument(getWebWindow()); + document.setParentScope(this); + final Iterator<HtmlElement> children = unknownElement.getHtmlElementDescendants().iterator(); + if (children.hasNext()) { + final HtmlElement root = children.next(); + document.loadXML(root.asXml().trim()); + } + result = document; + } + } } return result; |
From: <rb...@us...> - 2015-02-11 07:24:03
|
Revision: 9971 http://sourceforge.net/p/htmlunit/code/9971 Author: rbri Date: 2015-02-11 07:23:56 +0000 (Wed, 11 Feb 2015) Log Message: ----------- cleanup Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-02-11 07:22:40 UTC (rev 9970) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-02-11 07:23:56 UTC (rev 9971) @@ -628,8 +628,7 @@ * Returns the console property. * @return the console property */ - @JsxGetter({ @WebBrowser(value = FF, minVersion = 4), @WebBrowser(value = IE, minVersion = 11), - @WebBrowser(CHROME) }) + @JsxGetter({ @WebBrowser(FF), @WebBrowser(value = IE, minVersion = 11), @WebBrowser(CHROME) }) public ScriptableObject getConsole() { return console_; } @@ -638,8 +637,7 @@ * Sets the console. * @param console the console */ - @JsxSetter({ @WebBrowser(value = FF, minVersion = 4), @WebBrowser(value = IE, minVersion = 11), - @WebBrowser(CHROME) }) + @JsxSetter({ @WebBrowser(FF), @WebBrowser(value = IE, minVersion = 11), @WebBrowser(CHROME) }) public void setConsole(final ScriptableObject console) { console_ = console; } |
From: <asa...@us...> - 2015-05-03 08:40:56
|
Revision: 10413 http://sourceforge.net/p/htmlunit/code/10413 Author: asashour Date: 2015-05-03 08:40:53 +0000 (Sun, 03 May 2015) Log Message: ----------- Window to inherit EventTarget, to be done at prototype level. Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-05-03 08:02:41 UTC (rev 10412) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-05-03 08:40:53 UTC (rev 10413) @@ -129,6 +129,7 @@ import com.gargoylesoftware.htmlunit.javascript.host.dom.Node; import com.gargoylesoftware.htmlunit.javascript.host.dom.Selection; import com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer; +import com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget; import com.gargoylesoftware.htmlunit.javascript.host.html.DocumentProxy; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLBodyElement; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLCollection; @@ -158,7 +159,7 @@ * @see <a href="http://msdn.microsoft.com/en-us/library/ms535873.aspx">MSDN documentation</a> */ @JsxClass -public class Window extends SimpleScriptable implements ScriptableWithFallbackGetter, Function { +public class Window extends EventTarget implements ScriptableWithFallbackGetter, Function { private static final Log LOG = LogFactory.getLog(Window.class); |
From: <rb...@us...> - 2016-02-24 17:18:10
|
Revision: 11904 http://sourceforge.net/p/htmlunit/code/11904 Author: rbri Date: 2016-02-24 17:18:08 +0000 (Wed, 24 Feb 2016) Log Message: ----------- add a bit more info to the error msg Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-02-24 16:37:07 UTC (rev 11903) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-02-24 17:18:08 UTC (rev 11904) @@ -2062,7 +2062,7 @@ Context.throwAsScriptRuntimeEx( new Exception( "SyntaxError: Failed to execute 'postMessage' on 'Window': Invalid target origin '" - + targetOrigin + "' was specified.")); + + targetOrigin + "' was specified (reason: " + e.getMessage() + ".")); } if (getPort(targetURL) != getPort(currentURL)) { |
From: <asa...@us...> - 2016-04-28 12:37:48
|
Revision: 12513 http://sourceforge.net/p/htmlunit/code/12513 Author: asashour Date: 2016-04-28 12:37:46 +0000 (Thu, 28 Apr 2016) Log Message: ----------- Fixing build (for now). Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-04-28 12:24:25 UTC (rev 12512) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-04-28 12:37:46 UTC (rev 12513) @@ -1319,7 +1319,7 @@ if (result instanceof Window) { final WebWindow webWindow = ((Window) result).getWebWindow(); - result = webWindow.getScriptableObject(); + result = getProxy(webWindow); } } |
From: <asa...@us...> - 2016-05-16 07:59:47
|
Revision: 12641 http://sourceforge.net/p/htmlunit/code/12641 Author: asashour Date: 2016-05-16 07:59:44 +0000 (Mon, 16 May 2016) Log Message: ----------- IE version is 11 Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-05-16 07:47:53 UTC (rev 12640) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-05-16 07:59:44 UTC (rev 12641) @@ -1923,9 +1923,6 @@ */ @JsxFunction(@WebBrowser(IE)) public int ScriptEngineMajorVersion() { - if (getBrowserVersion().getBrowserVersionNumeric() < 10) { - return 5; - } return getBrowserVersion().getBrowserVersionNumeric(); } @@ -1936,9 +1933,6 @@ */ @JsxFunction(@WebBrowser(IE)) public int ScriptEngineMinorVersion() { - if (getBrowserVersion().getBrowserVersionNumeric() < 10) { - return getBrowserVersion().getBrowserVersionNumeric(); - } return 0; } |
From: <asa...@us...> - 2016-05-18 16:37:03
|
Revision: 12668 http://sourceforge.net/p/htmlunit/code/12668 Author: asashour Date: 2016-05-18 16:37:00 +0000 (Wed, 18 May 2016) Log Message: ----------- showModalDialog() is available in Chrome Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-05-18 14:59:07 UTC (rev 12667) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-05-18 16:37:00 UTC (rev 12668) @@ -1648,7 +1648,7 @@ * @see <a href="http://msdn.microsoft.com/en-us/library/ms536759.aspx">MSDN Documentation</a> * @see <a href="https://developer.mozilla.org/en/DOM/window.showModalDialog">Mozilla Documentation</a> */ - @JsxFunction({@WebBrowser(IE), @WebBrowser(FF)}) + @JsxFunction public Object showModalDialog(final String url, final Object arguments, final String features) { final WebWindow webWindow = getWebWindow(); final WebClient client = webWindow.getWebClient(); |
From: <asa...@us...> - 2016-05-18 16:53:35
|
Revision: 12671 http://sourceforge.net/p/htmlunit/code/12671 Author: asashour Date: 2016-05-18 16:53:33 +0000 (Wed, 18 May 2016) Log Message: ----------- Revert: showModalDialog() is available in Chrome, we have incorrect test in WindowTest Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-05-18 16:40:50 UTC (rev 12670) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-05-18 16:53:33 UTC (rev 12671) @@ -1648,7 +1648,7 @@ * @see <a href="http://msdn.microsoft.com/en-us/library/ms536759.aspx">MSDN Documentation</a> * @see <a href="https://developer.mozilla.org/en/DOM/window.showModalDialog">Mozilla Documentation</a> */ - @JsxFunction + @JsxFunction({@WebBrowser(IE), @WebBrowser(FF)}) public Object showModalDialog(final String url, final Object arguments, final String features) { final WebWindow webWindow = getWebWindow(); final WebClient client = webWindow.getWebClient(); |
From: <asa...@us...> - 2017-03-25 08:07:14
|
Revision: 13902 http://sourceforge.net/p/htmlunit/code/13902 Author: asashour Date: 2017-03-25 08:07:11 +0000 (Sat, 25 Mar 2017) Log Message: ----------- checkstyle Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2017-03-25 07:38:28 UTC (rev 13901) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2017-03-25 08:07:11 UTC (rev 13902) @@ -1295,7 +1295,7 @@ /** * To be called when the property detection fails in normal scenarios. - * + * * @param name the name * @return the found object, or {@link Scriptable#NOT_FOUND} */ |
From: <rb...@us...> - 2018-08-01 20:20:04
|
Revision: 15506 http://sourceforge.net/p/htmlunit/code/15506 Author: rbri Date: 2018-08-01 20:20:01 +0000 (Wed, 01 Aug 2018) Log Message: ----------- try to do a bit more houskeeping to make hopefully the processing of large style sheets faster Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2018-07-31 18:07:46 UTC (rev 15505) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2018-08-01 20:20:01 UTC (rev 15506) @@ -168,6 +168,10 @@ private static final class CSSPropertiesCache implements Serializable { private transient WeakHashMap<Element, Map<String, CSS2Properties>> computedStyles_ = new WeakHashMap<>(); + // Dummy value to associate with an Object in the backing Map + private static final Object PRESENT = new Object(); + private transient WeakHashMap<DomNode, Object> cleanedNodes_ = new WeakHashMap<>(); + public synchronized CSS2Properties get(final Element element, final String normalizedPseudo) { final Map<String, CSS2Properties> elementMap = computedStyles_.get(element); if (elementMap != null) { @@ -181,11 +185,16 @@ if (elementMap == null) { elementMap = new WeakHashMap<>(); computedStyles_.put(element, elementMap); + cleanedNodes_.remove(element.getDomNodeOrDie()); } elementMap.put(normalizedPseudo, style); } public synchronized void nodeChanged(final DomNode changed, final boolean clearParents) { + if (cleanedNodes_.containsKey(changed)) { + return; + } + for (final Iterator<Map.Entry<Element, Map<String, CSS2Properties>>> i = computedStyles_.entrySet().iterator(); i.hasNext();) { final Map.Entry<Element, Map<String, CSS2Properties>> entry = i.next(); @@ -194,6 +203,7 @@ || changed.getParentNode() == node.getParentNode() || changed.isAncestorOf(node) || clearParents && node.isAncestorOf(changed)) { + cleanedNodes_.put(node, PRESENT); i.remove(); } } |
From: <asa...@us...> - 2015-05-08 10:42:05
|
Revision: 10439 http://sourceforge.net/p/htmlunit/code/10439 Author: asashour Date: 2015-05-08 10:42:03 +0000 (Fri, 08 May 2015) Log Message: ----------- window.performance Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-05-08 10:22:28 UTC (rev 10438) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-05-08 10:42:03 UTC (rev 10439) @@ -136,6 +136,7 @@ import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLUnknownElement; +import com.gargoylesoftware.htmlunit.javascript.host.performance.Performance; import com.gargoylesoftware.htmlunit.javascript.host.xml.XMLDocument; import com.gargoylesoftware.htmlunit.xml.XmlPage; @@ -2264,4 +2265,16 @@ } } } + + /** + * Returns the {@code performance} property. + * @return the {@code performance} property + */ + @JsxGetter({ @WebBrowser(CHROME), @WebBrowser(FF), @WebBrowser(value = IE, minVersion = 11) }) + public Performance getPerformance() { + final Performance performance = new Performance(); + performance.setParentScope(getParentScope()); + performance.setPrototype(getPrototype(performance.getClass())); + return performance; + } } |
From: <rb...@us...> - 2015-09-05 11:29:40
|
Revision: 11110 http://sourceforge.net/p/htmlunit/code/11110 Author: rbri Date: 2015-09-05 11:29:37 +0000 (Sat, 05 Sep 2015) Log Message: ----------- code cleanup and simplification Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-09-05 11:01:31 UTC (rev 11109) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-09-05 11:29:37 UTC (rev 11110) @@ -1104,6 +1104,26 @@ } /** + * Returns the onload property. Note that this is not necessarily a function if something else has been set. + * @return the onload property + */ + @JsxGetter + public Object getOnload() { + final Object onload = getHandlerForJavaScript("load"); + if (onload == null) { + // NB: for IE, the onload of window is the one of the body element but not for Mozilla. + final HtmlPage page = (HtmlPage) getWebWindow().getEnclosedPage(); + final HtmlElement body = page.getBody(); + if (body != null) { + final HTMLBodyElement b = (HTMLBodyElement) body.getScriptObject(); + return b.getEventHandler("onload"); + } + return null; + } + return onload; + } + + /** * Sets the value of the onload event handler. * @param newOnload the new handler */ @@ -1117,31 +1137,22 @@ } /** - * Sets the value of the onclick event handler. - * @param newOnload the new handler - */ - @JsxSetter - public void setOnclick(final Object newOnload) { - getEventListenersContainer().setEventHandlerProp("click", newOnload); - } - - /** * Returns the onclick property (caution this is not necessary a function if something else has * been set). * @return the onclick property */ @JsxGetter public Object getOnclick() { - return getEventListenersContainer().getEventHandlerProp("click"); + return getHandlerForJavaScript("click"); } /** - * Sets the value of the ondblclick event handler. - * @param newHandler the new handler + * Sets the value of the onclick event handler. + * @param newOnload the new handler */ @JsxSetter - public void setOndblclick(final Object newHandler) { - getEventListenersContainer().setEventHandlerProp("dblclick", newHandler); + public void setOnclick(final Object newOnload) { + setHandlerForJavaScript("click", newOnload); } /** @@ -1151,27 +1162,16 @@ */ @JsxGetter public Object getOndblclick() { - return getEventListenersContainer().getEventHandlerProp("dblclick"); + return getHandlerForJavaScript("dblclick"); } /** - * Returns the onload property. Note that this is not necessarily a function if something else has been set. - * @return the onload property + * Sets the value of the ondblclick event handler. + * @param newHandler the new handler */ - @JsxGetter - public Object getOnload() { - final Object onload = getEventListenersContainer().getEventHandlerProp("load"); - if (onload == null) { - // NB: for IE, the onload of window is the one of the body element but not for Mozilla. - final HtmlPage page = (HtmlPage) getWebWindow().getEnclosedPage(); - final HtmlElement body = page.getBody(); - if (body != null) { - final HTMLBodyElement b = (HTMLBodyElement) body.getScriptObject(); - return b.getEventHandler("onload"); - } - return null; - } - return onload; + @JsxSetter + public void setOndblclick(final Object newHandler) { + setHandlerForJavaScript("dblclick", newHandler); } /** @@ -1181,7 +1181,7 @@ */ @JsxGetter public Object getOnhashchange() { - return getEventListenersContainer().getEventHandlerProp(Event.TYPE_HASH_CHANGE); + return getHandlerForJavaScript(Event.TYPE_HASH_CHANGE); } /** @@ -1190,7 +1190,7 @@ */ @JsxSetter public void setOnhashchange(final Object newHandler) { - getEventListenersContainer().setEventHandlerProp(Event.TYPE_HASH_CHANGE, newHandler); + setHandlerForJavaScript(Event.TYPE_HASH_CHANGE, newHandler); } /** @@ -2173,7 +2173,7 @@ */ @JsxGetter({@WebBrowser(FF), @WebBrowser(CHROME), @WebBrowser(value = IE, minVersion = 11) }) - public Object getSnsubmit() { + public Object getOnsubmit() { return getHandlerForJavaScript(Event.TYPE_SUBMIT); } |
From: <rb...@us...> - 2015-09-05 13:53:11
|
Revision: 11112 http://sourceforge.net/p/htmlunit/code/11112 Author: rbri Date: 2015-09-05 13:53:09 +0000 (Sat, 05 Sep 2015) Log Message: ----------- ups Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-09-05 13:52:31 UTC (rev 11111) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-09-05 13:53:09 UTC (rev 11112) @@ -849,8 +849,7 @@ } final WebWindow top = getWebWindow().getTopWindow(); - top_ = getProxy(top); - return top_; + return getProxy(top); } /** |
From: <asa...@us...> - 2015-09-19 04:24:59
|
Revision: 11253 http://sourceforge.net/p/htmlunit/code/11253 Author: asashour Date: 2015-09-19 04:24:56 +0000 (Sat, 19 Sep 2015) Log Message: ----------- Window: no such method "ulert"! Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-09-19 04:22:39 UTC (rev 11252) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-09-19 04:24:56 UTC (rev 11253) @@ -265,15 +265,6 @@ } /** - * The JavaScript function "alert()". - * @param message the message - */ - @JsxFunction - public void ulert(final Object message) { - System.out.println(message); - } - - /** * The JavaScript function {@code alert()}. * @param message the message */ |
From: <asa...@us...> - 2015-10-02 15:14:17
|
Revision: 11344 http://sourceforge.net/p/htmlunit/code/11344 Author: asashour Date: 2015-10-02 15:14:14 +0000 (Fri, 02 Oct 2015) Log Message: ----------- Committed by mistake Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-10-02 14:54:46 UTC (rev 11343) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-10-02 15:14:14 UTC (rev 11344) @@ -2073,6 +2073,20 @@ } /** + * {@inheritDoc} + * Used to allow re-declaration of constants (eg: "var undefined;"). + * @see com.gargoylesoftware.htmlunit.javascript.NativeGlobalTest + */ + @Override + public boolean isConst(final String name) { + if ("undefined".equals(name) || "Infinity".equals(name) || "NaN".equals(name)) { + return false; + } + + return super.isConst(name); + } + + /** * Dispatches an event into the event system (standards-conformant browsers only). See * <a href="https://developer.mozilla.org/en-US/docs/DOM/window.dispatchEvent">the Gecko * DOM reference</a> for more information. @@ -2291,14 +2305,6 @@ } return crypto_; } - - /** - * {@inheritDoc} - */ - @Override - public Window getWindow() throws RuntimeException { - return this; - } } class HTMLCollectionFrames extends HTMLCollection { |
From: <rb...@us...> - 2015-11-16 18:00:24
|
Revision: 11548 http://sourceforge.net/p/htmlunit/code/11548 Author: rbri Date: 2015-11-16 18:00:22 +0000 (Mon, 16 Nov 2015) Log Message: ----------- remove dependency to commons collection Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-11-16 17:48:09 UTC (rev 11547) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-11-16 18:00:22 UTC (rev 11548) @@ -48,8 +48,6 @@ import java.util.WeakHashMap; import org.apache.commons.codec.binary.Base64; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.Predicate; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -1439,7 +1437,6 @@ } private Object getElementsByName(final HtmlPage page, final String name) { - Object result = NOT_FOUND; // May be attempting to retrieve element(s) by name. IMPORTANT: We're using map-backed operations // like getHtmlElementsByName() and getHtmlElementById() as much as possible, so as to avoid XPath @@ -1449,56 +1446,48 @@ final List<DomElement> elements = page.getElementsByName(name); final boolean includeFormFields = getBrowserVersion().hasFeature(JS_WINDOW_FORMFIELDS_ACCESSIBLE_BY_NAME); - final Predicate filter = new Predicate() { - @Override - public boolean evaluate(final Object object) { - if (object instanceof HtmlEmbed - || object instanceof HtmlForm - || object instanceof HtmlImage - || object instanceof HtmlObject) { - return true; - } - if (includeFormFields && ( - object instanceof HtmlAnchor - || object instanceof HtmlButton - || object instanceof HtmlInput - || object instanceof HtmlMap - || object instanceof HtmlSelect - || object instanceof HtmlTextArea)) { - return true; - } - return false; + final Filter filter = new Filter(includeFormFields); + + final Iterator<DomElement> it = elements.iterator(); + while (it.hasNext()) { + if (!filter.matches(it.next())) { + it.remove(); } - }; - CollectionUtils.filter(elements, filter); + } + if (elements.size() == 0) { + return NOT_FOUND; + } + if (elements.size() == 1) { - result = getScriptableFor(elements.get(0)); + return getScriptableFor(elements.get(0)); } - else if (elements.size() > 1) { - // Null must be changed to '' for proper collection initialization. - final String expElementName = "null".equals(name) ? "" : name; - result = new HTMLCollection(page, true, "Window.getElementsByName('" + name + "')") { - @Override - protected List<Object> computeElements() { - final List<DomElement> elements = page.getElementsByName(expElementName); - CollectionUtils.filter(elements, filter); + // Null must be changed to '' for proper collection initialization. + final String expElementName = "null".equals(name) ? "" : name; - return new ArrayList<Object>(elements); - } + return new HTMLCollection(page, true, "Window.getElementsByName('" + name + "')") { + @Override + protected List<Object> computeElements() { + final List<DomElement> elements = page.getElementsByName(expElementName); + final List<Object> result = new ArrayList<Object>(elements.size()); - @Override - protected EffectOnCache getEffectOnCache(final HtmlAttributeChangeEvent event) { - if ("name".equals(event.getName())) { - return EffectOnCache.RESET; + for (DomElement domElement : elements) { + if (filter.matches(domElement)) { + result.add(domElement); } - return EffectOnCache.NONE; } - }; - } + return result; + } - return result; + @Override + protected EffectOnCache getEffectOnCache(final HtmlAttributeChangeEvent event) { + if ("name".equals(event.getName())) { + return EffectOnCache.RESET; + } + return EffectOnCache.NONE; + } + }; } /** @@ -1862,6 +1851,33 @@ "height", "width")); + private static final class Filter { + private final boolean includeFormFields_; + + private Filter(final boolean includeFormFields) { + includeFormFields_ = includeFormFields; + } + + private boolean matches(final Object object) { + if (object instanceof HtmlEmbed + || object instanceof HtmlForm + || object instanceof HtmlImage + || object instanceof HtmlObject) { + return true; + } + if (includeFormFields_ && ( + object instanceof HtmlAnchor + || object instanceof HtmlButton + || object instanceof HtmlInput + || object instanceof HtmlMap + || object instanceof HtmlSelect + || object instanceof HtmlTextArea)) { + return true; + } + return false; + } + } + /** * <p>Listens for changes anywhere in the document and evicts cached computed styles whenever something relevant * changes. Note that the very lazy way of doing this (completely clearing the cache every time something happens) |
From: <asa...@us...> - 2016-04-28 07:53:08
|
Revision: 12505 http://sourceforge.net/p/htmlunit/code/12505 Author: asashour Date: 2016-04-28 07:53:05 +0000 (Thu, 28 Apr 2016) Log Message: ----------- trying to remove WindowProxy Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-04-28 07:29:01 UTC (rev 12504) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-04-28 07:53:05 UTC (rev 12505) @@ -552,8 +552,8 @@ * @return the window property (a reference to <tt>this</tt>) */ @JsxGetter(propertyName = "window") - public WindowProxy getWindow_js() { - return windowProxy_; + public Window getWindow_js() { + return this; } /** @@ -561,8 +561,8 @@ * @return this */ @JsxGetter - public WindowProxy getSelf() { - return windowProxy_; + public Window getSelf() { + return this; } /** @@ -880,8 +880,8 @@ * @return the value of the frames property */ @JsxGetter(propertyName = "frames") - public WindowProxy getFrames_js() { - return windowProxy_; + public Window getFrames_js() { + return this; } /** |
From: <asa...@us...> - 2016-04-28 23:08:51
|
Revision: 12523 http://sourceforge.net/p/htmlunit/code/12523 Author: asashour Date: 2016-04-28 23:08:49 +0000 (Thu, 28 Apr 2016) Log Message: ----------- trivial Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-04-28 22:55:04 UTC (rev 12522) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-04-28 23:08:49 UTC (rev 12523) @@ -2018,7 +2018,6 @@ * called <tt>preventDefault</tt>; {@code true} otherwise */ @Override - @JsxFunction public boolean dispatchEvent(final Event event) { event.setTarget(this); final ScriptResult result = fireEvent(event); |
From: <asa...@us...> - 2016-04-28 23:16:07
|
Revision: 12524 http://sourceforge.net/p/htmlunit/code/12524 Author: asashour Date: 2016-04-28 23:16:04 +0000 (Thu, 28 Apr 2016) Log Message: ----------- trivial Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-04-28 23:08:49 UTC (rev 12523) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-04-28 23:16:04 UTC (rev 12524) @@ -2009,13 +2009,7 @@ } /** - * Dispatches an event into the event system (standards-conformant browsers only). See - * <a href="https://developer.mozilla.org/en-US/docs/DOM/window.dispatchEvent">the Gecko - * DOM reference</a> for more information. - * - * @param event the event to be dispatched - * @return {@code false} if at least one of the event handlers which handled the event - * called <tt>preventDefault</tt>; {@code true} otherwise + * {@inheritDoc} */ @Override public boolean dispatchEvent(final Event event) { |
From: <asa...@us...> - 2016-05-13 13:47:36
|
Revision: 12628 http://sourceforge.net/p/htmlunit/code/12628 Author: asashour Date: 2016-05-13 13:47:33 +0000 (Fri, 13 May 2016) Log Message: ----------- javadoc Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-05-13 13:25:34 UTC (rev 12627) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-05-13 13:47:33 UTC (rev 12628) @@ -287,7 +287,7 @@ } /** - * The JavaScript function "confirm()". + * The JavaScript function {@code confirm}. * @param message the message * @return true if ok was pressed, false if cancel was pressed */ @@ -303,7 +303,7 @@ } /** - * The JavaScript function "prompt()". + * The JavaScript function {@code prompt}. * @param message the message * @return true if ok was pressed, false if cancel was pressed */ @@ -505,9 +505,9 @@ } /** - * Cancels a time-out previously set with the <tt>setTimeout</tt> method. + * Cancels a time-out previously set with the {@link #setTimeout(Object, int, Object)} method. * - * @param timeoutId identifier for the timeout to clear (returned by <tt>setTimeout</tt>) + * @param timeoutId identifier for the timeout to clear (returned by {@link #setTimeout(Object, int, Object)}) */ @JsxFunction public void clearTimeout(final int timeoutId) { @@ -548,7 +548,7 @@ } /** - * Returns the window property. This is a synonym for "self". + * Returns the window property. This is a synonym for {@code self}. * @return the window property (a reference to <tt>this</tt>) */ @JsxGetter(propertyName = "window") @@ -566,8 +566,8 @@ } /** - * Returns the localStorage property. - * @return the localStorage property + * Returns the {@code localStorage} property. + * @return the {@code localStorage} property */ @JsxGetter public Storage getLocalStorage() { @@ -575,8 +575,8 @@ } /** - * Returns the sessionStorage property. - * @return the sessionStorage property + * Returns the {@code sessionStorage} property. + * @return the {@code sessionStorage} property */ @JsxGetter public Storage getSessionStorage() { @@ -611,7 +611,7 @@ } /** - * Sets the location property. This will cause a reload of the window. + * Sets the {@code location} property. This will cause a reload of the window. * @param newLocation the URL of the new content * @throws IOException when location loading fails */ @@ -621,8 +621,8 @@ } /** - * Returns the console property. - * @return the console property + * Returns the {@code console} property. + * @return the {@code console} property */ @JsxGetter public ScriptableObject getConsole() { @@ -630,7 +630,7 @@ } /** - * Sets the console. + * Sets the {@code console}. * @param console the console */ @JsxSetter @@ -650,7 +650,7 @@ } /** - * Dummy implementation for requestAnimationFrame. + * Dummy implementation for {@code requestAnimationFrame}. * @param callback the function to call when it's time to update the animation * @return an identification id * @see <a href="https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame">MDN Doc</a> @@ -662,7 +662,7 @@ } /** - * Dummy implementation for cancelAnimationFrame. + * Dummy implementation for {@code cancelAnimationFrame}. * @param requestId the ID value returned by the call to window.requestAnimationFrame() * @see <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame">MDN Doc</a> */ @@ -673,7 +673,7 @@ /** * Returns the {@code screen} property. - * @return the screen property + * @return the {@code screen} property */ @JsxGetter public Screen getScreen() { @@ -802,8 +802,8 @@ } /** - * Returns the value of the top property. - * @return the value of "top" + * Returns the value of the {@code top} property. + * @return the value of {@code top} */ @JsxGetter public Object getTop() { @@ -816,7 +816,7 @@ } /** - * Sets the value of the top property. + * Sets the value of the {@code top} property. * @param o the new value */ @JsxSetter @@ -1475,9 +1475,10 @@ } /** - * Cancels the interval previously started using the setInterval method. + * Cancels the interval previously started using the {@link #setInterval(Object, int, Object)} method. * Current implementation does nothing. - * @param intervalID specifies the interval to cancel as returned by the setInterval method + * @param intervalID specifies the interval to cancel as returned by the + * {@link #setInterval(Object, int, Object)} method * @see <a href="http://msdn.microsoft.com/en-us/library/ms536353.aspx">MSDN documentation</a> */ @JsxFunction @@ -1489,8 +1490,8 @@ } /** - * Returns the innerWidth. - * @return a dummy value + * Returns the {@code innerWidth}. + * @return the {@code innerWidth} * @see <a href="http://www.mozilla.org/docs/dom/domref/dom_window_ref28.html">Mozilla doc</a> */ @JsxGetter @@ -1499,8 +1500,8 @@ } /** - * Returns the outerWidth. - * @return a dummy value + * Returns the {@code outerWidth}. + * @return the {@code outerWidth} * @see <a href="http://www.mozilla.org/docs/dom/domref/dom_window_ref79.html">Mozilla doc</a> */ @JsxGetter @@ -1509,8 +1510,8 @@ } /** - * Returns the innerHeight. - * @return a dummy value + * Returns the {@code innerHeight}. + * @return the {@code innerHeight} * @see <a href="http://www.mozilla.org/docs/dom/domref/dom_window_ref27.html">Mozilla doc</a> */ @JsxGetter @@ -1519,8 +1520,8 @@ } /** - * Returns the outer height. - * @return a dummy value + * Returns the {@code outerHeight}. + * @return the {@code outerHeight} * @see <a href="http://www.mozilla.org/docs/dom/domref/dom_window_ref78.html">Mozilla doc</a> */ @JsxGetter @@ -1542,7 +1543,7 @@ } /** - * Does nothing special anymore... just like FF. + * Does nothing special anymore. * @param type the type of events to capture * @see Document#captureEvents(String) */ @@ -1690,7 +1691,7 @@ } /** - * Gets the controllers. The result doesn't currently matter but it is important to return an + * Gets the {@code controllers}. The result doesn't currently matter but it is important to return an * object as some JavaScript libraries check it. * @see <a href="https://developer.mozilla.org/En/DOM/Window.controllers">Mozilla documentation</a> * @return some object @@ -1701,7 +1702,7 @@ } /** - * Sets the controllers. + * Sets the {@code controllers}. * @param value the new value */ @JsxSetter(@WebBrowser(FF)) |
From: <asa...@us...> - 2016-05-16 07:27:48
|
Revision: 12637 http://sourceforge.net/p/htmlunit/code/12637 Author: asashour Date: 2016-05-16 07:27:45 +0000 (Mon, 16 May 2016) Log Message: ----------- trivial Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-05-16 07:27:20 UTC (rev 12636) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2016-05-16 07:27:45 UTC (rev 12637) @@ -639,7 +639,7 @@ } /** - * Prints messages to the console. + * Prints messages to the {@code console}. * @param message the message to log */ @JsxFunction(@WebBrowser(FF)) |