Skip to content

Commit 24c2ebd

Browse files
committed
Firefox 149, Chrome 147
1 parent 00324ac commit 24c2ebd

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

src/main/java/org/htmlunit/BrowserVersionFeatures.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ public enum BrowserVersionFeatures {
3838
@BrowserFeature({CHROME, EDGE})
3939
ANCHOR_SEND_PING_REQUEST,
4040

41+
/** Screen colorDepth is 32 instead of 24. */
42+
@BrowserFeature({CHROME, EDGE})
43+
COLOR_DEPHT_32,
44+
4145
/** Background image is 'initial'. */
4246
@BrowserFeature({CHROME, EDGE})
4347
CSS_BACKGROUND_INITIAL,
@@ -156,10 +160,6 @@ public enum BrowserVersionFeatures {
156160
@BrowserFeature({CHROME, EDGE})
157161
HTMLLINK_CHECK_TYPE_FOR_STYLESHEET,
158162

159-
/** willValidate does not check the readonly property. */
160-
@BrowserFeature({FF, FF_ESR})
161-
HTMLSELECT_WILL_VALIDATE_IGNORES_READONLY,
162-
163163
/** Should org.htmlunit.javascript.host.html.HTMLTrackElement#isEndTagForbidden(). */
164164
@BrowserFeature({FF, FF_ESR})
165165
HTMLTRACK_END_TAG_FORBIDDEN,

src/main/java/org/htmlunit/Screen.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
*/
1515
package org.htmlunit;
1616

17+
import static org.htmlunit.BrowserVersionFeatures.COLOR_DEPHT_32;
18+
1719
import java.io.Serializable;
1820

1921
/**
@@ -31,6 +33,8 @@ public class Screen implements Serializable {
3133
private final int screenHeight_;
3234
private final int screenWidth_;
3335

36+
private final int colorDepth_;
37+
3438
/**
3539
* Creates an instance.
3640
* @param webClient the client this belongs to
@@ -39,6 +43,13 @@ public Screen(final WebClient webClient) {
3943
super();
4044
screenHeight_ = webClient.getOptions().getScreenHeight();
4145
screenWidth_ = webClient.getOptions().getScreenWidth();
46+
47+
if (webClient.getBrowserVersion().hasFeature(COLOR_DEPHT_32)) {
48+
colorDepth_ = 32;
49+
}
50+
else {
51+
colorDepth_ = 24;
52+
}
4253
}
4354

4455
/**
@@ -105,7 +116,7 @@ public void setAvailWidth(final int availWidth) {
105116
* @return the {@code colorDepth} property
106117
*/
107118
public int getColorDepth() {
108-
return 24;
119+
return colorDepth_;
109120
}
110121

111122
/**
@@ -180,7 +191,7 @@ public void setLeft(final int left) {
180191
* @return the {@code pixelDepth} property
181192
*/
182193
public int getPixelDepth() {
183-
return 24;
194+
return colorDepth_;
184195
}
185196

186197
/**

0 commit comments

Comments
 (0)