From 3eec5af3f07fdab9084f40d6955411a667b433c4 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 11 May 2010 12:26:30 +0200 Subject: Updated WebKit to b4aa5e1ddc41edab895132aba3cc66d9d7129444 Integrated changes: || || mingw-w64 and JIT support || || || [Qt] QWebPage viewMode property || || || [Qt] Fix infinite redirection loop in QNetworkReplyHandler || || || [Qt] Enable YARR_JIT for X86 Mac for QtWebKit || || || [Qt] Adapt DNS pre-fetching to Qt DNS cache code || || || [Qt] Crash in QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate when animation were used || || || [PATCH] [Qt] Compilation with Plugins disabled is broken || || || Crash in handleTouchEvent: using dangling node ptrs in hashmap || || || Potential crash in EventHandler::handleTouchEvent || || || Spatial Navigation: create a getter for the "fudgeFactor" || || || [Qt] QtWebKit has render bugs on Google Maps markers || || || LayoutTests/fast/canvas/pointInPath.html passed, actually it failed || || || [Qt] Expose HTMLTokenizer yielding parameters || --- src/3rdparty/webkit/.tag | 2 +- src/3rdparty/webkit/JavaScriptCore/ChangeLog | 23 +++ src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h | 6 +- src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebCore/ChangeLog | 163 +++++++++++++++++++++ src/3rdparty/webkit/WebCore/WebCore.gypi | 2 +- src/3rdparty/webkit/WebCore/WebCore.pro | 2 +- src/3rdparty/webkit/WebCore/page/EventHandler.cpp | 13 +- .../webkit/WebCore/page/SpatialNavigation.cpp | 13 +- .../webkit/WebCore/page/SpatialNavigation.h | 5 + .../platform/graphics/qt/GraphicsContextQt.cpp | 16 +- .../webkit/WebCore/platform/graphics/qt/PathQt.cpp | 29 ++++ .../platform/network/qt/DnsPrefetchHelper.h | 11 ++ .../platform/network/qt/QNetworkReplyHandler.cpp | 13 +- .../platform/network/qt/QNetworkReplyHandler.h | 1 + .../WebCore/platform/qt/TemporaryLinkStubs.cpp | 119 --------------- .../WebCore/platform/qt/TemporaryLinkStubsQt.cpp | 119 +++++++++++++++ .../webkit/WebKit/qt/Api/qgraphicswebview.cpp | 22 ++- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 32 ++-- src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h | 2 + src/3rdparty/webkit/WebKit/qt/ChangeLog | 58 ++++++++ .../webkit/WebKit/qt/symbian/bwins/QtWebKitu.def | 2 +- .../webkit/WebKit/qt/symbian/eabi/QtWebKitu.def | 2 +- .../WebKit/qt/tests/qwebpage/tst_qwebpage.cpp | 17 +++ 24 files changed, 505 insertions(+), 169 deletions(-) delete mode 100644 src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp create mode 100644 src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubsQt.cpp diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag index 75fc5e7..65cfdda 100644 --- a/src/3rdparty/webkit/.tag +++ b/src/3rdparty/webkit/.tag @@ -1 +1 @@ -b4aa5e1ddc41edab895132aba3cc66d9d7129444 +dc5821c3df2ef60456d85263160852f5335cf946 diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog index 1439ae0..97176ef 100644 --- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog +++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog @@ -1,3 +1,26 @@ +2010-05-10 Laszlo Gombos + + Reviewed by Darin Adler. + + [Qt] Disable JIT support for mingw-w64 + https://bugs.webkit.org/show_bug.cgi?id=38747 + + Disale JIT for mingw-w64 as it is reportedly + unstable. + + Thanks for Vanboxem Rruben for the investigation. + + * wtf/Platform.h: + +2010-05-06 Laszlo Gombos + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Enable YARR_JIT for X86 Mac for QtWebKit + https://bugs.webkit.org/show_bug.cgi?id=38668 + + * wtf/Platform.h: + 2010-05-02 Laszlo Gombos Reviewed by Eric Seidel. diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h index c582905..8d98765 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h @@ -927,8 +927,6 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ #elif CPU(X86) && OS(WINDOWS) && COMPILER(MINGW) && GCC_VERSION >= 40100 #define ENABLE_JIT 1 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1 -#elif CPU(X86_64) && OS(WINDOWS) && COMPILER(MINGW64) && GCC_VERSION >= 40100 - #define ENABLE_JIT 1 #elif CPU(X86) && OS(WINDOWS) && COMPILER(MSVC) #define ENABLE_JIT 1 #define WTF_USE_JIT_STUB_ARGUMENT_REGISTER 1 @@ -1011,7 +1009,9 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ || (CPU(X86_64) && OS(LINUX) && GCC_VERSION >= 40100) \ || (CPU(ARM_TRADITIONAL) && OS(LINUX)) \ || (CPU(ARM_TRADITIONAL) && OS(SYMBIAN) && COMPILER(RVCT)) \ - || (CPU(MIPS) && OS(LINUX)) + || (CPU(MIPS) && OS(LINUX)) \ + || (CPU(X86) && OS(DARWIN)) \ + || (CPU(X86_64) && OS(DARWIN)) #define ENABLE_YARR 1 #define ENABLE_YARR_JIT 1 #endif diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 98debf6..24f855b 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from and has the sha1 checksum - 07b60cf799680fcfb7785ee88e14f8030a5dbfa2 + b4aa5e1ddc41edab895132aba3cc66d9d7129444 diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index 6617b66..ee42878 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,166 @@ +2010-05-03 Antonio Gomes + + Reviewed by Kenneth Christiansen. + + Spatial Navigation: create a getter for the "fudgeFactor" + https://bugs.webkit.org/show_bug.cgi?id=38488 + + A couple of places in the Spatial Navigation code make use of a "fudge factor" + to improve precision by working around outline focus metrics and such. Patch adds + a helper method for unify getter operations of this value, instead of having it + declared locally in the various methods it is used. + + No behaviour change. + + * page/SpatialNavigation.cpp: + (WebCore::scrollIntoView): + (WebCore::deflateIfOverlapped): + * page/SpatialNavigation.h: + (WebCore::fudgeFactor): + +2010-05-10 Markus Goetz + + Reviewed by Simon Hausmann. + + Qt after 4.6.3 has its integrated DNS cache. Therefore some + code is not necessary anymore. + + https://bugs.webkit.org/show_bug.cgi?id=38834 + + * platform/network/qt/DnsPrefetchHelper.h: + (WebCore::DnsPrefetchHelper::lookup): + (WebCore::DnsPrefetchHelper::lookedUp): + +2010-05-06 Laszlo Gombos + + Unreviewed, build fix WinCE for QtWebKit. + + [Qt] Compilation with Plugins disabled is broken + https://bugs.webkit.org/show_bug.cgi?id=31407 + + Rename platform/qt/TemporaryLinkStubs.cpp to avoid name collition on + Windows. + + Thanks for Ismail "cartman" Donmez for help. + + No new tests, as there is no new functionality. + + * WebCore.gypi: + * WebCore.pro: + * platform/qt/TemporaryLinkStubs.cpp: Removed. + * platform/qt/TemporaryLinkStubsQt.cpp: Copied from WebCore/platform/qt/TemporaryLinkStubs.cpp. + +2010-04-23 Qi Zhang + + Reviewed by Laszlo Gombos. + + [Qt] LayoutTests/fast/canvas/pointInPath.html passed, actually it failed + https://bugs.webkit.org/show_bug.cgi?id=37276 + + QPainterPath::contains doesn't count the point on the bound. + + * platform/graphics/qt/PathQt.cpp: + (WebCore::isPointOnPathBorder): + (WebCore::Path::contains): + +2010-05-07 Tor Arne Vestbø + + Reviewed by Simon Hausmann. + + [Qt] Fix rendering of -webkit-user-select: none + + -webkit-user-select: none is implemented by filling + the area with an invalid default-constructed Color. + In most ports passing an invalid color down to the + graphics backend seems to produce transparent fills. + + In Qt the behavior of painting with an invalid QColor + is undefined, and in practice it results in painting + black opaque areas. + + One way to fix this would be to use Qt::transparent + when converting an undefined Color to a QColor, but + Qt does not have short circuits for fully transparent + painting, and we actually end up in slow code paths + due to the transparency. So, we're better of doing the + short circuit in WebKit. + + https://bugs.webkit.org/show_bug.cgi?id=38523 + + * platform/graphics/qt/GraphicsContextQt.cpp: + +2010-04-05 Robert Hogan + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Fix infinite redirection loop in QNetworkReplyHandler + + Put a maximum on consecutive redirections so we don't have to + worry about whether it's the same url or not. + + Tolerate up to 10 consecutive redirections, anything beyond + that is considered a potentially infinite recursion in the + redirection requests. This is the same behaviour as Firefox. + + https://bugs.webkit.org/show_bug.cgi?id=37097 + + * platform/network/qt/QNetworkReplyHandler.cpp: + (WebCore::QNetworkReplyHandler::QNetworkReplyHandler): + (WebCore::QNetworkReplyHandler::sendResponseIfNeeded): + * platform/network/qt/QNetworkReplyHandler.h: + +2010-04-05 Robert Hogan + + Reviewed by Kenneth Rohde-Christiansen. + + [Qt] Fix infinite redirection loop in QNetworkReplyHandler + + Qt enters an infinite loop if a redirect response redirects to itself. + + Fixes http/tests/xmlhttprequest/connection-error-sync.html + + https://bugs.webkit.org/show_bug.cgi?id=37097 + + * platform/network/qt/QNetworkReplyHandler.cpp: + (WebCore::QNetworkReplyHandler::sendResponseIfNeeded): + +2010-05-07 Ben Murdoch + + Reviewed by Darin Adler. + + Potential crash in EventHandler::handleTouchEvent + https://bugs.webkit.org/show_bug.cgi?id=38646 + + Fix a ref counting bug that can cause a crash if the m_originatingouchPointTargets + hashmap holds the last ref to an EventTarget when the user lifts their finger. + + This is very hard to reproduce in a consistent way and clearly a + simple logic error in the code, therefore no new tests. + + * page/EventHandler.cpp: + (WebCore::EventHandler::handleTouchEvent): Don't let the RefPtr we get back from + the hasmap go out of scope so soon as it could delete the wrapped ptr if the + hashmap held the last ref (and we use the raw ptr that the RefPtr + wraps later in the WebCore::Touch constructor). + +2010-05-04 Ben Murdoch + + Reviewed by Simon Hausmann. + + Crash in handleTouchEvent: using dangling node ptrs in hashmap + https://bugs.webkit.org/show_bug.cgi?id=38514 + + When navigating away from a page, if you have your finger still + pressed and then lift it on the new page we see a crash if the + node got deleted as we still have a dangling pointer in the + m_originatingTouchPointTargets hashmap and try to use it as the + receiver to dispatch a touchend event. + + Test: fast/events/touch/touch-stale-node-crash.html + + * page/EventHandler.cpp: + (WebCore::EventHandler::clear): Clear the hashmap of touch targets. + 2010-05-04 Luiz Agostini Reviewed by Simon Hausmann. diff --git a/src/3rdparty/webkit/WebCore/WebCore.gypi b/src/3rdparty/webkit/WebCore/WebCore.gypi index caa79f2..701ad90 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.gypi +++ b/src/3rdparty/webkit/WebCore/WebCore.gypi @@ -2640,7 +2640,7 @@ 'platform/qt/SharedBufferQt.cpp', 'platform/qt/SharedTimerQt.cpp', 'platform/qt/SoundQt.cpp', - 'platform/qt/TemporaryLinkStubs.cpp', + 'platform/qt/TemporaryLinkStubsQt.cpp', 'platform/qt/WheelEventQt.cpp', 'platform/qt/WidgetQt.cpp', 'platform/sql/SQLValue.cpp', diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index beeb529..e42cd8e 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -2081,7 +2081,7 @@ SOURCES += \ platform/qt/SoundQt.cpp \ platform/qt/LoggingQt.cpp \ platform/text/qt/StringQt.cpp \ - platform/qt/TemporaryLinkStubs.cpp \ + platform/qt/TemporaryLinkStubsQt.cpp \ platform/text/qt/TextBoundariesQt.cpp \ platform/text/qt/TextBreakIteratorQt.cpp \ platform/text/qt/TextCodecQt.cpp \ diff --git a/src/3rdparty/webkit/WebCore/page/EventHandler.cpp b/src/3rdparty/webkit/WebCore/page/EventHandler.cpp index 0a0e8c6..46dd7ae 100644 --- a/src/3rdparty/webkit/WebCore/page/EventHandler.cpp +++ b/src/3rdparty/webkit/WebCore/page/EventHandler.cpp @@ -230,6 +230,9 @@ void EventHandler::clear() m_capturingMouseEventsNode = 0; m_latchedWheelEventNode = 0; m_previousWheelScrolledNode = 0; +#if ENABLE(TOUCH_EVENTS) + m_originatingTouchPointTargets.clear(); +#endif } void EventHandler::selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults& result) @@ -2714,21 +2717,21 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event) // Increment the platform touch id by 1 to avoid storing a key of 0 in the hashmap. unsigned touchPointTargetKey = point.id() + 1; - EventTarget* touchTarget = 0; + RefPtr touchTarget; if (point.state() == PlatformTouchPoint::TouchPressed) { m_originatingTouchPointTargets.set(touchPointTargetKey, target); touchTarget = target; } else if (point.state() == PlatformTouchPoint::TouchReleased || point.state() == PlatformTouchPoint::TouchCancelled) { // The target should be the original target for this touch, so get it from the hashmap. As it's a release or cancel // we also remove it from the map. - touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey).get(); + touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey); } else - touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey).get(); + touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey); - if (!touchTarget) + if (!touchTarget.get()) continue; - RefPtr touch = Touch::create(doc->frame(), touchTarget, point.id(), + RefPtr touch = Touch::create(doc->frame(), touchTarget.get(), point.id(), point.screenPos().x(), point.screenPos().y(), adjustedPageX, adjustedPageY); diff --git a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp index 890eacd..d7eaf25 100644 --- a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp +++ b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp @@ -477,9 +477,8 @@ void scrollIntoView(Element* element) // it is preferable to inflate |element|'s bounding rect a bit before // scrolling it for accurate reason. // Element's scrollIntoView method does not provide this flexibility. - static const int fudgeFactor = 2; IntRect bounds = element->getRect(); - bounds.inflate(fudgeFactor); + bounds.inflate(fudgeFactor()); element->renderer()->enclosingLayer()->scrollRectToVisible(bounds); } @@ -497,14 +496,14 @@ static void deflateIfOverlapped(IntRect& a, IntRect& b) if (!a.intersects(b) || a.contains(b) || b.contains(a)) return; - static const int fudgeFactor = -2; + int deflateFactor = -fudgeFactor(); // Avoid negative width or height values. - if ((a.width() + 2 * fudgeFactor > 0) && (a.height() + 2 * fudgeFactor > 0)) - a.inflate(fudgeFactor); + if ((a.width() + 2 * deflateFactor > 0) && (a.height() + 2 * deflateFactor > 0)) + a.inflate(deflateFactor); - if ((b.width() + 2 * fudgeFactor > 0) && (b.height() + 2 * fudgeFactor > 0)) - b.inflate(fudgeFactor); + if ((b.width() + 2 * deflateFactor > 0) && (b.height() + 2 * deflateFactor > 0)) + b.inflate(deflateFactor); } static bool checkNegativeCoordsForNode(Node* node, const IntRect& curRect) diff --git a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.h b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.h index 90ff1cf..309b095 100644 --- a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.h +++ b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.h @@ -40,6 +40,11 @@ inline long long maxDistance() return numeric_limits::max(); } +inline unsigned int fudgeFactor() +{ + return 2; +} + // Spatially speaking, two given elements in a web page can be: // 1) Fully aligned: There is a full intersection between the rects, either // vertically or horizontally. diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp index edac268..0100b72 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp @@ -641,12 +641,12 @@ void GraphicsContext::fillRect(const FloatRect& rect) } } -void GraphicsContext::fillRect(const FloatRect& rect, const Color& c, ColorSpace colorSpace) +void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorSpace colorSpace) { - if (paintingDisabled()) + if (paintingDisabled() || !color.isValid()) return; - m_data->solidColor.setColor(c); + m_data->solidColor.setColor(color); QPainter* p = m_data->p(); if (m_common->state.shadowColor.isValid()) drawBorderlessRectShadow(this, p, rect); @@ -655,7 +655,7 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& c, ColorSpace void GraphicsContext::fillRoundedRect(const IntRect& rect, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color& color, ColorSpace colorSpace) { - if (paintingDisabled() || !color.alpha()) + if (paintingDisabled() || !color.isValid() || !color.alpha()) return; Path path = Path::createRoundedRectangle(rect, topLeft, topRight, bottomLeft, bottomRight); @@ -717,7 +717,7 @@ void GraphicsContext::drawFocusRing(const Vector& paths, int width, int of */ void GraphicsContext::drawFocusRing(const Vector& rects, int /* width */, int /* offset */, const Color& color) { - if (paintingDisabled()) + if (paintingDisabled() || !color.isValid()) return; unsigned rectCount = rects.size(); @@ -1141,8 +1141,9 @@ void GraphicsContext::setURLForRect(const KURL&, const IntRect&) void GraphicsContext::setPlatformStrokeColor(const Color& color, ColorSpace colorSpace) { - if (paintingDisabled()) + if (paintingDisabled() || !color.isValid()) return; + QPainter* p = m_data->p(); QPen newPen(p->pen()); m_data->solidColor.setColor(color); @@ -1172,8 +1173,9 @@ void GraphicsContext::setPlatformStrokeThickness(float thickness) void GraphicsContext::setPlatformFillColor(const Color& color, ColorSpace colorSpace) { - if (paintingDisabled()) + if (paintingDisabled() || !color.isValid()) return; + m_data->solidColor.setColor(color); m_data->p()->setBrush(m_data->solidColor); } diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp index ee4af7f..4b0c21f 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp @@ -69,12 +69,41 @@ Path& Path::operator=(const Path& other) return *this; } +// Check whether a point is on the border +bool isPointOnPathBorder(const QPolygonF& border, const QPointF& p) +{ + QPointF p1 = border.at(0); + QPointF p2; + + for (int i = 1; i < border.size(); ++i) { + p2 = border.at(i); + // (x1<=x<=x2||x1=>x>=x2) && (y1<=y<=y2||y1=>y>=y2) && (y2-y1)(x-x1) == (y-y1)(x2-x1) + // In which, (y2-y1)(x-x1) == (y-y1)(x2-x1) is from (y2-y1)/(x2-x1) == (y-y1)/(x-x1) + // it want to check the slope between p1 and p2 is same with slope between p and p1, + // if so then the three points lie on the same line. + // In which, (x1<=x<=x2||x1=>x>=x2) && (y1<=y<=y2||y1=>y>=y2) want to make sure p is + // between p1 and p2, not outside. + if (((p.x() <= p1.x() && p.x() >= p2.x()) || (p.x() >= p1.x() && p.x() <= p2.x())) + && ((p.y() <= p1.y() && p.y() >= p2.y()) || (p.y() >= p1.y() && p.y() <= p2.y())) + && (p2.y() - p1.y()) * (p.x() - p1.x()) == (p.y() - p1.y()) * (p2.x() - p1.x())) { + return true; + } + p1 = p2; + } + return false; +} + bool Path::contains(const FloatPoint& point, WindRule rule) const { Qt::FillRule savedRule = m_path.fillRule(); const_cast(&m_path)->setFillRule(rule == RULE_EVENODD ? Qt::OddEvenFill : Qt::WindingFill); bool contains = m_path.contains(point); + + if (!contains) { + // check whether the point is on the border + contains = isPointOnPathBorder(m_path.toFillPolygon(), point); + } const_cast(&m_path)->setFillRule(savedRule); return contains; diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h b/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h index 0d98fcb..e355025 100644 --- a/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h +++ b/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h @@ -42,6 +42,13 @@ namespace WebCore { if (currentLookups >= 10) return; // do not launch more than 10 lookups at the same time +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 3) + currentLookups++; + QHostInfo::lookupHost(hostname, this, SLOT(lookedUp(QHostInfo))); +#else + // This code is only needed for Qt versions that do not have + // the small Qt DNS cache yet. + QTime* entryTime = lookupCache.object(hostname); if (entryTime && entryTime->elapsed() > 300*1000) { // delete knowledge about lookup if it is already 300 seconds old @@ -54,6 +61,7 @@ namespace WebCore { currentLookups++; QHostInfo::lookupHost(hostname, this, SLOT(lookedUp(QHostInfo))); } +#endif } void lookedUp(const QHostInfo&) @@ -61,11 +69,14 @@ namespace WebCore { // we do not cache the result, we throw it away. // we currently rely on the OS to cache the results. If it does not do that // then at least the ISP nameserver did it. + // Since Qt 4.6.3, Qt also has a small DNS cache. currentLookups--; } protected: +#if QT_VERSION < QT_VERSION_CHECK(4, 6, 3) QCache lookupCache; // 100 entries +#endif int currentLookups; }; diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp index 403718f..abeb895 100644 --- a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp +++ b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp @@ -49,6 +49,7 @@ #define SIGNAL_CONN Qt::QueuedConnection #endif +static const int gMaxRecursionLimit = 10; namespace WebCore { @@ -139,6 +140,7 @@ QNetworkReplyHandler::QNetworkReplyHandler(ResourceHandle* handle, LoadMode load , m_shouldFinish(false) , m_shouldSendResponse(false) , m_shouldForwardData(false) + , m_redirectionTries(gMaxRecursionLimit) { const ResourceRequest &r = m_resourceHandle->request(); @@ -336,9 +338,18 @@ void QNetworkReplyHandler::sendResponseIfNeeded() QUrl redirection = m_reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl(); if (redirection.isValid()) { + QUrl newUrl = m_reply->url().resolved(redirection); + + m_redirectionTries--; + if (m_redirectionTries == 0) { // 10 or more redirections to the same url is considered infinite recursion + ResourceError error(newUrl.host(), 400 /*bad request*/, + newUrl.toString(), + QCoreApplication::translate("QWebPage", "Redirection limit reached")); + client->didFail(m_resourceHandle, error); + return; + } m_redirected = true; - QUrl newUrl = m_reply->url().resolved(redirection); ResourceRequest newRequest = m_resourceHandle->request(); newRequest.setURL(newUrl); diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.h b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.h index eb5ae3c..1abad4e 100644 --- a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.h +++ b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.h @@ -82,6 +82,7 @@ private: bool m_shouldFinish; bool m_shouldSendResponse; bool m_shouldForwardData; + int m_redirectionTries; }; // Self destructing QIODevice for FormData diff --git a/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp b/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp deleted file mode 100644 index 814f961..0000000 --- a/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com - * Copyright (C) 2006 George Staikos - * Copyright (C) 2006 Dirk Mueller - * Copyright (C) 2006 Nikolas Zimmermann - * Copyright (C) 2008 Collabora, Ltd. - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -#include "config.h" - -#include "AXObjectCache.h" -#include "DNS.h" -#include "CString.h" -#include "CachedResource.h" -#include "CookieJar.h" -#include "Cursor.h" -#include "Font.h" -#include "Frame.h" -#include "FrameLoader.h" -#include "FTPDirectoryDocument.h" -#include "IntPoint.h" -#include "Widget.h" -#include "GraphicsContext.h" -#include "Cursor.h" -#include "loader.h" -#include "FileSystem.h" -#include "FrameView.h" -#include "GraphicsContext.h" -#include "IconLoader.h" -#include "IntPoint.h" -#include "KURL.h" -#include "Language.h" -#include "loader.h" -#include "LocalizedStrings.h" -#include "Node.h" -#include "NotImplemented.h" -#include "Path.h" -#include "PlatformMouseEvent.h" -#include "PluginDatabase.h" -#include "PluginPackage.h" -#include "PluginView.h" -#include "RenderTheme.h" -#include "SharedBuffer.h" -#include "SystemTime.h" -#include "TextBoundaries.h" -#include "Widget.h" -#include -#include -#include - -using namespace WebCore; - -#if defined(Q_OS_WINCE) -Vector PluginDatabase::defaultPluginDirectories() -{ - notImplemented(); - return Vector(); -} - -void PluginDatabase::getPluginPathsInDirectories(HashSet& paths) const -{ - notImplemented(); -} - -bool PluginDatabase::isPreferredPluginDirectory(const String& directory) -{ - notImplemented(); - return false; -} -#endif - -namespace WebCore { - -void getSupportedKeySizes(Vector&) -{ - notImplemented(); -} - -String signedPublicKeyAndChallengeString(unsigned, const String&, const KURL&) -{ - return String(); -} - -#if !defined(Q_OS_WIN) -// defined in win/SystemTimeWin.cpp, which is compiled for the Qt/Windows port -float userIdleTime() -{ - notImplemented(); - return FLT_MAX; // return an arbitrarily high userIdleTime so that releasing pages from the page cache isn't postponed -} -#endif - -} - -// vim: ts=4 sw=4 et diff --git a/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubsQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubsQt.cpp new file mode 100644 index 0000000..814f961 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubsQt.cpp @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com + * Copyright (C) 2006 George Staikos + * Copyright (C) 2006 Dirk Mueller + * Copyright (C) 2006 Nikolas Zimmermann + * Copyright (C) 2008 Collabora, Ltd. + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. + */ + +#include "config.h" + +#include "AXObjectCache.h" +#include "DNS.h" +#include "CString.h" +#include "CachedResource.h" +#include "CookieJar.h" +#include "Cursor.h" +#include "Font.h" +#include "Frame.h" +#include "FrameLoader.h" +#include "FTPDirectoryDocument.h" +#include "IntPoint.h" +#include "Widget.h" +#include "GraphicsContext.h" +#include "Cursor.h" +#include "loader.h" +#include "FileSystem.h" +#include "FrameView.h" +#include "GraphicsContext.h" +#include "IconLoader.h" +#include "IntPoint.h" +#include "KURL.h" +#include "Language.h" +#include "loader.h" +#include "LocalizedStrings.h" +#include "Node.h" +#include "NotImplemented.h" +#include "Path.h" +#include "PlatformMouseEvent.h" +#include "PluginDatabase.h" +#include "PluginPackage.h" +#include "PluginView.h" +#include "RenderTheme.h" +#include "SharedBuffer.h" +#include "SystemTime.h" +#include "TextBoundaries.h" +#include "Widget.h" +#include +#include +#include + +using namespace WebCore; + +#if defined(Q_OS_WINCE) +Vector PluginDatabase::defaultPluginDirectories() +{ + notImplemented(); + return Vector(); +} + +void PluginDatabase::getPluginPathsInDirectories(HashSet& paths) const +{ + notImplemented(); +} + +bool PluginDatabase::isPreferredPluginDirectory(const String& directory) +{ + notImplemented(); + return false; +} +#endif + +namespace WebCore { + +void getSupportedKeySizes(Vector&) +{ + notImplemented(); +} + +String signedPublicKeyAndChallengeString(unsigned, const String&, const KURL&) +{ + return String(); +} + +#if !defined(Q_OS_WIN) +// defined in win/SystemTimeWin.cpp, which is compiled for the Qt/Windows port +float userIdleTime() +{ + notImplemented(); + return FLT_MAX; // return an arbitrarily high userIdleTime so that releasing pages from the page cache isn't postponed +} +#endif + +} + +// vim: ts=4 sw=4 et diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp index 0c13e43..75a23d9 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp @@ -82,7 +82,6 @@ public: , page(0) , resizesToContents(false) #if USE(ACCELERATED_COMPOSITING) - , rootGraphicsLayer(0) , shouldSync(false) #endif { @@ -158,7 +157,7 @@ public: enum { RootGraphicsLayerZValue, OverlayZValue }; #if USE(ACCELERATED_COMPOSITING) - QGraphicsItem* rootGraphicsLayer; + QWeakPointer rootGraphicsLayer; // we need to sync the layers if we get a special call from the WebCore // compositor telling us to do so. We'll get that call from ChromeClientQt bool shouldSync; @@ -171,12 +170,11 @@ public: QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate() { #if USE(ACCELERATED_COMPOSITING) - if (rootGraphicsLayer) { - // we don't need to delete the root graphics layer - // The lifecycle is managed in GraphicsLayerQt.cpp - rootGraphicsLayer->setParentItem(0); - q->scene()->removeItem(rootGraphicsLayer); - } + if (!rootGraphicsLayer) + return; + // we don't need to delete the root graphics layer. The lifecycle is managed in GraphicsLayerQt.cpp. + rootGraphicsLayer.data()->setParentItem(0); + q->scene()->removeItem(rootGraphicsLayer.data()); #endif } @@ -204,12 +202,12 @@ void QGraphicsWebViewPrivate::createOrDeleteOverlay() void QGraphicsWebViewPrivate::setRootGraphicsLayer(QGraphicsItem* layer) { if (rootGraphicsLayer) { - rootGraphicsLayer->setParentItem(0); - q->scene()->removeItem(rootGraphicsLayer); + rootGraphicsLayer.data()->setParentItem(0); + q->scene()->removeItem(rootGraphicsLayer.data()); QWebFramePrivate::core(q->page()->mainFrame())->view()->syncCompositingStateRecursive(); } - rootGraphicsLayer = layer; + rootGraphicsLayer = layer ? layer->toGraphicsObject() : 0; if (layer) { layer->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true); @@ -231,7 +229,7 @@ void QGraphicsWebViewPrivate::updateCompositingScrollPosition() { if (rootGraphicsLayer && q->page() && q->page()->mainFrame()) { const QPoint scrollPosition = q->page()->mainFrame()->scrollPosition(); - rootGraphicsLayer->setPos(-scrollPosition); + rootGraphicsLayer.data()->setPos(-scrollPosition); } } #endif diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index b8b50b7..e9ebce5 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -119,15 +119,6 @@ using namespace WebCore; -void QWEBKIT_EXPORT qt_wrt_setViewMode(QWebPage* page, const QString& mode) -{ - QWebPagePrivate::priv(page)->viewMode = mode; - WebCore::Frame* frame = QWebFramePrivate::core(page->mainFrame()); - WebCore::FrameView* view = frame->view(); - frame->document()->updateStyleSelector(); - view->forceLayout(); -} - void QWEBKIT_EXPORT qt_drt_overwritePluginDirectories() { PluginDatabase* db = PluginDatabase::installedPlugins(/* populate */ false); @@ -1361,6 +1352,26 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) ev->accept(); } +void QWebPagePrivate::dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent* event) +{ + if (event->propertyName() == "_q_viewMode") { + QString mode = q->property("_q_viewMode").toString(); + if (mode != viewMode) { + viewMode = mode; + WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame()); + WebCore::FrameView* view = frame->view(); + frame->document()->updateStyleSelector(); + view->forceLayout(); + } + } else if (event->propertyName() == "_q_HTMLTokenizerChunkSize") { + int chunkSize = q->property("_q_HTMLTokenizerChunkSize").toInt(); + q->handle()->page->setCustomHTMLTokenizerChunkSize(chunkSize); + } else if (event->propertyName() == "_q_HTMLTokenizerTimeDelay") { + double timeDelay = q->property("_q_HTMLTokenizerTimeDelay").toDouble(); + q->handle()->page->setCustomHTMLTokenizerTimeDelay(timeDelay); + } +} + void QWebPagePrivate::shortcutOverrideEvent(QKeyEvent* event) { WebCore::Frame* frame = page->focusController()->focusedOrMainFrame(); @@ -2708,6 +2719,9 @@ bool QWebPage::event(QEvent *ev) d->touchEvent(static_cast(ev)); break; #endif + case QEvent::DynamicPropertyChange: + d->dynamicPropertyChangeEvent(static_cast(ev)); + break; default: return QObject::event(ev); } diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h index 0712d0c..5350cd9 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h @@ -112,6 +112,8 @@ public: void inputMethodEvent(QInputMethodEvent*); + void dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent*); + void shortcutOverrideEvent(QKeyEvent*); void leaveEvent(QEvent*); void handleClipboard(QEvent*, Qt::MouseButton); diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index 555b14d..6ddaa2b 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,61 @@ +2010-05-09 Noam Rosenthal + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Crash in QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate when animation were used + https://bugs.webkit.org/show_bug.cgi?id=38574 + + The fix uses a QWeakPointer for rootGraphicsLayer, protecting from a crash in case the layer is deleted before the QGraphicsWebView. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): + (QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate): + (QGraphicsWebViewPrivate::setRootGraphicsLayer): + (QGraphicsWebViewPrivate::updateCompositingScrollPosition): + +2010-05-03 Laszlo Gombos + + Reviewed by Simon Hausmann. + + [Qt] Expose HTMLTokenizer yielding parameters + https://bugs.webkit.org/show_bug.cgi?id=37023 + + Enables to set TimeDelay and ChunkSize for + HTMLTokenizer. + + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + +2010-05-04 Laszlo Gombos + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QWebPage viewMode property + https://bugs.webkit.org/show_bug.cgi?id=38119 + + Rename the property from wrt_viewMode to _q_viewMode. + + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::viewModes): + +2010-04-28 Luiz Agostini + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QWebPage viewMode property + https://bugs.webkit.org/show_bug.cgi?id=38119 + + Replacing method qt_wrt_setViewMode by wrt_viewMode property. + + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + (QWebPage::event): + * Api/qwebpage_p.h: + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::wrt_viewModes): + 2010-04-09 Tasuku Suzuki Reviewed by Simon Hausmann. diff --git a/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def b/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def index a450f9e..910ba8f 100644 --- a/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def +++ b/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def @@ -642,7 +642,7 @@ EXPORTS ?qt_drt_webinspector_executeScript@@YAXPAVQWebPage@@JABVQString@@@Z @ 641 NONAME ; void qt_drt_webinspector_executeScript(class QWebPage *, long, class QString const &) ?qt_drt_webinspector_show@@YAXPAVQWebPage@@@Z @ 642 NONAME ; void qt_drt_webinspector_show(class QWebPage *) ?qt_drt_workerThreadCount@@YAHXZ @ 643 NONAME ; int qt_drt_workerThreadCount(void) - ?qt_wrt_setViewMode@@YAXPAVQWebPage@@ABVQString@@@Z @ 644 NONAME ; void qt_wrt_setViewMode(class QWebPage *, class QString const &) + ?qt_wrt_setViewMode@@YAXPAVQWebPage@@ABVQString@@@Z @ 644 NONAME ABSENT ; void qt_wrt_setViewMode(class QWebPage *, class QString const &) ?qtwebkit_webframe_scrollRecursively@@YAXPAVQWebFrame@@HHABVQPoint@@@Z @ 645 NONAME ; void qtwebkit_webframe_scrollRecursively(class QWebFrame *, int, int, class QPoint const &) ?resizesToContents@QGraphicsWebView@@QBE_NXZ @ 646 NONAME ; bool QGraphicsWebView::resizesToContents(void) const ?scrollToAnchor@QWebFrame@@QAEXABVQString@@@Z @ 647 NONAME ; void QWebFrame::scrollToAnchor(class QString const &) diff --git a/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def b/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def index 145fe0b..ca462d0 100644 --- a/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def +++ b/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def @@ -716,7 +716,7 @@ EXPORTS _ZN13QWebInspector10closeEventEP11QCloseEvent @ 715 NONAME _ZN16QGraphicsWebView26setTiledBackingStoreFrozenEb @ 716 NONAME _ZNK16QGraphicsWebView25isTiledBackingStoreFrozenEv @ 717 NONAME - _Z18qt_wrt_setViewModeP8QWebPageRK7QString @ 718 NONAME + _Z18qt_wrt_setViewModeP8QWebPageRK7QString @ 718 NONAME ABSENT _Z19qt_drt_setMediaTypeP9QWebFrameRK7QString @ 719 NONAME _Z26qt_drt_enableCaretBrowsingP8QWebPageb @ 720 NONAME _ZNK12QWebSettings12inspectorUrlEv @ 721 NONAME diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp index f7eddd5..834a394 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -110,6 +110,8 @@ private slots: void userAgentApplicationName(); void userAgentLocaleChange(); + void viewModes(); + void crashTests_LazyInitializationOfMainFrame(); void screenshot_data(); @@ -357,6 +359,21 @@ void tst_QWebPage::userStyleSheet() QCOMPARE(networkManager->requestedUrls.at(0), QUrl("http://does.not/exist.png")); } +void tst_QWebPage::viewModes() +{ + m_view->setHtml(""); + m_page->setProperty("_q_viewMode", "minimized"); + + QVariant empty = m_page->mainFrame()->evaluateJavaScript("window.styleMedia.matchMedium(\"(-webkit-view-mode)\")"); + QVERIFY(empty.type() == QVariant::Bool && empty.toBool()); + + QVariant minimized = m_page->mainFrame()->evaluateJavaScript("window.styleMedia.matchMedium(\"(-webkit-view-mode: minimized)\")"); + QVERIFY(minimized.type() == QVariant::Bool && minimized.toBool()); + + QVariant maximized = m_page->mainFrame()->evaluateJavaScript("window.styleMedia.matchMedium(\"(-webkit-view-mode: maximized)\")"); + QVERIFY(maximized.type() == QVariant::Bool && !maximized.toBool()); +} + void tst_QWebPage::modified() { m_page->mainFrame()->setUrl(QUrl("data:text/html,blub")); -- cgit v0.12 From 8191aae91f97c22545750460c7a7d5ef1a7288bd Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 12 May 2010 12:55:03 +0200 Subject: Updated WebKit to dc5821c3df2ef60456d85263160852f5335cf946 Integrated changes: || || [Qt] fast/text/find-hidden-text.html || || || Rename window.media to window.styleMedia || || || Need to call FrameView::scrollPositionChanged when changing the scroll position when the ScrollView does not have a platformWidget || || || [Qt] fast/frames/flattening/frameset-flattening-subframesets.html fails intermittently on Qt bot || --- src/3rdparty/webkit/.tag | 2 +- src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebCore/ChangeLog | 99 ++++++++++ src/3rdparty/webkit/WebCore/WebCore.gypi | 16 +- src/3rdparty/webkit/WebCore/WebCore.pri | 4 +- src/3rdparty/webkit/WebCore/WebCore.pro | 4 +- src/3rdparty/webkit/WebCore/css/Media.cpp | 77 -------- src/3rdparty/webkit/WebCore/css/Media.h | 54 ------ src/3rdparty/webkit/WebCore/css/Media.idl | 31 ---- src/3rdparty/webkit/WebCore/css/StyleMedia.cpp | 77 ++++++++ src/3rdparty/webkit/WebCore/css/StyleMedia.h | 55 ++++++ src/3rdparty/webkit/WebCore/css/StyleMedia.idl | 32 ++++ .../webkit/WebCore/generated/JSDOMWindow.cpp | 10 +- .../webkit/WebCore/generated/JSDOMWindow.h | 2 +- src/3rdparty/webkit/WebCore/generated/JSMedia.cpp | 201 --------------------- src/3rdparty/webkit/WebCore/generated/JSMedia.h | 87 --------- .../webkit/WebCore/generated/JSStyleMedia.cpp | 201 +++++++++++++++++++++ .../webkit/WebCore/generated/JSStyleMedia.h | 87 +++++++++ src/3rdparty/webkit/WebCore/page/AbstractView.idl | 2 +- src/3rdparty/webkit/WebCore/page/DOMWindow.cpp | 6 +- src/3rdparty/webkit/WebCore/page/DOMWindow.h | 8 +- src/3rdparty/webkit/WebCore/page/DOMWindow.idl | 2 +- src/3rdparty/webkit/WebCore/page/FrameView.h | 2 +- .../webkit/WebCore/platform/ScrollView.cpp | 1 + src/3rdparty/webkit/WebCore/platform/ScrollView.h | 3 + .../WebCore/platform/qt/ScrollbarThemeQt.cpp | 2 +- 26 files changed, 586 insertions(+), 481 deletions(-) delete mode 100644 src/3rdparty/webkit/WebCore/css/Media.cpp delete mode 100644 src/3rdparty/webkit/WebCore/css/Media.h delete mode 100644 src/3rdparty/webkit/WebCore/css/Media.idl create mode 100644 src/3rdparty/webkit/WebCore/css/StyleMedia.cpp create mode 100644 src/3rdparty/webkit/WebCore/css/StyleMedia.h create mode 100644 src/3rdparty/webkit/WebCore/css/StyleMedia.idl delete mode 100644 src/3rdparty/webkit/WebCore/generated/JSMedia.cpp delete mode 100644 src/3rdparty/webkit/WebCore/generated/JSMedia.h create mode 100644 src/3rdparty/webkit/WebCore/generated/JSStyleMedia.cpp create mode 100644 src/3rdparty/webkit/WebCore/generated/JSStyleMedia.h diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag index 65cfdda..d8b4b32 100644 --- a/src/3rdparty/webkit/.tag +++ b/src/3rdparty/webkit/.tag @@ -1 +1 @@ -dc5821c3df2ef60456d85263160852f5335cf946 +57d10d5c05e59bbf7de8189ff47dd18d1be996dc diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 24f855b..c8c2aa3 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from and has the sha1 checksum - b4aa5e1ddc41edab895132aba3cc66d9d7129444 + dc5821c3df2ef60456d85263160852f5335cf946 diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index ee42878..76b4eff 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,102 @@ +2010-04-29 James Robinson + + Reviewed by Simon Fraser. + + Calls FrameView::scrollPositionChanged whenever a ScrollView is scrolled + https://bugs.webkit.org/show_bug.cgi?id=38286 + + When a ScrollView's scroll position is changed, we have to call + FrameView::scrollPositionChanged to generate repaint invalidation for + fixed position elements. This ends up getting called indirectly when + the ScrollView has a platformWidget through the port layer + (see WebHTMLView.mm's _frameOrBoundsChanged method for how the mac + port does it) but not when there is no platformWidget. + + This is tested by the fast/repaint/fixed-* tests when run in pixel + mode. + + Test: fast/repaint/fixed-move-after-keyboard-scroll.html + + * page/FrameView.h: + * platform/ScrollView.cpp: + (WebCore::ScrollView::valueChanged): + * platform/ScrollView.h: + (WebCore::ScrollView::scrollPositionChanged): + +2010-04-23 Kenneth Rohde Christiansen + + Unreviewed build fix. + + Change Media to StyleMedia + + * DerivedSources.make: + +2010-04-22 Kenneth Rohde Christiansen + + Reviewed by Laszlo Gombos. + + Rename window.media to window.styleMedia + https://bugs.webkit.org/show_bug.cgi?id=36187 + + Rename the interface Media to StyleMedia as required by the + new CSSOM View spec. + + * Android.derived.jscbindings.mk: + * Android.derived.v8bindings.mk: + * GNUmakefile.am: + * WebCore.gypi: + * WebCore.pri: + * WebCore.pro: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + * css/Media.cpp: Removed. + * css/Media.h: Removed. + * css/Media.idl: Removed. + * css/StyleMedia.cpp: Added. + (WebCore::StyleMedia::StyleMedia): + (WebCore::StyleMedia::type): + (WebCore::StyleMedia::matchMedium): + * css/StyleMedia.h: Added. + (WebCore::StyleMedia::create): + (WebCore::StyleMedia::disconnectFrame): + * css/StyleMedia.idl: Added. + * page/DOMWindow.cpp: + (WebCore::DOMWindow::styleMedia): + * page/DOMWindow.h: + (WebCore::DOMWindow::optionalMedia): + * page/DOMWindow.idl: + +2010-04-22 Kenneth Rohde Christiansen + + Reviewed by Simon Fraser. + + Rename window.media to window.styleMedia + https://bugs.webkit.org/show_bug.cgi?id=36187 + + It has been defined that the AbstractView media extension + defined in the CSSOM View spec should be renamed to styleMedia. + This patch does that and updates the current layout tests + making use of it. + + * page/AbstractView.idl: + * page/DOMWindow.cpp: + (WebCore::DOMWindow::styleMedia): + * page/DOMWindow.h: + * page/DOMWindow.idl: + +2010-05-11 Benjamin Poulain + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] fast/text/find-hidden-text.html + https://bugs.webkit.org/show_bug.cgi?id=32922 + + Use the real page step for populating the QStyleOption otherwhise + the size can be negative, which can break the QStyle used. + + * platform/qt/ScrollbarThemeQt.cpp: + (WebCore::styleOptionSlider): + 2010-05-03 Antonio Gomes Reviewed by Kenneth Christiansen. diff --git a/src/3rdparty/webkit/WebCore/WebCore.gypi b/src/3rdparty/webkit/WebCore/WebCore.gypi index 701ad90..1e92f1f 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.gypi +++ b/src/3rdparty/webkit/WebCore/WebCore.gypi @@ -18,10 +18,10 @@ 'css/CSSVariablesDeclaration.idl', 'css/CSSVariablesRule.idl', 'css/Counter.idl', - 'css/Media.idl', 'css/MediaList.idl', - 'css/RGBColor.idl', 'css/Rect.idl', + 'css/RGBColor.idl', + 'css/StyleMedia.idl', 'css/StyleSheet.idl', 'css/StyleSheetList.idl', 'css/WebKitCSSKeyframeRule.idl', @@ -1003,33 +1003,33 @@ 'css/FontValue.h', 'css/MediaFeatureNames.cpp', 'css/MediaFeatureNames.h', - 'css/Media.cpp', - 'css/Media.h', 'css/MediaList.cpp', 'css/MediaList.h', 'css/MediaQuery.cpp', - 'css/MediaQuery.h', 'css/MediaQueryEvaluator.cpp', 'css/MediaQueryEvaluator.h', 'css/MediaQueryExp.cpp', 'css/MediaQueryExp.h', + 'css/MediaQuery.h', 'css/Pair.h', 'css/Rect.h', 'css/RGBColor.cpp', 'css/RGBColor.h', - 'css/SVGCSSComputedStyleDeclaration.cpp', - 'css/SVGCSSParser.cpp', - 'css/SVGCSSStyleSelector.cpp', 'css/ShadowValue.cpp', 'css/ShadowValue.h', 'css/StyleBase.cpp', 'css/StyleBase.h', 'css/StyleList.cpp', 'css/StyleList.h', + 'css/StyleMedia.cpp', + 'css/StyleMedia.h', 'css/StyleSheet.cpp', 'css/StyleSheet.h', 'css/StyleSheetList.cpp', 'css/StyleSheetList.h', + 'css/SVGCSSComputedStyleDeclaration.cpp', + 'css/SVGCSSParser.cpp', + 'css/SVGCSSStyleSelector.cpp', 'css/WebKitCSSKeyframeRule.cpp', 'css/WebKitCSSKeyframeRule.h', 'css/WebKitCSSKeyframesRule.cpp', diff --git a/src/3rdparty/webkit/WebCore/WebCore.pri b/src/3rdparty/webkit/WebCore/WebCore.pri index ad514a2..5f5987f 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pri +++ b/src/3rdparty/webkit/WebCore/WebCore.pri @@ -227,10 +227,10 @@ IDL_BINDINGS += \ css/CSSValueList.idl \ css/CSSVariablesDeclaration.idl \ css/CSSVariablesRule.idl \ - css/Media.idl \ css/MediaList.idl \ - css/RGBColor.idl \ css/Rect.idl \ + css/RGBColor.idl \ + css/StyleMedia.idl \ css/StyleSheet.idl \ css/StyleSheetList.idl \ css/WebKitCSSKeyframeRule.idl \ diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index e42cd8e..254d17b 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -431,7 +431,6 @@ SOURCES += \ css/FontFamilyValue.cpp \ css/FontValue.cpp \ css/MediaFeatureNames.cpp \ - css/Media.cpp \ css/MediaList.cpp \ css/MediaQuery.cpp \ css/MediaQueryEvaluator.cpp \ @@ -440,6 +439,7 @@ SOURCES += \ css/ShadowValue.cpp \ css/StyleBase.cpp \ css/StyleList.cpp \ + css/StyleMedia.cpp \ css/StyleSheet.cpp \ css/StyleSheetList.cpp \ css/WebKitCSSKeyframeRule.cpp \ @@ -1145,7 +1145,6 @@ HEADERS += \ css/FontFamilyValue.h \ css/FontValue.h \ css/MediaFeatureNames.h \ - css/Media.h \ css/MediaList.h \ css/MediaQueryEvaluator.h \ css/MediaQueryExp.h \ @@ -1154,6 +1153,7 @@ HEADERS += \ css/ShadowValue.h \ css/StyleBase.h \ css/StyleList.h \ + css/StyleMedia.h \ css/StyleSheet.h \ css/StyleSheetList.h \ css/WebKitCSSKeyframeRule.h \ diff --git a/src/3rdparty/webkit/WebCore/css/Media.cpp b/src/3rdparty/webkit/WebCore/css/Media.cpp deleted file mode 100644 index e238602..0000000 --- a/src/3rdparty/webkit/WebCore/css/Media.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2009 Apple 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: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -#include "config.h" - -#include "Media.h" -#include "CSSStyleSelector.h" -#include "Frame.h" -#include "FrameView.h" -#include "MediaList.h" -#include "MediaQueryEvaluator.h" - -namespace WebCore { - -Media::Media(Frame* frame) - : m_frame(frame) -{ -} - -String Media::type() const -{ - FrameView* view = m_frame ? m_frame->view() : 0; - if (view) - return view->mediaType(); - - return String(); -} - -bool Media::matchMedium(const String& query) const -{ - if (!m_frame) - return false; - - Document* document = m_frame->document(); - ASSERT(document); - Element* documentElement = document->documentElement(); - ASSERT(documentElement); - - CSSStyleSelector* styleSelector = document->styleSelector(); - if (!styleSelector) - return false; - - RefPtr rootStyle = styleSelector->styleForElement(documentElement, 0 /*defaultParent*/, false /*allowSharing*/, true /*resolveForRootDefault*/); - RefPtr media = MediaList::create(); - - ExceptionCode ec = 0; - media->setMediaText(query, ec); - if (ec) - return false; - - MediaQueryEvaluator screenEval(type(), m_frame, rootStyle.get()); - return screenEval.eval(media.get()); -} - -} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/css/Media.h b/src/3rdparty/webkit/WebCore/css/Media.h deleted file mode 100644 index ee6961b..0000000 --- a/src/3rdparty/webkit/WebCore/css/Media.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2009 Apple 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: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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 Media_h -#define Media_h - -#include "DOMWindow.h" - -namespace WebCore { - -class Media : public RefCounted { -public: - static PassRefPtr create(Frame* frame) - { - return adoptRef(new Media(frame)); - } - - void disconnectFrame() { m_frame = 0; } - - String type() const; - - bool matchMedium(const String&) const; - -private: - Media(Frame*); - - Frame* m_frame; -}; - -} // namespace - -#endif // Media_h diff --git a/src/3rdparty/webkit/WebCore/css/Media.idl b/src/3rdparty/webkit/WebCore/css/Media.idl deleted file mode 100644 index 1bf5900..0000000 --- a/src/3rdparty/webkit/WebCore/css/Media.idl +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2009 Apple 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: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -module view { - interface Media { - readonly attribute DOMString type; - boolean matchMedium(in DOMString mediaquery); - }; -} diff --git a/src/3rdparty/webkit/WebCore/css/StyleMedia.cpp b/src/3rdparty/webkit/WebCore/css/StyleMedia.cpp new file mode 100644 index 0000000..6cb662f --- /dev/null +++ b/src/3rdparty/webkit/WebCore/css/StyleMedia.cpp @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2009 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. + */ + +#include "config.h" +#include "StyleMedia.h" + +#include "CSSStyleSelector.h" +#include "Frame.h" +#include "FrameView.h" +#include "MediaList.h" +#include "MediaQueryEvaluator.h" + +namespace WebCore { + +StyleMedia::StyleMedia(Frame* frame) + : m_frame(frame) +{ +} + +String StyleMedia::type() const +{ + FrameView* view = m_frame ? m_frame->view() : 0; + if (view) + return view->mediaType(); + + return String(); +} + +bool StyleMedia::matchMedium(const String& query) const +{ + if (!m_frame) + return false; + + Document* document = m_frame->document(); + ASSERT(document); + Element* documentElement = document->documentElement(); + ASSERT(documentElement); + + CSSStyleSelector* styleSelector = document->styleSelector(); + if (!styleSelector) + return false; + + RefPtr rootStyle = styleSelector->styleForElement(documentElement, 0 /*defaultParent*/, false /*allowSharing*/, true /*resolveForRootDefault*/); + RefPtr media = MediaList::create(); + + ExceptionCode ec = 0; + media->setMediaText(query, ec); + if (ec) + return false; + + MediaQueryEvaluator screenEval(type(), m_frame, rootStyle.get()); + return screenEval.eval(media.get()); +} + +} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/css/StyleMedia.h b/src/3rdparty/webkit/WebCore/css/StyleMedia.h new file mode 100644 index 0000000..761e6a3 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/css/StyleMedia.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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 StyleMedia_h +#define StyleMedia_h + +#include "DOMWindow.h" + +namespace WebCore { + +class StyleMedia : public RefCounted { +public: + static PassRefPtr create(Frame* frame) + { + return adoptRef(new StyleMedia(frame)); + } + + void disconnectFrame() { m_frame = 0; } + + String type() const; + + bool matchMedium(const String&) const; + +private: + StyleMedia(Frame*); + + Frame* m_frame; +}; + +} // namespace + +#endif // StyleMedia_h diff --git a/src/3rdparty/webkit/WebCore/css/StyleMedia.idl b/src/3rdparty/webkit/WebCore/css/StyleMedia.idl new file mode 100644 index 0000000..7be35cc --- /dev/null +++ b/src/3rdparty/webkit/WebCore/css/StyleMedia.idl @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. + */ + +module view { + interface StyleMedia { + readonly attribute DOMString type; + boolean matchMedium(in DOMString mediaquery); + }; +} diff --git a/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp b/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp index 04238bc..11dfd2e 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp @@ -152,7 +152,6 @@ #include "JSHTMLVideoElement.h" #include "JSImageData.h" #include "JSKeyboardEvent.h" -#include "JSMedia.h" #include "JSMediaError.h" #include "JSMediaList.h" #include "JSMessageChannel.h" @@ -299,6 +298,7 @@ #include "JSSharedWorker.h" #include "JSStorage.h" #include "JSStorageEvent.h" +#include "JSStyleMedia.h" #include "JSStyleSheet.h" #include "JSStyleSheetList.h" #include "JSText.h" @@ -334,11 +334,11 @@ #include "JSXPathResult.h" #include "JSXSLTProcessor.h" #include "KURL.h" -#include "Media.h" #include "Navigator.h" #include "RegisteredEventListener.h" #include "Screen.h" #include "Storage.h" +#include "StyleMedia.h" #include "WebKitPoint.h" #include #include @@ -395,7 +395,7 @@ static const HashTableValue JSDOMWindowTableValues[409] = { "parent", DontDelete, (intptr_t)static_cast(jsDOMWindowParent), (intptr_t)setJSDOMWindowParent }, { "top", DontDelete, (intptr_t)static_cast(jsDOMWindowTop), (intptr_t)setJSDOMWindowTop }, { "document", DontDelete|ReadOnly, (intptr_t)static_cast(jsDOMWindowDocument), (intptr_t)0 }, - { "media", DontDelete|ReadOnly, (intptr_t)static_cast(jsDOMWindowMedia), (intptr_t)0 }, + { "styleMedia", DontDelete|ReadOnly, (intptr_t)static_cast(jsDOMWindowStyleMedia), (intptr_t)0 }, { "devicePixelRatio", DontDelete, (intptr_t)static_cast(jsDOMWindowDevicePixelRatio), (intptr_t)setJSDOMWindowDevicePixelRatio }, { "applicationCache", DontDelete|ReadOnly, (intptr_t)static_cast(jsDOMWindowApplicationCache), (intptr_t)0 }, { "sessionStorage", DontDelete|ReadOnly, (intptr_t)static_cast(jsDOMWindowSessionStorage), (intptr_t)0 }, @@ -1304,14 +1304,14 @@ JSValue jsDOMWindowDocument(ExecState* exec, JSValue slotBase, const Identifier& return result; } -JSValue jsDOMWindowMedia(ExecState* exec, JSValue slotBase, const Identifier&) +JSValue jsDOMWindowStyleMedia(ExecState* exec, JSValue slotBase, const Identifier&) { JSDOMWindow* castedThis = static_cast(asObject(slotBase)); if (!castedThis->allowsAccessFrom(exec)) return jsUndefined(); UNUSED_PARAM(exec); DOMWindow* imp = static_cast(castedThis->impl()); - JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->media())); + JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->styleMedia())); return result; } diff --git a/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h b/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h index a6f3253..7e50556 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h +++ b/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h @@ -231,7 +231,7 @@ void setJSDOMWindowParent(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); JSC::JSValue jsDOMWindowTop(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); void setJSDOMWindowTop(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); JSC::JSValue jsDOMWindowDocument(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); -JSC::JSValue jsDOMWindowMedia(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +JSC::JSValue jsDOMWindowStyleMedia(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); JSC::JSValue jsDOMWindowDevicePixelRatio(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); void setJSDOMWindowDevicePixelRatio(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); JSC::JSValue jsDOMWindowApplicationCache(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); diff --git a/src/3rdparty/webkit/WebCore/generated/JSMedia.cpp b/src/3rdparty/webkit/WebCore/generated/JSMedia.cpp deleted file mode 100644 index 1579c2b..0000000 --- a/src/3rdparty/webkit/WebCore/generated/JSMedia.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/* - This file is part of the WebKit open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "config.h" -#include "JSMedia.h" - -#include "KURL.h" -#include "Media.h" -#include -#include -#include - -using namespace JSC; - -namespace WebCore { - -ASSERT_CLASS_FITS_IN_CELL(JSMedia); - -/* Hash table */ - -static const HashTableValue JSMediaTableValues[3] = -{ - { "type", DontDelete|ReadOnly, (intptr_t)static_cast(jsMediaType), (intptr_t)0 }, - { "constructor", DontEnum|ReadOnly, (intptr_t)static_cast(jsMediaConstructor), (intptr_t)0 }, - { 0, 0, 0, 0 } -}; - -static JSC_CONST_HASHTABLE HashTable JSMediaTable = -#if ENABLE(PERFECT_HASH_SIZE) - { 3, JSMediaTableValues, 0 }; -#else - { 4, 3, JSMediaTableValues, 0 }; -#endif - -/* Hash table for constructor */ - -static const HashTableValue JSMediaConstructorTableValues[1] = -{ - { 0, 0, 0, 0 } -}; - -static JSC_CONST_HASHTABLE HashTable JSMediaConstructorTable = -#if ENABLE(PERFECT_HASH_SIZE) - { 0, JSMediaConstructorTableValues, 0 }; -#else - { 1, 0, JSMediaConstructorTableValues, 0 }; -#endif - -class JSMediaConstructor : public DOMConstructorObject { -public: - JSMediaConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) - : DOMConstructorObject(JSMediaConstructor::createStructure(globalObject->objectPrototype()), globalObject) - { - putDirect(exec->propertyNames().prototype, JSMediaPrototype::self(exec, globalObject), None); - } - virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); - virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); - virtual const ClassInfo* classInfo() const { return &s_info; } - static const ClassInfo s_info; - - static PassRefPtr createStructure(JSValue proto) - { - return Structure::create(proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount); - } - -protected: - static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | DOMConstructorObject::StructureFlags; -}; - -const ClassInfo JSMediaConstructor::s_info = { "MediaConstructor", 0, &JSMediaConstructorTable, 0 }; - -bool JSMediaConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) -{ - return getStaticValueSlot(exec, &JSMediaConstructorTable, this, propertyName, slot); -} - -bool JSMediaConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) -{ - return getStaticValueDescriptor(exec, &JSMediaConstructorTable, this, propertyName, descriptor); -} - -/* Hash table for prototype */ - -static const HashTableValue JSMediaPrototypeTableValues[2] = -{ - { "matchMedium", DontDelete|Function, (intptr_t)static_cast(jsMediaPrototypeFunctionMatchMedium), (intptr_t)1 }, - { 0, 0, 0, 0 } -}; - -static JSC_CONST_HASHTABLE HashTable JSMediaPrototypeTable = -#if ENABLE(PERFECT_HASH_SIZE) - { 0, JSMediaPrototypeTableValues, 0 }; -#else - { 2, 1, JSMediaPrototypeTableValues, 0 }; -#endif - -const ClassInfo JSMediaPrototype::s_info = { "MediaPrototype", 0, &JSMediaPrototypeTable, 0 }; - -JSObject* JSMediaPrototype::self(ExecState* exec, JSGlobalObject* globalObject) -{ - return getDOMPrototype(exec, globalObject); -} - -bool JSMediaPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) -{ - return getStaticFunctionSlot(exec, &JSMediaPrototypeTable, this, propertyName, slot); -} - -bool JSMediaPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) -{ - return getStaticFunctionDescriptor(exec, &JSMediaPrototypeTable, this, propertyName, descriptor); -} - -const ClassInfo JSMedia::s_info = { "Media", 0, &JSMediaTable, 0 }; - -JSMedia::JSMedia(NonNullPassRefPtr structure, JSDOMGlobalObject* globalObject, PassRefPtr impl) - : DOMObjectWithGlobalPointer(structure, globalObject) - , m_impl(impl) -{ -} - -JSMedia::~JSMedia() -{ - forgetDOMObject(this, impl()); -} - -JSObject* JSMedia::createPrototype(ExecState* exec, JSGlobalObject* globalObject) -{ - return new (exec) JSMediaPrototype(JSMediaPrototype::createStructure(globalObject->objectPrototype())); -} - -bool JSMedia::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) -{ - return getStaticValueSlot(exec, &JSMediaTable, this, propertyName, slot); -} - -bool JSMedia::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) -{ - return getStaticValueDescriptor(exec, &JSMediaTable, this, propertyName, descriptor); -} - -JSValue jsMediaType(ExecState* exec, JSValue slotBase, const Identifier&) -{ - JSMedia* castedThis = static_cast(asObject(slotBase)); - UNUSED_PARAM(exec); - Media* imp = static_cast(castedThis->impl()); - JSValue result = jsString(exec, imp->type()); - return result; -} - -JSValue jsMediaConstructor(ExecState* exec, JSValue slotBase, const Identifier&) -{ - JSMedia* domObject = static_cast(asObject(slotBase)); - return JSMedia::getConstructor(exec, domObject->globalObject()); -} -JSValue JSMedia::getConstructor(ExecState* exec, JSGlobalObject* globalObject) -{ - return getDOMConstructor(exec, static_cast(globalObject)); -} - -JSValue JSC_HOST_CALL jsMediaPrototypeFunctionMatchMedium(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) -{ - UNUSED_PARAM(args); - if (!thisValue.inherits(&JSMedia::s_info)) - return throwError(exec, TypeError); - JSMedia* castedThisObj = static_cast(asObject(thisValue)); - Media* imp = static_cast(castedThisObj->impl()); - const UString& mediaquery = args.at(0).toString(exec); - - - JSC::JSValue result = jsBoolean(imp->matchMedium(mediaquery)); - return result; -} - -JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Media* object) -{ - return getDOMObjectWrapper(exec, globalObject, object); -} -Media* toMedia(JSC::JSValue value) -{ - return value.inherits(&JSMedia::s_info) ? static_cast(asObject(value))->impl() : 0; -} - -} diff --git a/src/3rdparty/webkit/WebCore/generated/JSMedia.h b/src/3rdparty/webkit/WebCore/generated/JSMedia.h deleted file mode 100644 index 28515c9..0000000 --- a/src/3rdparty/webkit/WebCore/generated/JSMedia.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - This file is part of the WebKit open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef JSMedia_h -#define JSMedia_h - -#include "JSDOMBinding.h" -#include -#include - -namespace WebCore { - -class Media; - -class JSMedia : public DOMObjectWithGlobalPointer { - typedef DOMObjectWithGlobalPointer Base; -public: - JSMedia(NonNullPassRefPtr, JSDOMGlobalObject*, PassRefPtr); - virtual ~JSMedia(); - static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*); - virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); - virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&); - virtual const JSC::ClassInfo* classInfo() const { return &s_info; } - static const JSC::ClassInfo s_info; - - static PassRefPtr createStructure(JSC::JSValue prototype) - { - return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); - } - - static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*); - Media* impl() const { return m_impl.get(); } - -private: - RefPtr m_impl; -protected: - static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; -}; - -JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, Media*); -Media* toMedia(JSC::JSValue); - -class JSMediaPrototype : public JSC::JSObject { - typedef JSC::JSObject Base; -public: - static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*); - virtual const JSC::ClassInfo* classInfo() const { return &s_info; } - static const JSC::ClassInfo s_info; - virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); - virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); - static PassRefPtr createStructure(JSC::JSValue prototype) - { - return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); - } - JSMediaPrototype(NonNullPassRefPtr structure) : JSC::JSObject(structure) { } -protected: - static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; -}; - -// Functions - -JSC::JSValue JSC_HOST_CALL jsMediaPrototypeFunctionMatchMedium(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); -// Attributes - -JSC::JSValue jsMediaType(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); -JSC::JSValue jsMediaConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); - -} // namespace WebCore - -#endif diff --git a/src/3rdparty/webkit/WebCore/generated/JSStyleMedia.cpp b/src/3rdparty/webkit/WebCore/generated/JSStyleMedia.cpp new file mode 100644 index 0000000..b06bf09 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/generated/JSStyleMedia.cpp @@ -0,0 +1,201 @@ +/* + This file is part of the WebKit open source project. + This file has been generated by generate-bindings.pl. DO NOT MODIFY! + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" +#include "JSStyleMedia.h" + +#include "KURL.h" +#include "StyleMedia.h" +#include +#include +#include + +using namespace JSC; + +namespace WebCore { + +ASSERT_CLASS_FITS_IN_CELL(JSStyleMedia); + +/* Hash table */ + +static const HashTableValue JSStyleMediaTableValues[3] = +{ + { "type", DontDelete|ReadOnly, (intptr_t)static_cast(jsStyleMediaType), (intptr_t)0 }, + { "constructor", DontEnum|ReadOnly, (intptr_t)static_cast(jsStyleMediaConstructor), (intptr_t)0 }, + { 0, 0, 0, 0 } +}; + +static JSC_CONST_HASHTABLE HashTable JSStyleMediaTable = +#if ENABLE(PERFECT_HASH_SIZE) + { 3, JSStyleMediaTableValues, 0 }; +#else + { 4, 3, JSStyleMediaTableValues, 0 }; +#endif + +/* Hash table for constructor */ + +static const HashTableValue JSStyleMediaConstructorTableValues[1] = +{ + { 0, 0, 0, 0 } +}; + +static JSC_CONST_HASHTABLE HashTable JSStyleMediaConstructorTable = +#if ENABLE(PERFECT_HASH_SIZE) + { 0, JSStyleMediaConstructorTableValues, 0 }; +#else + { 1, 0, JSStyleMediaConstructorTableValues, 0 }; +#endif + +class JSStyleMediaConstructor : public DOMConstructorObject { +public: + JSStyleMediaConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) + : DOMConstructorObject(JSStyleMediaConstructor::createStructure(globalObject->objectPrototype()), globalObject) + { + putDirect(exec->propertyNames().prototype, JSStyleMediaPrototype::self(exec, globalObject), None); + } + virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); + virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); + virtual const ClassInfo* classInfo() const { return &s_info; } + static const ClassInfo s_info; + + static PassRefPtr createStructure(JSValue proto) + { + return Structure::create(proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount); + } + +protected: + static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | DOMConstructorObject::StructureFlags; +}; + +const ClassInfo JSStyleMediaConstructor::s_info = { "StyleMediaConstructor", 0, &JSStyleMediaConstructorTable, 0 }; + +bool JSStyleMediaConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + return getStaticValueSlot(exec, &JSStyleMediaConstructorTable, this, propertyName, slot); +} + +bool JSStyleMediaConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +{ + return getStaticValueDescriptor(exec, &JSStyleMediaConstructorTable, this, propertyName, descriptor); +} + +/* Hash table for prototype */ + +static const HashTableValue JSStyleMediaPrototypeTableValues[2] = +{ + { "matchMedium", DontDelete|Function, (intptr_t)static_cast(jsStyleMediaPrototypeFunctionMatchMedium), (intptr_t)1 }, + { 0, 0, 0, 0 } +}; + +static JSC_CONST_HASHTABLE HashTable JSStyleMediaPrototypeTable = +#if ENABLE(PERFECT_HASH_SIZE) + { 0, JSStyleMediaPrototypeTableValues, 0 }; +#else + { 2, 1, JSStyleMediaPrototypeTableValues, 0 }; +#endif + +const ClassInfo JSStyleMediaPrototype::s_info = { "StyleMediaPrototype", 0, &JSStyleMediaPrototypeTable, 0 }; + +JSObject* JSStyleMediaPrototype::self(ExecState* exec, JSGlobalObject* globalObject) +{ + return getDOMPrototype(exec, globalObject); +} + +bool JSStyleMediaPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + return getStaticFunctionSlot(exec, &JSStyleMediaPrototypeTable, this, propertyName, slot); +} + +bool JSStyleMediaPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +{ + return getStaticFunctionDescriptor(exec, &JSStyleMediaPrototypeTable, this, propertyName, descriptor); +} + +const ClassInfo JSStyleMedia::s_info = { "StyleMedia", 0, &JSStyleMediaTable, 0 }; + +JSStyleMedia::JSStyleMedia(NonNullPassRefPtr structure, JSDOMGlobalObject* globalObject, PassRefPtr impl) + : DOMObjectWithGlobalPointer(structure, globalObject) + , m_impl(impl) +{ +} + +JSStyleMedia::~JSStyleMedia() +{ + forgetDOMObject(this, impl()); +} + +JSObject* JSStyleMedia::createPrototype(ExecState* exec, JSGlobalObject* globalObject) +{ + return new (exec) JSStyleMediaPrototype(JSStyleMediaPrototype::createStructure(globalObject->objectPrototype())); +} + +bool JSStyleMedia::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + return getStaticValueSlot(exec, &JSStyleMediaTable, this, propertyName, slot); +} + +bool JSStyleMedia::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +{ + return getStaticValueDescriptor(exec, &JSStyleMediaTable, this, propertyName, descriptor); +} + +JSValue jsStyleMediaType(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSStyleMedia* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + StyleMedia* imp = static_cast(castedThis->impl()); + JSValue result = jsString(exec, imp->type()); + return result; +} + +JSValue jsStyleMediaConstructor(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSStyleMedia* domObject = static_cast(asObject(slotBase)); + return JSStyleMedia::getConstructor(exec, domObject->globalObject()); +} +JSValue JSStyleMedia::getConstructor(ExecState* exec, JSGlobalObject* globalObject) +{ + return getDOMConstructor(exec, static_cast(globalObject)); +} + +JSValue JSC_HOST_CALL jsStyleMediaPrototypeFunctionMatchMedium(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) +{ + UNUSED_PARAM(args); + if (!thisValue.inherits(&JSStyleMedia::s_info)) + return throwError(exec, TypeError); + JSStyleMedia* castedThisObj = static_cast(asObject(thisValue)); + StyleMedia* imp = static_cast(castedThisObj->impl()); + const UString& mediaquery = args.at(0).toString(exec); + + + JSC::JSValue result = jsBoolean(imp->matchMedium(mediaquery)); + return result; +} + +JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, StyleMedia* object) +{ + return getDOMObjectWrapper(exec, globalObject, object); +} +StyleMedia* toStyleMedia(JSC::JSValue value) +{ + return value.inherits(&JSStyleMedia::s_info) ? static_cast(asObject(value))->impl() : 0; +} + +} diff --git a/src/3rdparty/webkit/WebCore/generated/JSStyleMedia.h b/src/3rdparty/webkit/WebCore/generated/JSStyleMedia.h new file mode 100644 index 0000000..12601d5 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/generated/JSStyleMedia.h @@ -0,0 +1,87 @@ +/* + This file is part of the WebKit open source project. + This file has been generated by generate-bindings.pl. DO NOT MODIFY! + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef JSStyleMedia_h +#define JSStyleMedia_h + +#include "JSDOMBinding.h" +#include +#include + +namespace WebCore { + +class StyleMedia; + +class JSStyleMedia : public DOMObjectWithGlobalPointer { + typedef DOMObjectWithGlobalPointer Base; +public: + JSStyleMedia(NonNullPassRefPtr, JSDOMGlobalObject*, PassRefPtr); + virtual ~JSStyleMedia(); + static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*); + virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); + virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&); + virtual const JSC::ClassInfo* classInfo() const { return &s_info; } + static const JSC::ClassInfo s_info; + + static PassRefPtr createStructure(JSC::JSValue prototype) + { + return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); + } + + static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*); + StyleMedia* impl() const { return m_impl.get(); } + +private: + RefPtr m_impl; +protected: + static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; +}; + +JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, StyleMedia*); +StyleMedia* toStyleMedia(JSC::JSValue); + +class JSStyleMediaPrototype : public JSC::JSObject { + typedef JSC::JSObject Base; +public: + static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*); + virtual const JSC::ClassInfo* classInfo() const { return &s_info; } + static const JSC::ClassInfo s_info; + virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); + virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); + static PassRefPtr createStructure(JSC::JSValue prototype) + { + return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); + } + JSStyleMediaPrototype(NonNullPassRefPtr structure) : JSC::JSObject(structure) { } +protected: + static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; +}; + +// Functions + +JSC::JSValue JSC_HOST_CALL jsStyleMediaPrototypeFunctionMatchMedium(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); +// Attributes + +JSC::JSValue jsStyleMediaType(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +JSC::JSValue jsStyleMediaConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); + +} // namespace WebCore + +#endif diff --git a/src/3rdparty/webkit/WebCore/page/AbstractView.idl b/src/3rdparty/webkit/WebCore/page/AbstractView.idl index 290bf48..e4ece0f 100644 --- a/src/3rdparty/webkit/WebCore/page/AbstractView.idl +++ b/src/3rdparty/webkit/WebCore/page/AbstractView.idl @@ -32,7 +32,7 @@ module views { OmitConstructor ] AbstractView { readonly attribute Document document; - readonly attribute Media media; + readonly attribute Media styleMedia; }; } diff --git a/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp b/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp index dd90200..8dcff5c 100644 --- a/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp +++ b/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp @@ -57,7 +57,7 @@ #include "InspectorController.h" #include "InspectorTimelineAgent.h" #include "Location.h" -#include "Media.h" +#include "StyleMedia.h" #include "MessageEvent.h" #include "Navigator.h" #include "NotificationCenter.h" @@ -1112,10 +1112,10 @@ Document* DOMWindow::document() const return m_frame->document(); } -PassRefPtr DOMWindow::media() const +PassRefPtr DOMWindow::styleMedia() const { if (!m_media) - m_media = Media::create(m_frame); + m_media = StyleMedia::create(m_frame); return m_media.get(); } diff --git a/src/3rdparty/webkit/WebCore/page/DOMWindow.h b/src/3rdparty/webkit/WebCore/page/DOMWindow.h index a70713b..cf9bc88 100644 --- a/src/3rdparty/webkit/WebCore/page/DOMWindow.h +++ b/src/3rdparty/webkit/WebCore/page/DOMWindow.h @@ -56,7 +56,7 @@ namespace WebCore { class IndexedDatabaseRequest; class InspectorTimelineAgent; class Location; - class Media; + class StyleMedia; class Navigator; class Node; class NotificationCenter; @@ -187,7 +187,7 @@ namespace WebCore { // DOM Level 2 AbstractView Interface Document* document() const; // CSSOM View Module - PassRefPtr media() const; + PassRefPtr styleMedia() const; // DOM Level 2 Style Interface PassRefPtr getComputedStyle(Element*, const String& pseudoElt) const; @@ -353,7 +353,7 @@ namespace WebCore { Console* optionalConsole() const { return m_console.get(); } Navigator* optionalNavigator() const { return m_navigator.get(); } Location* optionalLocation() const { return m_location.get(); } - Media* optionalMedia() const { return m_media.get(); } + StyleMedia* optionalMedia() const { return m_media.get(); } #if ENABLE(DOM_STORAGE) Storage* optionalSessionStorage() const { return m_sessionStorage.get(); } Storage* optionalLocalStorage() const { return m_localStorage.get(); } @@ -390,7 +390,7 @@ namespace WebCore { mutable RefPtr m_console; mutable RefPtr m_navigator; mutable RefPtr m_location; - mutable RefPtr m_media; + mutable RefPtr m_media; #if ENABLE(DOM_STORAGE) mutable RefPtr m_sessionStorage; mutable RefPtr m_localStorage; diff --git a/src/3rdparty/webkit/WebCore/page/DOMWindow.idl b/src/3rdparty/webkit/WebCore/page/DOMWindow.idl index 31e4d4f..33e49e8 100644 --- a/src/3rdparty/webkit/WebCore/page/DOMWindow.idl +++ b/src/3rdparty/webkit/WebCore/page/DOMWindow.idl @@ -141,7 +141,7 @@ module window { readonly attribute Document document; // CSSOM View Module - readonly attribute Media media; + readonly attribute StyleMedia styleMedia; // DOM Level 2 Style Interface CSSStyleDeclaration getComputedStyle(in Element element, diff --git a/src/3rdparty/webkit/WebCore/page/FrameView.h b/src/3rdparty/webkit/WebCore/page/FrameView.h index 7371d13..7119975 100644 --- a/src/3rdparty/webkit/WebCore/page/FrameView.h +++ b/src/3rdparty/webkit/WebCore/page/FrameView.h @@ -139,7 +139,7 @@ public: virtual void scrollRectIntoViewRecursively(const IntRect&); virtual void setScrollPosition(const IntPoint&); - void scrollPositionChanged(); + virtual void scrollPositionChanged(); String mediaType() const; void setMediaType(const String&); diff --git a/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp b/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp index 5c70eff..e50ab55 100644 --- a/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp +++ b/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp @@ -292,6 +292,7 @@ void ScrollView::valueChanged(Scrollbar* scrollbar) if (scrollbarsSuppressed()) return; + scrollPositionChanged(); scrollContents(scrollDelta); } diff --git a/src/3rdparty/webkit/WebCore/platform/ScrollView.h b/src/3rdparty/webkit/WebCore/platform/ScrollView.h index 9134ddf..118a310 100644 --- a/src/3rdparty/webkit/WebCore/platform/ScrollView.h +++ b/src/3rdparty/webkit/WebCore/platform/ScrollView.h @@ -302,6 +302,9 @@ private: // Called to update the scrollbars to accurately reflect the state of the view. void updateScrollbars(const IntSize& desiredOffset); + // Called when the scroll position within this view changes. FrameView overrides this to generate repaint invalidations. + virtual void scrollPositionChanged() {} + void platformInit(); void platformDestroy(); void platformAddChild(Widget*); diff --git a/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp index 04a2b1b..eb2d934 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp @@ -114,7 +114,7 @@ static QStyleOptionSlider* styleOptionSlider(Scrollbar* scrollbar, QWidget* widg opt.state |= QStyle::State_Horizontal; opt.sliderValue = scrollbar->value(); opt.sliderPosition = opt.sliderValue; - opt.pageStep = scrollbar->visibleSize(); + opt.pageStep = scrollbar->pageStep(); opt.singleStep = scrollbar->lineStep(); opt.minimum = 0; opt.maximum = qMax(0, scrollbar->maximum()); -- cgit v0.12