MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / WebWindowImpl

Class WebWindowImpl

src/main/java/org/htmlunit/WebWindowImpl.java:54–424  ·  view source on GitHub ↗

INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. Base class for common WebWindow functionality. While public, this class is not exposed in any other places of the API. Internally we can cast to this class when we need access to functionality th

Source from the content-addressed store, hash-verified

52 * @author Sven Strickroth
53 */
54public abstract class WebWindowImpl implements WebWindow {
55
56 private static final Log LOG = LogFactory.getLog(WebWindowImpl.class);
57
58 private final WebClient webClient_;
59 private final Screen screen_;
60 private Page enclosedPage_;
61 private transient HtmlUnitScriptable scriptObject_;
62 private JavaScriptJobManager jobManager_;
63 private final List<WebWindowImpl> childWindows_ = new ArrayList<>();
64 private String name_ = "";
65 private final History history_ = new History(this);
66 private boolean closed_;
67
68 private int innerHeight_;
69 private int outerHeight_;
70 private int innerWidth_;
71 private int outerWidth_;
72
73 /**
74 * Creates a window and associates it with the client.
75 *
76 * @param webClient the web client that "owns" this window
77 */
78 public WebWindowImpl(final WebClient webClient) {
79 WebAssert.notNull("webClient", webClient);
80 webClient_ = webClient;
81 jobManager_ = BackgroundJavaScriptFactory.theFactory().createJavaScriptJobManager(this);
82
83 screen_ = new Screen(webClient);
84
85 innerHeight_ = 605;
86 innerWidth_ = 1256;
87 if (webClient.getBrowserVersion().hasFeature(JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_94)) {
88 outerHeight_ = innerHeight_ + 94;
89 outerWidth_ = innerWidth_ + 16;
90 }
91 else if (webClient.getBrowserVersion().hasFeature(JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_138)) {
92 outerHeight_ = innerHeight_ + 138;
93 outerWidth_ = innerWidth_ + 24;
94 }
95 else if (webClient.getBrowserVersion().hasFeature(JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_147)) {
96 outerHeight_ = innerHeight_ + 147;
97 outerWidth_ = innerWidth_ + 16;
98 }
99 else {
100 outerHeight_ = innerHeight_ + 115;
101 outerWidth_ = innerWidth_ + 14;
102 }
103 }
104
105 /**
106 * Registers the window with the client.
107 */
108 protected void performRegistration() {
109 webClient_.registerWebWindow(this);
110 }
111

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…