diff options
Diffstat (limited to 'WebCore')
36 files changed, 103 insertions, 212 deletions
diff --git a/WebCore/Android.mk b/WebCore/Android.mk index 0ab375b..d5bc740 100644 --- a/WebCore/Android.mk +++ b/WebCore/Android.mk @@ -517,7 +517,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ platform/network/ResourceRequestBase.cpp \ platform/network/ResourceResponseBase.cpp \ \ - platform/network/android/Cookie.cpp \ + platform/network/android/CookieJarAndroid.cpp \ platform/network/android/NetworkStateNotifierAndroid.cpp \ platform/network/android/ResourceHandleAndroid.cpp \ platform/network/android/ResourceRequestAndroid.cpp \ diff --git a/WebCore/bindings/v8/V8GCController.cpp b/WebCore/bindings/v8/V8GCController.cpp index e08cf66..b478636 100644 --- a/WebCore/bindings/v8/V8GCController.cpp +++ b/WebCore/bindings/v8/V8GCController.cpp @@ -239,16 +239,6 @@ bool operator<(const GrouperItem& a, const GrouperItem& b) typedef Vector<GrouperItem> GrouperList; -#if PLATFORM(ANDROID) -// Android's implementation of std::sort seems unable to do the necessary -// template matching to pick up operator< for GrouperItem, so we have to -// manually pass a comparison function. -static bool compareGrouperItem(const GrouperItem& a, const GrouperItem& b) -{ - return a < b; -} -#endif - class ObjectGrouperVisitor : public DOMWrapperMap<Node>::Visitor { public: ObjectGrouperVisitor() @@ -295,11 +285,7 @@ public: void applyGrouping() { // Group by sorting by the group id. -#if PLATFORM(ANDROID) - std::sort(m_grouper.begin(), m_grouper.end(), compareGrouperItem); -#else std::sort(m_grouper.begin(), m_grouper.end()); -#endif // FIXME Should probably work in iterators here, but indexes were easier for my simple mind. for (size_t i = 0; i < m_grouper.size(); ) { diff --git a/WebCore/config.h b/WebCore/config.h index 8fbed4f..6fa1f40 100644 --- a/WebCore/config.h +++ b/WebCore/config.h @@ -80,7 +80,6 @@ #define WEBCORE_NAVIGATOR_VENDOR "Google Inc." // This must be defined before we include FastMalloc.h, below. #define USE_SYSTEM_MALLOC 1 -#define ANDROID_MOBILE // change can be merged back to WebKit.org for MOBILE #define LOG_DISABLED 1 #include <wtf/Assertions.h> // Central place to set which optional features Android uses. diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp index 85966d7..13c2fae 100644 --- a/WebCore/dom/Document.cpp +++ b/WebCore/dom/Document.cpp @@ -371,9 +371,6 @@ Document::Document(Frame* frame, bool isXHTML) , m_hasOpenDatabases(false) #endif , m_usingGeolocation(false) -#ifdef ANDROID_MOBILE - , mExtraLayoutDelay(0) -#endif #if ENABLE(WML) , m_containsWMLContent(false) #endif @@ -431,6 +428,7 @@ Document::Document(Frame* frame, bool isXHTML) m_processingLoadEvent = false; m_startTime = currentTime(); m_overMinimumLayoutThreshold = false; + m_extraLayoutDelay = 0; initSecurityContext(); initDNSPrefetch(); @@ -1880,13 +1878,13 @@ bool Document::shouldScheduleLayout() int Document::minimumLayoutDelay() { if (m_overMinimumLayoutThreshold) - return 0; + return m_extraLayoutDelay; int elapsed = elapsedTime(); m_overMinimumLayoutThreshold = elapsed > cLayoutScheduleThreshold; // We'll want to schedule the timer to fire at the minimum layout threshold. - return max(0, cLayoutScheduleThreshold - elapsed); + return max(0, cLayoutScheduleThreshold - elapsed) + m_extraLayoutDelay; } int Document::elapsedTime() const diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h index 3d0582c..f2125b1 100644 --- a/WebCore/dom/Document.h +++ b/WebCore/dom/Document.h @@ -523,6 +523,10 @@ public: void setParsing(bool); bool parsing() const { return m_bParsing; } int minimumLayoutDelay(); + + // This method is used by Android. + void setExtraLayoutDelay(int delay) { m_extraLayoutDelay = delay; } + bool shouldScheduleLayout(); int elapsedTime() const; @@ -815,11 +819,6 @@ public: void updateFocusAppearanceSoon(); void cancelFocusAppearanceUpdate(); -#ifdef ANDROID_MOBILE - void setExtraLayoutDelay(int delay) { mExtraLayoutDelay = delay; } - int extraLayoutDelay() { return mExtraLayoutDelay; } -#endif - // FF method for accessing the selection added for compatability. DOMSelection* getSelection() const; @@ -1091,9 +1090,11 @@ private: typedef std::pair<Vector<DocumentMarker>, Vector<IntRect> > MarkerMapVectorPair; typedef HashMap<RefPtr<Node>, MarkerMapVectorPair*> MarkerMap; MarkerMap m_markers; + #if !PLATFORM(ANDROID) mutable AXObjectCache* m_axObjectCache; #endif + Timer<Document> m_updateFocusAppearanceTimer; Element* m_cssTarget; @@ -1103,6 +1104,10 @@ private: HashSet<RefPtr<HistoryItem> > m_associatedHistoryItems; double m_startTime; bool m_overMinimumLayoutThreshold; + // This is used to increase the minimum delay between re-layouts. It is set + // using setExtraLayoutDelay to modify the minimum delay used at different + // points during the lifetime of the Document. + int m_extraLayoutDelay; Vector<std::pair<ScriptElementData*, CachedResourceHandle<CachedScript> > > m_scriptsToExecuteSoon; Timer<Document> m_executeScriptSoonTimer; @@ -1195,10 +1200,6 @@ private: bool m_usingGeolocation; -#ifdef ANDROID_MOBILE - int mExtraLayoutDelay; -#endif - #if ENABLE(WML) bool m_containsWMLContent; #endif diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp index 163424d..acfe51f 100644 --- a/WebCore/html/HTMLInputElement.cpp +++ b/WebCore/html/HTMLInputElement.cpp @@ -340,11 +340,11 @@ bool HTMLInputElement::stepMismatch() const // double's fractional part size is DBL_MAN_DIG-bit. If the current // value is greater than step*2^DBL_MANT_DIG, the following fmod() makes // no sense. - if (doubleValue / pow(2, DBL_MANT_DIG) > step) + if (doubleValue / pow(2.0, DBL_MANT_DIG) > step) return false; double remainder = fmod(doubleValue, step); // Accepts errors in lower 7-bit. - double acceptableError = step / pow(2, DBL_MANT_DIG - 7); + double acceptableError = step / pow(2.0, DBL_MANT_DIG - 7); return acceptableError < remainder && remainder < (step - acceptableError); } // Non-RANGE types should be rejected by getAllowedValueStep(). diff --git a/WebCore/html/HTMLTokenizer.cpp b/WebCore/html/HTMLTokenizer.cpp index 3ca6958..a552442 100644 --- a/WebCore/html/HTMLTokenizer.cpp +++ b/WebCore/html/HTMLTokenizer.cpp @@ -1849,11 +1849,7 @@ void HTMLTokenizer::timerFired(Timer<HTMLTokenizer>*) printf("Beginning timer write at time %d\n", m_doc->elapsedTime()); #endif -#ifdef ANDROID_MOBILE - if (m_doc->view() && m_doc->view()->layoutPending() && !m_doc->minimumLayoutDelay() && !m_doc->extraLayoutDelay()) { -#else if (m_doc->view() && m_doc->view()->layoutPending() && !m_doc->minimumLayoutDelay()) { -#endif // Restart the timer and let layout win. This is basically a way of ensuring that the layout // timer has higher priority than our timer. m_timer.startOneShot(0); diff --git a/WebCore/loader/CachedImage.cpp b/WebCore/loader/CachedImage.cpp index a91f126..780d7ee 100644 --- a/WebCore/loader/CachedImage.cpp +++ b/WebCore/loader/CachedImage.cpp @@ -252,7 +252,7 @@ inline void CachedImage::createImage() } #endif m_image = BitmapImage::create(this); -#if PLATFORM(SGL) +#if PLATFORM(ANDROID) m_image->setURL(url()); #endif } diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp index 4a6ca3d..e07ee92 100644 --- a/WebCore/loader/FrameLoader.cpp +++ b/WebCore/loader/FrameLoader.cpp @@ -1743,12 +1743,7 @@ void FrameLoader::setFirstPartyForCookies(const KURL& url) // This does the same kind of work that didOpenURL does, except it relies on the fact // that a higher level already checked that the URLs match and the scrolling is the right thing to do. -#if PLATFORM(ANDROID) -// TODO: Upstream to webkit.org -void FrameLoader::loadInSameDocument(const KURL& url, SerializedScriptValue* stateObject, bool isNewNavigation, bool suppressAddToHistory) -#else void FrameLoader::loadInSameDocument(const KURL& url, SerializedScriptValue* stateObject, bool isNewNavigation) -#endif { // If we have a state object, we cannot also be a new navigation. ASSERT(!stateObject || (stateObject && !isNewNavigation)); @@ -1756,12 +1751,7 @@ void FrameLoader::loadInSameDocument(const KURL& url, SerializedScriptValue* sta // Update the data source's request with the new URL to fake the URL change m_frame->document()->setURL(url); documentLoader()->replaceRequestURLForSameDocumentNavigation(url); -#if PLATFORM(ANDROID) - // TODO: Upstream to webkit.org - if (isNewNavigation && !shouldTreatURLAsSameAsCurrent(url) && !stateObject && !suppressAddToHistory) { -#else if (isNewNavigation && !shouldTreatURLAsSameAsCurrent(url) && !stateObject) { -#endif // NB: must happen after replaceRequestURLForSameDocumentNavigation(), since we add // based on the current request. Must also happen before we openURL and displace the // scroll position, since adding the BF item will save away scroll state. @@ -3478,14 +3468,7 @@ void FrameLoader::continueFragmentScrollAfterNavigationPolicy(const ResourceRequ return; bool isRedirect = m_quickRedirectComing || policyChecker()->loadType() == FrameLoadTypeRedirectWithLockedBackForwardList; -#ifdef ANDROID_USER_GESTURE - // Do not add history items for a fragment scroll not initiated by the - // user. http://bugs.webkit.org/show_bug.cgi?id=30224 - bool isUserInitiated = isProcessingUserGesture() || request.getUserGesture(); - loadInSameDocument(request.url(), 0, !isRedirect, !isUserInitiated); -#else loadInSameDocument(request.url(), 0, !isRedirect); -#endif } bool FrameLoader::shouldScrollToAnchor(bool isFormSubmission, FrameLoadType loadType, const KURL& url) @@ -3773,12 +3756,7 @@ void FrameLoader::navigateWithinDocument(HistoryItem* item) history()->setCurrentItem(item); // loadInSameDocument() actually changes the URL and notifies load delegates of a "fake" load -#if PLATFORM(ANDROID) - // TODO: Upstream to webkit.org - loadInSameDocument(item->url(), item->stateObject(), false, false); -#else loadInSameDocument(item->url(), item->stateObject(), false); -#endif // Restore user view state from the current history item here since we don't do a normal load. // Even though we just manually set the current history item, this ASSERT verifies nothing diff --git a/WebCore/loader/FrameLoader.h b/WebCore/loader/FrameLoader.h index 03a1175..875736f 100644 --- a/WebCore/loader/FrameLoader.h +++ b/WebCore/loader/FrameLoader.h @@ -439,12 +439,7 @@ private: Frame* loadSubframe(HTMLFrameOwnerElement*, const KURL&, const String& name, const String& referrer); -#if PLATFORM(ANDROID) - // TODO: Upstream to webkit.org - void loadInSameDocument(const KURL&, SerializedScriptValue* stateObject, bool isNewNavigation, bool suppressAddToHistory); -#else void loadInSameDocument(const KURL&, SerializedScriptValue* stateObject, bool isNewNavigation); -#endif void provisionalLoadStarted(); diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp index b338017..b533bad 100644 --- a/WebCore/page/FrameView.cpp +++ b/WebCore/page/FrameView.cpp @@ -1151,11 +1151,7 @@ void FrameView::scheduleRelayout() m_frame->ownerRenderer()->setNeedsLayoutAndPrefWidthsRecalc(); #endif -#ifdef ANDROID_MOBILE - int delay = m_frame->document()->minimumLayoutDelay() + m_frame->document()->extraLayoutDelay(); -#else int delay = m_frame->document()->minimumLayoutDelay(); -#endif if (m_layoutTimer.isActive() && m_delayedLayout && !delay) unscheduleRelayout(); if (m_layoutTimer.isActive()) @@ -1209,11 +1205,7 @@ void FrameView::scheduleRelayoutOfSubtree(RenderObject* relayoutRoot) } } } else { -#ifdef ANDROID_MOBILE - int delay = m_frame->document()->minimumLayoutDelay() + m_frame->document()->extraLayoutDelay(); -#else int delay = m_frame->document()->minimumLayoutDelay(); -#endif m_layoutRoot = relayoutRoot; m_delayedLayout = delay != 0; m_layoutTimer.startOneShot(delay * 0.001); diff --git a/WebCore/platform/Timer.cpp b/WebCore/platform/Timer.cpp index 4804540..ea3effd 100644 --- a/WebCore/platform/Timer.cpp +++ b/WebCore/platform/Timer.cpp @@ -37,11 +37,6 @@ #include <wtf/HashSet.h> #include <wtf/Vector.h> -#if PLATFORM(ANDROID) -#include "stl_iterator_base.h" -#include "heap.h" -#endif - using namespace std; namespace WebCore { diff --git a/WebCore/platform/android/PlatformBridge.h b/WebCore/platform/android/PlatformBridge.h index 9adb314..a1ed50a 100644 --- a/WebCore/platform/android/PlatformBridge.h +++ b/WebCore/platform/android/PlatformBridge.h @@ -50,6 +50,10 @@ public: // KeyGenerator static WTF::Vector<String> getSupportedKeyStrengthList(); static String getSignedPublicKeyAndChallengeString(unsigned index, const String& challenge, const KURL&); + // Cookies + static void setCookies(const KURL&, const String& value); + static String cookies(const KURL&); + static bool cookiesEnabled(); // These ids need to be in sync with the constants in BrowserFrame.java enum rawResId { NoDomain = 1, @@ -68,5 +72,6 @@ public: #endif // USE(ACCELERATED_COMPOSITING) }; + } #endif // PlatformBridge_h diff --git a/WebCore/platform/graphics/BitmapImage.h b/WebCore/platform/graphics/BitmapImage.h index a07daf2..0031df6 100644 --- a/WebCore/platform/graphics/BitmapImage.h +++ b/WebCore/platform/graphics/BitmapImage.h @@ -148,7 +148,7 @@ public: virtual bool getHBITMAPOfSize(HBITMAP, LPSIZE); #endif -#if PLATFORM(SGL) +#if PLATFORM(ANDROID) virtual void setURL(const String& str); #endif diff --git a/WebCore/platform/graphics/FloatPoint.h b/WebCore/platform/graphics/FloatPoint.h index 7d32bcf..45a1e83 100644 --- a/WebCore/platform/graphics/FloatPoint.h +++ b/WebCore/platform/graphics/FloatPoint.h @@ -100,7 +100,7 @@ public: operator BPoint() const; #endif -#if (PLATFORM(SKIA) || PLATFORM(SGL)) +#if PLATFORM(SKIA) operator SkPoint() const; FloatPoint(const SkPoint&); #endif diff --git a/WebCore/platform/graphics/FloatRect.h b/WebCore/platform/graphics/FloatRect.h index 4b4694f..2dc854d 100644 --- a/WebCore/platform/graphics/FloatRect.h +++ b/WebCore/platform/graphics/FloatRect.h @@ -55,7 +55,7 @@ class wxRect2DDouble; class BRect; #endif -#if (PLATFORM(SKIA) || PLATFORM(SGL)) +#if PLATFORM(SKIA) struct SkRect; #endif @@ -149,7 +149,7 @@ public: operator BRect() const; #endif -#if (PLATFORM(SKIA) || PLATFORM(SGL)) +#if PLATFORM(SKIA) FloatRect(const SkRect&); operator SkRect() const; #endif diff --git a/WebCore/platform/graphics/Gradient.cpp b/WebCore/platform/graphics/Gradient.cpp index 77a0d21..204a2b6 100644 --- a/WebCore/platform/graphics/Gradient.cpp +++ b/WebCore/platform/graphics/Gradient.cpp @@ -161,7 +161,7 @@ void Gradient::setGradientSpaceTransform(const TransformationMatrix& gradientSpa setPlatformGradientSpaceTransform(gradientSpaceTransformation); } -#if !PLATFORM(SKIA) +#if !(PLATFORM(SKIA) && !PLATFORM(ANDROID)) void Gradient::setPlatformGradientSpaceTransform(const TransformationMatrix&) { } diff --git a/WebCore/platform/graphics/Gradient.h b/WebCore/platform/graphics/Gradient.h index 7f01251..011a2cd 100644 --- a/WebCore/platform/graphics/Gradient.h +++ b/WebCore/platform/graphics/Gradient.h @@ -46,13 +46,15 @@ typedef QGradient* PlatformGradient; #elif PLATFORM(CAIRO) typedef struct _cairo_pattern cairo_pattern_t; typedef cairo_pattern_t* PlatformGradient; -#elif PLATFORM(ANDROID) && PLATFORM(SGL) +#elif PLATFORM(SKIA) +#if PLATFORM(ANDROID) #include "SkShader.h" typedef class PlatformGradientRec* PlatformGradient; -#elif PLATFORM(SKIA) +#else class SkShader; typedef class SkShader* PlatformGradient; typedef class SkShader* PlatformPattern; +#endif #else typedef void* PlatformGradient; #endif @@ -86,13 +88,11 @@ namespace WebCore { struct ColorStop; const Vector<ColorStop>& getStops() const; #else - -#if PLATFORM(ANDROID) && PLATFORM(SGL) +#if PLATFORM(ANDROID) SkShader* getShader(SkShader::TileMode); #endif PlatformGradient platformGradient(); #endif - struct ColorStop { float stop; float red; diff --git a/WebCore/platform/graphics/GraphicsContext.cpp b/WebCore/platform/graphics/GraphicsContext.cpp index fee05ee..e80004f 100644 --- a/WebCore/platform/graphics/GraphicsContext.cpp +++ b/WebCore/platform/graphics/GraphicsContext.cpp @@ -518,7 +518,7 @@ void GraphicsContext::fillRect(const FloatRect& rect, Generator& generator) generator.fill(this, rect); } -#if !PLATFORM(SKIA) +#if !(PLATFORM(SKIA) && !PLATFORM(ANDROID)) void GraphicsContext::setPlatformFillGradient(Gradient*) { } @@ -536,7 +536,7 @@ void GraphicsContext::setPlatformStrokePattern(Pattern*) } #endif -#if !PLATFORM(CG) && !PLATFORM(SKIA) +#if !PLATFORM(CG) && !(PLATFORM(SKIA) && !PLATFORM(ANDROID)) // Implement this if you want to go ahead and push the drawing mode into your native context // immediately. void GraphicsContext::setPlatformTextDrawingMode(int mode) @@ -544,7 +544,7 @@ void GraphicsContext::setPlatformTextDrawingMode(int mode) } #endif -#if !PLATFORM(QT) && !PLATFORM(CAIRO) && !PLATFORM(SKIA) && !PLATFORM(HAIKU) +#if !PLATFORM(QT) && !PLATFORM(CAIRO) && !(PLATFORM(SKIA) && !PLATFORM(ANDROID)) && !PLATFORM(HAIKU) void GraphicsContext::setPlatformStrokeStyle(const StrokeStyle&) { } diff --git a/WebCore/platform/graphics/GraphicsContext.h b/WebCore/platform/graphics/GraphicsContext.h index 96a6221..ecf2101 100644 --- a/WebCore/platform/graphics/GraphicsContext.h +++ b/WebCore/platform/graphics/GraphicsContext.h @@ -46,12 +46,6 @@ QT_BEGIN_NAMESPACE class QPainter; QT_END_NAMESPACE typedef QPainter PlatformGraphicsContext; -#elif PLATFORM(SGL) -namespace WebCore { -class PlatformGraphicsContext; -} -class SkPaint; -struct SkPoint; #elif PLATFORM(WX) class wxGCDC; class wxWindowDC; @@ -72,7 +66,15 @@ class wxWindowDC; typedef wxWindowDC PlatformGraphicsContext; #endif #elif PLATFORM(SKIA) +#if PLATFORM(ANDROID) +namespace WebCore { +class PlatformGraphicsContext; +} +class SkPaint; +struct SkPoint; +#else typedef class PlatformContextSkia PlatformGraphicsContext; +#endif #elif PLATFORM(HAIKU) class BView; typedef BView PlatformGraphicsContext; @@ -190,7 +192,7 @@ namespace WebCore { void applyFillPattern(); #endif -#if PLATFORM(SGL) +#if PLATFORM(ANDROID) // initialize a paint for bitmaps void setupBitmapPaint(SkPaint*); // initialize a paint for filling @@ -204,7 +206,7 @@ namespace WebCore { bool willFill() const; // returns true if there is a valid (non-transparent) stroke color bool willStroke() const; - + // may return NULL, since we lazily allocate the path. This is the path // that is drawn by drawPath() const SkPath* getCurrPath() const; diff --git a/WebCore/platform/graphics/Image.h b/WebCore/platform/graphics/Image.h index aef6577..f25169b 100644 --- a/WebCore/platform/graphics/Image.h +++ b/WebCore/platform/graphics/Image.h @@ -148,7 +148,7 @@ public: virtual bool getHBITMAPOfSize(HBITMAP, LPSIZE) { return false; } #endif -#if PLATFORM(SGL) +#if PLATFORM(ANDROID) virtual void setURL(const String& str) {} #endif diff --git a/WebCore/platform/graphics/ImageSource.h b/WebCore/platform/graphics/ImageSource.h index 19c7bf7..083c7b0 100644 --- a/WebCore/platform/graphics/ImageSource.h +++ b/WebCore/platform/graphics/ImageSource.h @@ -45,12 +45,14 @@ QT_END_NAMESPACE #elif PLATFORM(CAIRO) struct _cairo_surface; typedef struct _cairo_surface cairo_surface_t; -#elif PLATFORM(ANDROID) && PLATFORM(SGL) +#elif PLATFORM(SKIA) +#if PLATFORM(ANDROID) #include "SkString.h" class SkBitmapRef; class PrivateAndroidImageSourceRec; -#elif PLATFORM(SKIA) +#else class NativeImageSkia; +#endif #elif PLATFORM(HAIKU) class BBitmap; #elif PLATFORM(WINCE) @@ -70,14 +72,14 @@ typedef CGImageRef NativeImagePtr; class ImageDecoderQt; typedef ImageDecoderQt* NativeImageSourcePtr; typedef QPixmap* NativeImagePtr; -#elif PLATFORM(ANDROID) -#if PLATFORM(SGL) +#elif PLATFORM(SKIA) +#if PLATFORM(ANDROID) class String; #ifdef ANDROID_ANIMATED_GIF class ImageDecoder; #endif struct NativeImageSourcePtr { - SkString m_url; + SkString m_url; PrivateAndroidImageSourceRec* m_image; #ifdef ANDROID_ANIMATED_GIF ImageDecoder* m_gifDecoder; @@ -85,7 +87,7 @@ struct NativeImageSourcePtr { }; typedef const Vector<char>* NativeBytePtr; typedef SkBitmapRef* NativeImagePtr; -#elif PLATFORM(SKIA) // ANDROID +#else class ImageDecoder; typedef ImageDecoder* NativeImageSourcePtr; typedef NativeImageSkia* NativeImagePtr; @@ -101,8 +103,6 @@ typedef wxBitmap* NativeImagePtr; #endif #elif PLATFORM(CAIRO) typedef cairo_surface_t* NativeImagePtr; -#elif PLATFORM(SKIA) -typedef NativeImageSkia* NativeImagePtr; #elif PLATFORM(HAIKU) typedef BBitmap* NativeImagePtr; #elif PLATFORM(WINCE) @@ -166,11 +166,9 @@ public: bool frameIsCompleteAtIndex(size_t); // Whether or not the frame is completely decoded. #if PLATFORM(ANDROID) -#if PLATFORM(SGL) void clearURL(); void setURL(const String& url); #endif -#endif private: #if PLATFORM(ANDROID) // FIXME: This is protected only to allow ImageSourceSkia to set ICO decoder diff --git a/WebCore/platform/graphics/IntPoint.h b/WebCore/platform/graphics/IntPoint.h index afbfb46..ab5f3ec 100644 --- a/WebCore/platform/graphics/IntPoint.h +++ b/WebCore/platform/graphics/IntPoint.h @@ -63,7 +63,7 @@ class BPoint; class wxPoint; #endif -#if (PLATFORM(SKIA) || PLATFORM(SGL)) +#if PLATFORM(SKIA) struct SkPoint; struct SkIPoint; #endif @@ -133,7 +133,7 @@ public: operator wxPoint() const; #endif -#if (PLATFORM(SKIA) || PLATFORM(SGL)) +#if PLATFORM(SKIA) IntPoint(const SkIPoint&); operator SkIPoint() const; operator SkPoint() const; diff --git a/WebCore/platform/graphics/IntRect.h b/WebCore/platform/graphics/IntRect.h index cd912ff..97b21bc 100644 --- a/WebCore/platform/graphics/IntRect.h +++ b/WebCore/platform/graphics/IntRect.h @@ -57,7 +57,7 @@ class BRect; class wxRect; #endif -#if (PLATFORM(SKIA) || PLATFORM(SGL)) +#if PLATFORM(SKIA) struct SkRect; struct SkIRect; #endif @@ -155,7 +155,7 @@ public: operator CGRect() const; #endif -#if (PLATFORM(SKIA) || PLATFORM(SGL)) +#if PLATFORM(SKIA) IntRect(const SkIRect&); operator SkRect() const; operator SkIRect() const; diff --git a/WebCore/platform/graphics/Path.h b/WebCore/platform/graphics/Path.h index fef5ad2..6618fb7 100644 --- a/WebCore/platform/graphics/Path.h +++ b/WebCore/platform/graphics/Path.h @@ -39,9 +39,6 @@ QT_BEGIN_NAMESPACE class QPainterPath; QT_END_NAMESPACE typedef QPainterPath PlatformPath; -#elif PLATFORM(SGL) -class SkPath; -typedef SkPath PlatformPath; #elif PLATFORM(WX) && USE(WXGC) class wxGraphicsPath; typedef wxGraphicsPath PlatformPath; diff --git a/WebCore/platform/graphics/Pattern.h b/WebCore/platform/graphics/Pattern.h index 2f1192c..aa0a357 100644 --- a/WebCore/platform/graphics/Pattern.h +++ b/WebCore/platform/graphics/Pattern.h @@ -39,7 +39,7 @@ typedef CGPatternRef PlatformPatternPtr; #elif PLATFORM(CAIRO) #include <cairo.h> typedef cairo_pattern_t* PlatformPatternPtr; -#elif PLATFORM(SKIA) || PLATFORM(SGL) +#elif PLATFORM(SKIA) class SkShader; typedef SkShader* PlatformPatternPtr; #elif PLATFORM(QT) diff --git a/WebCore/platform/graphics/skia/NativeImageSkia.cpp b/WebCore/platform/graphics/skia/NativeImageSkia.cpp index 477be05..2411897 100644 --- a/WebCore/platform/graphics/skia/NativeImageSkia.cpp +++ b/WebCore/platform/graphics/skia/NativeImageSkia.cpp @@ -30,7 +30,7 @@ #include "config.h" -#if PLATFORM(SKIA) +#if !PLATFORM(ANDROID) #include "skia/ext/image_operations.h" #endif @@ -65,10 +65,11 @@ bool NativeImageSkia::hasResizedBitmap(int w, int h) const SkBitmap NativeImageSkia::resizedBitmap(int w, int h) const { -#if PLATFORM(SKIA) +#if !PLATFORM(ANDROID) if (m_resizedImage.width() != w || m_resizedImage.height() != h) m_resizedImage = skia::ImageOperations::Resize(*this, skia::ImageOperations::RESIZE_LANCZOS3, w, h); #endif + return m_resizedImage; } diff --git a/WebCore/platform/graphics/transforms/TransformationMatrix.h b/WebCore/platform/graphics/transforms/TransformationMatrix.h index 33f9afe..802ad3c 100644 --- a/WebCore/platform/graphics/transforms/TransformationMatrix.h +++ b/WebCore/platform/graphics/transforms/TransformationMatrix.h @@ -37,7 +37,7 @@ #include <cairo.h> #elif PLATFORM(QT) #include <QTransform> -#elif PLATFORM(SKIA) || PLATFORM(SGL) +#elif PLATFORM(SKIA) #include <SkMatrix.h> #elif PLATFORM(WX) && USE(WXGC) #include <wx/graphics.h> @@ -301,7 +301,7 @@ public: operator cairo_matrix_t() const; #elif PLATFORM(QT) operator QTransform() const; -#elif PLATFORM(SKIA) || PLATFORM(SGL) +#elif PLATFORM(SKIA) operator SkMatrix() const; #elif PLATFORM(WX) && USE(WXGC) operator wxGraphicsMatrix() const; diff --git a/WebCore/platform/image-decoders/ImageDecoder.h b/WebCore/platform/image-decoders/ImageDecoder.h index 08f4aa2..535efa1 100644 --- a/WebCore/platform/image-decoders/ImageDecoder.h +++ b/WebCore/platform/image-decoders/ImageDecoder.h @@ -36,8 +36,7 @@ #include <wtf/RefPtr.h> #include <wtf/Vector.h> -#if (PLATFORM(SKIA) || PLATFORM(SGL)) -// TODO(benm): ANDROID: Can we define PLATFORM(SKIA) instead of PLATFORM(SGL) before upstreaming? +#if PLATFORM(SKIA) #include "NativeImageSkia.h" #elif PLATFORM(QT) #include <QImage> @@ -58,7 +57,7 @@ namespace WebCore { DisposeOverwriteBgcolor, // Clear frame to transparent DisposeOverwritePrevious, // Clear frame to previous framebuffer contents }; -#if (PLATFORM(SKIA) || PLATFORM(QT) || PLATFORM(SGL)) +#if PLATFORM(SKIA) || PLATFORM(QT) typedef uint32_t PixelData; #else typedef unsigned PixelData; @@ -102,7 +101,7 @@ namespace WebCore { memcpy(getAddr(startX, destY), startAddr, rowBytes); } -#if (PLATFORM(SKIA) || PLATFORM(SGL)) +#if PLATFORM(ANDROID) NativeImageSkia& bitmap() { return m_bitmap; } const NativeImageSkia& bitmap() const { return m_bitmap; } #endif @@ -148,7 +147,7 @@ namespace WebCore { inline PixelData* getAddr(int x, int y) { -#if (PLATFORM(SKIA) || PLATFORM(SGL)) +#if PLATFORM(SKIA) return m_bitmap.getAddr32(x, y); #elif PLATFORM(QT) return reinterpret_cast<QRgb*>(m_image.scanLine(y)) + x; @@ -173,7 +172,7 @@ namespace WebCore { } } -#if (PLATFORM(SKIA) || PLATFORM(SGL)) +#if PLATFORM(SKIA) NativeImageSkia m_bitmap; #elif PLATFORM(QT) mutable QImage m_image; diff --git a/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp b/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp index 6acaed5..96342fa 100644 --- a/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp +++ b/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp @@ -26,8 +26,7 @@ #include "config.h" #include "ImageDecoder.h" - -#if PLATFORM(SGL) +#if PLATFORM(ANDROID) #include "SkBitmapRef.h" #endif @@ -85,7 +84,7 @@ bool RGBA32Buffer::setSize(int newWidth, int newHeight) NativeImagePtr RGBA32Buffer::asNewNativeImage() const { -#if PLATFORM(SGL) +#if PLATFORM(ANDROID) return new SkBitmapRef(m_bitmap); #else return new NativeImageSkia(m_bitmap); diff --git a/WebCore/platform/network/android/AuthenticationChallenge.h b/WebCore/platform/network/android/AuthenticationChallenge.h index e272d60..954bfd8 100644 --- a/WebCore/platform/network/android/AuthenticationChallenge.h +++ b/WebCore/platform/network/android/AuthenticationChallenge.h @@ -31,8 +31,6 @@ namespace WebCore { -class ResourceHandle; - class AuthenticationChallenge : public AuthenticationChallengeBase { }; diff --git a/WebCore/platform/network/android/Cookie.cpp b/WebCore/platform/network/android/Cookie.cpp deleted file mode 100644 index 3d10e4a..0000000 --- a/WebCore/platform/network/android/Cookie.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2007, The Android Open Source Project - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" - -#include "CookieClient.h" -#include "JavaSharedClient.h" - -using namespace android; - -namespace WebCore { - -class Document; - -void setCookies(Document*, const KURL& url, const String& value) -{ - if (JavaSharedClient::GetCookieClient()) - JavaSharedClient::GetCookieClient()->setCookies(url, value); -} - -String cookies(const Document* , const KURL& url) -{ - if (JavaSharedClient::GetCookieClient()) - return JavaSharedClient::GetCookieClient()->cookies(url); - return String(); -} - -bool cookiesEnabled(const Document* ) -{ - if (JavaSharedClient::GetCookieClient()) - return JavaSharedClient::GetCookieClient()->cookiesEnabled(); - return false; -} - -} diff --git a/WebCore/platform/network/android/CookieClient.h b/WebCore/platform/network/android/CookieJarAndroid.cpp index be2963e..ba4b5dc 100644 --- a/WebCore/platform/network/android/CookieClient.h +++ b/WebCore/platform/network/android/CookieJarAndroid.cpp @@ -23,24 +23,27 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef COOKIE_CLIENT_H -#define COOKIE_CLIENT_H +#include "config.h" -#include "KURL.h" -#include "PlatformString.h" +#include "CookieJar.h" -using namespace WebCore; +#include "PlatformBridge.h" -namespace android { +namespace WebCore { -class CookieClient { +void setCookies(Document*, const KURL& url, const String& value) +{ + PlatformBridge::setCookies(url, value); +} + +String cookies(const Document*, const KURL& url) +{ + return PlatformBridge::cookies(url); +} -public: - virtual ~CookieClient() {} - virtual void setCookies(const KURL& url, const String& value) = 0; - virtual String cookies(const KURL& url) = 0; - virtual bool cookiesEnabled() = 0; -}; +bool cookiesEnabled(const Document*) +{ + return PlatformBridge::cookiesEnabled(); +} } -#endif diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp index 8517d6d..4d209de 100644 --- a/WebCore/rendering/RenderBlockLineLayout.cpp +++ b/WebCore/rendering/RenderBlockLineLayout.cpp @@ -852,6 +852,8 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i // and text align is auto, or justify or left in LTR, or right in RTL, we // will wrap text around screen width so that it doesn't need to scroll // horizontally when reading a paragraph. + // In case the line height is less than the font size, we skip + // the text wrapping since this will cause text overlapping. const Settings* settings = document()->settings(); bool doTextWrap = settings && settings->layoutAlgorithm() == Settings::kLayoutFitColumnToScreen; if (doTextWrap) { @@ -862,7 +864,10 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i // width as it may cause text to overlap. bool positioned = isPositioned(); EFloat cssfloat = style()->floating(); + const int lineHeight = style()->computedLineHeight(); + const int fontSize = style()->fontSize(); doTextWrap = autowrap && !positioned && + (fontSize <= lineHeight) && (((dir == LTR && cssfloat != FRIGHT) || (dir == RTL && cssfloat != FLEFT)) && ((ta == TAAUTO) || (ta == JUSTIFY) || diff --git a/WebCore/rendering/RenderPartObject.cpp b/WebCore/rendering/RenderPartObject.cpp index f864c00..8e9118e 100644 --- a/WebCore/rendering/RenderPartObject.cpp +++ b/WebCore/rendering/RenderPartObject.cpp @@ -322,10 +322,15 @@ void RenderPartObject::layout() #ifdef FLATTEN_IFRAME RenderPart::calcWidth(); RenderPart::calcHeight(); + // Calculate the styled dimensions by subtracting the border and padding. + int extraWidth = paddingLeft() + paddingRight() + borderLeft() + borderRight(); + int extraHeight = paddingTop() + paddingBottom() + borderTop() + borderBottom(); + int styleWidth = width() - extraWidth; + int styleHeight = height() - extraHeight; // Some IFrames have a width and/or height of 1 when they are meant to be // hidden. If that is the case, do not try to expand. - if (node()->hasTagName(iframeTag) && widget() && widget()->isFrameView() - && width() > 1 && height() > 1) { + if (node()->hasTagName(iframeTag) && widget() && widget()->isFrameView() && + styleWidth > 1 && styleHeight > 1) { HTMLIFrameElement* element = static_cast<HTMLIFrameElement*>(node()); bool scrolling = element->scrollingMode() != ScrollbarAlwaysOff; bool widthIsFixed = style()->width().isFixed(); @@ -336,15 +341,11 @@ void RenderPartObject::layout() if (scrolling || !widthIsFixed || !heightIsFixed) { FrameView* view = static_cast<FrameView*>(widget()); RenderView* root = view ? view->frame()->contentRenderer() : NULL; - RenderPart* owner = view->frame()->ownerRenderer(); - if (root && style()->visibility() != HIDDEN - && (!owner || owner->style()->visibility() != HIDDEN)) { + if (root && style()->visibility() != HIDDEN) { // Update the dimensions to get the correct minimum preferred // width updateWidgetPosition(); - int extraWidth = paddingLeft() + paddingRight() + borderLeft() + borderRight(); - int extraHeight = paddingTop() + paddingBottom() + borderTop() + borderBottom(); // Use the preferred width if it is larger and only if // scrollbars are visible or the width style is not fixed. if (scrolling || !widthIsFixed) diff --git a/WebCore/svg/graphics/SVGPaintServer.cpp b/WebCore/svg/graphics/SVGPaintServer.cpp index 728ff1b..6b81f72 100644 --- a/WebCore/svg/graphics/SVGPaintServer.cpp +++ b/WebCore/svg/graphics/SVGPaintServer.cpp @@ -38,7 +38,7 @@ #include "SVGStyledElement.h" #include "SVGURIReference.h" -#if PLATFORM(SKIA) +#if PLATFORM(SKIA) && !PLATFORM(ANDROID) #include "PlatformContextSkia.h" #endif @@ -184,7 +184,7 @@ void SVGPaintServer::renderPath(GraphicsContext*& context, const RenderObject* p context->strokePath(); } -#if PLATFORM(SKIA) +#if PLATFORM(SKIA) && !PLATFORM(ANDROID) void SVGPaintServer::teardown(GraphicsContext*& context, const RenderObject*, SVGPaintTargetType, bool) const { // FIXME: Move this into the GraphicsContext |
