diff options
author | Steve Block <steveblock@google.com> | 2011-09-26 13:12:35 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-09-26 22:52:08 +0100 |
commit | 4cdf1c24e9a5622cded19588d9821f6c41b4d5a8 (patch) | |
tree | 7f0e52c03f0b69b9e0fa508dffd769f4f44dfc19 /Source/WebCore | |
parent | b73d73df5423e237b8aafcbd60fdaf9e195243f8 (diff) | |
download | external_webkit-4cdf1c24e9a5622cded19588d9821f6c41b4d5a8.zip external_webkit-4cdf1c24e9a5622cded19588d9821f6c41b4d5a8.tar.gz external_webkit-4cdf1c24e9a5622cded19588d9821f6c41b4d5a8.tar.bz2 |
Add temporary work-around to allow loading local data from Documents with substituted data
This is a temporary workaround for a WebCore bug which is awaiting resolution.
See https://bugs.webkit.org/show_bug.cgi?id=68711 and this bug for details.
This change adds a new property to Frame to track when its Document pointer is
up-to-date. This is is used only when setting up the securty context for a
Document with substituted data and allows us to skip the buggy check in
Document::loader().
Bug: 5188895
Change-Id: I5d7d2cca83fa0c6db084d505f5b48207046a9cd0
Diffstat (limited to 'Source/WebCore')
-rw-r--r-- | Source/WebCore/dom/Document.cpp | 8 | ||||
-rw-r--r-- | Source/WebCore/loader/DocumentWriter.cpp | 4 | ||||
-rw-r--r-- | Source/WebCore/page/Frame.cpp | 8 | ||||
-rw-r--r-- | Source/WebCore/page/Frame.h | 10 |
4 files changed, 29 insertions, 1 deletions
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp index c8bf374..d85a949 100644 --- a/Source/WebCore/dom/Document.cpp +++ b/Source/WebCore/dom/Document.cpp @@ -5070,7 +5070,13 @@ DocumentLoader* Document::loader() const if (!loader) return 0; - if (m_frame->document() != this) +#if PLATFORM(ANDROID) + // Temporary hack for http://b/5188895 + bool isDocumentUpToDate = m_frame->isDocumentUpToDate(); +#else + bool isDocumentUpToDate = true; +#endif + if (isDocumentUpToDate && m_frame->document() != this) return 0; return loader; diff --git a/Source/WebCore/loader/DocumentWriter.cpp b/Source/WebCore/loader/DocumentWriter.cpp index 2fc02d1..cca4005 100644 --- a/Source/WebCore/loader/DocumentWriter.cpp +++ b/Source/WebCore/loader/DocumentWriter.cpp @@ -114,6 +114,10 @@ void DocumentWriter::begin(const KURL& url, bool dispatch, SecurityOrigin* origi // Create a new document before clearing the frame, because it may need to // inherit an aliased security context. +#if PLATFORM(ANDROID) + // Temporary hack for http://b/5188895 + m_frame->setDocumentIsNotUpToDate(); +#endif RefPtr<Document> document = createDocument(url); // If the new document is for a Plugin but we're supposed to be sandboxed from Plugins, diff --git a/Source/WebCore/page/Frame.cpp b/Source/WebCore/page/Frame.cpp index c3b56e7..8a1ad69 100644 --- a/Source/WebCore/page/Frame.cpp +++ b/Source/WebCore/page/Frame.cpp @@ -171,6 +171,10 @@ inline Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoader , m_inViewSourceMode(false) , m_isDisconnected(false) , m_excludeFromTextSearch(false) +#if PLATFORM(ANDROID) + // Temporary hack for http://b/5188895 + , m_isDocumentUpToDate(true) +#endif { ASSERT(page); AtomicString::init(); @@ -302,6 +306,10 @@ void Frame::setDocument(PassRefPtr<Document> newDoc) } m_doc = newDoc; +#if PLATFORM(ANDROID) + // Temporary hack for http://b/5188895 + m_isDocumentUpToDate = true; +#endif selection()->updateSecureKeyboardEntryIfActive(); if (m_doc && !m_doc->attached()) diff --git a/Source/WebCore/page/Frame.h b/Source/WebCore/page/Frame.h index 05805cf..101cee3 100644 --- a/Source/WebCore/page/Frame.h +++ b/Source/WebCore/page/Frame.h @@ -101,6 +101,11 @@ namespace WebCore { Page* page() const; HTMLFrameOwnerElement* ownerElement() const; +#if PLATFORM(ANDROID) + // Temporary hack for http://b/5188895 + bool isDocumentUpToDate() const { return m_isDocumentUpToDate; } + void setDocumentIsNotUpToDate() { m_isDocumentUpToDate = false; } +#endif Document* document() const; FrameView* view() const; @@ -247,6 +252,11 @@ namespace WebCore { bool m_isDisconnected; bool m_excludeFromTextSearch; +#if PLATFORM(ANDROID) + // Temporary hack for http://b/5188895 + bool m_isDocumentUpToDate; +#endif + #if ENABLE(TILED_BACKING_STORE) // FIXME: The tiled backing store belongs in FrameView, not Frame. |