summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/dom/Document.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/dom/Document.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/dom/Document.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/3rdparty/webkit/WebCore/dom/Document.cpp b/src/3rdparty/webkit/WebCore/dom/Document.cpp
index 3d01c80..3ee00ad 100644
--- a/src/3rdparty/webkit/WebCore/dom/Document.cpp
+++ b/src/3rdparty/webkit/WebCore/dom/Document.cpp
@@ -1663,7 +1663,8 @@ void Document::implicitClose()
}
frame()->loader()->checkCallImplicitClose();
-
+ RenderObject* renderObject = renderer();
+
// We used to force a synchronous display and flush here. This really isn't
// necessary and can in fact be actively harmful if pages are loading at a rate of > 60fps
// (if your platform is syncing flushes and limiting them to 60fps).
@@ -1672,13 +1673,18 @@ void Document::implicitClose()
updateStyleIfNeeded();
// Always do a layout after loading if needed.
- if (view() && renderer() && (!renderer()->firstChild() || renderer()->needsLayout()))
+ if (view() && renderObject && (!renderObject->firstChild() || renderObject->needsLayout()))
view()->layout();
}
#if PLATFORM(MAC)
- if (f && renderer() && this == topDocument() && AXObjectCache::accessibilityEnabled())
- axObjectCache()->postNotification(renderer(), "AXLoadComplete", true);
+ if (f && renderObject && this == topDocument() && AXObjectCache::accessibilityEnabled())
+ // The AX cache may have been cleared at this point, but we need to make sure it contains an
+ // AX object to send the notification to. getOrCreate will make sure that an valid AX object
+ // exists in the cache (we ignore the return value because we don't need it here). This is
+ // only safe to call when a layout is not in progress, so it can not be used in postNotification.
+ axObjectCache()->getOrCreate(renderObject);
+ axObjectCache()->postNotification(renderObject, "AXLoadComplete", true);
#endif
#if ENABLE(SVG)
@@ -2598,7 +2604,7 @@ bool Document::setFocusedNode(PassRefPtr<Node> newFocusedNode)
else
view()->setFocus();
}
- }
+ }
#if PLATFORM(MAC) && !PLATFORM(CHROMIUM)
if (!focusChangeBlocked && m_focusedNode && AXObjectCache::accessibilityEnabled())
@@ -4354,19 +4360,19 @@ void Document::parseDNSPrefetchControlHeader(const String& dnsPrefetchControl)
void Document::reportException(const String& errorMessage, int lineNumber, const String& sourceURL)
{
if (DOMWindow* window = domWindow())
- window->console()->addMessage(JSMessageSource, ErrorMessageLevel, errorMessage, lineNumber, sourceURL);
+ window->console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, errorMessage, lineNumber, sourceURL);
}
-void Document::addMessage(MessageDestination destination, MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
+void Document::addMessage(MessageDestination destination, MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
{
switch (destination) {
case InspectorControllerDestination:
if (page())
- page()->inspectorController()->addMessageToConsole(source, level, message, lineNumber, sourceURL);
+ page()->inspectorController()->addMessageToConsole(source, type, level, message, lineNumber, sourceURL);
return;
case ConsoleDestination:
if (DOMWindow* window = domWindow())
- window->console()->addMessage(source, level, message, lineNumber, sourceURL);
+ window->console()->addMessage(source, type, level, message, lineNumber, sourceURL);
return;
}
ASSERT_NOT_REACHED();