Skip to content

Commit

Permalink
Reverting change to use effective style for determining element visib…
Browse files Browse the repository at this point in the history
…ility

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.
  • Loading branch information
jimevans committed Oct 17, 2019
1 parent 6ebbe5a commit 1c5bdc3
Show file tree
Hide file tree
Showing 9 changed files with 11,485 additions and 10,949 deletions.
8 changes: 4 additions & 4 deletions cpp/iedriver/ActionSimulators/JavaScriptActionSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int JavaScriptActionSimulator::SimulateKeyDown(BrowserHandle browser_wrapper,
delete extra_info;
LOG(DEBUG) << "Using synthetic events for sending keys";
std::wstring script_source = L"(function() { return function(){" +
atoms::asString(atoms::INPUTS) +
atoms::asString(atoms::INPUTS_BIN) +
L"; return webdriver.atoms.inputs.sendKeys(" +
L"arguments[0], arguments[1], arguments[2], arguments[3]);" +
L"};})();";
Expand Down Expand Up @@ -108,7 +108,7 @@ int JavaScriptActionSimulator::SimulatePointerMove(BrowserHandle browser_wrapper
delete extra_info;

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

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ bool ClickElementCommandHandler::IsOptionElement(ElementHandle element_wrapper)

std::wstring ClickElementCommandHandler::GetSyntheticClickAtom() {
std::wstring script_source = L"(function() { return function(){" +
atoms::asString(atoms::INPUTS) +
atoms::asString(atoms::INPUTS_BIN) +
L"; return webdriver.atoms.inputs.click(arguments[0]);" +
L"};})();";
return script_source;
Expand Down
22,379 changes: 11,460 additions & 10,919 deletions cpp/iedriver/Generated/atoms.h

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions cpp/iedriver/IEDriver.rc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,150,0,0
PRODUCTVERSION 3,150,0,0
FILEVERSION 3,150,1,0
PRODUCTVERSION 3,150,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -68,12 +68,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Software Freedom Conservancy"
VALUE "FileDescription", "Driver library for the IE driver"
VALUE "FileVersion", "3.150.0.0"
VALUE "FileVersion", "3.150.1.0"
VALUE "InternalName", "IEDriver.dll"
VALUE "LegalCopyright", "Copyright (C) 2019"
VALUE "OriginalFilename", "IEDriver.dll"
VALUE "ProductName", "Selenium WebDriver"
VALUE "ProductVersion", "3.150.0.0"
VALUE "ProductVersion", "3.150.1.0"
END
END
BLOCK "VarFileInfo"
Expand Down
12 changes: 12 additions & 0 deletions cpp/iedriverserver/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ available via the project downloads page. Changes in "revision" field indicate
private releases checked into the prebuilts directory of the source tree, but
not made generally available on the downloads page.

v3.150.1.0
==========
* Reverted 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.
* Other updates to JavaScript automation atoms.

v3.150.0.0
==========
* (on behalf of Stanley Hon) Added basic support for IEDriver to drive
Expand Down
8 changes: 4 additions & 4 deletions cpp/iedriverserver/IEDriverServer.rc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,150,0,0
PRODUCTVERSION 3,150,0,0
FILEVERSION 3,150,1,0
PRODUCTVERSION 3,150,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -68,12 +68,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Software Freedom Conservancy"
VALUE "FileDescription", "Command line server for the IE driver"
VALUE "FileVersion", "3.150.0.0"
VALUE "FileVersion", "3.150.1.0"
VALUE "InternalName", "IEDriverServer.exe"
VALUE "LegalCopyright", "Copyright (C) 2019"
VALUE "OriginalFilename", "IEDriverServer.exe"
VALUE "ProductName", "Selenium WebDriver"
VALUE "ProductVersion", "3.150.0.0"
VALUE "ProductVersion", "3.150.1.0"
END
END
BLOCK "VarFileInfo"
Expand Down
Binary file modified cpp/prebuilt/Win32/Release/IEDriverServer.exe
Binary file not shown.
Binary file modified cpp/prebuilt/x64/Release/IEDriverServer.exe
Binary file not shown.
17 changes: 0 additions & 17 deletions javascript/atoms/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -739,23 +739,6 @@ bot.dom.getOverflowState = function(elem, opt_region) {
return bot.dom.OverflowState.HIDDEN;
}

if (goog.userAgent.IE) {
// On IE, if the containing element has scroll bars, the
// height and width given by getComputedStyle differ from the
// client bounding rect. To avoid accidentally assuming the
// point is not overflowed, when it's really behind a scrollbar,
// use the effective height and width of the container.
var effectiveWidth = goog.string.parseInt(bot.dom.getEffectiveStyle(container, "width"));
var effectiveHeight = goog.string.parseInt(bot.dom.getEffectiveStyle(container, "height"));
if (effectiveWidth != containerRect.width ||
effectiveHeight != containerRect.height) {
containerRect = new goog.math.Rect(containerRect.left,
containerRect.top,
effectiveWidth,
effectiveHeight);
}
}

// Check "underflow": if an element is to the left or above the container
var underflowsX = region.right < containerRect.left;
var underflowsY = region.bottom < containerRect.top;
Expand Down

0 comments on commit 1c5bdc3

Please sign in to comment.