diff --git a/javascript/atoms/dom.js b/javascript/atoms/dom.js index 68dbdacc16..d8519f518e 100644 --- a/javascript/atoms/dom.js +++ b/javascript/atoms/dom.js @@ -587,14 +587,8 @@ bot.dom.isShown = function(elem, opt_ignoreOpacity) { var parent = bot.dom.getParentNodeInComposedDom(e); if (bot.dom.IS_SHADOW_DOM_ENABLED && (parent instanceof ShadowRoot)) { - if (parent.host.shadowRoot !== parent) { - // There is a younger shadow root, which will take precedence over - // the shadow this element is in, thus this element won't be - // displayed. - return false; - } else { - parent = parent.host; - } + // For backward compatibility, treat all shadow roots as shown. + return true; } if (parent && (parent.nodeType == goog.dom.NodeType.DOCUMENT || @@ -609,7 +603,7 @@ bot.dom.isShown = function(elem, opt_ignoreOpacity) { return false; } - return parent && displayed(parent); + return !!parent && displayed(parent); } return bot.dom.isShown_(elem, !!opt_ignoreOpacity, displayed); @@ -1175,7 +1169,7 @@ bot.dom.appendVisibleTextLinesFromTextNode_ = function(textNode, lines, } if (textTransform == 'capitalize') { - text = text.replace(/(^|\s|\b)(\S)/g, function() { + text = text.replace(/(^|[^\d\p{L}\p{S}])([\p{Ll}|\p{S}])/gu, function() { return arguments[1] + arguments[2].toUpperCase(); }); } else if (textTransform == 'uppercase') { @@ -1270,13 +1264,6 @@ bot.dom.getOpacityNonIE_ = function(elem) { bot.dom.getParentNodeInComposedDom = function(node) { var /**@type {Node}*/ parent = node.parentNode; - // Shadow DOM v1 - if (parent && parent.shadowRoot && node.assignedSlot !== undefined) { - // Can be null on purpose, meaning it has no parent as - // it hasn't yet been slotted - return node.assignedSlot ? node.assignedSlot.parentNode : null; - } - // Shadow DOM V0 (deprecated) if (node.getDestinationInsertionPoints) { var destinations = node.getDestinationInsertionPoints(); @@ -1285,6 +1272,13 @@ bot.dom.getParentNodeInComposedDom = function(node) { } } + // Shadow DOM v1 + if (parent && parent.shadowRoot && node.assignedSlot !== undefined) { + // Can be null on purpose, meaning it has no parent as + // it hasn't yet been slotted + return node.assignedSlot ? node.assignedSlot.parentNode : null; + } + return parent; }; diff --git a/javascript/atoms/mouse.js b/javascript/atoms/mouse.js index 737ed50f62..1bc9e858f5 100644 --- a/javascript/atoms/mouse.js +++ b/javascript/atoms/mouse.js @@ -143,7 +143,7 @@ bot.Mouse.NO_BUTTON_VALUE_INDEX_ = 3; * click/ mouseup/ mouseout/ mousemove contextmenu * dblclick mousedown mouseover * IE_DOC_PRE9 0 0 0 X 1 4 2 X 0 0 0 0 1 4 2 0 X X 0 X - * WEBKIT/IE9 0 1 2 X 0 1 2 X 0 1 2 0 0 1 2 0 X X 2 X + * WEBKIT/IE9 0 1 2 X 0 1 2 X 0 1 2 4 0 1 2 4 X X 2 X * GECKO 0 1 2 X 0 1 2 X 0 0 0 0 0 0 0 0 X X 2 X * * @private {!Object.>} @@ -163,8 +163,8 @@ bot.Mouse.MOUSE_BUTTON_VALUE_MAP_ = (function() { buttonValueMap[bot.events.EventType.CLICK] = [0, 1, 2, null]; buttonValueMap[bot.events.EventType.CONTEXTMENU] = [null, null, 2, null]; buttonValueMap[bot.events.EventType.MOUSEUP] = [0, 1, 2, null]; - buttonValueMap[bot.events.EventType.MOUSEOUT] = [0, 1, 2, 0]; - buttonValueMap[bot.events.EventType.MOUSEMOVE] = [0, 1, 2, 0]; + buttonValueMap[bot.events.EventType.MOUSEOUT] = [0, 1, 2, 4]; + buttonValueMap[bot.events.EventType.MOUSEMOVE] = [0, 1, 2, 4]; } else { buttonValueMap[bot.events.EventType.CLICK] = [0, 1, 2, null]; buttonValueMap[bot.events.EventType.CONTEXTMENU] = [null, null, 2, null]; diff --git a/javascript/chrome-driver/atoms.js b/javascript/chrome-driver/atoms.js index 5185e010fb..3febbeba5c 100644 --- a/javascript/chrome-driver/atoms.js +++ b/javascript/chrome-driver/atoms.js @@ -211,7 +211,7 @@ webdriver.chrome.getFirstClientRect = function(elem) { * at the given location. Useful for debugging test clicking issues. * * @param {!Element} elem The element to use. - * @param {!goog.math.Coordinate} coord The coordinate to use. + * @param {!Object} coord The coordinate to use. * @return {{clickable:boolean, message: (string|undefined)}} Object containing * a boolean "clickable" property, as to whether it can be clicked, and an * optional "message" string property, which contains any warning/error