diff options
author | Steve Block <steveblock@google.com> | 2009-10-21 14:12:09 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-10-22 16:36:53 +0100 |
commit | bc7b84de3fd863c500a8169fd00dca3811cadbb3 (patch) | |
tree | 1d3d4b6c3c86a7e5d24ab942837279ee38a292e4 | |
parent | 1609212f285a36758049a60789693cc6f721fbc8 (diff) | |
download | external_webkit-bc7b84de3fd863c500a8169fd00dca3811cadbb3.zip external_webkit-bc7b84de3fd863c500a8169fd00dca3811cadbb3.tar.gz external_webkit-bc7b84de3fd863c500a8169fd00dca3811cadbb3.tar.bz2 |
Makes a number of changes to ease future merging with and upstreaming to webkit.org.
- Fixes whitespace discrepancies between webkit.org and Android versions
- Re-orders Android-specific changes to minimise the diff with webkit.org
- Makes sure all Android-specific changes are appropriately guarded.
- Fixes some Android-specific style problems
None of these should introduce any functional changes for PLATFORM(ANDROID).
Change-Id: Id27cf0b0e8682a7f29590c3fccae2d287b3630f1
38 files changed, 186 insertions, 167 deletions
diff --git a/WebCore/bindings/v8/ChildThreadDOMData.h b/WebCore/bindings/v8/ChildThreadDOMData.h index ab90e5b..173a5e8 100644 --- a/WebCore/bindings/v8/ChildThreadDOMData.h +++ b/WebCore/bindings/v8/ChildThreadDOMData.h @@ -39,7 +39,9 @@ namespace WebCore { class ChildThreadDOMData : public DOMData { public: ChildThreadDOMData(); +#if PLATFORM(ANDROID) virtual ~ChildThreadDOMData() { } +#endif DOMDataStore& getStore(); diff --git a/WebCore/bindings/v8/DOMData.h b/WebCore/bindings/v8/DOMData.h index 07e14e5..e67adb4 100644 --- a/WebCore/bindings/v8/DOMData.h +++ b/WebCore/bindings/v8/DOMData.h @@ -45,7 +45,9 @@ namespace WebCore { class DOMData : public Noncopyable { public: DOMData(); +#if PLATFORM(ANDROID) virtual ~DOMData() { } +#endif static DOMData* getCurrent(); static DOMData* getCurrentMainThread(); // Caller must be on the main thread. diff --git a/WebCore/bindings/v8/DOMObjectsInclude.h b/WebCore/bindings/v8/DOMObjectsInclude.h index 275d56d..fe04518 100644 --- a/WebCore/bindings/v8/DOMObjectsInclude.h +++ b/WebCore/bindings/v8/DOMObjectsInclude.h @@ -149,6 +149,7 @@ #include "TextMetrics.h" #include "TimeRanges.h" #include "TreeWalker.h" +#include "XSLTProcessor.h" #include "V8AbstractEventListener.h" #include "V8CustomEventListener.h" #include "V8DOMWindow.h" @@ -156,7 +157,6 @@ #include "V8LazyEventListener.h" #include "V8NodeFilterCondition.h" #include "ValidityState.h" -#include "VoidCallback.h" #include "WebKitAnimationEvent.h" #include "WebKitCSSKeyframeRule.h" #include "WebKitCSSKeyframesRule.h" @@ -174,7 +174,6 @@ #include "XPathExpression.h" #include "XPathNSResolver.h" #include "XPathResult.h" -#include "XSLTProcessor.h" #if ENABLE(OFFLINE_WEB_APPLICATIONS) #include "DOMApplicationCache.h" @@ -234,7 +233,7 @@ #include "V8SVGPODTypeWrapper.h" #endif // SVG -#if ENABLE(TOUCH_EVENTS) +#if ENABLE(TOUCH_EVENTS) // Android #include "Touch.h" #include "TouchList.h" #include "TouchEvent.h" diff --git a/WebCore/bindings/v8/V8Index.cpp b/WebCore/bindings/v8/V8Index.cpp index 5782aac..d93a48f 100644 --- a/WebCore/bindings/v8/V8Index.cpp +++ b/WebCore/bindings/v8/V8Index.cpp @@ -142,6 +142,9 @@ #include "V8HTMLTitleElement.h" #include "V8HTMLUListElement.h" #include "V8ImageData.h" +#if !PLATFORM(ANDROID) +#include "V8InspectorBackend.h" +#endif #include "V8Media.h" #include "V8MediaList.h" #include "V8MessageChannel.h" @@ -200,24 +203,11 @@ #include "V8XMLHttpRequestUpload.h" #include "V8XMLSerializer.h" #include "V8RGBColor.h" -#include "V8VoidCallback.h" - -#if !PLATFORM(ANDROID) -#include "V8InspectorBackend.h" -#endif #if ENABLE(OFFLINE_WEB_APPLICATIONS) #include "V8DOMApplicationCache.h" #endif -#if ENABLE(DATABASE) -#include "V8Database.h" -#include "V8SQLError.h" -#include "V8SQLResultSet.h" -#include "V8SQLResultSetRowList.h" -#include "V8SQLTransaction.h" -#endif - #if ENABLE(DOM_STORAGE) #include "V8Storage.h" #include "V8StorageEvent.h" @@ -404,6 +394,35 @@ #include "V8SharedWorker.h" #endif +#if ENABLE(3D_CANVAS) +#include "V8CanvasRenderingContext3D.h" +#include "V8CanvasArrayBuffer.h" +#include "V8CanvasArray.h" +#include "V8CanvasByteArray.h" +#include "V8CanvasBuffer.h" +#include "V8CanvasFloatArray.h" +#include "V8CanvasFramebuffer.h" +#include "V8CanvasIntArray.h" +#include "V8CanvasProgram.h" +#include "V8CanvasRenderbuffer.h" +#include "V8CanvasShader.h" +#include "V8CanvasShortArray.h" +#include "V8CanvasTexture.h" +#include "V8CanvasUnsignedByteArray.h" +#include "V8CanvasUnsignedIntArray.h" +#include "V8CanvasUnsignedShortArray.h" +#endif + +#if PLATFORM(ANDROID) +// TODO: Upstream these guards to webkit.org +#if ENABLE(DATABASE) +#include "V8Database.h" +#include "V8SQLError.h" +#include "V8SQLResultSet.h" +#include "V8SQLResultSetRowList.h" +#include "V8SQLTransaction.h" +#endif + #if ENABLE(GEOLOCATION) #include "V8Coordinates.h" #include "V8Geolocation.h" @@ -429,24 +448,8 @@ #include "V8XSLTProcessor.h" #endif -#if ENABLE(3D_CANVAS) -#include "V8CanvasRenderingContext3D.h" -#include "V8CanvasArrayBuffer.h" -#include "V8CanvasArray.h" -#include "V8CanvasByteArray.h" -#include "V8CanvasBuffer.h" -#include "V8CanvasFloatArray.h" -#include "V8CanvasFramebuffer.h" -#include "V8CanvasIntArray.h" -#include "V8CanvasProgram.h" -#include "V8CanvasRenderbuffer.h" -#include "V8CanvasShader.h" -#include "V8CanvasShortArray.h" -#include "V8CanvasTexture.h" -#include "V8CanvasUnsignedByteArray.h" -#include "V8CanvasUnsignedIntArray.h" -#include "V8CanvasUnsignedShortArray.h" -#endif +#include "V8VoidCallback.h" +#endif // PLATFORM(ANDROID) namespace WebCore { diff --git a/WebCore/bindings/v8/V8Index.h b/WebCore/bindings/v8/V8Index.h index e91ffd7..097197e 100644 --- a/WebCore/bindings/v8/V8Index.h +++ b/WebCore/bindings/v8/V8Index.h @@ -363,7 +363,7 @@ typedef v8::Persistent<v8::FunctionTemplate> (*FunctionTemplateFactory)(); V(CANVASPIXELARRAY, CanvasPixelArray) \ V(KEYBOARDEVENT, KeyboardEvent) \ V(LOCATION, Location) \ - V(MEDIA, Media) \ + V(MEDIA, Media) \ V(MEDIALIST, MediaList) #define DOM_OBJECT_TYPES_2(V) \ @@ -395,7 +395,6 @@ typedef v8::Persistent<v8::FunctionTemplate> (*FunctionTemplateFactory)(); V(TREEWALKER, TreeWalker) \ V(UIEVENT, UIEvent) \ V(VALIDITYSTATE, ValidityState) \ - V(VOIDCALLBACK, VoidCallback) \ V(WEBKITANIMATIONEVENT, WebKitAnimationEvent) \ V(WEBKITCSSKEYFRAMERULE, WebKitCSSKeyframeRule) \ V(WEBKITCSSKEYFRAMESRULE, WebKitCSSKeyframesRule) \ @@ -416,24 +415,6 @@ typedef v8::Persistent<v8::FunctionTemplate> (*FunctionTemplateFactory)(); SHARED_WORKER_NONNODE_WRAPPER_TYPES(V) \ WORKER_NONNODE_WRAPPER_TYPES(V) -#if ENABLE(XPATH) -#define DOM_OBJECT_XPATH_TYPES(V) \ - V(XPATHEVALUATOR, XPathEvaluator) \ - V(XPATHEXCEPTION, XPathException) \ - V(XPATHEXPRESSION, XPathExpression) \ - V(XPATHNSRESOLVER, XPathNSResolver) \ - V(XPATHRESULT, XPathResult) -#else -#define DOM_OBJECT_XPATH_TYPES(V) -#endif - -#if ENABLE(XSLT) -#define DOM_OBJECT_XSLT_TYPES(V) \ - V(XSLTPROCESSOR, XSLTProcessor) -#else -#define DOM_OBJECT_XSLT_TYPES(V) -#endif - #if ENABLE(DATABASE) #define DOM_OBJECT_DATABASE_TYPES(V) \ V(DATABASE, Database) \ @@ -460,16 +441,6 @@ typedef v8::Persistent<v8::FunctionTemplate> (*FunctionTemplateFactory)(); #define DOM_OBJECT_WORKERS_TYPES(V) #endif -#if ENABLE(GEOLOCATION) -#define DOM_OBJECT_GEOLOCATION_TYPES(V) \ - V(COORDINATES, Coordinates) \ - V(GEOLOCATION, Geolocation) \ - V(GEOPOSITION, Geoposition) \ - V(POSITIONERROR, PositionError) -#else -#define DOM_OBJECT_GEOLOCATION_TYPES(V) -#endif - #if ENABLE(3D_CANVAS) #define DOM_OBJECT_3D_CANVAS_TYPES(V) \ V(CANVASARRAY, CanvasArray) \ @@ -501,7 +472,50 @@ typedef v8::Persistent<v8::FunctionTemplate> (*FunctionTemplateFactory)(); #define DOM_OBJECT_TOUCH_EVENT_TYPES(V) #endif -#if PLATFORM(CHROMIUM) +#if ENABLE(XPATH) +#define DOM_OBJECT_XPATH_TYPES(V) \ + V(XPATHEVALUATOR, XPathEvaluator) \ + V(XPATHEXCEPTION, XPathException) \ + V(XPATHEXPRESSION, XPathExpression) \ + V(XPATHNSRESOLVER, XPathNSResolver) \ + V(XPATHRESULT, XPathResult) +#else +#define DOM_OBJECT_XPATH_TYPES(V) +#endif + +#if ENABLE(XSLT) +#define DOM_OBJECT_XSLT_TYPES(V) \ + V(XSLTPROCESSOR, XSLTProcessor) +#else +#define DOM_OBJECT_XSLT_TYPES(V) +#endif + +#if ENABLE(GEOLOCATION) +#define DOM_OBJECT_GEOLOCATION_TYPES(V) \ + V(COORDINATES, Coordinates) \ + V(GEOLOCATION, Geolocation) \ + V(GEOPOSITION, Geoposition) \ + V(POSITIONERROR, PositionError) +#else +#define DOM_OBJECT_GEOLOCATION_TYPES(V) +#endif + +#if !PLATFORM(ANDROID) +#define DOM_OBJECT_INSPECTOR_TYPES(V) \ + V(INSPECTORBACKEND, InspectorBackend) +#else +#define DOM_OBJECT_INSPECTOR_TYPES(V) +#endif + +#if PLATFORM(ANDROID) +#define DOM_OBJECT_VOIDCALLBACK_TYPES(V) \ + V(VOIDCALLBACK, VoidCallback) +#else +#define DOM_OBJECT_VOIDCALLBACK_TYPES(V) +#endif + +#if PLATFORM(ANDROID) +// This block is modified, but is not Android-specific. #define DOM_OBJECT_TYPES(V) \ DOM_OBJECT_TYPES_1(V) \ DOM_OBJECT_TYPES_2(V) \ @@ -511,16 +525,10 @@ typedef v8::Persistent<v8::FunctionTemplate> (*FunctionTemplateFactory)(); DOM_OBJECT_3D_CANVAS_TYPES(V) \ DOM_OBJECT_XPATH_TYPES(V) \ DOM_OBJECT_XSLT_TYPES(V) \ - V(INSPECTORBACKEND, InspectorBackend) -#elif PLATFORM(ANDROID) -#define DOM_OBJECT_TYPES(V) \ - DOM_OBJECT_TYPES_1(V) \ - DOM_OBJECT_TYPES_2(V) \ - DOM_OBJECT_DATABASE_TYPES(V) \ DOM_OBJECT_GEOLOCATION_TYPES(V) \ - DOM_OBJECT_STORAGE_TYPES(V) \ DOM_OBJECT_TOUCH_EVENT_TYPES(V) \ - DOM_OBJECT_WORKERS_TYPES(V) + DOM_OBJECT_VOIDCALLBACK_TYPES(V) \ + DOM_OBJECT_INSPECTOR_TYPES(V) #endif #if ENABLE(SVG) diff --git a/WebCore/bindings/v8/V8Proxy.cpp b/WebCore/bindings/v8/V8Proxy.cpp index fa2370c..dd3c218 100644 --- a/WebCore/bindings/v8/V8Proxy.cpp +++ b/WebCore/bindings/v8/V8Proxy.cpp @@ -32,7 +32,6 @@ #include "V8Proxy.h" #include "CSSMutableStyleDeclaration.h" -#include "CString.h" #include "DateExtension.h" #include "DOMObjectsInclude.h" #include "DocumentLoader.h" @@ -51,6 +50,8 @@ #include "V8Index.h" #include "V8IsolatedWorld.h" +#include <algorithm> +#include <utility> #include <v8.h> #include <v8-debug.h> #include <wtf/Assertions.h> @@ -66,6 +67,10 @@ #include "TimeCounter.h" #endif +#if PLATFORM(ANDROID) +#include "CString.h" +#endif + namespace WebCore { v8::Persistent<v8::Context> V8Proxy::m_utilityContext; diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp index 5ba9db0..efa2f7a 100644 --- a/WebCore/dom/Document.cpp +++ b/WebCore/dom/Document.cpp @@ -22,6 +22,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ + #include "config.h" #include "Document.h" diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h index 82a5b98..fc2eea0 100644 --- a/WebCore/dom/Document.h +++ b/WebCore/dom/Document.h @@ -809,7 +809,7 @@ public: void updateFocusAppearanceSoon(); void cancelFocusAppearanceUpdate(); - + #ifdef ANDROID_MOBILE void setExtraLayoutDelay(int delay) { mExtraLayoutDelay = delay; } int extraLayoutDelay() { return mExtraLayoutDelay; } diff --git a/WebCore/dom/Element.h b/WebCore/dom/Element.h index 8d12cc9..d27976a 100644 --- a/WebCore/dom/Element.h +++ b/WebCore/dom/Element.h @@ -196,6 +196,7 @@ public: KURL getURLAttribute(const QualifiedName&) const; virtual const QualifiedName& imageSourceAttributeName() const; virtual String target() const { return String(); } + virtual void focus(bool restorePreviousSelection = true); virtual void updateFocusAppearance(bool restorePreviousSelection); void blur(); diff --git a/WebCore/html/HTMLCollection.cpp b/WebCore/html/HTMLCollection.cpp index 76de60a..2b29589 100644 --- a/WebCore/html/HTMLCollection.cpp +++ b/WebCore/html/HTMLCollection.cpp @@ -251,15 +251,15 @@ Node* HTMLCollection::firstItem() const Node* HTMLCollection::nextItem() const { resetCollectionInfo(); - + #ifdef ANDROID_FIX - // resetCollectionInfo() can set info->current to be 0. If this is the - // case, we need to go back to the firstItem. Otherwise traverseNextItem + // resetCollectionInfo() can set info->current to be 0. If this is the + // case, we need to go back to the firstItem. Otherwise traverseNextItem // will crash. if (!m_info->current) return firstItem(); #endif - + // Look for the 'second' item. The first one is currentItem, already given back. Element* retval = itemAfter(m_info->current); m_info->current = retval; diff --git a/WebCore/html/HTMLSelectElement.h b/WebCore/html/HTMLSelectElement.h index d28f116..8f575d2 100644 --- a/WebCore/html/HTMLSelectElement.h +++ b/WebCore/html/HTMLSelectElement.h @@ -106,8 +106,8 @@ private: virtual RenderObject* createRenderer(RenderArena*, RenderStyle *); virtual bool appendFormData(FormDataList&, bool); - virtual int listToOptionIndex(int listIndex) const; virtual int optionToListIndex(int optionIndex) const; + virtual int listToOptionIndex(int listIndex) const; virtual void reset(); diff --git a/WebCore/html/HTMLTokenizer.cpp b/WebCore/html/HTMLTokenizer.cpp index 9215dc3..7c01f6a 100644 --- a/WebCore/html/HTMLTokenizer.cpp +++ b/WebCore/html/HTMLTokenizer.cpp @@ -24,6 +24,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + #include "config.h" #include "HTMLTokenizer.h" @@ -484,7 +485,7 @@ HTMLTokenizer::State HTMLTokenizer::scriptHandler(State state) #ifdef ANDROID_INSTRUMENT android::TimeCounter::recordNoCounter(android::TimeCounter::ParsingTimeCounter, __FUNCTION__); #endif - + if (!m_parser->skipMode() && !followingFrameset) { if (cs) { if (savedPrependingSrc) @@ -517,7 +518,7 @@ HTMLTokenizer::State HTMLTokenizer::scriptHandler(State state) #ifdef ANDROID_INSTRUMENT android::TimeCounter::start(android::TimeCounter::ParsingTimeCounter); #endif - + if (!m_executingScript && !state.loadingExtScript()) { m_src.append(m_pendingSrc); m_pendingSrc.clear(); @@ -541,7 +542,6 @@ HTMLTokenizer::State HTMLTokenizer::scriptHandler(State state) } } - #if PRELOAD_SCANNER_ENABLED if (!m_pendingScripts.isEmpty() && !m_executingScript) { if (!m_preloadScanner) @@ -1651,7 +1651,6 @@ void HTMLTokenizer::write(const SegmentedString& str, bool appendData) return; } - #if PRELOAD_SCANNER_ENABLED if (m_preloadScanner && m_preloadScanner->inProgress() && appendData) m_preloadScanner->end(); diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h index dcbfe38..06fd250 100644 --- a/WebCore/inspector/InspectorController.h +++ b/WebCore/inspector/InspectorController.h @@ -62,6 +62,9 @@ class Document; class DocumentLoader; class GraphicsContext; class HitTestResult; +#if !PLATFORM(ANDROID) +class InspectorBackend; +#endif class InspectorClient; class InspectorDOMAgent; class InspectorFrontend; @@ -84,11 +87,6 @@ class InspectorDatabaseResource; class InspectorDOMStorageResource; class InspectorResource; -#if !PLATFORM(ANDROID) -class InspectorBackend; -class InspectorFrontend; -#endif - class InspectorController #if ENABLE(JAVASCRIPT_DEBUGGER) : JavaScriptDebugListener @@ -360,6 +358,7 @@ private: Page* m_inspectedPage; InspectorClient* m_client; + OwnPtr<InspectorFrontend> m_frontend; RefPtr<InspectorDOMAgent> m_domAgent; OwnPtr<InspectorTimelineAgent> m_timelineAgent; ScriptObject m_injectedScriptObj; @@ -389,7 +388,6 @@ private: bool m_resourceTrackingEnabled; bool m_resourceTrackingSettingsLoaded; #if !PLATFORM(ANDROID) - OwnPtr<InspectorFrontend> m_frontend; RefPtr<InspectorBackend> m_inspectorBackend; #endif HashMap<String, ScriptValue> m_idToWrappedObject; diff --git a/WebCore/loader/Cache.cpp b/WebCore/loader/Cache.cpp index 1f28709..391790f 100644 --- a/WebCore/loader/Cache.cpp +++ b/WebCore/loader/Cache.cpp @@ -38,7 +38,6 @@ #include <stdio.h> #include <wtf/CurrentTime.h> - using namespace std; namespace WebCore { diff --git a/WebCore/loader/DocLoader.cpp b/WebCore/loader/DocLoader.cpp index b2d9cc8..fff8e59 100644 --- a/WebCore/loader/DocLoader.cpp +++ b/WebCore/loader/DocLoader.cpp @@ -255,6 +255,7 @@ CachedResource* DocLoader::requestResource(CachedResource::Type type, const Stri } checkForReload(fullURL); + CachedResource* resource = cache()->requestResource(this, type, fullURL, charset, isPreload); if (resource) { // Check final URL of resource to catch redirects. diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp index fffd6ee..071c0a7 100644 --- a/WebCore/loader/FrameLoader.cpp +++ b/WebCore/loader/FrameLoader.cpp @@ -3091,7 +3091,7 @@ void FrameLoader::checkLoadCompleteForThisFrame() if (Page* page = m_frame->page()) page->progress()->progressCompleted(m_frame); - + #ifdef ANDROID_INSTRUMENT if (!m_frame->tree()->parent() && m_frame->document()->renderArena()) android::TimeCounter::report(m_URL, cache()->getLiveSize(), cache()->getDeadSize(), diff --git a/WebCore/loader/FrameLoader.h b/WebCore/loader/FrameLoader.h index 3a1d27f..9ea3775 100644 --- a/WebCore/loader/FrameLoader.h +++ b/WebCore/loader/FrameLoader.h @@ -100,7 +100,6 @@ namespace WebCore { void setupForReplace(); void setupForReplaceByMIMEType(const String& newMIMEType); - void loadURLIntoChildFrame(const KURL&, const String& referer, Frame*); void loadFrameRequest(const FrameLoadRequest&, bool lockHistory, bool lockBackForwardList, // Called by submitForm, calls loadPostRequest and loadURL. diff --git a/WebCore/loader/appcache/ApplicationCacheGroup.cpp b/WebCore/loader/appcache/ApplicationCacheGroup.cpp index a3d551b..1a223ce 100644 --- a/WebCore/loader/appcache/ApplicationCacheGroup.cpp +++ b/WebCore/loader/appcache/ApplicationCacheGroup.cpp @@ -777,7 +777,6 @@ void ApplicationCacheGroup::checkIfLoadIsComplete() RefPtr<ApplicationCache> oldNewestCache = (m_newestCache == m_cacheBeingUpdated) ? 0 : m_newestCache; setNewestCache(m_cacheBeingUpdated.release()); - if (cacheStorage().storeNewestCache(this)) { // New cache stored, now remove the old cache. if (oldNewestCache) diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp index c03efb0..da3c92b 100644 --- a/WebCore/page/Frame.cpp +++ b/WebCore/page/Frame.cpp @@ -25,6 +25,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ + #include "config.h" #include "Frame.h" @@ -1630,7 +1631,6 @@ void Frame::pageDestroyed() page()->focusController()->setFocusedFrame(0); script()->clearWindowShell(); - script()->clearScriptObjects(); script()->updatePlatformScriptObjects(); @@ -1705,7 +1705,6 @@ bool Frame::shouldClose() return chrome->runBeforeUnloadConfirmPanel(text, this); } - void Frame::scheduleClose() { if (!shouldClose()) diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp index e7006ed..888e975 100644 --- a/WebCore/page/FrameView.cpp +++ b/WebCore/page/FrameView.cpp @@ -23,6 +23,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ + #include "config.h" #include "FrameView.h" diff --git a/WebCore/page/Geolocation.idl b/WebCore/page/Geolocation.idl index e9770ad..e125118 100644 --- a/WebCore/page/Geolocation.idl +++ b/WebCore/page/Geolocation.idl @@ -31,6 +31,7 @@ module core { [Custom] void getCurrentPosition(in PositionCallback successCallback, in PositionErrorCallback errorCallback, in PositionOptions options); [Custom] long watchPosition(in PositionCallback successCallback, in PositionErrorCallback errorCallback, in PositionOptions options); + void clearWatch(in long watchId); }; diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp index 98d08d2..df42718 100644 --- a/WebCore/page/Settings.cpp +++ b/WebCore/page/Settings.cpp @@ -138,7 +138,7 @@ Settings::Settings(Page* page) // A Frame may not have been created yet, so we initialize the AtomicString // hash before trying to use it. AtomicString::init(); -#ifdef ANDROID_META_SUPPORT +#ifdef ANDROID_META_SUPPORT resetMetadataSettings(); #endif } @@ -444,9 +444,9 @@ void Settings::setMetadataSettings(const String& key, const String& value) int width = value.toInt(); if (width <= 10000) { if (width <= 320) { - // This is a hack to accommodate the pages designed for the - // original iPhone. The new version, since 10/2007, is to - // use device-width which works for both portrait and + // This is a hack to accommodate the pages designed for the + // original iPhone. The new version, since 10/2007, is to + // use device-width which works for both portrait and // landscape modes. m_viewport_width = 0; } else { @@ -502,25 +502,25 @@ void Settings::setMetadataSettings(const String& key, const String& value) } else if (key == "telephone") { if (value == "no") { m_format_detection_telephone = false; - } + } } else if (key == "address") { if (value == "no") { m_format_detection_address = false; - } + } } else if (key == "email") { if (value == "no") { m_format_detection_email = false; - } + } } else if (key == "format-detection") { - // even Apple doc says "format-detection" should be the name of the - // <meta> tag. In the real world, e.g. amazon.com, use + // even Apple doc says "format-detection" should be the name of the + // <meta> tag. In the real world, e.g. amazon.com, use // "format-detection=no" in the "viewport" <meta> tag to disable all // format detection. if (value == "no") { m_format_detection_telephone = false; m_format_detection_address = false; m_format_detection_email = false; - } + } } } #endif diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h index 344746f..f03e792 100644 --- a/WebCore/page/Settings.h +++ b/WebCore/page/Settings.h @@ -92,7 +92,7 @@ namespace WebCore { bool useWideViewport() const { return m_useWideViewport; } void setUseWideViewport(bool use) { m_useWideViewport = use; } #endif - + void setSerifFontFamily(const AtomicString&); const AtomicString& serifFontFamily() const { return m_serifFontFamily; } diff --git a/WebCore/platform/wx/TemporaryLinkStubs.cpp b/WebCore/platform/wx/TemporaryLinkStubs.cpp index 8b13789..e69de29 100644 --- a/WebCore/platform/wx/TemporaryLinkStubs.cpp +++ b/WebCore/platform/wx/TemporaryLinkStubs.cpp @@ -1 +0,0 @@ - diff --git a/WebCore/plugins/PluginView.cpp b/WebCore/plugins/PluginView.cpp index c066e25..811f6be 100644 --- a/WebCore/plugins/PluginView.cpp +++ b/WebCore/plugins/PluginView.cpp @@ -60,6 +60,8 @@ #include "RenderObject.h" #include "npruntime_impl.h" #include "Settings.h" +#include <wtf/ASCIICType.h> + #if defined(ANDROID_PLUGINS) #include "TouchEvent.h" #endif @@ -72,11 +74,7 @@ #include "runtime.h" #include <runtime/JSLock.h> #include <runtime/JSValue.h> -#endif - -#include <wtf/ASCIICType.h> -#if USE(JSC) using JSC::ExecState; using JSC::JSLock; using JSC::JSObject; @@ -1269,9 +1267,8 @@ void PluginView::invalidateWindowlessPluginRect(const IntRect& rect) void PluginView::paintMissingPluginIcon(GraphicsContext* context, const IntRect& rect) { static RefPtr<Image> nullPluginImage; - if (!nullPluginImage) { + if (!nullPluginImage) nullPluginImage = Image::loadPlatformResource("nullPlugin"); - } IntRect imageRect(frameRect().x(), frameRect().y(), nullPluginImage->width(), nullPluginImage->height()); @@ -1280,9 +1277,8 @@ void PluginView::paintMissingPluginIcon(GraphicsContext* context, const IntRect& imageRect.move(xOffset, yOffset); - if (!rect.intersects(imageRect)) { + if (!rect.intersects(imageRect)) return; - } context->save(); context->clip(windowClipRect()); @@ -1311,8 +1307,10 @@ const char* PluginView::userAgent() if (m_plugin->quirks().contains(PluginQuirkWantsMozillaUserAgent)) return MozillaUserAgent; #endif + if (m_userAgent.isNull()) m_userAgent = m_parentFrame->loader()->userAgent(m_url).utf8(); + return m_userAgent.data(); } diff --git a/WebCore/rendering/AutoTableLayout.cpp b/WebCore/rendering/AutoTableLayout.cpp index c37fba4..0e001c7 100644 --- a/WebCore/rendering/AutoTableLayout.cpp +++ b/WebCore/rendering/AutoTableLayout.cpp @@ -495,10 +495,10 @@ void AutoTableLayout::insertSpanCell(RenderTableCell *cell) void AutoTableLayout::layout() { -#ifdef ANDROID_LAYOUT +#ifdef ANDROID_LAYOUT if (m_table->isSingleColumn()) return; -#endif +#endif // table layout based on the values collected in the layout structure. int tableWidth = m_table->width() - m_table->bordersPaddingAndSpacing(); int available = tableWidth; diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp index c6d18d2..902a5b3 100644 --- a/WebCore/rendering/RenderBlock.cpp +++ b/WebCore/rendering/RenderBlock.cpp @@ -1428,7 +1428,7 @@ bool RenderBlock::layoutOnlyPositionedObjects() updateScrollInfoAfterLayout(); #ifdef ANDROID_FIX - // iframe flatten will call FrameView::layout() which calls performPostLayoutTasks, + // iframe flatten will call FrameView::layout() which calls performPostLayoutTasks, // which may make us need to layout again if (!posChildNeedsLayout() || normalChildNeedsLayout() || selfNeedsLayout()) return false; diff --git a/WebCore/rendering/RenderBlock.h b/WebCore/rendering/RenderBlock.h index e23ebda..09e76ee 100644 --- a/WebCore/rendering/RenderBlock.h +++ b/WebCore/rendering/RenderBlock.h @@ -139,9 +139,6 @@ public: // style from this RenderBlock. RenderBlock* createAnonymousBlock(bool isFlexibleBox = false) const; - Vector<IntRect>* columnRects() const; - int columnGap() const; - protected: int maxTopPosMargin() const { return m_maxMargin ? m_maxMargin->m_topPos : MaxMargin::topPosDefault(this); } int maxTopNegMargin() const { return m_maxMargin ? m_maxMargin->m_topNeg : MaxMargin::topNegDefault(this); } @@ -343,7 +340,17 @@ private: int desiredColumnWidth() const; unsigned desiredColumnCount() const; +#if PLATFORM(ANDROID) +public: + Vector<IntRect>* columnRects() const; +private: +#endif void setDesiredColumnCountAndWidth(int count, int width); +#if PLATFORM(ANDROID) +public: + int columnGap() const; +private: +#endif void paintContinuationOutlines(PaintInfo&, int tx, int ty); diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp index b2b14cd..9142953 100644 --- a/WebCore/rendering/RenderBlockLineLayout.cpp +++ b/WebCore/rendering/RenderBlockLineLayout.cpp @@ -865,7 +865,7 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i EFloat cssfloat = style()->floating(); doTextWrap = autowrap && !positioned && (((dir == LTR && cssfloat != FRIGHT) || - (dir == RTL && cssfloat != FLEFT)) && + (dir == RTL && cssfloat != FLEFT)) && ((ta == TAAUTO) || (ta == JUSTIFY) || ((ta == LEFT || ta == WEBKIT_LEFT) && (dir == LTR)) || ((ta == RIGHT || ta == WEBKIT_RIGHT) && (dir == RTL)))); @@ -948,7 +948,7 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i break; } if (obj->isFloating() || obj->isPositioned()) { - // floating and absolute or fixed positioning are done out + // floating and absolute or fixed positioning are done out // of normal flow. Don't need to worry about height any more. break; } diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp index efd88a7..83f9624 100644 --- a/WebCore/rendering/RenderBox.cpp +++ b/WebCore/rendering/RenderBox.cpp @@ -1244,7 +1244,7 @@ void RenderBox::calcWidth() } } #endif - + if (isPositioned()) { calcAbsoluteHorizontal(); return; @@ -1284,10 +1284,11 @@ void RenderBox::calcWidth() if (treatAsReplaced) #endif setWidth(max(w.value() + borderLeft() + borderRight() + paddingLeft() + paddingRight(), minPrefWidth())); + #ifdef ANDROID_LAYOUT // in SSR mode with replaced box, if the box width is wider than the container width, // it will be shrinked to fit to the container. - if (containerWidth && (width() + m_marginLeft + m_marginRight) > containerWidth && + if (containerWidth && (width() + m_marginLeft + m_marginRight) > containerWidth && document()->frame()->settings()->layoutAlgorithm() == Settings::kLayoutSSR) { m_marginLeft = m_marginRight = 0; setWidth(containerWidth); @@ -1338,8 +1339,8 @@ void RenderBox::calcWidth() } #ifdef ANDROID_LAYOUT // in SSR mode with non-replaced box, we use ANDROID_SSR_MARGIN_PADDING for left/right margin. - // If the box width is wider than the container width, it will be shrinked to fit to the container. - if (containerWidth && !treatAsReplaced && + // If the box width is wider than the container width, it will be shrinked to fit to the container. + if (containerWidth && !treatAsReplaced && document()->settings()->layoutAlgorithm() == Settings::kLayoutSSR) { setWidth(width() + m_marginLeft + m_marginRight); m_marginLeft = m_marginLeft > ANDROID_SSR_MARGIN_PADDING ? ANDROID_SSR_MARGIN_PADDING : m_marginLeft; diff --git a/WebCore/rendering/RenderFrame.cpp b/WebCore/rendering/RenderFrame.cpp index 54a73c7..482d10d 100644 --- a/WebCore/rendering/RenderFrame.cpp +++ b/WebCore/rendering/RenderFrame.cpp @@ -70,7 +70,7 @@ void RenderFrame::layout() if (widget() && widget()->isFrameView()) { FrameView* view = static_cast<FrameView*>(widget()); RenderView* root = NULL; - if (view->frame() && view->frame()->document() && + if (view->frame() && view->frame()->document() && view->frame()->document()->renderer() && view->frame()->document()->renderer()->isRenderView()) root = static_cast<RenderView*>(view->frame()->document()->renderer()); diff --git a/WebCore/rendering/RenderFrameSet.cpp b/WebCore/rendering/RenderFrameSet.cpp index 041a025..a855a08 100644 --- a/WebCore/rendering/RenderFrameSet.cpp +++ b/WebCore/rendering/RenderFrameSet.cpp @@ -602,7 +602,7 @@ void RenderFrameSet::positionFrames() child = (RenderBox*)firstChild(); yPos = 0; #endif // FLATTEN_FRAMESET - + for (int r = 0; r < rows; r++) { int xPos = 0; int height = m_rows.m_sizes[r]; diff --git a/WebCore/rendering/RenderFrameSet.h b/WebCore/rendering/RenderFrameSet.h index aa3ac64..ef92c39 100644 --- a/WebCore/rendering/RenderFrameSet.h +++ b/WebCore/rendering/RenderFrameSet.h @@ -73,7 +73,7 @@ public: #ifdef FLATTEN_FRAMESET void setGridNeedsLayout() { m_gridCalculated = false; } #endif - + private: static const int noSplit = -1; diff --git a/WebCore/rendering/RenderImage.cpp b/WebCore/rendering/RenderImage.cpp index ec2a4d3..1f79e50 100644 --- a/WebCore/rendering/RenderImage.cpp +++ b/WebCore/rendering/RenderImage.cpp @@ -550,7 +550,7 @@ int RenderImage::calcReplacedWidth(bool includeMaxWidth) const } return width; #else - return max(minW, min(width, maxW)); + return max(minW, min(width, maxW)); #endif } @@ -572,19 +572,19 @@ int RenderImage::calcReplacedHeight() const #ifdef ANDROID_LAYOUT height = max(minH, min(height, maxH)); // in SSR mode, we will fit the image to its container width - if (height && document()->settings()->layoutAlgorithm() == Settings::kLayoutSSR) { + if (height && document()->settings()->layoutAlgorithm() == Settings::kLayoutSSR) { int width; if (isWidthSpecified()) width = calcReplacedWidthUsing(style()->width()); else width = calcAspectRatioWidth(); int minW = calcReplacedWidthUsing(style()->minWidth()); - int maxW = style()->maxWidth().value() == undefinedLength ? width : - calcReplacedWidthUsing(style()->maxWidth()); + int maxW = style()->maxWidth().value() == undefinedLength ? width : + calcReplacedWidthUsing(style()->maxWidth()); width = max(minW, min(width, maxW)); int cw = containingBlockWidthForContent(); - if (cw && width && width>cw) + if (cw && width && width > cw) height = cw * height / width; // preserve aspect ratio } return height; diff --git a/WebCore/rendering/RenderTable.cpp b/WebCore/rendering/RenderTable.cpp index 0acaa43..677851e 100644 --- a/WebCore/rendering/RenderTable.cpp +++ b/WebCore/rendering/RenderTable.cpp @@ -62,8 +62,8 @@ RenderTable::RenderTable(Node* node) , m_borderRight(0) { #ifdef ANDROID_LAYOUT - m_singleColumn = false; -#endif + m_singleColumn = false; +#endif m_columnPos.fill(0, 2); m_columns.fill(ColumnStruct(), 1); } @@ -208,7 +208,7 @@ void RenderTable::calcWidth() } } #endif - + if (isPositioned()) calcAbsoluteHorizontal(); @@ -248,7 +248,7 @@ void RenderTable::calcWidth() // in SSR mode, we ignore left/right margin for table if (document()->settings()->layoutAlgorithm() == Settings::kLayoutSSR) return; -#endif +#endif calcHorizontalMargins(style()->marginLeft(), style()->marginRight(), availableWidth); } @@ -273,13 +273,13 @@ void RenderTable::layout() bool relayoutChildren = false; int oldVisibleWidth = m_visibleWidth; #endif - + int oldWidth = width(); calcWidth(); #ifdef ANDROID_LAYOUT if (oldVisibleWidth != m_visibleWidth - && document()->settings()->layoutAlgorithm() == Settings::kLayoutFitColumnToScreen) + && document()->settings()->layoutAlgorithm() == Settings::kLayoutFitColumnToScreen) relayoutChildren = true; else if (document()->settings()->layoutAlgorithm() == Settings::kLayoutSSR) { // if the width of a table is wider than its container width, or it has a nested table, @@ -298,7 +298,7 @@ void RenderTable::layout() } if (shouldRenderAsSingleColumn) { - m_singleColumn = true; + m_singleColumn = true; if (width() > cw) setWidth(cw); if (m_minPrefWidth > cw) diff --git a/WebCore/rendering/RenderTableSection.cpp b/WebCore/rendering/RenderTableSection.cpp index 1e087f6..9339f9e 100644 --- a/WebCore/rendering/RenderTableSection.cpp +++ b/WebCore/rendering/RenderTableSection.cpp @@ -262,12 +262,11 @@ void RenderTableSection::setCellWidths() if (view()->frameView()) { const Settings* settings = document()->settings(); ASSERT(settings); - if (settings->layoutAlgorithm() == Settings::kLayoutFitColumnToScreen) { + if (settings->layoutAlgorithm() == Settings::kLayoutFitColumnToScreen) visibleWidth = view()->frameView()->screenWidth(); - } } #endif - + for (int i = 0; i < m_gridRows; i++) { Row& row = *m_grid[i].row; int cols = row.size(); @@ -284,12 +283,13 @@ void RenderTableSection::setCellWidths() endCol++; } int w = columnPos[endCol] - columnPos[j] - table()->hBorderSpacing(); -#ifdef ANDROID_LAYOUT - if (table()->isSingleColumn()) - w = table()->width()-(table()->borderLeft()+table()->borderRight()+ - (table()->collapseBorders()?0:(table()->paddingLeft()+table()->paddingRight()+ - 2*table()->hBorderSpacing()))); -#endif +#ifdef ANDROID_LAYOUT + if (table()->isSingleColumn()) { + int b = table()->collapseBorders() ? + 0 : table()->paddingLeft() + table()->paddingRight() + 2 * table()->hBorderSpacing(); + w = table()->width() - (table()->borderLeft() + table()->borderRight() + b); + } +#endif int oldWidth = cell->width(); #ifdef ANDROID_LAYOUT if (w != oldWidth || (visibleWidth > 0 && visibleWidth != cell->getVisibleWidth())) { @@ -326,7 +326,7 @@ int RenderTableSection::calcRowHeight() #ifdef ANDROID_LAYOUT if (table()->isSingleColumn()) return m_rowPos[m_gridRows]; -#endif +#endif RenderTableCell* cell; @@ -446,26 +446,26 @@ int RenderTableSection::layoutRows(int toAdd) int hspacing = table()->hBorderSpacing(); int vspacing = table()->vBorderSpacing(); int rHeight = vspacing; - + int leftOffset = hspacing; - + int nEffCols = table()->numEffCols(); for (int r = 0; r < totalRows; r++) { for (int c = 0; c < nEffCols; c++) { CellStruct current = cellAt(r, c); RenderTableCell* cell = current.cell; - + if (!cell || current.inColSpan) continue; if (r > 0 && (cellAt(r-1, c).cell == cell)) continue; - + // cell->setCellTopExtra(0); // cell->setCellBottomExtra(0); - + int oldCellX = cell->x(); int oldCellY = cell->y(); - + if (style()->direction() == RTL) { cell->setX(table()->width()); cell->setY(rHeight); @@ -485,7 +485,7 @@ int RenderTableSection::layoutRows(int toAdd) rHeight += cell->height() + vspacing; } } - + setHeight(rHeight); return height(); } @@ -1058,7 +1058,7 @@ void RenderTableSection::paintObject(PaintInfo& paintInfo, int tx, int ty) unsigned int startcol = 0; unsigned int endcol = totalCols; if (table()->isSingleColumn()) { - // FIXME: should we be smarter too? + // FIXME: should we be smarter too? } else { // FIXME: possible to rollback to the common tree. // rowPos size is set in calcRowHeight(), which is called from table layout(). @@ -1155,6 +1155,7 @@ void RenderTableSection::paintObject(PaintInfo& paintInfo, int tx, int ty) if (!row->hasSelfPaintingLayer()) cell->paintBackgroundsBehindCell(paintInfo, tx, ty, row); } + if ((!cell->hasSelfPaintingLayer() && !row->hasSelfPaintingLayer()) || paintInfo.phase == PaintPhaseCollapsedTableBorders) cell->paint(paintInfo, tx, ty); } diff --git a/WebCore/rendering/RenderTextControl.cpp b/WebCore/rendering/RenderTextControl.cpp index bcb2455..c8b4e0f 100644 --- a/WebCore/rendering/RenderTextControl.cpp +++ b/WebCore/rendering/RenderTextControl.cpp @@ -318,9 +318,6 @@ void RenderTextControl::subtreeHasChanged() String RenderTextControl::finishText(Vector<UChar>& result) const { - // ANDROID: This method was modified with a fix from WebKit r31081. This - // comment can be removed the next time we update. - // Remove one trailing newline; there's always one that's collapsed out by rendering. size_t size = result.size(); if (size && result[size - 1] == '\n') @@ -495,9 +492,8 @@ void RenderTextControl::calcPrefWidths() m_minPrefWidth += toAdd; m_maxPrefWidth += toAdd; +#if !PLATFORM(ANDROID) // FIXME: This causes cnn.com loading way slow. Comment it out for now -//#ifdef ANDROID_LAYOUT -#if 0 Frame* frame = document()->frame(); if (frame && frame->settings()->layoutAlgorithm() == Settings::kLayoutFitColumnToScreen) { int maxWidth = frame->view()->visibleWidth() - 2 * ANDROID_FCTS_MARGIN_PADDING; diff --git a/WebCore/rendering/break_lines.cpp b/WebCore/rendering/break_lines.cpp index 0e81caa..be460c8 100644 --- a/WebCore/rendering/break_lines.cpp +++ b/WebCore/rendering/break_lines.cpp @@ -52,7 +52,7 @@ static inline bool shouldBreakAfter(UChar ch) case '-': case '?': #ifdef ANDROID_LAYOUT - // as '/' is used in uri which is always long, we would like to break it + // as '/' is used in uri which is always long, we would like to break it case '/': #endif case softHyphen: |