diff options
author | Kristian Monsen <kristianm@google.com> | 2010-06-28 16:42:48 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2010-07-02 10:29:56 +0100 |
commit | 06ea8e899e48f1f2f396b70e63fae369f2f23232 (patch) | |
tree | 20c1428cd05c76f32394ab354ea35ed99acd86d8 /WebCore/page | |
parent | 72aad67af14193199e29cdd5c4ddc095a8b9a8a8 (diff) | |
download | external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.zip external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.gz external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.bz2 |
Merge WebKit at r61871: Initial merge by git.
Change-Id: I6cff43abca9cc4782e088a469ad4f03f166a65d5
Diffstat (limited to 'WebCore/page')
27 files changed, 507 insertions, 205 deletions
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp index 413dba1..40b7494 100644 --- a/WebCore/page/DOMWindow.cpp +++ b/WebCore/page/DOMWindow.cpp @@ -26,6 +26,7 @@ #include "config.h" #include "DOMWindow.h" +#include "AbstractDatabase.h" #include "Base64.h" #include "BarInfo.h" #include "BeforeUnloadEvent.h" @@ -229,7 +230,7 @@ bool DOMWindow::dispatchAllPendingBeforeUnloadEvents() if (!frame) continue; - if (!frame->shouldClose()) + if (!frame->loader()->shouldClose()) return false; } @@ -756,7 +757,18 @@ void DOMWindow::focus() if (!m_frame) return; - m_frame->focusWindow(); + Page* page = m_frame->page(); + if (!page) + return; + + // If we're a top level window, bring the window to the front. + if (m_frame == page->mainFrame()) + page->chrome()->focus(); + + if (!m_frame) + return; + + m_frame->eventHandler()->focusDocumentView(); } void DOMWindow::blur() @@ -764,7 +776,14 @@ void DOMWindow::blur() if (!m_frame) return; - m_frame->unfocusWindow(); + Page* page = m_frame->page(); + if (!page) + return; + + if (m_frame != page->mainFrame()) + return; + + page->chrome()->unfocus(); } void DOMWindow::close() @@ -782,8 +801,13 @@ void DOMWindow::close() Settings* settings = m_frame->settings(); bool allowScriptsToCloseWindows = settings && settings->allowScriptsToCloseWindows(); - if (page->openedByDOM() || page->getHistoryLength() <= 1 || allowScriptsToCloseWindows) - m_frame->scheduleClose(); + if (!(page->openedByDOM() || page->getHistoryLength() <= 1 || allowScriptsToCloseWindows)) + return; + + if (!m_frame->loader()->shouldClose()) + return; + + page->chrome()->closeWindowSoon(); } void DOMWindow::print() @@ -1064,36 +1088,34 @@ void DOMWindow::setName(const String& string) m_frame->tree()->setName(string); } -String DOMWindow::status() const +void DOMWindow::setStatus(const String& string) { - if (!m_frame) - return String(); + m_status = string; - return m_frame->jsStatusBarText(); -} + if (!m_frame) + return; -void DOMWindow::setStatus(const String& string) -{ - if (!m_frame) - return; + Page* page = m_frame->page(); + if (!page) + return; - m_frame->setJSStatusBarText(string); + ASSERT(m_frame->document()); // Client calls shouldn't be made when the frame is in inconsistent state. + page->chrome()->setStatusbarText(m_frame, m_status); } -String DOMWindow::defaultStatus() const +void DOMWindow::setDefaultStatus(const String& string) { - if (!m_frame) - return String(); + m_defaultStatus = string; - return m_frame->jsDefaultStatusBarText(); -} + if (!m_frame) + return; -void DOMWindow::setDefaultStatus(const String& string) -{ - if (!m_frame) - return; + Page* page = m_frame->page(); + if (!page) + return; - m_frame->setJSDefaultStatusBarText(string); + ASSERT(m_frame->document()); // Client calls shouldn't be made when the frame is in inconsistent state. + page->chrome()->setStatusbarText(m_frame, m_defaultStatus); } DOMWindow* DOMWindow::self() const @@ -1219,7 +1241,7 @@ double DOMWindow::devicePixelRatio() const PassRefPtr<Database> DOMWindow::openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec) { RefPtr<Database> database = 0; - if (m_frame && Database::isAvailable() && m_frame->document()->securityOrigin()->canAccessDatabase()) + if (m_frame && AbstractDatabase::isAvailable() && m_frame->document()->securityOrigin()->canAccessDatabase()) database = Database::openDatabase(m_frame->document(), name, version, displayName, estimatedSize, creationCallback, ec); if (!database && !ec) diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h index a1f40a8..4765b31 100644 --- a/WebCore/page/DOMWindow.h +++ b/WebCore/page/DOMWindow.h @@ -410,8 +410,21 @@ namespace WebCore { #endif EventTargetData m_eventTargetData; + + String m_status; + String m_defaultStatus; }; + inline String DOMWindow::status() const + { + return m_status; + } + + inline String DOMWindow::defaultStatus() const + { + return m_defaultStatus; + } + } // namespace WebCore #endif // DOMWindow_h diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl index bf1d55d..5b1000a 100644 --- a/WebCore/page/DOMWindow.idl +++ b/WebCore/page/DOMWindow.idl @@ -54,7 +54,7 @@ module window { attribute [Replaceable] BarInfo toolbar; attribute [Replaceable] Navigator navigator; attribute [Replaceable] Navigator clientInformation; - attribute [DoNotCheckDomainSecurity, JSCCustom, V8CustomSetter, V8DisallowShadowing] Location location; + attribute [DoNotCheckDomainSecurity, JSCCustom, V8CustomSetter, V8DisallowShadowing, CPPCustom] Location location; attribute [Replaceable, CustomGetter, V8CustomSetter] Event event; @@ -730,6 +730,10 @@ module window { #endif #endif +#if defined(ENABLE_DATABASE) + attribute SQLExceptionConstructor SQLException; +#endif + attribute [Conditional=TOUCH_EVENTS] TouchEventConstructor TouchEvent; attribute DOMFormDataConstructor FormData; @@ -737,6 +741,8 @@ module window { attribute [Conditional=FILE_READER|FILE_WRITER] FileErrorConstructor FileError; attribute [Conditional=FILE_READER] FileReaderConstructor FileReader; + attribute BlobBuilderConstructor BlobBuilder; + #endif // defined(LANGUAGE_JAVASCRIPT) #if defined(V8_BINDING) && V8_BINDING diff --git a/WebCore/page/EditorClient.h b/WebCore/page/EditorClient.h index cdf0bd8..69f48e7 100644 --- a/WebCore/page/EditorClient.h +++ b/WebCore/page/EditorClient.h @@ -34,11 +34,18 @@ #include <wtf/Vector.h> #if PLATFORM(MAC) +#ifdef __OBJC__ +@class NSArray; +@class NSData; +@class NSString; +@class NSURL; +#else class NSArray; class NSData; class NSString; class NSURL; #endif +#endif namespace WebCore { diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp index 5fde80e..c28b1a5 100644 --- a/WebCore/page/EventHandler.cpp +++ b/WebCore/page/EventHandler.cpp @@ -1014,6 +1014,9 @@ bool EventHandler::scrollOverflow(ScrollDirection direction, ScrollGranularity g bool EventHandler::scrollRecursively(ScrollDirection direction, ScrollGranularity granularity, Node* startingNode) { + // The layout needs to be up to date to determine if we can scroll. We may be + // here because of an onLoad event, in which case the final layout hasn't been performed yet. + m_frame->document()->updateLayoutIgnorePendingStylesheets(); bool handled = scrollOverflow(direction, granularity, startingNode); if (!handled) { Frame* frame = m_frame; diff --git a/WebCore/page/EventSource.idl b/WebCore/page/EventSource.idl index be01098..9da7017 100644 --- a/WebCore/page/EventSource.idl +++ b/WebCore/page/EventSource.idl @@ -1,6 +1,6 @@ /* - * Copyright (C) 2009 Ericsson AB - * All rights reserved. + * Copyright (C) 2009 Ericsson AB. All rights reserved. + * Copyright (C) 2010 Apple Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,7 +33,10 @@ module window { interface [ Conditional=EVENTSOURCE, - CustomConstructor, + CanBeConstructed, + CustomConstructFunction, + ConstructorParameters=1, + V8CustomConstructor, EventTarget, NoStaticTables ] EventSource { diff --git a/WebCore/page/FocusController.cpp b/WebCore/page/FocusController.cpp index 804341d..e9f180b 100644 --- a/WebCore/page/FocusController.cpp +++ b/WebCore/page/FocusController.cpp @@ -319,7 +319,7 @@ bool FocusController::advanceFocusDirectionally(FocusDirection direction, Keyboa // if |node| element is not in the viewport. if (hasOffscreenRect(node)) { Frame* frame = node->document()->view()->frame(); - scrollInDirection(frame, direction); + scrollInDirection(frame, direction, focusCandidate); return true; } @@ -341,103 +341,152 @@ bool FocusController::advanceFocusDirectionally(FocusDirection direction, Keyboa return true; } -// FIXME: Make this method more modular, and simpler to understand and maintain. -static void updateFocusCandidateIfCloser(Node* focusedNode, const FocusCandidate& candidate, FocusCandidate& closest) +static void updateFocusCandidateInSameContainer(const FocusCandidate& candidate, FocusCandidate& closest) { - bool sameDocument = candidate.document() == closest.document(); - if (sameDocument) { - if (closest.alignment > candidate.alignment - || (closest.parentAlignment && candidate.alignment > closest.parentAlignment)) - return; - } else if (closest.alignment > candidate.alignment - && (closest.parentAlignment && candidate.alignment > closest.parentAlignment)) + if (closest.isNull()) { + closest = candidate; return; + } - if (candidate.alignment != None - || (closest.parentAlignment >= candidate.alignment - && closest.document() == candidate.document())) { + if (candidate.alignment == closest.alignment) { + if (candidate.distance < closest.distance) + closest = candidate; + return; + } + + if (candidate.alignment > closest.alignment) + closest = candidate; +} - // If we are now in an higher precedent case, lets reset the current closest's - // distance so we force it to be bigger than any result we will get from - // spatialDistance(). - if (closest.alignment < candidate.alignment - && closest.parentAlignment < candidate.alignment) - closest.distance = maxDistance(); +static void updateFocusCandidateIfCloser(Node* focusedNode, const FocusCandidate& candidate, FocusCandidate& closest) +{ + // First, check the common case: neither candidate nor closest are + // inside scrollable content, then no need to care about enclosingScrollableBox + // heuristics or parent{Distance,Alignment}, but only distance and alignment. + if (!candidate.inScrollableContainer() && !closest.inScrollableContainer()) { + updateFocusCandidateInSameContainer(candidate, closest); + return; } - // Bail out if candidate's distance is larger than that of the closest candidate. - if (candidate.distance >= closest.distance) + bool sameContainer = candidate.document() == closest.document() && candidate.enclosingScrollableBox == closest.enclosingScrollableBox; + + // Second, if candidate and closest are in the same "container" (i.e. {i}frame or any + // scrollable block element), we can handle them as common case. + if (sameContainer) { + updateFocusCandidateInSameContainer(candidate, closest); return; + } - if (closest.isNull()) { + // Last, we are considering moving to a candidate located in a different enclosing + // scrollable box than closest. + bool isInInnerDocument = !isInRootDocument(focusedNode); + + bool sameContainerAsCandidate = isInInnerDocument ? focusedNode->document() == candidate.document() : + focusedNode->isDescendantOf(candidate.enclosingScrollableBox); + + bool sameContainerAsClosest = isInInnerDocument ? focusedNode->document() == closest.document() : + focusedNode->isDescendantOf(closest.enclosingScrollableBox); + + // sameContainerAsCandidate and sameContainerAsClosest are mutually exclusive. + ASSERT(!(sameContainerAsCandidate && sameContainerAsClosest)); + + if (sameContainerAsCandidate) { closest = candidate; return; } - // If the focused node and the candadate are in the same document and current - // closest candidate is not in an {i}frame that is preferable to get focused ... - if (focusedNode->document() == candidate.document() - && candidate.distance < closest.parentDistance) - closest = candidate; - else if (focusedNode->document() != candidate.document()) { - // If the focusedNode is in an inner document and candidate is in a - // different document, we only consider to change focus if there is not - // another already good focusable candidate in the same document as focusedNode. - if (!((isInRootDocument(candidate.node) && !isInRootDocument(focusedNode)) - && focusedNode->document() == closest.document())) + if (sameContainerAsClosest) { + // Nothing to be done. + return; + } + + // NOTE: !sameContainerAsCandidate && !sameContainerAsClosest + // If distance is shorter, and we are talking about scrollable container, + // lets compare parent distance and alignment before anything. + if (candidate.distance < closest.distance) { + if (candidate.alignment >= closest.parentAlignment + || candidate.parentAlignment == closest.parentAlignment) { + closest = candidate; + return; + } + + } else if (candidate.parentDistance < closest.distance) { + if (candidate.parentAlignment >= closest.alignment) { closest = candidate; + return; + } } } void FocusController::findFocusableNodeInDirection(Node* outer, Node* focusedNode, FocusDirection direction, KeyboardEvent* event, - FocusCandidate& closestFocusCandidate, - const FocusCandidate& candidateParent) + FocusCandidate& closest, const FocusCandidate& candidateParent) { ASSERT(outer); ASSERT(candidateParent.isNull() || candidateParent.node->hasTagName(frameTag) - || candidateParent.node->hasTagName(iframeTag)); + || candidateParent.node->hasTagName(iframeTag) + || isScrollableContainerNode(candidateParent.node)); + + // Walk all the child nodes and update closest if we find a nearer node. + Node* node = outer; + while (node) { - // Walk all the child nodes and update closestFocusCandidate if we find a nearer node. - Node* candidate = outer; - while (candidate) { // Inner documents case. + if (node->isFrameOwnerElement()) { + deepFindFocusableNodeInDirection(node, focusedNode, direction, event, closest); + + // Scrollable block elements (e.g. <div>, etc) case. + } else if (isScrollableContainerNode(node)) { + deepFindFocusableNodeInDirection(node, focusedNode, direction, event, closest); + node = node->traverseNextSibling(); + continue; + + } else if (node != focusedNode && node->isKeyboardFocusable(event)) { + FocusCandidate candidate(node); + + // There are two ways to identify we are in a recursive call from deepFindFocusableNodeInDirection + // (i.e. processing an element in an iframe, frame or a scrollable block element): + + // 1) If candidateParent is not null, and it holds the distance and alignment data of the + // parent container element itself; + // 2) Parent of outer is <frame> or <iframe>; + // 3) Parent is any other scrollable block element. + if (!candidateParent.isNull()) { + candidate.parentAlignment = candidateParent.alignment; + candidate.parentDistance = candidateParent.distance; + candidate.enclosingScrollableBox = candidateParent.node; + + } else if (!isInRootDocument(outer)) { + if (Document* document = static_cast<Document*>(outer->parent())) + candidate.enclosingScrollableBox = static_cast<Node*>(document->ownerElement()); - if (candidate->isFrameOwnerElement()) - deepFindFocusableNodeInDirection(candidate, focusedNode, direction, event, closestFocusCandidate); - else if (candidate != focusedNode && candidate->isKeyboardFocusable(event)) { - FocusCandidate currentFocusCandidate(candidate); + } else if (isScrollableContainerNode(outer->parent())) + candidate.enclosingScrollableBox = outer->parent(); // Get distance and alignment from current candidate. - distanceDataForNode(direction, focusedNode, currentFocusCandidate); + distanceDataForNode(direction, focusedNode, candidate); // Bail out if distance is maximum. - if (currentFocusCandidate.distance == maxDistance()) { - candidate = candidate->traverseNextNode(outer->parent()); + if (candidate.distance == maxDistance()) { + node = node->traverseNextNode(outer->parent()); continue; } - // If candidateParent is not null, it means that we are in a recursive call - // from deepFineFocusableNodeInDirection (i.e. processing an element in an iframe), - // and holds the distance and alignment data of the iframe element itself. - if (!candidateParent.isNull()) { - currentFocusCandidate.parentAlignment = candidateParent.alignment; - currentFocusCandidate.parentDistance = candidateParent.distance; - } - - updateFocusCandidateIfCloser(focusedNode, currentFocusCandidate, closestFocusCandidate); + updateFocusCandidateIfCloser(focusedNode, candidate, closest); } - candidate = candidate->traverseNextNode(outer->parent()); + node = node->traverseNextNode(outer->parent()); } } void FocusController::deepFindFocusableNodeInDirection(Node* container, Node* focusedNode, FocusDirection direction, KeyboardEvent* event, - FocusCandidate& closestFocusCandidate) + FocusCandidate& closest) { - ASSERT(container->hasTagName(frameTag) || container->hasTagName(iframeTag)); + ASSERT(container->hasTagName(frameTag) + || container->hasTagName(iframeTag) + || isScrollableContainerNode(container)); // Track if focusedNode is a descendant of the current container node being processed. bool descendantOfContainer = false; @@ -457,10 +506,15 @@ void FocusController::deepFindFocusableNodeInDirection(Node* container, Node* fo descendantOfContainer = innerDocument == focusedNode->document(); firstChild = innerDocument->firstChild(); + // Scrollable block elements (e.g. <div>, etc) + } else if (isScrollableContainerNode(container)) { + + firstChild = container->firstChild(); + descendantOfContainer = focusedNode->isDescendantOf(container); } if (descendantOfContainer) { - findFocusableNodeInDirection(firstChild, focusedNode, direction, event, closestFocusCandidate); + findFocusableNodeInDirection(firstChild, focusedNode, direction, event, closest); return; } @@ -474,8 +528,8 @@ void FocusController::deepFindFocusableNodeInDirection(Node* container, Node* fo return; // FIXME: Consider alignment? - if (candidateParent.distance < closestFocusCandidate.distance) - findFocusableNodeInDirection(firstChild, focusedNode, direction, event, closestFocusCandidate, candidateParent); + if (candidateParent.distance < closest.distance) + findFocusableNodeInDirection(firstChild, focusedNode, direction, event, closest, candidateParent); } static bool relinquishesEditingFocus(Node *node) @@ -540,20 +594,23 @@ bool FocusController::setFocusedNode(Node* node, PassRefPtr<Frame> newFocusedFra // FIXME: Might want to disable this check for caretBrowsing if (oldFocusedNode && oldFocusedNode->rootEditableElement() == oldFocusedNode && !relinquishesEditingFocus(oldFocusedNode)) return false; - + + // Set input method state before changing the focused node, so that the + // input method can still have a chance to finish the ongoing composition + // session. + m_page->editorClient()->setInputMethodState(node ? node->shouldUseInputMethod() : false); + clearSelectionIfNeeded(oldFocusedFrame.get(), newFocusedFrame.get(), node); - + if (!node) { if (oldDocument) oldDocument->setFocusedNode(0); - m_page->editorClient()->setInputMethodState(false); return true; } RefPtr<Document> newDocument = node->document(); if (newDocument && newDocument->focusedNode() == node) { - m_page->editorClient()->setInputMethodState(node->shouldUseInputMethod()); return true; } @@ -565,8 +622,6 @@ bool FocusController::setFocusedNode(Node* node, PassRefPtr<Frame> newFocusedFra if (newDocument) newDocument->setFocusedNode(node); - m_page->editorClient()->setInputMethodState(node->shouldUseInputMethod()); - return true; } diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp index fb658d2..75a4598 100644 --- a/WebCore/page/Frame.cpp +++ b/WebCore/page/Frame.cpp @@ -135,7 +135,7 @@ static inline Frame* parentFromOwnerElement(HTMLFrameOwnerElement* ownerElement) return ownerElement->document()->frame(); } -Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* frameLoaderClient) +inline Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* frameLoaderClient) : m_page(page) , m_treeNode(this, parentFromOwnerElement(ownerElement)) , m_loader(this, frameLoaderClient) @@ -178,16 +178,17 @@ Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* XMLNames::init(); if (!ownerElement) { - page->setMainFrame(this); #if ENABLE(TILED_BACKING_STORE) // Top level frame only for now. setTiledBackingStoreEnabled(page->settings()->tiledBackingStoreEnabled()); #endif } else { page->incrementFrameCount(); + // Make sure we will not end up with two frames referencing the same owner element. - ASSERT((!(ownerElement->m_contentFrame)) || (ownerElement->m_contentFrame->ownerElement() != ownerElement)); - ownerElement->m_contentFrame = this; + Frame*& contentFrameSlot = ownerElement->m_contentFrame; + ASSERT(!contentFrameSlot || contentFrameSlot->ownerElement() != ownerElement); + contentFrameSlot = this; } #ifndef NDEBUG @@ -195,6 +196,14 @@ Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* #endif } +PassRefPtr<Frame> Frame::create(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* client) +{ + RefPtr<Frame> frame = adoptRef(new Frame(page, ownerElement, client)); + if (!ownerElement) + page->setMainFrame(frame); + return frame.release(); +} + Frame::~Frame() { setView(0); @@ -624,22 +633,6 @@ void Frame::setPrinting(bool printing, float minPageWidth, float maxPageWidth, b child->setPrinting(printing, minPageWidth, maxPageWidth, adjustViewSize); } -void Frame::setJSStatusBarText(const String& text) -{ - ASSERT(m_doc); // Client calls shouldn't be made when the frame is in inconsistent state. - m_kjsStatusBarText = text; - if (m_page) - m_page->chrome()->setStatusbarText(this, m_kjsStatusBarText); -} - -void Frame::setJSDefaultStatusBarText(const String& text) -{ - ASSERT(m_doc); // Client calls shouldn't be made when the frame is in inconsistent state. - m_kjsDefaultStatusBarText = text; - if (m_page) - m_page->chrome()->setStatusbarText(this, m_kjsDefaultStatusBarText); -} - void Frame::setNeedsReapplyStyles() { // When the frame is not showing web content, it doesn't make sense to apply styles. @@ -1436,6 +1429,7 @@ String Frame::documentTypeString() const return String(); } +<<<<<<< HEAD void Frame::focusWindow() { if (!page()) @@ -1474,6 +1468,8 @@ void Frame::scheduleClose() chrome->closeWindowSoon(); } +======= +>>>>>>> webkit.org at r61871 void Frame::respondToChangedSelection(const VisibleSelection& oldSelection, bool closeTyping) { bool isContinuousSpellCheckingEnabled = editor()->isContinuousSpellCheckingEnabled(); diff --git a/WebCore/page/Frame.h b/WebCore/page/Frame.h index cb7e977..c2d364f 100644 --- a/WebCore/page/Frame.h +++ b/WebCore/page/Frame.h @@ -76,10 +76,7 @@ namespace WebCore { #endif { public: - static PassRefPtr<Frame> create(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* client) - { - return adoptRef(new Frame(page, ownerElement, client)); - } + static PassRefPtr<Frame> create(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*); void setView(PassRefPtr<FrameView>); ~Frame(); @@ -189,19 +186,6 @@ namespace WebCore { private: void lifeSupportTimerFired(Timer<Frame>*); - // === to be moved into Chrome - - public: - void focusWindow(); - void unfocusWindow(); - bool shouldClose(); - void scheduleClose(); - - void setJSStatusBarText(const String&); - void setJSDefaultStatusBarText(const String&); - String jsStatusBarText() const; - String jsDefaultStatusBarText() const; - // === to be moved into Editor public: @@ -336,9 +320,6 @@ namespace WebCore { ScriptController m_script; - String m_kjsStatusBarText; - String m_kjsDefaultStatusBarText; - mutable VisibleSelection m_mark; mutable Editor m_editor; mutable SelectionController m_selectionController; @@ -424,16 +405,6 @@ namespace WebCore { m_mark = s; } - inline String Frame::jsStatusBarText() const - { - return m_kjsStatusBarText; - } - - inline String Frame::jsDefaultStatusBarText() const - { - return m_kjsDefaultStatusBarText; - } - inline bool Frame::needsReapplyStyles() const { return m_needsReapplyStyles; @@ -509,13 +480,6 @@ namespace WebCore { return &m_eventHandler; } - inline bool Frame::shouldClose() - { - // FIXME: Some WebKit clients call Frame::shouldClose() directly. - // We should transition them to calling FrameLoader::shouldClose() then get rid of this method. - return m_loader.shouldClose(); - } - } // namespace WebCore #endif // Frame_h diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp index 6fe8d38..500a6dd 100644 --- a/WebCore/page/FrameView.cpp +++ b/WebCore/page/FrameView.cpp @@ -90,23 +90,25 @@ using namespace HTMLNames; double FrameView::sCurrentPaintTimeStamp = 0.0; +// REPAINT_THROTTLING now chooses default values for throttling parameters. +// Should be removed when applications start using runtime configuration. #if ENABLE(REPAINT_THROTTLING) // Normal delay -static const double deferredRepaintDelay = 0.025; +double FrameView::s_deferredRepaintDelay = 0.025; // Negative value would mean that first few repaints happen without a delay -static const double initialDeferredRepaintDelayDuringLoading = 0; +double FrameView::s_initialDeferredRepaintDelayDuringLoading = 0; // The delay grows on each repaint to this maximum value -static const double maxDeferredRepaintDelayDuringLoading = 2.5; +double FrameView::s_maxDeferredRepaintDelayDuringLoading = 2.5; // On each repaint the delay increses by this amount -static const double deferredRepaintDelayIncrementDuringLoading = 0.5; +double FrameView::s_deferredRepaintDelayIncrementDuringLoading = 0.5; #else // FIXME: Repaint throttling could be good to have on all platform. // The balance between CPU use and repaint frequency will need some tuning for desktop. // More hooks may be needed to reset the delay on things like GIF and CSS animations. -static const double deferredRepaintDelay = 0; -static const double initialDeferredRepaintDelayDuringLoading = 0; -static const double maxDeferredRepaintDelayDuringLoading = 0; -static const double deferredRepaintDelayIncrementDuringLoading = 0; +double FrameView::s_deferredRepaintDelay = 0; +double FrameView::s_initialDeferredRepaintDelayDuringLoading = 0; +double FrameView::s_maxDeferredRepaintDelayDuringLoading = 0; +double FrameView::s_deferredRepaintDelayIncrementDuringLoading = 0; #endif // The maximum number of updateWidgets iterations that should be done before returning. @@ -222,7 +224,7 @@ void FrameView::reset() m_deferringRepaints = 0; m_repaintCount = 0; m_repaintRects.clear(); - m_deferredRepaintDelay = initialDeferredRepaintDelayDuringLoading; + m_deferredRepaintDelay = s_initialDeferredRepaintDelayDuringLoading; m_deferredRepaintTimer.stop(); m_lastPaintTime = 0; m_paintBehavior = PaintBehaviorNormal; @@ -930,6 +932,8 @@ void FrameView::removeSlowRepaintObject() void FrameView::addFixedObject() { + if (!m_fixedObjectCount && platformWidget()) + setCanBlitOnScroll(false); ++m_fixedObjectCount; } @@ -937,6 +941,64 @@ void FrameView::removeFixedObject() { ASSERT(m_fixedObjectCount > 0); --m_fixedObjectCount; + if (!m_fixedObjectCount) + setCanBlitOnScroll(!useSlowRepaints()); +} + +bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) +{ + const size_t fixedObjectThreshold = 5; + + RenderBlock::PositionedObjectsListHashSet* positionedObjects = 0; + if (RenderView* root = m_frame->contentRenderer()) + positionedObjects = root->positionedObjects(); + + if (!positionedObjects || positionedObjects->isEmpty()) { + hostWindow()->scroll(scrollDelta, rectToScroll, clipRect); + return true; + } + + // Get the rects of the fixed objects visible in the rectToScroll + Vector<IntRect, fixedObjectThreshold> subRectToUpdate; + bool updateInvalidatedSubRect = true; + RenderBlock::PositionedObjectsListHashSet::const_iterator end = positionedObjects->end(); + for (RenderBlock::PositionedObjectsListHashSet::const_iterator it = positionedObjects->begin(); it != end; ++it) { + RenderBox* renderBox = *it; + if (renderBox->style()->position() != FixedPosition) + continue; + IntRect updateRect = renderBox->layer()->repaintRectIncludingDescendants(); + updateRect = contentsToWindow(updateRect); + + updateRect.intersect(rectToScroll); + if (!updateRect.isEmpty()) { + if (subRectToUpdate.size() >= fixedObjectThreshold) { + updateInvalidatedSubRect = false; + break; + } + subRectToUpdate.append(updateRect); + } + } + + // Scroll the view + if (updateInvalidatedSubRect) { + // 1) scroll + hostWindow()->scroll(scrollDelta, rectToScroll, clipRect); + + // 2) update the area of fixed objects that has been invalidated + size_t fixObjectsCount = subRectToUpdate.size(); + for (size_t i = 0; i < fixObjectsCount; ++i) { + IntRect updateRect = subRectToUpdate[i]; + IntRect scrolledRect = updateRect; + scrolledRect.move(scrollDelta); + updateRect.unite(scrolledRect); + updateRect.intersect(rectToScroll); + hostWindow()->invalidateContentsAndWindow(updateRect, false); + } + return true; + } + + // the number of fixed objects exceed the threshold, we cannot use the fast path + return false; } void FrameView::setIsOverlapped(bool isOverlapped) @@ -1240,13 +1302,13 @@ void FrameView::updateDeferredRepaintDelay() { Document* document = m_frame->document(); if (!document || (!document->parsing() && !document->docLoader()->requestCount())) { - m_deferredRepaintDelay = deferredRepaintDelay; + m_deferredRepaintDelay = s_deferredRepaintDelay; return; } - if (m_deferredRepaintDelay < maxDeferredRepaintDelayDuringLoading) { - m_deferredRepaintDelay += deferredRepaintDelayIncrementDuringLoading; - if (m_deferredRepaintDelay > maxDeferredRepaintDelayDuringLoading) - m_deferredRepaintDelay = maxDeferredRepaintDelayDuringLoading; + if (m_deferredRepaintDelay < s_maxDeferredRepaintDelayDuringLoading) { + m_deferredRepaintDelay += s_deferredRepaintDelayIncrementDuringLoading; + if (m_deferredRepaintDelay > s_maxDeferredRepaintDelayDuringLoading) + m_deferredRepaintDelay = s_maxDeferredRepaintDelayDuringLoading; } } @@ -2251,4 +2313,29 @@ void FrameView::setZoomFactor(float percent, ZoomMode mode) layout(); } + +// Normal delay +void FrameView::setRepaintThrottlingDeferredRepaintDelay(double p) +{ + s_deferredRepaintDelay = p; +} + +// Negative value would mean that first few repaints happen without a delay +void FrameView::setRepaintThrottlingnInitialDeferredRepaintDelayDuringLoading(double p) +{ + s_initialDeferredRepaintDelayDuringLoading = p; +} + +// The delay grows on each repaint to this maximum value +void FrameView::setRepaintThrottlingMaxDeferredRepaintDelayDuringLoading(double p) +{ + s_maxDeferredRepaintDelayDuringLoading = p; +} + +// On each repaint the delay increases by this amount +void FrameView::setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading(double p) +{ + s_deferredRepaintDelayIncrementDuringLoading = p; +} + } // namespace WebCore diff --git a/WebCore/page/FrameView.h b/WebCore/page/FrameView.h index 69cc67a..b047db0 100644 --- a/WebCore/page/FrameView.h +++ b/WebCore/page/FrameView.h @@ -46,7 +46,7 @@ class RenderLayer; class RenderObject; class RenderEmbeddedObject; class RenderScrollbarPart; -class ScheduledEvent; +struct ScheduledEvent; class String; template <typename T> class Timer; @@ -222,6 +222,18 @@ public: float pageZoomFactor() const { return shouldApplyPageZoom() ? m_zoomFactor : 1.0f; } float textZoomFactor() const { return shouldApplyTextZoom() ? m_zoomFactor : 1.0f; } + // Normal delay + static void setRepaintThrottlingDeferredRepaintDelay(double p); + // Negative value would mean that first few repaints happen without a delay + static void setRepaintThrottlingnInitialDeferredRepaintDelayDuringLoading(double p); + // The delay grows on each repaint to this maximum value + static void setRepaintThrottlingMaxDeferredRepaintDelayDuringLoading(double p); + // On each repaint the delay increses by this amount + static void setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading(double p); + +protected: + virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect); + private: FrameView(Frame*); @@ -354,6 +366,11 @@ private: RenderScrollbarPart* m_scrollCorner; float m_zoomFactor; + + static double s_deferredRepaintDelay; + static double s_initialDeferredRepaintDelayDuringLoading; + static double s_maxDeferredRepaintDelayDuringLoading; + static double s_deferredRepaintDelayIncrementDuringLoading; }; #if ENABLE(INSPECTOR) diff --git a/WebCore/page/OriginAccessEntry.h b/WebCore/page/OriginAccessEntry.h index 7c8d556..67e39fe 100644 --- a/WebCore/page/OriginAccessEntry.h +++ b/WebCore/page/OriginAccessEntry.h @@ -28,8 +28,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef CrossOriginAccess_h -#define CrossOriginAccess_h +#ifndef OriginAccessEntry_h +#define OriginAccessEntry_h #include "PlatformString.h" @@ -71,4 +71,4 @@ inline bool operator!=(const OriginAccessEntry& a, const OriginAccessEntry& b) } // namespace WebCore -#endif // CrossOriginAccess_h +#endif // OriginAccessEntry_h diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp index 446f9f0..d5074aa 100644 --- a/WebCore/page/Page.cpp +++ b/WebCore/page/Page.cpp @@ -404,7 +404,7 @@ void Page::refreshPlugins(bool reload) continue; for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) { - if (frame->loader()->containsPlugins()) + if (frame->loader()->subframeLoader()->containsPlugins()) framesNeedingReload.append(frame); } } @@ -415,7 +415,7 @@ void Page::refreshPlugins(bool reload) PluginData* Page::pluginData() const { - if (!mainFrame()->loader()->allowPlugins(NotAboutToInstantiatePlugin)) + if (!mainFrame()->loader()->subframeLoader()->allowPlugins(NotAboutToInstantiatePlugin)) return 0; if (!m_pluginData) m_pluginData = PluginData::create(this); diff --git a/WebCore/page/PageGroupLoadDeferrer.cpp b/WebCore/page/PageGroupLoadDeferrer.cpp index 122658b..ced8f36 100644 --- a/WebCore/page/PageGroupLoadDeferrer.cpp +++ b/WebCore/page/PageGroupLoadDeferrer.cpp @@ -43,8 +43,10 @@ PageGroupLoadDeferrer::PageGroupLoadDeferrer(Page* page, bool deferSelf) // This code is not logically part of load deferring, but we do not want JS code executed beneath modal // windows or sheets, which is exactly when PageGroupLoadDeferrer is used. - for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree()->traverseNext()) + for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree()->traverseNext()) { frame->document()->suspendActiveDOMObjects(); + frame->document()->suspendExecuteScriptSoonTimer(); + } } } @@ -60,8 +62,10 @@ PageGroupLoadDeferrer::~PageGroupLoadDeferrer() if (Page* page = m_deferredFrames[i]->page()) { page->setDefersLoading(false); - for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) + for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) { frame->document()->resumeActiveDOMObjects(); + frame->document()->resumeExecuteScriptSoonTimer(); + } } } } diff --git a/WebCore/page/PrintContext.cpp b/WebCore/page/PrintContext.cpp index bc4b31a..4ab7367 100644 --- a/WebCore/page/PrintContext.cpp +++ b/WebCore/page/PrintContext.cpp @@ -199,6 +199,42 @@ int PrintContext::pageNumberForElement(Element* element, const FloatSize& pageSi return -1; } +String PrintContext::pageProperty(Frame* frame, const char* propertyName, int pageNumber) +{ + Document* document = frame->document(); + document->updateLayout(); + RefPtr<RenderStyle> style = document->styleForPage(pageNumber); + + // Implement formatters for properties we care about. + if (!strcmp(propertyName, "margin-left")) + return String::format("%d", style->marginLeft().rawValue()); + if (!strcmp(propertyName, "line-height")) + return String::format("%d", style->lineHeight().rawValue()); + if (!strcmp(propertyName, "font-size")) + return String::format("%d", style->fontDescription().computedPixelSize()); + if (!strcmp(propertyName, "font-family")) + return String::format("%s", style->fontDescription().family().family().string().utf8().data()); + + return String::format("pageProperty() unimplemented for: %s", propertyName); +} + +bool PrintContext::isPageBoxVisible(Frame* frame, int pageNumber) +{ + return frame->document()->isPageBoxVisible(pageNumber); +} + +String PrintContext::pageAreaRectInPixels(Frame* frame, int pageNumber) +{ + IntRect pageArea = frame->document()->pageAreaRectInPixels(pageNumber); + return String::format("(%d,%d,%d,%d)", pageArea.x(), pageArea.y(), pageArea.width(), pageArea.height()); +} + +String PrintContext::preferredPageSizeInPixels(Frame* frame, int pageNumber) +{ + IntSize pageSize = frame->document()->preferredPageSizeInPixels(pageNumber); + return String::format("(%d,%d)", pageSize.width(), pageSize.height()); +} + int PrintContext::numberOfPages(Frame* frame, const FloatSize& pageSizeInPixels) { frame->document()->updateLayout(); diff --git a/WebCore/page/PrintContext.h b/WebCore/page/PrintContext.h index 1891144..81a9b76 100644 --- a/WebCore/page/PrintContext.h +++ b/WebCore/page/PrintContext.h @@ -31,6 +31,7 @@ class FloatRect; class FloatSize; class GraphicsContext; class IntRect; +class String; class PrintContext { public: @@ -54,6 +55,10 @@ public: // Used by layout tests. static int pageNumberForElement(Element*, const FloatSize& pageSizeInPixels); + static String pageProperty(Frame* frame, const char* propertyName, int pageNumber); + static bool isPageBoxVisible(Frame* frame, int pageNumber); + static String pageAreaRectInPixels(Frame* frame, int pageNumber); + static String preferredPageSizeInPixels(Frame* frame, int pageNumber); static int numberOfPages(Frame*, const FloatSize& pageSizeInPixels); protected: diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp index b20f2e5..503b938 100644 --- a/WebCore/page/Settings.cpp +++ b/WebCore/page/Settings.cpp @@ -144,7 +144,7 @@ Settings::Settings(Page* page) , m_webGLEnabled(false) , m_loadDeferringEnabled(true) , m_tiledBackingStoreEnabled(false) - , m_html5ParserEnabled(false) + , m_html5ParserEnabled(true) , m_paginateDuringLayoutEnabled(false) #ifdef ANDROID_PLUGINS , m_pluginsOnDemand(false) diff --git a/WebCore/page/SpatialNavigation.cpp b/WebCore/page/SpatialNavigation.cpp index 0239c39..58b70e4 100644 --- a/WebCore/page/SpatialNavigation.cpp +++ b/WebCore/page/SpatialNavigation.cpp @@ -125,8 +125,11 @@ static IntRect renderRectRelativeToRootDocument(RenderObject* render) // Handle nested frames. for (Frame* frame = render->document()->frame(); frame; frame = frame->tree()->parent()) { - if (HTMLFrameOwnerElement* ownerElement = frame->ownerElement()) - rect.move(ownerElement->offsetLeft(), ownerElement->offsetTop()); + if (Element* element = static_cast<Element*>(frame->ownerElement())) { + do { + rect.move(element->offsetLeft(), element->offsetTop()); + } while ((element = element->offsetParent())); + } } return rect; @@ -445,7 +448,7 @@ bool hasOffscreenRect(Node* node) // In a bottom-up way, this method tries to scroll |frame| in a given direction // |direction|, going up in the frame tree hierarchy in case it does not succeed. -bool scrollInDirection(Frame* frame, FocusDirection direction) +bool scrollInDirection(Frame* frame, FocusDirection direction, const FocusCandidate& candidate) { if (!frame) return false; @@ -469,6 +472,9 @@ bool scrollInDirection(Frame* frame, FocusDirection direction) return false; } + if (!candidate.isNull() && isScrollableContainerNode(candidate.enclosingScrollableBox)) + return frame->eventHandler()->scrollRecursively(scrollDirection, ScrollByLine, candidate.enclosingScrollableBox); + return frame->eventHandler()->scrollRecursively(scrollDirection, ScrollByLine); } @@ -527,4 +533,17 @@ static bool checkNegativeCoordsForNode(Node* node, const IntRect& curRect) return canBeScrolled; } +bool isScrollableContainerNode(Node* node) +{ + if (!node) + return false; + + if (RenderObject* renderer = node->renderer()) { + return (renderer->isBox() && toRenderBox(renderer)->canBeScrolledAndHasScrollableArea() + && node->hasChildNodes() && !node->isDocumentNode()); + } + + return false; +} + } // namespace WebCore diff --git a/WebCore/page/SpatialNavigation.h b/WebCore/page/SpatialNavigation.h index d38fb09..78419a7 100644 --- a/WebCore/page/SpatialNavigation.h +++ b/WebCore/page/SpatialNavigation.h @@ -97,6 +97,7 @@ enum RectsAlignment { struct FocusCandidate { FocusCandidate() : node(0) + , enclosingScrollableBox(0) , distance(maxDistance()) , parentDistance(maxDistance()) , alignment(None) @@ -106,6 +107,7 @@ struct FocusCandidate { FocusCandidate(Node* n) : node(n) + , enclosingScrollableBox(0) , distance(maxDistance()) , parentDistance(maxDistance()) , alignment(None) @@ -114,9 +116,11 @@ struct FocusCandidate { } bool isNull() const { return !node; } + bool inScrollableContainer() const { return node && enclosingScrollableBox; } Document* document() const { return node ? node->document() : 0; } Node* node; + Node* enclosingScrollableBox; long long distance; long long parentDistance; RectsAlignment alignment; @@ -124,10 +128,11 @@ struct FocusCandidate { }; void distanceDataForNode(FocusDirection direction, Node* start, FocusCandidate& candidate); -bool scrollInDirection(Frame*, FocusDirection); +bool scrollInDirection(Frame*, FocusDirection, const FocusCandidate& candidate = FocusCandidate()); void scrollIntoView(Element*); bool hasOffscreenRect(Node*); bool isInRootDocument(Node*); +bool isScrollableContainerNode(Node*); } // namspace WebCore diff --git a/WebCore/page/WebKitPoint.idl b/WebCore/page/WebKitPoint.idl index fd617b2..4e6021f 100644 --- a/WebCore/page/WebKitPoint.idl +++ b/WebCore/page/WebKitPoint.idl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Apple Inc. All rights reserved. + * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,7 +25,12 @@ module window { - interface [CustomConstructor] WebKitPoint { + interface [ + CanBeConstructed, + CustomConstructFunction, + ConstructorParameters=2, + V8CustomConstructor + ] WebKitPoint { attribute float x; attribute float y; }; diff --git a/WebCore/page/XSSAuditor.cpp b/WebCore/page/XSSAuditor.cpp index b5aba79..33a0951 100644 --- a/WebCore/page/XSSAuditor.cpp +++ b/WebCore/page/XSSAuditor.cpp @@ -35,7 +35,7 @@ #include "DOMWindow.h" #include "Frame.h" #include "KURL.h" -#include "PreloadScanner.h" +#include "LegacyPreloadScanner.h" #include "ResourceResponseBase.h" #include "ScriptSourceCode.h" #include "Settings.h" @@ -277,7 +277,7 @@ String XSSAuditor::decodeHTMLEntities(const String& string, bool leaveUndecodabl if (leaveUndecodableEntitiesUntouched) sourceShadow = source; bool notEnoughCharacters = false; - unsigned entity = PreloadScanner::consumeEntity(source, notEnoughCharacters); + unsigned entity = LegacyPreloadScanner::consumeEntity(source, notEnoughCharacters); // We ignore notEnoughCharacters because we might as well use this loop // to copy the remaining characters into |result|. diff --git a/WebCore/page/XSSAuditor.h b/WebCore/page/XSSAuditor.h index 7afbf07..20e0a53 100644 --- a/WebCore/page/XSSAuditor.h +++ b/WebCore/page/XSSAuditor.h @@ -66,8 +66,8 @@ namespace WebCore { // * ScriptController::executeIfJavaScriptURL - used to evaluate JavaScript URLs. // * ScriptEventListener::createAttributeEventListener - used to create JavaScript event handlers. // * HTMLBaseElement::process - used to set the document base URL. - // * HTMLDocumentParser::parseTag - used to load external JavaScript scripts. - // * FrameLoader::requestObject - used to load <object>/<embed> elements. + // * LegacyHTMLDocumentParser::parseTag - used to load external JavaScript scripts. + // * SubframeLoader::requestObject - used to load <object>/<embed> elements. // class XSSAuditor : public Noncopyable { public: @@ -95,7 +95,7 @@ namespace WebCore { // Determines whether object should be loaded based on the content of // any user-submitted data. // - // This method is called by FrameLoader::requestObject. + // This method is called by SubframeLoader::requestObject. bool canLoadObject(const String& url) const; // Determines whether the base URL should be changed based on the content diff --git a/WebCore/page/animation/AnimationBase.cpp b/WebCore/page/animation/AnimationBase.cpp index aa6a4c1..7195d1f 100644 --- a/WebCore/page/animation/AnimationBase.cpp +++ b/WebCore/page/animation/AnimationBase.cpp @@ -191,6 +191,22 @@ static inline EVisibility blendFunc(const AnimationBase* anim, EVisibility from, return result > 0. ? VISIBLE : (to != VISIBLE ? to : from); } +static inline LengthBox blendFunc(const AnimationBase* anim, const LengthBox& from, const LengthBox& to, double progress) +{ + // Length types have to match to animate + if (from.top().type() != to.top().type() + || from.right().type() != to.right().type() + || from.bottom().type() != to.bottom().type() + || from.left().type() != to.left().type()) + return to; + + LengthBox result(blendFunc(anim, from.top(), to.top(), progress), + blendFunc(anim, from.right(), to.right(), progress), + blendFunc(anim, from.bottom(), to.bottom(), progress), + blendFunc(anim, from.left(), to.left(), progress)); + return result; +} + class PropertyWrapperBase; static void addShorthandProperties(); @@ -634,6 +650,8 @@ void AnimationBase::ensurePropertyMap() gPropertyWrappers->append(new PropertyWrapper<const IntSize&>(CSSPropertyBorderBottomRightRadius, &RenderStyle::borderBottomRightRadius, &RenderStyle::setBorderBottomRightRadius)); gPropertyWrappers->append(new PropertyWrapper<EVisibility>(CSSPropertyVisibility, &RenderStyle::visibility, &RenderStyle::setVisibility)); gPropertyWrappers->append(new PropertyWrapper<float>(CSSPropertyZoom, &RenderStyle::zoom, &RenderStyle::setZoom)); + + gPropertyWrappers->append(new PropertyWrapper<LengthBox>(CSSPropertyClip, &RenderStyle::clip, &RenderStyle::setClip)); #if USE(ACCELERATED_COMPOSITING) gPropertyWrappers->append(new PropertyWrapperAcceleratedOpacity()); @@ -652,7 +670,6 @@ void AnimationBase::ensurePropertyMap() gPropertyWrappers->append(new PropertyWrapperMaybeInvalidColor(CSSPropertyBorderBottomColor, &RenderStyle::borderBottomColor, &RenderStyle::setBorderBottomColor)); gPropertyWrappers->append(new PropertyWrapperMaybeInvalidColor(CSSPropertyOutlineColor, &RenderStyle::outlineColor, &RenderStyle::setOutlineColor)); - // These are for shadows gPropertyWrappers->append(new PropertyWrapperShadow(CSSPropertyWebkitBoxShadow, &RenderStyle::boxShadow, &RenderStyle::setBoxShadow)); gPropertyWrappers->append(new PropertyWrapperShadow(CSSPropertyTextShadow, &RenderStyle::textShadow, &RenderStyle::setTextShadow)); diff --git a/WebCore/page/animation/AnimationBase.h b/WebCore/page/animation/AnimationBase.h index ac55a2b..91ef8cf 100644 --- a/WebCore/page/animation/AnimationBase.h +++ b/WebCore/page/animation/AnimationBase.h @@ -42,7 +42,7 @@ class Element; class Node; class RenderObject; class RenderStyle; -class TimingFunction; +struct TimingFunction; class AnimationBase : public RefCounted<AnimationBase> { friend class CompositeAnimation; diff --git a/WebCore/page/brew/ChromeClientBrew.h b/WebCore/page/brew/ChromeClientBrew.h new file mode 100644 index 0000000..d1fac2d --- /dev/null +++ b/WebCore/page/brew/ChromeClientBrew.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2010, Company 100, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ChromeClientBrew_h +#define ChromeClientBrew_h + +#include "ChromeClient.h" +#include <wtf/Forward.h> + +namespace WebCore { +class IntRect; +class PopupMenuClient; + +// Contains Brew-specific extensions to the ChromeClient. Only put +// things here that don't make sense for other ports. +class ChromeClientBrew : public ChromeClient { +public: + virtual void createSelectPopup(PopupMenuClient*, int selected, const IntRect& rect) = 0; + virtual bool destroySelectPopup() = 0; +}; + +} // namespace WebCore + +#endif diff --git a/WebCore/page/mac/WebCoreViewFactory.h b/WebCore/page/mac/WebCoreViewFactory.h index db70b6d..2ca0d17 100644 --- a/WebCore/page/mac/WebCoreViewFactory.h +++ b/WebCore/page/mac/WebCoreViewFactory.h @@ -28,9 +28,6 @@ @protocol WebCoreViewFactory -- (NSArray *)pluginsInfo; // array of id <WebCorePluginInfo> -- (void)refreshPlugins; - - (NSString *)inputElementAltText; - (NSString *)resetButtonDefaultLabel; - (NSString *)searchableIndexIntroduction; @@ -171,13 +168,3 @@ @interface WebCoreViewFactory (SubclassResponsibility) <WebCoreViewFactory> @end - -@protocol WebCorePluginInfo <NSObject> -- (NSString *)name; -- (NSString *)filename; -- (NSString *)pluginDescription; -- (NSEnumerator *)MIMETypeEnumerator; -- (NSString *)descriptionForMIMEType:(NSString *)MIMEType; -- (NSArray *)extensionsForMIMEType:(NSString *)MIMEType; -@end - diff --git a/WebCore/page/win/FrameWin.h b/WebCore/page/win/FrameWin.h index 4c274b7..cbfe33d 100644 --- a/WebCore/page/win/FrameWin.h +++ b/WebCore/page/win/FrameWin.h @@ -23,8 +23,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef FrameWin_H -#define FrameWin_H +#ifndef FrameWin_h +#define FrameWin_h #include <wtf/Vector.h> |