diff options
Diffstat (limited to 'WebCore/page/Frame.cpp')
-rw-r--r-- | WebCore/page/Frame.cpp | 209 |
1 files changed, 22 insertions, 187 deletions
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp index a8d58fd..1261d08 100644 --- a/WebCore/page/Frame.cpp +++ b/WebCore/page/Frame.cpp @@ -5,7 +5,7 @@ * 2000 Simon Hausmann <hausmann@kde.org> * 2000 Stefan Schimanski <1Stein@gmx.de> * 2001 George Staikos <staikos@kde.org> - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) * Copyright (C) 2008 Eric Seidel <eric@webkit.org> @@ -30,13 +30,13 @@ #include "Frame.h" #include "ApplyStyleCommand.h" -#include "BeforeUnloadEvent.h" #include "CSSComputedStyleDeclaration.h" #include "CSSMutableStyleDeclaration.h" #include "CSSProperty.h" #include "CSSPropertyNames.h" #include "CachedCSSStyleSheet.h" #include "Chrome.h" +#include "ChromeClient.h" #include "DOMWindow.h" #include "DocLoader.h" #include "DocumentType.h" @@ -94,6 +94,10 @@ #include "runtime_root.h" #endif +#if ENABLE(MATHML) +#include "MathMLNames.h" +#endif + #if ENABLE(SVG) #include "SVGDocument.h" #include "SVGDocumentExtensions.h" @@ -101,6 +105,7 @@ #include "XLinkNames.h" #endif +<<<<<<< HEAD #if PLATFORM(ANDROID) #include "WebViewCore.h" #endif @@ -113,10 +118,16 @@ #include "MathMLNames.h" #endif +======= +>>>>>>> webkit.org at r59636 #if ENABLE(TILED_BACKING_STORE) #include "TiledBackingStore.h" #endif +#if ENABLE(WML) +#include "WMLNames.h" +#endif + using namespace std; namespace WebCore { @@ -228,26 +239,6 @@ Frame::~Frame() ASSERT(!m_lifeSupportTimer.isActive()); } -void Frame::init() -{ - m_loader.init(); -} - -FrameLoader* Frame::loader() const -{ - return &m_loader; -} - -RedirectScheduler* Frame::redirectScheduler() const -{ - return &m_redirectScheduler; -} - -FrameView* Frame::view() const -{ - return m_view.get(); -} - void Frame::setView(PassRefPtr<FrameView> view) { // We the custom scroll bars as early as possible to prevent m_doc->detach() @@ -280,16 +271,6 @@ void Frame::setView(PassRefPtr<FrameView> view) #endif } -ScriptController* Frame::script() -{ - return &m_script; -} - -Document* Frame::document() const -{ - return m_doc.get(); -} - void Frame::setDocument(PassRefPtr<Document> newDoc) { if (m_doc && m_doc->attached() && !m_doc->inPageCache()) { @@ -366,16 +347,6 @@ IntRect Frame::firstRectForRange(Range* range) const startCaretRect.height()); } -SelectionController* Frame::selection() const -{ - return &m_selectionController; -} - -Editor* Frame::editor() const -{ - return &m_editor; -} - TextGranularity Frame::selectionGranularity() const { return m_selectionController.granularity(); @@ -386,12 +357,6 @@ SelectionController* Frame::dragCaretController() const return m_page->dragCaretController(); } - -AnimationController* Frame::animation() const -{ - return &m_animationController; -} - static RegularExpression* createRegExpForLabels(const Vector<String>& labels) { // REVIEW- version of this call in FrameMac.mm caches based on the NSArray ptrs being @@ -579,21 +544,6 @@ String Frame::matchLabelsAgainstElement(const Vector<String>& labels, Element* e return matchLabelsAgainstString(labels, element->getAttribute(idAttr)); } -const VisibleSelection& Frame::mark() const -{ - return m_mark; -} - -void Frame::setMark(const VisibleSelection& s) -{ - ASSERT(!s.base().node() || s.base().node()->document() == document()); - ASSERT(!s.extent().node() || s.extent().node()->document() == document()); - ASSERT(!s.start().node() || s.start().node()->document() == document()); - ASSERT(!s.end().node() || s.end().node()->document() == document()); - - m_mark = s; -} - void Frame::notifyRendererOfSelectionChange(bool userTriggered) { RenderObject* renderer = 0; @@ -672,11 +622,6 @@ void Frame::paintDragCaret(GraphicsContext* p, int tx, int ty, const IntRect& cl #endif } -float Frame::zoomFactor() const -{ - return m_zoomFactor; -} - ZoomMode Frame::zoomMode() const { return m_page->settings()->zoomMode(); @@ -755,16 +700,6 @@ void Frame::setJSDefaultStatusBarText(const String& text) m_page->chrome()->setStatusbarText(this, m_kjsDefaultStatusBarText); } -String Frame::jsStatusBarText() const -{ - return m_kjsStatusBarText; -} - -String Frame::jsDefaultStatusBarText() const -{ - return m_kjsDefaultStatusBarText; -} - void Frame::setNeedsReapplyStyles() { // When the frame is not showing web content, it doesn't make sense to apply styles. @@ -784,11 +719,6 @@ void Frame::setNeedsReapplyStyles() view()->scheduleRelayout(); } -bool Frame::needsReapplyStyles() const -{ - return m_needsReapplyStyles; -} - void Frame::reapplyStyles() { m_needsReapplyStyles = false; @@ -859,21 +789,11 @@ bool Frame::isContentEditable() const return m_doc->inDesignMode(); } -CSSMutableStyleDeclaration *Frame::typingStyle() const -{ - return m_typingStyle.get(); -} - void Frame::setTypingStyle(CSSMutableStyleDeclaration *style) { m_typingStyle = style; } -void Frame::clearTypingStyle() -{ - m_typingStyle = 0; -} - void Frame::computeAndSetTypingStyle(CSSStyleDeclaration *style, EditAction editingAction) { if (!style || !style->length()) { @@ -1028,10 +948,8 @@ void Frame::applyEditingStyleToBodyElement() const void Frame::removeEditingStyleFromBodyElement() const { - RefPtr<NodeList> list = m_doc->getElementsByTagName("body"); - unsigned len = list->length(); - for (unsigned i = 0; i < len; i++) - removeEditingStyleFromElement(static_cast<Element*>(list->item(i))); + // FIXME: This function does nothing. We should either implement it + // or remove it along with all call sites. } void Frame::applyEditingStyleToElement(Element* element) const @@ -1051,10 +969,6 @@ void Frame::applyEditingStyleToElement(Element* element) const ASSERT(!ec); } -void Frame::removeEditingStyleFromElement(Element*) const -{ -} - #ifndef NDEBUG static HashSet<Frame*>& keepAliveSet() { @@ -1116,11 +1030,6 @@ RenderView* Frame::contentRenderer() const return toRenderView(object); } -HTMLFrameOwnerElement* Frame::ownerElement() const -{ - return m_ownerElement; -} - RenderPart* Frame::ownerRenderer() const { HTMLFrameOwnerElement* ownerElement = m_ownerElement; @@ -1138,26 +1047,6 @@ RenderPart* Frame::ownerRenderer() const return toRenderPart(object); } -bool Frame::isDisconnected() const -{ - return m_isDisconnected; -} - -void Frame::setIsDisconnected(bool isDisconnected) -{ - m_isDisconnected = isDisconnected; -} - -bool Frame::excludeFromTextSearch() const -{ - return m_excludeFromTextSearch; -} - -void Frame::setExcludeFromTextSearch(bool exclude) -{ - m_excludeFromTextSearch = exclude; -} - // returns FloatRect because going through IntRect would truncate any floats FloatRect Frame::selectionBounds(bool clipToVisibleContent) const { @@ -1353,16 +1242,6 @@ void Frame::setSelectionFromNone() selection()->setSelection(VisibleSelection(Position(node, 0), DOWNSTREAM)); } -bool Frame::inViewSourceMode() const -{ - return m_inViewSourceMode; -} - -void Frame::setInViewSourceMode(bool mode) -{ - m_inViewSourceMode = mode; -} - // Searches from the beginning of the document if nothing is selected. bool Frame::findString(const String& target, bool forward, bool caseFlag, bool wrapFlag, bool startInSelection) { @@ -1507,11 +1386,6 @@ unsigned Frame::markAllMatchesForText(const String& target, bool caseFlag, unsig return matchCount; } -bool Frame::markedTextMatchesAreHighlighted() const -{ - return m_highlightTextMatches; -} - void Frame::setMarkedTextMatchesAreHighlighted(bool flag) { if (flag == m_highlightTextMatches) @@ -1521,11 +1395,6 @@ void Frame::setMarkedTextMatchesAreHighlighted(bool flag) document()->repaintMarkers(DocumentMarker::TextMatch); } -FrameTree* Frame::tree() const -{ - return &m_treeNode; -} - void Frame::setDOMWindow(DOMWindow* domWindow) { if (m_domWindow) { @@ -1548,21 +1417,6 @@ void Frame::clearFormerDOMWindow(DOMWindow* window) m_liveFormerWindows.remove(window); } -Page* Frame::page() const -{ - return m_page; -} - -void Frame::detachFromPage() -{ - m_page = 0; -} - -EventHandler* Frame::eventHandler() const -{ - return &m_eventHandler; -} - void Frame::pageDestroyed() { if (Frame* parent = tree()->parent()) @@ -1676,32 +1530,6 @@ void Frame::unfocusWindow() page()->chrome()->unfocus(); } -bool Frame::shouldClose() -{ - Chrome* chrome = page() ? page()->chrome() : 0; - if (!chrome || !chrome->canRunBeforeUnloadConfirmPanel()) - return true; - - if (!m_domWindow) - return true; - - RefPtr<Document> doc = document(); - HTMLElement* body = doc->body(); - if (!body) - return true; - - RefPtr<BeforeUnloadEvent> beforeUnloadEvent = BeforeUnloadEvent::create(); - m_domWindow->dispatchEvent(beforeUnloadEvent.get(), m_domWindow->document()); - - if (!beforeUnloadEvent->defaultPrevented()) - doc->defaultEventHandler(beforeUnloadEvent.get()); - if (beforeUnloadEvent->result().isNull()) - return true; - - String text = doc->displayStringModifiedByEncoding(beforeUnloadEvent->result()); - return chrome->runBeforeUnloadConfirmPanel(text, this); -} - void Frame::scheduleClose() { if (!shouldClose()) @@ -1873,6 +1701,13 @@ IntRect Frame::tiledBackingStoreContentsRect() return IntRect(); return IntRect(IntPoint(), m_view->contentsSize()); } + +IntRect Frame::tiledBackingStoreVisibleRect() +{ + if (!m_page) + return IntRect(); + return m_page->chrome()->client()->visibleRectForTiledBackingStore(); +} #endif String Frame::layerTreeAsText() const |