Chromium Code Reviews| 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 2a2cb03bd15e6062cdea6878f92a303e2264fb94..dd835adfcdbc5ae24d60f72871fa972a6a81cb7c 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/platform/DOMExtension.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/platform/DOMExtension.js |
| @@ -277,6 +277,12 @@ Node.prototype.isComponentSelectionCollapsed = function() { |
| * @return {boolean} |
| */ |
| Node.prototype.hasSelection = function() { |
| + // FIXME: use contains(node, {includeShadow: true}) when it is fixed for shadow dom. |
|
dgozman
2016/12/22 01:59:33
TODO(luoe)
luoe
2016/12/22 02:03:56
Done.
|
| + var contents = this.querySelectorAll('content'); |
| + for (var content of contents) { |
| + if (Array.prototype.some.call(content.getDistributedNodes(), node => node.hasSelection())) |
|
allada
2016/12/20 18:41:36
Why Array.prototype.some.call?
Why not just acces
luoe
2016/12/20 19:23:58
getDistributedNodes() returns a NodeList, which do
allada
2016/12/21 23:28:26
I see.
|
| + return true; |
| + } |
| if (this.isComponentSelectionCollapsed()) |
| return false; |
| return this.getComponentSelection().containsNode(this, true); |