From: <asa...@us...> - 2013-03-07 10:07:32
|
Revision: 8147 http://sourceforge.net/p/htmlunit/code/8147 Author: asashour Date: 2013-03-07 10:07:29 +0000 (Thu, 07 Mar 2013) Log Message: ----------- Remove deprecated Htmlpage.getElementByAccessKey(), HtmlPage.getElementsByAccessKey() Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2013-03-07 10:04:13 UTC (rev 8146) +++ trunk/htmlunit/src/changes/changes.xml 2013-03-07 10:07:29 UTC (rev 8147) @@ -9,7 +9,7 @@ <body> <release version="2.13" date="???" description="Bugfixes"> <action type="remove" dev="asashour"> - Remove deprecated BaseFrame. + Remove deprecated BaseFrame, Htmlpage.getElementByAccessKey(), HtmlPage.getElementsByAccessKey() </action> </release> <release version="2.12" date="Mar 6, 2013" description="Bugfixes, CSS3 Selectors"> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java 2013-03-07 10:04:13 UTC (rev 8146) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java 2013-03-07 10:07:29 UTC (rev 8147) @@ -845,58 +845,15 @@ * @param accessKey the key to look for * @return the HTML element that is assigned to the specified key or null * if no elements can be found that match the specified key. - * - * @deprecated as of 2.11, use {@link #getHtmlElementByAccessKey(char)} instead */ - @Deprecated - public HtmlElement getElementByAccessKey(final char accessKey) { - return getHtmlElementByAccessKey(accessKey); - } - - /** - * Returns the HTML element that is assigned to the specified access key. An - * access key (aka mnemonic key) is used for keyboard navigation of the - * page.<p> - * - * Only the following HTML elements may have <tt>accesskey</tt>s defined: A, AREA, - * BUTTON, INPUT, LABEL, LEGEND, and TEXTAREA. - * - * @param accessKey the key to look for - * @return the HTML element that is assigned to the specified key or null - * if no elements can be found that match the specified key. - */ public HtmlElement getHtmlElementByAccessKey(final char accessKey) { - final List<HtmlElement> elements = getElementsByAccessKey(accessKey); + final List<HtmlElement> elements = getHtmlElementsByAccessKey(accessKey); if (elements.isEmpty()) { return null; } return elements.get(0); } - /** - * Returns all the HTML elements that are assigned to the specified access key. An - * access key (aka mnemonic key) is used for keyboard navigation of the - * page.<p> - * - * The HTML specification seems to indicate that one accesskey cannot be used - * for multiple elements however Internet Explorer does seem to support this. - * It's worth noting that Mozilla does not support multiple elements with one - * access key so you are making your HTML browser specific if you rely on this - * feature.<p> - * - * Only the following HTML elements may have <tt>accesskey</tt>s defined: A, AREA, - * BUTTON, INPUT, LABEL, LEGEND, and TEXTAREA. - * - * @param accessKey the key to look for - * @return the elements that are assigned to the specified accesskey - * - * @deprecated as of 2.11, please use {@link #getHtmlElementsByAccessKey(char)} instead - */ - @Deprecated - public List<HtmlElement> getElementsByAccessKey(final char accessKey) { - return getHtmlElementsByAccessKey(accessKey); - } - /** * Returns all the HTML elements that are assigned to the specified access key. An * access key (aka mnemonic key) is used for keyboard navigation of the @@ -1511,7 +1468,7 @@ * would only happen if the access key triggered a button which in turn caused a page load) */ public HtmlElement pressAccessKey(final char accessKey) throws IOException { - final HtmlElement element = getElementByAccessKey(accessKey); + final HtmlElement element = getHtmlElementByAccessKey(accessKey); if (element != null) { element.focus(); final Page newPage; |