Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/Document.h |
| diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h |
| index f4b3d4b85eaa081b97540e286c804ac805782bd5..22e518360217c2221b789bc11374de9a2eaa6b1c 100644 |
| --- a/third_party/WebKit/Source/core/dom/Document.h |
| +++ b/third_party/WebKit/Source/core/dom/Document.h |
| @@ -224,6 +224,13 @@ enum CreateElementFlags { |
| CreatedByFragmentParser = CreatedByParser | AsynchronousCustomElements, |
| }; |
| +enum SrcdocType { |
|
jochen (gone - plz use gerrit)
2017/01/27 15:14:19
nit. enum class. enum constants should start with
|
| + NotSrcdoc, |
| + Srcdoc, |
| + FragmentParserCreatedSrcdoc, |
| + DocumentWriteCreatedSrcdoc |
| +}; |
| + |
| // Collect data about deferred loading of offscreen cross-origin documents. All |
| // cross-origin documents log Created. Only those that would load log a reason. |
| // We can then see the % of cross-origin documents that never have to load. |
| @@ -434,13 +441,17 @@ class CORE_EXPORT Document : public ContainerNode, |
| bool isFrameSet() const; |
| - bool isSrcdocDocument() const { return m_isSrcdocDocument; } |
| + bool isSrcdocDocument() const { return m_srcdocType != NotSrcdoc; } |
| bool isMobileDocument() const { return m_isMobileDocument; } |
| // True if this document is an IFrame srcdoc document, and the frame in which |
| - // it lives was created by a fragment parser (e.g. 'innerHTML'). |
| + // it lives was created by a fragment parser (e.g. 'innerHTML') or |
| + // 'document.write', respectively. |
| bool isFragmentParserCreatedSrcdoc() const { |
| - return m_isFragmentParserCreatedSrcdoc; |
| + return m_srcdocType == FragmentParserCreatedSrcdoc; |
| + } |
| + bool isDocumentWriteCreatedSrcdoc() const { |
| + return m_srcdocType == DocumentWriteCreatedSrcdoc; |
| } |
| StyleResolver* styleResolver() const; |
| @@ -1598,9 +1609,10 @@ class CORE_EXPORT Document : public ContainerNode, |
| bool m_isViewSource; |
| bool m_sawElementsInKnownNamespaces; |
| - bool m_isSrcdocDocument; |
| + SrcdocType m_srcdocType; |
| bool m_isMobileDocument; |
| bool m_isFragmentParserCreatedSrcdoc; |
| + bool m_isDocumentWriteCreatedSrcdoc; |
| LayoutView* m_layoutView; |