Reviewed by Hyatt.
[WebKit-https.git] / WebCore / loader / FrameLoader.cpp
index 0c237eb296c55253fc56ed6ed3959237737b2484..518f3820ad06a6eaf1a36afd6aa1a3324ae29101 100644 (file)
@@ -1412,6 +1412,13 @@ bool FrameLoader::gotoAnchor(const String& name)
 {
     ASSERT(m_frame->document());
 
+    if (!m_frame->document()->haveStylesheetsLoaded()) {
+        m_frame->document()->setGotoAnchorNeededAfterStylesheetsLoad(true);
+        return false;
+    }
+
+    m_frame->document()->setGotoAnchorNeededAfterStylesheetsLoad(false);
+
     Node* anchorNode = m_frame->document()->getElementById(AtomicString(name));
     if (!anchorNode)
         anchorNode = m_frame->document()->anchors()->namedItem(name, !m_frame->document()->inCompatMode());