| Index: third_party/WebKit/Source/core/dom/Document.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
|
| index 9c107592c0d797f84dfe57c01071d5e9ee4248ec..c2c805ff2c05fad79f1ebf5f4377a9c562944a81 100644
|
| --- a/third_party/WebKit/Source/core/dom/Document.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Document.cpp
|
| @@ -432,6 +432,7 @@ Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC
|
| , m_containsPlugins(false)
|
| , m_updateFocusAppearanceSelectionBahavior(SelectionBehaviorOnFocus::Reset)
|
| , m_ignoreDestructiveWriteCount(0)
|
| + , m_throwOnDynamicMarkupInsertionCount(0)
|
| , m_markers(new DocumentMarkerController(*this))
|
| , m_updateFocusAppearanceTimer(this, &Document::updateFocusAppearanceTimerFired)
|
| , m_cssTarget(nullptr)
|
| @@ -2393,6 +2394,11 @@ void Document::open(Document* enteredDocument, ExceptionState& exceptionState)
|
| return;
|
| }
|
|
|
| + if (m_throwOnDynamicMarkupInsertionCount) {
|
| + exceptionState.throwDOMException(InvalidStateError, "Custom Element constructor should not use open().");
|
| + return;
|
| + }
|
| +
|
| if (enteredDocument) {
|
| if (!getSecurityOrigin()->canAccess(enteredDocument->getSecurityOrigin())) {
|
| exceptionState.throwSecurityError("Can only call open() on same-origin documents.");
|
| @@ -2590,6 +2596,11 @@ void Document::close(ExceptionState& exceptionState)
|
| return;
|
| }
|
|
|
| + if (m_throwOnDynamicMarkupInsertionCount) {
|
| + exceptionState.throwDOMException(InvalidStateError, "Custom Element constructor should not use close().");
|
| + return;
|
| + }
|
| +
|
| close();
|
| }
|
|
|
| @@ -2853,6 +2864,11 @@ void Document::write(const SegmentedString& text, Document* enteredDocument, Exc
|
| return;
|
| }
|
|
|
| + if (m_throwOnDynamicMarkupInsertionCount) {
|
| + exceptionState.throwDOMException(InvalidStateError, "Custom Element constructor should not use write().");
|
| + return;
|
| + }
|
| +
|
| if (enteredDocument && !getSecurityOrigin()->canAccess(enteredDocument->getSecurityOrigin())) {
|
| exceptionState.throwSecurityError("Can only call write() on same-origin documents.");
|
| return;
|
|
|