Skip to content

Commit 1c5bdc3

Browse files
committed
Reverting change to use effective style for determining element visibility
If a containing element has scrollbars, simply using the client bounding rect to determine the click point could lead the click point behind a scrollbar be determined as "in view," when clicking on the point would instead click on the scrollbar. A previous fix for this issue was not sufficiently robust in all scenarios, leading some elements to be seen as not displayed at all. Accordingly, this change has been reverted until a more correct one can be created.
1 parent 6ebbe5a commit 1c5bdc3

File tree

9 files changed

+11485
-10949
lines changed

9 files changed

+11485
-10949
lines changed

cpp/iedriver/ActionSimulators/JavaScriptActionSimulator.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int JavaScriptActionSimulator::SimulateKeyDown(BrowserHandle browser_wrapper,
7676
delete extra_info;
7777
LOG(DEBUG) << "Using synthetic events for sending keys";
7878
std::wstring script_source = L"(function() { return function(){" +
79-
atoms::asString(atoms::INPUTS) +
79+
atoms::asString(atoms::INPUTS_BIN) +
8080
L"; return webdriver.atoms.inputs.sendKeys(" +
8181
L"arguments[0], arguments[1], arguments[2], arguments[3]);" +
8282
L"};})();";
@@ -108,7 +108,7 @@ int JavaScriptActionSimulator::SimulatePointerMove(BrowserHandle browser_wrapper
108108
delete extra_info;
109109

110110
std::wstring script_source = L"(function() { return function(){" +
111-
atoms::asString(atoms::INPUTS) +
111+
atoms::asString(atoms::INPUTS_BIN) +
112112
L"; return webdriver.atoms.inputs.mouseMove(arguments[0], arguments[1], arguments[2], arguments[3]);" +
113113
L"};})();";
114114

@@ -144,7 +144,7 @@ int JavaScriptActionSimulator::SimulatePointerDown(BrowserHandle browser_wrapper
144144
INPUT input) {
145145
LOG(DEBUG) << "Using synthetic events for mouse button down";
146146
std::wstring script_source = L"(function() { return function(){" +
147-
atoms::asString(atoms::INPUTS) +
147+
atoms::asString(atoms::INPUTS_BIN) +
148148
L"; return webdriver.atoms.inputs.mouseButtonDown(arguments[0]);" +
149149
L"};})();";
150150

@@ -166,7 +166,7 @@ int JavaScriptActionSimulator::SimulatePointerUp(BrowserHandle browser_wrapper,
166166
INPUT input) {
167167
LOG(DEBUG) << "Using synthetic events for mouse button up";
168168
std::wstring script_source = L"(function() { return function(){" +
169-
atoms::asString(atoms::INPUTS) +
169+
atoms::asString(atoms::INPUTS_BIN) +
170170
L"; return webdriver.atoms.inputs.mouseButtonUp(arguments[0]);" +
171171
L"};})();";
172172

cpp/iedriver/CommandHandlers/ClickElementCommandHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ bool ClickElementCommandHandler::IsOptionElement(ElementHandle element_wrapper)
215215

216216
std::wstring ClickElementCommandHandler::GetSyntheticClickAtom() {
217217
std::wstring script_source = L"(function() { return function(){" +
218-
atoms::asString(atoms::INPUTS) +
218+
atoms::asString(atoms::INPUTS_BIN) +
219219
L"; return webdriver.atoms.inputs.click(arguments[0]);" +
220220
L"};})();";
221221
return script_source;

cpp/iedriver/Generated/atoms.h

Lines changed: 11460 additions & 10919 deletions
Large diffs are not rendered by default.

cpp/iedriver/IEDriver.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ END
5050
//
5151

5252
VS_VERSION_INFO VERSIONINFO
53-
FILEVERSION 3,150,0,0
54-
PRODUCTVERSION 3,150,0,0
53+
FILEVERSION 3,150,1,0
54+
PRODUCTVERSION 3,150,1,0
5555
FILEFLAGSMASK 0x3fL
5656
#ifdef _DEBUG
5757
FILEFLAGS 0x1L
@@ -68,12 +68,12 @@ BEGIN
6868
BEGIN
6969
VALUE "CompanyName", "Software Freedom Conservancy"
7070
VALUE "FileDescription", "Driver library for the IE driver"
71-
VALUE "FileVersion", "3.150.0.0"
71+
VALUE "FileVersion", "3.150.1.0"
7272
VALUE "InternalName", "IEDriver.dll"
7373
VALUE "LegalCopyright", "Copyright (C) 2019"
7474
VALUE "OriginalFilename", "IEDriver.dll"
7575
VALUE "ProductName", "Selenium WebDriver"
76-
VALUE "ProductVersion", "3.150.0.0"
76+
VALUE "ProductVersion", "3.150.1.0"
7777
END
7878
END
7979
BLOCK "VarFileInfo"

cpp/iedriverserver/CHANGELOG

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ available via the project downloads page. Changes in "revision" field indicate
99
private releases checked into the prebuilts directory of the source tree, but
1010
not made generally available on the downloads page.
1111

12+
v3.150.1.0
13+
==========
14+
* Reverted change to use effective style for determining element visibility.
15+
If a containing element has scrollbars, simply using the client bounding
16+
rect to determine the click point could lead the click point behind a
17+
scrollbar be determined as "in view," when clicking on the point would
18+
instead click on the scrollbar. A previous fix for this issue was not
19+
sufficiently robust in all scenarios, leading some elements to be seen
20+
as not displayed at all. Accordingly, this change has been reverted
21+
until a more correct one can be created.
22+
* Other updates to JavaScript automation atoms.
23+
1224
v3.150.0.0
1325
==========
1426
* (on behalf of Stanley Hon) Added basic support for IEDriver to drive

cpp/iedriverserver/IEDriverServer.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ END
5050
//
5151

5252
VS_VERSION_INFO VERSIONINFO
53-
FILEVERSION 3,150,0,0
54-
PRODUCTVERSION 3,150,0,0
53+
FILEVERSION 3,150,1,0
54+
PRODUCTVERSION 3,150,1,0
5555
FILEFLAGSMASK 0x3fL
5656
#ifdef _DEBUG
5757
FILEFLAGS 0x1L
@@ -68,12 +68,12 @@ BEGIN
6868
BEGIN
6969
VALUE "CompanyName", "Software Freedom Conservancy"
7070
VALUE "FileDescription", "Command line server for the IE driver"
71-
VALUE "FileVersion", "3.150.0.0"
71+
VALUE "FileVersion", "3.150.1.0"
7272
VALUE "InternalName", "IEDriverServer.exe"
7373
VALUE "LegalCopyright", "Copyright (C) 2019"
7474
VALUE "OriginalFilename", "IEDriverServer.exe"
7575
VALUE "ProductName", "Selenium WebDriver"
76-
VALUE "ProductVersion", "3.150.0.0"
76+
VALUE "ProductVersion", "3.150.1.0"
7777
END
7878
END
7979
BLOCK "VarFileInfo"
69 KB
Binary file not shown.
2 KB
Binary file not shown.

javascript/atoms/dom.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -739,23 +739,6 @@ bot.dom.getOverflowState = function(elem, opt_region) {
739739
return bot.dom.OverflowState.HIDDEN;
740740
}
741741

742-
if (goog.userAgent.IE) {
743-
// On IE, if the containing element has scroll bars, the
744-
// height and width given by getComputedStyle differ from the
745-
// client bounding rect. To avoid accidentally assuming the
746-
// point is not overflowed, when it's really behind a scrollbar,
747-
// use the effective height and width of the container.
748-
var effectiveWidth = goog.string.parseInt(bot.dom.getEffectiveStyle(container, "width"));
749-
var effectiveHeight = goog.string.parseInt(bot.dom.getEffectiveStyle(container, "height"));
750-
if (effectiveWidth != containerRect.width ||
751-
effectiveHeight != containerRect.height) {
752-
containerRect = new goog.math.Rect(containerRect.left,
753-
containerRect.top,
754-
effectiveWidth,
755-
effectiveHeight);
756-
}
757-
}
758-
759742
// Check "underflow": if an element is to the left or above the container
760743
var underflowsX = region.right < containerRect.left;
761744
var underflowsY = region.bottom < containerRect.top;

0 commit comments

Comments
 (0)