| Index: third_party/WebKit/Source/devtools/front_end/platform/DOMExtension.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/platform/DOMExtension.js b/third_party/WebKit/Source/devtools/front_end/platform/DOMExtension.js
|
| index 9174e09b04c65098459a8255852b0d057b443b12..3c9d08dd79c5e5e6901638537da4af0c8d806c62 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/platform/DOMExtension.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/platform/DOMExtension.js
|
| @@ -122,7 +122,7 @@ Node.prototype.rangeOfWord = function(offset, stopCharacters, stayWithinNode, di
|
| result.setEnd(endNode, endOffset);
|
|
|
| return result;
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {!Node=} stayWithin
|
| @@ -138,7 +138,7 @@ Node.prototype.traverseNextTextNode = function(stayWithin)
|
| node = node.traverseNextNode(stayWithin);
|
|
|
| return node;
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {number|undefined} x
|
| @@ -165,7 +165,7 @@ Element.prototype.positionAt = function(x, y, relativeTo)
|
| this.style.setProperty("position", "absolute");
|
| else
|
| this.style.removeProperty("position");
|
| -}
|
| +};
|
|
|
| /**
|
| * @return {boolean}
|
| @@ -178,7 +178,7 @@ Element.prototype.isScrolledToBottom = function()
|
| // round, ceil or floor functions) or left intouch.
|
| // This adds up a total error up to 2.
|
| return Math.abs(this.scrollTop + this.clientHeight - this.scrollHeight) <= 2;
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {!Array.<string>} nameArray
|
| @@ -193,7 +193,7 @@ Node.prototype.enclosingNodeOrSelfWithNodeNameInArray = function(nameArray)
|
| }
|
| }
|
| return null;
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {string} nodeName
|
| @@ -202,7 +202,7 @@ Node.prototype.enclosingNodeOrSelfWithNodeNameInArray = function(nameArray)
|
| Node.prototype.enclosingNodeOrSelfWithNodeName = function(nodeName)
|
| {
|
| return this.enclosingNodeOrSelfWithNodeNameInArray([nodeName]);
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {string} className
|
| @@ -212,7 +212,7 @@ Node.prototype.enclosingNodeOrSelfWithNodeName = function(nodeName)
|
| Node.prototype.enclosingNodeOrSelfWithClass = function(className, stayWithin)
|
| {
|
| return this.enclosingNodeOrSelfWithClassList([className], stayWithin);
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {!Array.<string>} classNames
|
| @@ -233,7 +233,7 @@ Node.prototype.enclosingNodeOrSelfWithClassList = function(classNames, stayWithi
|
| }
|
| }
|
| return null;
|
| -}
|
| +};
|
|
|
| /**
|
| * @return {?Element}
|
| @@ -248,7 +248,7 @@ Node.prototype.parentElementOrShadowHost = function()
|
| if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE)
|
| return /** @type {!Element} */ (node.host);
|
| return null;
|
| -}
|
| +};
|
|
|
| /**
|
| * @return {?Node}
|
| @@ -256,7 +256,7 @@ Node.prototype.parentElementOrShadowHost = function()
|
| Node.prototype.parentNodeOrShadowHost = function()
|
| {
|
| return this.parentNode || this.host || null;
|
| -}
|
| +};
|
|
|
| /**
|
| * @return {?Selection}
|
| @@ -267,7 +267,7 @@ Node.prototype.getComponentSelection = function()
|
| while (parent && parent.nodeType !== Node.DOCUMENT_FRAGMENT_NODE)
|
| parent = parent.parentNode;
|
| return parent instanceof ShadowRoot ? parent.getSelection() : this.window().getSelection();
|
| -}
|
| +};
|
|
|
|
|
| /**
|
| @@ -279,7 +279,7 @@ Node.prototype.isComponentSelectionCollapsed = function()
|
| var selection = this.getComponentSelection();
|
| var range = selection && selection.rangeCount ? selection.getRangeAt(0) : null;
|
| return range ? range.collapsed : true;
|
| -}
|
| +};
|
|
|
| /**
|
| * @return {boolean}
|
| @@ -289,7 +289,7 @@ Node.prototype.hasSelection = function()
|
| if (this.isComponentSelectionCollapsed())
|
| return false;
|
| return this.getComponentSelection().containsNode(this, true);
|
| -}
|
| +};
|
|
|
| /**
|
| * @return {!Selection}
|
| @@ -304,7 +304,7 @@ Node.prototype.getDeepSelection = function()
|
| }
|
|
|
| return shadowRoot ? shadowRoot.getSelection() : this.window().getSelection();
|
| -}
|
| +};
|
|
|
| /**
|
| * @return {!Window}
|
| @@ -312,13 +312,13 @@ Node.prototype.getDeepSelection = function()
|
| Node.prototype.window = function()
|
| {
|
| return this.ownerDocument.defaultView;
|
| -}
|
| +};
|
|
|
| Element.prototype.removeChildren = function()
|
| {
|
| if (this.firstChild)
|
| this.textContent = "";
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {string} tagName
|
| @@ -353,7 +353,7 @@ Document.prototype.createElementWithClass = function(elementName, className, cus
|
| if (className)
|
| element.className = className;
|
| return element;
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {string} elementName
|
| @@ -378,7 +378,7 @@ Document.prototype.createSVGElement = function(childType, className)
|
| if (className)
|
| element.setAttribute("class", className);
|
| return element;
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {string} childType
|
| @@ -411,7 +411,7 @@ Element.prototype.createChild = function(elementName, className, customElementTy
|
| var element = this.ownerDocument.createElementWithClass(elementName, className, customElementType);
|
| this.appendChild(element);
|
| return element;
|
| -}
|
| +};
|
|
|
| DocumentFragment.prototype.createChild = Element.prototype.createChild;
|
|
|
| @@ -424,7 +424,7 @@ Element.prototype.createTextChild = function(text)
|
| var element = this.ownerDocument.createTextNode(text);
|
| this.appendChild(element);
|
| return element;
|
| -}
|
| +};
|
|
|
| DocumentFragment.prototype.createTextChild = Element.prototype.createTextChild;
|
|
|
| @@ -435,7 +435,7 @@ Element.prototype.createTextChildren = function(var_args)
|
| {
|
| for (var i = 0, n = arguments.length; i < n; ++i)
|
| this.createTextChild(arguments[i]);
|
| -}
|
| +};
|
|
|
| DocumentFragment.prototype.createTextChildren = Element.prototype.createTextChildren;
|
|
|
| @@ -445,7 +445,7 @@ DocumentFragment.prototype.createTextChildren = Element.prototype.createTextChil
|
| Element.prototype.totalOffsetLeft = function()
|
| {
|
| return this.totalOffset().left;
|
| -}
|
| +};
|
|
|
| /**
|
| * @return {number}
|
| @@ -453,7 +453,7 @@ Element.prototype.totalOffsetLeft = function()
|
| Element.prototype.totalOffsetTop = function()
|
| {
|
| return this.totalOffset().top;
|
| -}
|
| +};
|
|
|
| /**
|
| * @return {!{left: number, top: number}}
|
| @@ -462,7 +462,7 @@ Element.prototype.totalOffset = function()
|
| {
|
| var rect = this.getBoundingClientRect();
|
| return { left: rect.left, top: rect.top };
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {string} childType
|
| @@ -474,7 +474,7 @@ Element.prototype.createSVGChild = function(childType, className)
|
| var child = this.ownerDocument.createSVGElement(childType, className);
|
| this.appendChild(child);
|
| return child;
|
| -}
|
| +};
|
|
|
| /**
|
| * @constructor
|
| @@ -499,7 +499,7 @@ AnchorBox.prototype.relativeTo = function(box)
|
| {
|
| return new AnchorBox(
|
| this.x - box.x, this.y - box.y, this.width, this.height);
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {!Element} element
|
| @@ -508,7 +508,7 @@ AnchorBox.prototype.relativeTo = function(box)
|
| AnchorBox.prototype.relativeToElement = function(element)
|
| {
|
| return this.relativeTo(element.boxInWindow(element.ownerDocument.defaultView));
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {?AnchorBox} anchorBox
|
| @@ -517,7 +517,7 @@ AnchorBox.prototype.relativeToElement = function(element)
|
| AnchorBox.prototype.equals = function(anchorBox)
|
| {
|
| return !!anchorBox && this.x === anchorBox.x && this.y === anchorBox.y && this.width === anchorBox.width && this.height === anchorBox.height;
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {!Window=} targetWindow
|
| @@ -542,7 +542,7 @@ Element.prototype.boxInWindow = function(targetWindow)
|
| anchorBox.width = Math.min(this.offsetWidth, targetWindow.innerWidth - anchorBox.x);
|
| anchorBox.height = Math.min(this.offsetHeight, targetWindow.innerHeight - anchorBox.y);
|
| return anchorBox;
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {boolean=} preventDefault
|
| @@ -553,7 +553,7 @@ Event.prototype.consume = function(preventDefault)
|
| if (preventDefault)
|
| this.preventDefault();
|
| this.handled = true;
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {number=} start
|
| @@ -575,7 +575,7 @@ Text.prototype.select = function(start, end)
|
| range.setEnd(this, end);
|
| selection.addRange(range);
|
| return this;
|
| -}
|
| +};
|
|
|
| /**
|
| * @return {?number}
|
| @@ -600,7 +600,7 @@ Element.prototype.selectionLeftOffset = function()
|
| }
|
|
|
| return leftOffset;
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {...!Node} var_args
|
| @@ -609,7 +609,7 @@ Node.prototype.appendChildren = function(var_args)
|
| {
|
| for (var i = 0, n = arguments.length; i < n; ++i)
|
| this.appendChild(arguments[i]);
|
| -}
|
| +};
|
|
|
| /**
|
| * @return {string}
|
| @@ -617,7 +617,7 @@ Node.prototype.appendChildren = function(var_args)
|
| Node.prototype.deepTextContent = function()
|
| {
|
| return this.childTextNodes().map(function(node) { return node.textContent; }).join("");
|
| -}
|
| +};
|
|
|
| /**
|
| * @return {!Array.<!Node>}
|
| @@ -633,7 +633,7 @@ Node.prototype.childTextNodes = function()
|
| node = node.traverseNextTextNode(this);
|
| }
|
| return result;
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {?Node} node
|
| @@ -651,7 +651,7 @@ Node.prototype.isAncestor = function(node)
|
| currentNode = currentNode.parentNodeOrShadowHost();
|
| }
|
| return false;
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {?Node} descendant
|
| @@ -660,7 +660,7 @@ Node.prototype.isAncestor = function(node)
|
| Node.prototype.isDescendant = function(descendant)
|
| {
|
| return !!descendant && descendant.isAncestor(this);
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {?Node} node
|
| @@ -669,7 +669,7 @@ Node.prototype.isDescendant = function(descendant)
|
| Node.prototype.isSelfOrAncestor = function(node)
|
| {
|
| return !!node && (node === this || this.isAncestor(node));
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {?Node} node
|
| @@ -678,7 +678,7 @@ Node.prototype.isSelfOrAncestor = function(node)
|
| Node.prototype.isSelfOrDescendant = function(node)
|
| {
|
| return !!node && (node === this || this.isDescendant(node));
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {!Node=} stayWithin
|
| @@ -737,7 +737,7 @@ Node.prototype.traverseNextNode = function(stayWithin)
|
| }
|
|
|
| return null;
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {!Node=} stayWithin
|
| @@ -753,7 +753,7 @@ Node.prototype.traversePreviousNode = function(stayWithin)
|
| if (node)
|
| return node;
|
| return this.parentNodeOrShadowHost();
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {*} text
|
| @@ -774,7 +774,7 @@ Node.prototype.setTextContentTruncatedIfNeeded = function(text, placeholder)
|
|
|
| this.textContent = text;
|
| return false;
|
| -}
|
| +};
|
|
|
| /**
|
| * @return {?Node}
|
| @@ -783,7 +783,7 @@ Event.prototype.deepElementFromPoint = function()
|
| {
|
| var root = this.target && this.target.getComponentRoot();
|
| return root ? root.deepElementFromPoint(this.pageX, this.pageY) : null;
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {number} x
|
| @@ -796,7 +796,7 @@ Document.prototype.deepElementFromPoint = function(x, y)
|
| while (node && node.shadowRoot)
|
| node = node.shadowRoot.elementFromPoint(x, y);
|
| return node;
|
| -}
|
| +};
|
|
|
| DocumentFragment.prototype.deepElementFromPoint = Document.prototype.deepElementFromPoint;
|
|
|
| @@ -809,7 +809,7 @@ Document.prototype.deepActiveElement = function()
|
| while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)
|
| activeElement = activeElement.shadowRoot.activeElement;
|
| return activeElement;
|
| -}
|
| +};
|
|
|
| DocumentFragment.prototype.deepActiveElement = Document.prototype.deepActiveElement;
|
|
|
| @@ -820,7 +820,7 @@ Element.prototype.hasFocus = function()
|
| {
|
| var root = this.getComponentRoot();
|
| return !!root && this.isSelfOrAncestor(root.activeElement);
|
| -}
|
| +};
|
|
|
| /**
|
| * @return {?Document|?DocumentFragment}
|
| @@ -831,7 +831,7 @@ Node.prototype.getComponentRoot = function()
|
| while (node && node.nodeType !== Node.DOCUMENT_FRAGMENT_NODE && node.nodeType !== Node.DOCUMENT_NODE)
|
| node = node.parentNode;
|
| return /** @type {?Document|?DocumentFragment} */ (node);
|
| -}
|
| +};
|
|
|
| /**
|
| * @param {!Event} event
|
|
|