Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/StaticRange.h |
| diff --git a/third_party/WebKit/Source/core/dom/StaticRange.h b/third_party/WebKit/Source/core/dom/StaticRange.h |
| index 551efd9afb53f7dea7ef2ac9f880cdbc998ee6f6..4fc26dff45dca8b9d952d8b0094ac603bd86782a 100644 |
| --- a/third_party/WebKit/Source/core/dom/StaticRange.h |
| +++ b/third_party/WebKit/Source/core/dom/StaticRange.h |
| @@ -10,6 +10,7 @@ |
| #include "bindings/core/v8/ScriptWrappable.h" |
| #include "core/CoreExport.h" |
| #include "core/dom/Range.h" |
| +#include "core/editing/EphemeralRange.h" |
| #include "platform/heap/Handle.h" |
| namespace blink { |
| @@ -38,6 +39,13 @@ class CORE_EXPORT StaticRange final : public GarbageCollected<StaticRange>, |
| range->startOffset(), range->endContainer(), |
| range->endOffset()); |
| } |
| + static StaticRange* create(const EphemeralRange& range) { |
| + return new StaticRange(range.document(), |
|
yosin_UTC9
2017/03/08 07:35:51
Let's add |DCHECK(!range.isNull());| since creatin
chongz
2017/03/08 18:31:09
Done.
|
| + range.startPosition().computeContainerNode(), |
| + range.startPosition().computeOffsetInContainerNode(), |
| + range.endPosition().computeContainerNode(), |
| + range.endPosition().computeOffsetInContainerNode()); |
| + } |
| Node* startContainer() const { return m_startContainer.get(); } |
| void setStartContainer(Node* startContainer) { |