Skip to content

Commit

Permalink
more concrete return values
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Nov 13, 2024
1 parent 6fd3acf commit 3d0d279
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ public String getWordSpacing() {
* Gets the {@code zIndex} style attribute.
* @return the style attribute
*/
public Object getZIndex() {
public String getZIndex() {
final String value = getStyleAttribute(Definition.Z_INDEX_, true);
try {
Integer.parseInt(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1155,9 +1155,9 @@ public String getWordSpacing() {
* {@inheritDoc}
*/
@Override
public Object getZIndex() {
final Object response = super.getZIndex();
if (response.toString().isEmpty()) {
public String getZIndex() {
final String response = super.getZIndex();
if (response.isEmpty()) {
return AUTO;
}
return response;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/htmlunit/javascript/host/Window.java
Original file line number Diff line number Diff line change
Expand Up @@ -2146,7 +2146,7 @@ public SpeechSynthesis getSpeechSynthesis() {
* @return the {@code offscreenBuffering} property
*/
@JsxGetter({CHROME, EDGE})
public Object getOffscreenBuffering() {
public boolean getOffscreenBuffering() {
return true;
}

Expand Down Expand Up @@ -3807,7 +3807,7 @@ public void put(final String name, final Scriptable start, final Object value) {
* @return a boolean indicating whether the current context is secure (true) or not (false).
*/
@JsxGetter
public Object getIsSecureContext() {
public boolean getIsSecureContext() {
final Page page = getWebWindow().getEnclosedPage();
if (page != null) {
final String protocol = page.getUrl().getProtocol();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void setGlobalAlpha(final double globalAlpha) {
* @return the {@code fillStyle} property
*/
@JsxGetter
public Object getFillStyle() {
public HtmlUnitScriptable getFillStyle() {
LOG.info("CanvasRenderingContext2D.getFillStyle() not yet implemented");
return null;
}
Expand All @@ -132,7 +132,7 @@ public void setFillStyle(final String fillStyle) {
* @return the {@code strokeStyle} property
*/
@JsxGetter
public Object getStrokeStyle() {
public HtmlUnitScriptable getStrokeStyle() {
LOG.info("CanvasRenderingContext2D.getStrokeStyle() not yet implemented");
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1755,7 +1755,7 @@ public void setWordSpacing(final Object wordSpacing) {
* @return the style attribute
*/
@JsxGetter
public Object getZIndex() {
public String getZIndex() {
if (styleDeclaration_ == null) {
return null; // prototype
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ public String getWordSpacing() {
* {@inheritDoc}
*/
@Override
public Object getZIndex() {
public String getZIndex() {
return getCssStyleDeclaration().getZIndex();
}

Expand Down
7 changes: 0 additions & 7 deletions src/test/java/org/htmlunit/archunit/ArchitectureTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,11 @@ public boolean test(final JavaClass javaClass) {
.and().doNotHaveFullName("org.htmlunit.javascript.host.Window.getControllers()")
.and().doNotHaveFullName("org.htmlunit.javascript.host.Window.getEvent()")
.and().doNotHaveFullName("org.htmlunit.javascript.host.Window.getFrames_js()")
.and().doNotHaveFullName("org.htmlunit.javascript.host.Window.getIsSecureContext()")
.and().doNotHaveFullName("org.htmlunit.javascript.host.Window.getLength()")
.and().doNotHaveFullName("org.htmlunit.javascript.host.Window.getOffscreenBuffering()")
.and().doNotHaveFullName("org.htmlunit.javascript.host.Window.getOpener()")
.and().doNotHaveFullName("org.htmlunit.javascript.host.Window.getParent()")
.and().doNotHaveFullName("org.htmlunit.javascript.host.Window.getSelf()")
.and().doNotHaveFullName("org.htmlunit.javascript.host.Window.getTop()")
.and().doNotHaveFullName("org.htmlunit.javascript.host.canvas.CanvasRenderingContext2D.getFillStyle()")
.and().doNotHaveFullName("org.htmlunit.javascript.host.canvas.CanvasRenderingContext2D.getGlobalAlpha()")
.and().doNotHaveFullName("org.htmlunit.javascript.host.canvas.CanvasRenderingContext2D.getLineWidth()")
.and().doNotHaveFullName("org.htmlunit.javascript.host.canvas.CanvasRenderingContext2D.getStrokeStyle()")
.and().doNotHaveFullName("org.htmlunit.javascript.host.css.CSSStyleDeclaration.getZIndex()")
.and().doNotHaveFullName("org.htmlunit.javascript.host.dom.AbstractRange.getEndContainer()")
.and().doNotHaveFullName("org.htmlunit.javascript.host.dom.AbstractRange.getStartContainer()")
.and().doNotHaveFullName("org.htmlunit.javascript.host.dom.CharacterData.getData()")
Expand Down

0 comments on commit 3d0d279

Please sign in to comment.