diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2010-04-28 10:36:27 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2010-04-28 10:36:27 (GMT) |
commit | b7496ee877e3c0eef51ba982bf7acff082e1d5a1 (patch) | |
tree | 461b16a25d4c903a9a1a184570ca183faae0967a /src/3rdparty/webkit/WebCore/page | |
parent | a17339e943f21bb6c6e16884f716dd9ab8f94938 (diff) | |
download | Qt-b7496ee877e3c0eef51ba982bf7acff082e1d5a1.zip Qt-b7496ee877e3c0eef51ba982bf7acff082e1d5a1.tar.gz Qt-b7496ee877e3c0eef51ba982bf7acff082e1d5a1.tar.bz2 |
Updated WebKit to 862268aeb7150d3795d05bfc05f661bb5c598a27
Integrated bugfixes:
|| <https://webkit.org/b/33280> || [RVCT] ACID3 test crash ||
|| <https://webkit.org/b/37635> || Spatial Navigation: make hasOffscreenRect() to earlier return 'true' if absoluteClippedOverflowRect() gives an empty rect ||
|| <https://webkit.org/b/37637> || Repaint of fixed, transformed element is broken ||
|| <https://webkit.org/b/37313> || [Qt] Fix or remove the runtime flag for accelerated compositing. ||
|| <https://webkit.org/b/36365> || [Qt] [Performance] GraphicsLayer: constructing the layers takes too long ||
|| <https://webkit.org/b/37135> || Spatial Navigation: bail out as soon as algorithm finds a focus candidate is not applicable ||
|| <https://webkit.org/b/38062> || [Qt] HTTP pipelining efficiency increase ||
|| <https://webkit.org/b/35607> || Allow building smoothly on win32 and win64 using GCC ||
|| <https://webkit.org/b/37530> || No default selection for <select multiple> menu lists. ||
|| <https://webkit.org/b/37152> || [Qt] Rendering artifacts on Qt plugins when scrolling the page ||
|| <https://webkit.org/b/36773> || Spatial Navigation: proper handle negative x or y coordinates ||
|| <https://webkit.org/b/34729> || [Qt] Exposing an QVariantMap containing QObjectStar to Javascript causes Segmentation Fault ||
|| <https://webkit.org/b/34730> || [Qt] Null QObjects properties cause Segmentation Fault ||
|| <https://webkit.org/b/37163> || [Qt] inputMethodQuery returns coordinates in web page coordinates rather than in item coordinates. ||
|| <https://webkit.org/b/37934> || [Qt] QtLauncher: make FPS measurement accurate ||
|| <https://webkit.org/b/36783> || Update of fixed elements is not made correctly when the page has been scrolled ||
|| <https://webkit.org/b/37683> || [Qt] WebCore::Font::font() causes a QFont detach ||
|| <https://webkit.org/b/36532> || [Qt] Use integer pixel metric QFont API to fix rounding errors in text rendering on the Mac ||
|| <https://webkit.org/b/37303> || [Qt] Application crash on exit if NPPlugin is loaded ||
|| <https://webkit.org/b/37816> || [Qt] Multitouch mocking in QtLauncher doesn't work with QGraphicsView ||
|| <https://webkit.org/b/38111> || [Qt] Fix compilation against Qt 4.7 ||
|| <https://webkit.org/b/37821> || [Qt] loads APP directory when calling "window.open" ||
|| <https://webkit.org/b/35393> || [Qt] GraphicsLayer: performance optimizations ||
|| <https://webkit.org/b/32196> || Make it possible to distinguish between NPAPI plugins and Application plugins ||
|| <https://webkit.org/b/37319> || [Qt] tst_QWebFrame::overloadedSlots() fails ||
|| <https://webkit.org/b/34888> || Mac OS X: Use deployment target to determine whether memory tagging should be enabled ||
|| <https://webkit.org/b/36621> || Fix build if NPAPI support is disabled ||
|| <https://webkit.org/b/37461> || Spatial Navigation: make renderRectRelativeToRootDocument method to fallback to getRect() of Element when needed ||
|| <https://webkit.org/b/37719> || Some HTML5 Input tags not treated as needing an input method. ||
|| <https://webkit.org/b/36312> || Support viewport meta tag ||
|| <https://webkit.org/b/36751> || [Qt] Windows CE build is broken ||
|| <https://webkit.org/b/37980> || Fix the build on MSVC 64bit ||
|| <https://webkit.org/b/37727> || [Qt] Webkit fixes for RVCT4 ||
|| <https://webkit.org/b/36832> || [Qt] crash in debug mode just before exit ||
|| <https://webkit.org/b/37867> || [Qt] Patches to upstream from Qt for 2.0 ||
|| <https://webkit.org/b/37615> || Changing view mode names due to specification changes ||
|| <https://webkit.org/b/36853> || REGRESSION(r56552): Broken scrollbars size ||
|| <https://webkit.org/b/36216> || [Qt] GraphicsLayer: support fill-modes ||
|| <https://webkit.org/b/36859> || [Qt]QtLauncher crash on page with CSS 3D transform ||
|| <https://webkit.org/b/37802> || Spatial Navigation: at @updateFocusCandidateIfCloser make an assignment shortcut when FocusCandidate is null ||
Diffstat (limited to 'src/3rdparty/webkit/WebCore/page')
7 files changed, 154 insertions, 81 deletions
diff --git a/src/3rdparty/webkit/WebCore/page/ChromeClient.h b/src/3rdparty/webkit/WebCore/page/ChromeClient.h index 34e2893..0bfdbaf 100644 --- a/src/3rdparty/webkit/WebCore/page/ChromeClient.h +++ b/src/3rdparty/webkit/WebCore/page/ChromeClient.h @@ -56,6 +56,7 @@ namespace WebCore { class Widget; struct FrameLoadRequest; + struct ViewportArguments; struct WindowFeatures; #if USE(ACCELERATED_COMPOSITING) @@ -145,6 +146,8 @@ namespace WebCore { virtual void setToolTip(const String&, TextDirection) = 0; + virtual void didReceiveViewportArguments(Frame*, const ViewportArguments&) const { } + virtual void print(Frame*) = 0; #if ENABLE(DATABASE) @@ -211,6 +214,9 @@ namespace WebCore { // Sets a flag to specify that the view needs to be updated, so we need // to do an eager layout before the drawing. virtual void scheduleCompositingLayerSync() = 0; + // Returns whether or not the client can render the composited layer, + // regardless of the settings. + virtual bool allowsAcceleratedCompositing() const { return true; } #endif virtual bool supportsFullscreenForNode(const Node*) { return false; } @@ -231,10 +237,11 @@ namespace WebCore { #endif #if ENABLE(WIDGETS_10_SUPPORT) - virtual bool isDocked() { return false; } + virtual bool isWindowed() { return false; } virtual bool isFloating() { return false; } - virtual bool isApplication() { return false; } virtual bool isFullscreen() { return false; } + virtual bool isMaximized() { return false; } + virtual bool isMinimized() { return false; } #endif protected: diff --git a/src/3rdparty/webkit/WebCore/page/FocusController.cpp b/src/3rdparty/webkit/WebCore/page/FocusController.cpp index 089fb8f..fdd117b 100644 --- a/src/3rdparty/webkit/WebCore/page/FocusController.cpp +++ b/src/3rdparty/webkit/WebCore/page/FocusController.cpp @@ -341,51 +341,96 @@ bool FocusController::advanceFocusDirectionally(FocusDirection direction, Keyboa return true; } -static void updateFocusCandidateIfCloser(Node* focusedNode, Node* candidate, long long distance, FocusCandidate& closestFocusCandidate) +// FIXME: Make this method more modular, and simpler to understand and maintain. +static void updateFocusCandidateIfCloser(Node* focusedNode, const FocusCandidate& candidate, FocusCandidate& closest) { - // Bail out if |distance| is bigger than the current closest candidate. - if (distance >= closestFocusCandidate.distance) + 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)) return; - // If |focusedNode| and |candidate| are in the same document AND - // current |closestFocusCandidadte| is not in an {i}frame that is - // preferable to get focused. - if (focusedNode->document() == candidate->document() - && distance < closestFocusCandidate.parentDistance) { - closestFocusCandidate.node = candidate; - closestFocusCandidate.distance = distance; - closestFocusCandidate.parentDistance = maxDistance(); - } else if (focusedNode->document() != candidate->document()) { - // If the |focusedNode| is in an inner document and the |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) && !isInRootDocument(focusedNode)) - && focusedNode->document() == closestFocusCandidate.document())) { - closestFocusCandidate.node = candidate; - closestFocusCandidate.distance = distance; - } + if (candidate.alignment != None + || (closest.parentAlignment >= candidate.alignment + && closest.document() == candidate.document())) { + + // 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(); + + closest.alignment = candidate.alignment; + } + + // Bail out if candidate's distance is larger than that of the closest candidate. + if (candidate.distance >= closest.distance) + return; + + if (closest.isNull()) { + 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())) + closest = candidate; } } -void FocusController::findFocusableNodeInDirection(Document* document, Node* focusedNode, FocusDirection direction, KeyboardEvent* event, FocusCandidate& closestFocusCandidate) +void FocusController::findFocusableNodeInDirection(Document* document, Node* focusedNode, + FocusDirection direction, KeyboardEvent* event, + FocusCandidate& closestFocusCandidate, + const FocusCandidate& candidateParent) { ASSERT(document); + ASSERT(candidateParent.isNull() || static_cast<HTMLFrameOwnerElement*>(candidateParent.node)); - // Walk all the child nodes and update focusCandidate if we find a nearer node. + // Walk all the child nodes and update closestFocusCandidate if we find a nearer node. for (Node* candidate = document->firstChild(); candidate; candidate = candidate->traverseNextNode()) { // Inner documents case. + if (candidate->isFrameOwnerElement()) deepFindFocusableNodeInDirection(focusedNode, candidate, direction, event, closestFocusCandidate); else if (candidate != focusedNode && candidate->isKeyboardFocusable(event)) { - long long distance = distanceInDirection(focusedNode, candidate, - direction, closestFocusCandidate); - updateFocusCandidateIfCloser(focusedNode, candidate, distance, closestFocusCandidate); + FocusCandidate currentFocusCandidate(candidate); + + // Get distance and alignment from current candidate. + distanceDataForNode(direction, focusedNode, currentFocusCandidate); + + // Bail out if distance is maximum. + if (currentFocusCandidate.distance == maxDistance()) + 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); } } } -void FocusController::deepFindFocusableNodeInDirection(Node* focusedNode, Node* candidate, FocusDirection direction, KeyboardEvent* event, FocusCandidate& closestFocusCandidate) +void FocusController::deepFindFocusableNodeInDirection(Node* focusedNode, Node* candidate, + FocusDirection direction, KeyboardEvent* event, + FocusCandidate& closestFocusCandidate) { HTMLFrameOwnerElement* owner = static_cast<HTMLFrameOwnerElement*>(candidate); if (!owner->contentFrame()) @@ -400,20 +445,12 @@ void FocusController::deepFindFocusableNodeInDirection(Node* focusedNode, Node* else { // Check if the current {i}frame element itself is a good candidate // to move focus to. If it is, then we traverse its inner nodes. - // Lets pass a copy of the best candidate, to not get fooled by a - // frame without focusable elements. - FocusCandidate focusCandidateCopy = closestFocusCandidate; - long long distance = distanceInDirection(focusedNode, candidate, direction, focusCandidateCopy); - if (distance < focusCandidateCopy.distance) { - focusCandidateCopy.parentAlignment = focusCandidateCopy.alignment; - focusCandidateCopy.parentDistance = distance; - - findFocusableNodeInDirection(innerDocument, focusedNode, direction, event, focusCandidateCopy); - - // If we really have an inner closer focus candidate node, take it. - if (closestFocusCandidate.node != focusCandidateCopy.node) - closestFocusCandidate = focusCandidateCopy; - } + FocusCandidate candidateParent = FocusCandidate(candidate); + distanceDataForNode(direction, focusedNode, candidateParent); + + // FIXME: Consider alignment? + if (candidateParent.distance < closestFocusCandidate.distance) + findFocusableNodeInDirection(innerDocument, focusedNode, direction, event, closestFocusCandidate, candidateParent); } } diff --git a/src/3rdparty/webkit/WebCore/page/FocusController.h b/src/3rdparty/webkit/WebCore/page/FocusController.h index 75591c7..dfa3780 100644 --- a/src/3rdparty/webkit/WebCore/page/FocusController.h +++ b/src/3rdparty/webkit/WebCore/page/FocusController.h @@ -27,6 +27,7 @@ #define FocusController_h #include "FocusDirection.h" +#include "SpatialNavigation.h" #include <wtf/Forward.h> #include <wtf/Noncopyable.h> #include <wtf/RefPtr.h> @@ -38,7 +39,6 @@ class Frame; class KeyboardEvent; class Node; class Page; -struct FocusCandidate; class FocusController : public Noncopyable { public: @@ -63,7 +63,8 @@ private: bool advanceFocusDirectionally(FocusDirection, KeyboardEvent*); bool advanceFocusInDocumentOrder(FocusDirection, KeyboardEvent*, bool initialFocus); - void findFocusableNodeInDirection(Document*, Node*, FocusDirection, KeyboardEvent*, FocusCandidate&); + void findFocusableNodeInDirection(Document*, Node*, FocusDirection, KeyboardEvent*, FocusCandidate& closestFocusCandidate, + const FocusCandidate& parentCandidate = FocusCandidate()); void deepFindFocusableNodeInDirection(Node*, Node*, FocusDirection, KeyboardEvent*, FocusCandidate&); Page* m_page; diff --git a/src/3rdparty/webkit/WebCore/page/FrameView.cpp b/src/3rdparty/webkit/WebCore/page/FrameView.cpp index 45764de..39c92de 100644 --- a/src/3rdparty/webkit/WebCore/page/FrameView.cpp +++ b/src/3rdparty/webkit/WebCore/page/FrameView.cpp @@ -1067,6 +1067,7 @@ void FrameView::scrollPositionChanged() if (!m_nestedLayoutCount) { if (RenderView* root = m_frame->contentRenderer()) { root->updateWidgetPositions(); + root->layer()->updateRepaintRectsAfterScroll(); #if USE(ACCELERATED_COMPOSITING) if (root->usesCompositing()) root->compositor()->updateCompositingLayers(CompositingUpdateOnScroll); diff --git a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp index 86c9c5d..890eacd 100644 --- a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp +++ b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp @@ -46,16 +46,21 @@ static bool areRectsFullyAligned(FocusDirection, const IntRect&, const IntRect&) static bool areRectsPartiallyAligned(FocusDirection, const IntRect&, const IntRect&); static bool isRectInDirection(FocusDirection, const IntRect&, const IntRect&); static void deflateIfOverlapped(IntRect&, IntRect&); +static bool checkNegativeCoordsForNode(Node*, const IntRect&); -long long distanceInDirection(Node* start, Node* dest, FocusDirection direction, FocusCandidate& candidate) +void distanceDataForNode(FocusDirection direction, Node* start, FocusCandidate& candidate) { RenderObject* startRender = start->renderer(); - if (!startRender) - return maxDistance(); + if (!startRender) { + candidate.distance = maxDistance(); + return; + } - RenderObject* destRender = dest->renderer(); - if (!destRender) - return maxDistance(); + RenderObject* destRender = candidate.node->renderer(); + if (!destRender) { + candidate.distance = maxDistance(); + return; + } IntRect curRect = renderRectRelativeToRootDocument(startRender); IntRect targetRect = renderRectRelativeToRootDocument(destRender); @@ -64,40 +69,34 @@ long long distanceInDirection(Node* start, Node* dest, FocusDirection direction, // deflate both. deflateIfOverlapped(curRect, targetRect); + // If empty rects or negative width or height, bail out. if (curRect.isEmpty() || targetRect.isEmpty() - || targetRect.x() < 0 || targetRect.y() < 0) - return maxDistance(); + || targetRect.width() <= 0 || targetRect.height() <= 0) { + candidate.distance = maxDistance(); + return; + } - if (!isRectInDirection(direction, curRect, targetRect)) - return maxDistance(); + // Negative coordinates can be used if node is scrolled up offscreen. + if (!checkNegativeCoordsForNode(start, curRect)) { + candidate.distance = maxDistance(); + return; + } + + if (!checkNegativeCoordsForNode(candidate.node, targetRect)) { + candidate.distance = maxDistance(); + return; + } + + if (!isRectInDirection(direction, curRect, targetRect)) { + candidate.distance = maxDistance(); + return; + } // The distance between two nodes is not to be considered alone when evaluating/looking // for the best focus candidate node. Alignment of rects can be also a good point to be // considered in order to make the algorithm to behavior in a more intuitive way. - RectsAlignment alignment = alignmentForRects(direction, curRect, targetRect); - - bool sameDocument = dest->document() == candidate.document(); - if (sameDocument) { - if (candidate.alignment > alignment || (candidate.parentAlignment && alignment > candidate.parentAlignment)) - return maxDistance(); - } else if (candidate.alignment > alignment && (candidate.parentAlignment && alignment > candidate.parentAlignment)) - return maxDistance(); - - // FIXME_tonikitoo: simplify the logic here ! - if (alignment != None - || (!candidate.isNull() && candidate.parentAlignment >= alignment - && candidate.document() == dest->document())) { - - // If we are now in an higher precedent case, lets reset the current |candidate|'s - // |distance| so we force it to be bigger than the result we will get from - // |spatialDistance| (see below). - if (candidate.alignment < alignment && candidate.parentAlignment < alignment) - candidate.distance = maxDistance(); - - candidate.alignment = alignment; - } - - return spatialDistance(direction, curRect, targetRect); + candidate.alignment = alignmentForRects(direction, curRect, targetRect); + candidate.distance = spatialDistance(direction, curRect, targetRect); } // FIXME: This function does not behave correctly with transformed frames. @@ -107,6 +106,11 @@ static IntRect renderRectRelativeToRootDocument(RenderObject* render) IntRect rect(render->absoluteClippedOverflowRect()); + if (rect.isEmpty()) { + Element* e = static_cast<Element*>(render->node()); + rect = e->getRect(); + } + // In cases when the |render|'s associated node is in a scrollable inner // document, we only consider its scrollOffset if it is not offscreen. Node* node = render->node(); @@ -432,6 +436,9 @@ bool hasOffscreenRect(Node* node) return true; IntRect rect(render->absoluteClippedOverflowRect()); + if (rect.isEmpty()) + return true; + return !containerViewportRect.intersects(rect); } @@ -500,4 +507,24 @@ static void deflateIfOverlapped(IntRect& a, IntRect& b) b.inflate(fudgeFactor); } +static bool checkNegativeCoordsForNode(Node* node, const IntRect& curRect) +{ + ASSERT(node || node->renderer()); + + if (curRect.x() > 0 && curRect.y() > 0) + return true; + + bool canBeScrolled = false; + + RenderObject* renderer = node->renderer(); + for (; renderer; renderer = renderer->parent()) { + if (renderer->isBox() && toRenderBox(renderer)->canBeScrolledAndHasScrollableArea()) { + canBeScrolled = true; + break; + } + } + + return canBeScrolled; +} + } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.h b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.h index 7c183df..90ff1cf 100644 --- a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.h +++ b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.h @@ -118,7 +118,7 @@ struct FocusCandidate { RectsAlignment parentAlignment; }; -long long distanceInDirection(Node*, Node*, FocusDirection, FocusCandidate&); +void distanceDataForNode(FocusDirection direction, Node* start, FocusCandidate& candidate); bool scrollInDirection(Frame*, FocusDirection); void scrollIntoView(Element*); bool hasOffscreenRect(Node*); diff --git a/src/3rdparty/webkit/WebCore/page/qt/EventHandlerQt.cpp b/src/3rdparty/webkit/WebCore/page/qt/EventHandlerQt.cpp index 2fcce5b..5b24eae 100644 --- a/src/3rdparty/webkit/WebCore/page/qt/EventHandlerQt.cpp +++ b/src/3rdparty/webkit/WebCore/page/qt/EventHandlerQt.cpp @@ -51,7 +51,7 @@ #include "NotImplemented.h" QT_BEGIN_NAMESPACE -Q_DECL_IMPORT extern bool qt_tab_all_widgets; // from qapplication.cpp +Q_GUI_EXPORT extern bool qt_tab_all_widgets; // from qapplication.cpp QT_END_NAMESPACE namespace WebCore { |