#include "FrameLoader.h"
#include "FrameTree.h"
#include "FrameView.h"
-#include "GraphicsContext.h"
#include "HTMLCollection.h"
#include "HTMLFormElement.h"
#include "HTMLFrameOwnerElement.h"
#include "HistoryItem.h"
#include "InspectorController.h"
#include "Page.h"
+#include "painting/GraphicsContextBuilder.h"
#include "Performance.h"
#include "PlatformBridge.h"
-#include "PlatformContextSkia.h"
#include "PluginDocument.h"
#include "PrintContext.h"
#include "RenderFrame.h"
#include <algorithm>
#include <wtf/CurrentTime.h>
-#if OS(DARWIN)
-#include "LocalCurrentGraphicsContext.h"
-#endif
-
#if OS(LINUX) || OS(FREEBSD)
#include <gdk/gdk.h>
#endif
WebString WebFrameImpl::encoding() const
{
- return frame()->loader()->writer()->encoding();
+ return frame()->document()->loader()->writer()->encoding();
}
WebSize WebFrameImpl::scrollOffset() const
}
WebVector<WebFormElement> temp(formCount);
- for (size_t i = 0; i < formCount; ++i) {
- Node* node = forms->item(i);
+ size_t j = 0;
+ for (size_t sourceIndex = 0; j < forms->length(); ++sourceIndex) {
+ Node* node = forms->item(sourceIndex);
// Strange but true, sometimes item can be 0.
if (node && node->isHTMLElement())
- temp[i] = static_cast<HTMLFormElement*>(node);
+ temp[j++] = static_cast<HTMLFormElement*>(node);
}
+ ASSERT(j == formCount);
results.swap(temp);
}
RefPtr<HistoryItem> historyItem = PassRefPtr<HistoryItem>(item);
ASSERT(historyItem.get());
- // Sanity check for http://webkit.org/b/52819. It appears that some child
- // items of this item might be null. Try validating just the first set of
- // children in an attempt to catch it early.
- const HistoryItemVector& childItems = historyItem->children();
- int size = childItems.size();
- for (int i = 0; i < size; ++i) {
- RefPtr<HistoryItem> childItem = childItems[i].get();
- if (!childItem.get())
- CRASH();
- }
-
// If there is no currentItem, which happens when we are navigating in
// session history after a crash, we need to manufacture one otherwise WebKit
// hoarks. This is probably the wrong thing to do, but it seems to work.
return 0;
}
-#if OS(WINDOWS) || OS(LINUX) || OS(FREEBSD) || OS(SOLARIS)
- PlatformContextSkia context(canvas);
- GraphicsContext spool(&context);
-#elif OS(DARWIN)
- GraphicsContext spool(canvas);
- LocalCurrentGraphicsContext localContext(&spool);
-#endif
-
- return m_printContext->spoolPage(spool, page);
+ return m_printContext->spoolPage(GraphicsContextBuilder(canvas).context(), page);
}
void WebFrameImpl::printEnd()
RefPtr<Range> searchRange(rangeOfContents(frame()->document()));
+ Node* originalEndContainer = searchRange->endContainer();
+ int originalEndOffset = searchRange->endOffset();
+
ExceptionCode ec = 0, ec2 = 0;
if (m_resumeScopingFromRange.get()) {
// This is a continuation of a scoping operation that timed out and didn't
}
}
- Node* originalEndContainer = searchRange->endContainer();
- int originalEndOffset = searchRange->endOffset();
-
// This timeout controls how long we scope before releasing control. This
// value does not prevent us from running for longer than this, but it is
// periodically checked to see if we have exceeded our allocated time.
{
if (rect.isEmpty())
return;
-#if WEBKIT_USING_CG
- GraphicsContext gc(canvas);
- LocalCurrentGraphicsContext localContext(&gc);
-#elif WEBKIT_USING_SKIA
- PlatformContextSkia context(canvas);
-
- // PlatformGraphicsContext is actually a pointer to PlatformContextSkia
- GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context));
-#else
- notImplemented();
-#endif
- paintWithContext(gc, rect);
+ paintWithContext(GraphicsContextBuilder(canvas).context(), rect);
}
void WebFrameImpl::createFrameView()
view->setParentVisible(true);
}
-WebFrameImpl* WebFrameImpl::fromFrame(Frame* frame)
+WebFrameImpl* WebFrameImpl::fromFrame(const Frame* frame)
{
if (!frame)
return 0;
IntRect contentArea(
view->x(), view->y(), view->visibleWidth(), view->visibleHeight());
IntRect frameRect = view->frameRect();
- contentArea.move(-frameRect.topLeft().x(), -frameRect.topLeft().y());
+ contentArea.move(-frameRect.x(), -frameRect.y());
view->invalidateRect(contentArea);
}
ScrollbarTheme::nativeTheme()->scrollbarThickness(),
view->visibleHeight());
IntRect frameRect = view->frameRect();
- scrollBarVert.move(-frameRect.topLeft().x(), -frameRect.topLeft().y());
+ scrollBarVert.move(-frameRect.x(), -frameRect.y());
view->invalidateRect(scrollBarVert);
}
}
return;
if (!m_frame->navigationScheduler()->locationChangePending())
- m_frame->loader()->writer()->replaceDocument(scriptResult);
+ m_frame->document()->loader()->writer()->replaceDocument(scriptResult);
}
} // namespace WebKit