diff options
Diffstat (limited to 'WebCore/page')
33 files changed, 267 insertions, 236 deletions
diff --git a/WebCore/page/Chrome.cpp b/WebCore/page/Chrome.cpp index 8feedce..944f32f 100644 --- a/WebCore/page/Chrome.cpp +++ b/WebCore/page/Chrome.cpp @@ -426,6 +426,11 @@ void Chrome::chooseIconForFiles(const Vector<String>& filenames, FileChooser* fi m_client->chooseIconForFiles(filenames, fileChooser); } +void Chrome::dispatchViewportDataDidChange(const ViewportArguments& arguments) const +{ + m_client->dispatchViewportDataDidChange(arguments); +} + void Chrome::setCursor(const Cursor& cursor) { m_client->setCursor(cursor); diff --git a/WebCore/page/Chrome.h b/WebCore/page/Chrome.h index 5ee8897..1897b79 100644 --- a/WebCore/page/Chrome.h +++ b/WebCore/page/Chrome.h @@ -53,6 +53,7 @@ namespace WebCore { #endif struct FrameLoadRequest; + struct ViewportArguments; struct WindowFeatures; class Chrome : public HostWindow { @@ -139,6 +140,8 @@ namespace WebCore { void runOpenPanel(Frame*, PassRefPtr<FileChooser>); void chooseIconForFiles(const Vector<String>&, FileChooser*); + void dispatchViewportDataDidChange(const ViewportArguments&) const; + #if PLATFORM(MAC) void focusNSView(NSView*); #endif diff --git a/WebCore/page/ChromeClient.h b/WebCore/page/ChromeClient.h index bf6c157..29a54c9 100644 --- a/WebCore/page/ChromeClient.h +++ b/WebCore/page/ChromeClient.h @@ -146,6 +146,8 @@ namespace WebCore { virtual void setCursor(const Cursor&) = 0; // End methods used by HostWindow. + virtual void dispatchViewportDataDidChange(const ViewportArguments&) const { } + virtual void contentsSizeChanged(Frame*, const IntSize&) const = 0; virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const = 0; // Currently only Mac has a non empty implementation. @@ -155,8 +157,6 @@ namespace WebCore { virtual void setToolTip(const String&, TextDirection) = 0; - virtual void didReceiveViewportArguments(Frame*, const ViewportArguments&) const { } - virtual void print(Frame*) = 0; #if ENABLE(DATABASE) @@ -233,8 +233,6 @@ namespace WebCore { virtual bool allowsAcceleratedCompositing() const { return true; } #endif - virtual SharedGraphicsContext3D* getSharedGraphicsContext3D() { return 0; } - virtual bool supportsFullscreenForNode(const Node*) { return false; } virtual void enterFullscreenForNode(Node*) { } virtual void exitFullscreenForNode(Node*) { } diff --git a/WebCore/page/Console.cpp b/WebCore/page/Console.cpp index 9cc8d5d..2d4cc98 100644 --- a/WebCore/page/Console.cpp +++ b/WebCore/page/Console.cpp @@ -182,7 +182,7 @@ void Console::addMessage(MessageType type, MessageLevel level, ScriptCallStack* String message; if (getFirstArgumentAsString(callStack->state(), lastCaller, message)) - page->chrome()->client()->addMessageToConsole(JSMessageSource, type, level, message, lastCaller.lineNumber(), lastCaller.sourceURL().prettyURL()); + page->chrome()->client()->addMessageToConsole(JSMessageSource, type, level, message, lastCaller.lineNumber(), lastCaller.sourceURL()); #if ENABLE(INSPECTOR) page->inspectorController()->addMessageToConsole(JSMessageSource, type, level, callStack, message); @@ -191,7 +191,7 @@ void Console::addMessage(MessageType type, MessageLevel level, ScriptCallStack* if (!Console::shouldPrintExceptions()) return; - printSourceURLAndLine(lastCaller.sourceURL().prettyURL(), 0); + printSourceURLAndLine(lastCaller.sourceURL(), 0); printMessageSourceAndLevelPrefix(JSMessageSource, level); for (unsigned i = 0; i < lastCaller.argumentCount(); ++i) { @@ -269,7 +269,7 @@ void Console::count(ScriptCallStack* callStack) String title; getFirstArgumentAsString(callStack->state(), lastCaller, title); - page->inspectorController()->count(title, lastCaller.lineNumber(), lastCaller.sourceURL().string()); + page->inspectorController()->count(title, lastCaller.lineNumber(), lastCaller.sourceURL()); #else UNUSED_PARAM(callStack); #endif @@ -413,7 +413,7 @@ void Console::timeEnd(const String& title, ScriptCallStack* callStack) String message = title + String::format(": %.0fms", elapsed); const ScriptCallFrame& lastCaller = callStack->at(0); - page->inspectorController()->addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message, lastCaller.lineNumber(), lastCaller.sourceURL().string()); + page->inspectorController()->addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message, lastCaller.lineNumber(), lastCaller.sourceURL()); #else UNUSED_PARAM(title); UNUSED_PARAM(callStack); diff --git a/WebCore/page/DOMSelection.cpp b/WebCore/page/DOMSelection.cpp index 6c25103..03172b5 100644 --- a/WebCore/page/DOMSelection.cpp +++ b/WebCore/page/DOMSelection.cpp @@ -370,7 +370,7 @@ PassRefPtr<Range> DOMSelection::getRangeAt(int index, ExceptionCode& ec) ASSERT(rangeCount() == 1); if (Node* shadowAncestor = selectionShadowAncestor(m_frame)) { - Node* container = shadowAncestor->parentNode(); + ContainerNode* container = shadowAncestor->parentNode(); int offset = shadowAncestor->nodeIndex(); return Range::create(shadowAncestor->document(), container, offset, container, offset); } @@ -460,7 +460,7 @@ bool DOMSelection::containsNode(const Node* n, bool allowPartial) const if (!n || m_frame->document() != n->document() || selection->isNone()) return false; - Node* parentNode = n->parentNode(); + ContainerNode* parentNode = n->parentNode(); unsigned nodeIndex = n->nodeIndex(); RefPtr<Range> selectedRange = selection->selection().toNormalizedRange(); diff --git a/WebCore/page/DOMTimer.cpp b/WebCore/page/DOMTimer.cpp index 3ac6d15..57e6512 100644 --- a/WebCore/page/DOMTimer.cpp +++ b/WebCore/page/DOMTimer.cpp @@ -27,7 +27,7 @@ #include "config.h" #include "DOMTimer.h" -#include "InspectorTimelineAgent.h" +#include "InspectorInstrumentation.h" #include "ScheduledAction.h" #include "ScriptExecutionContext.h" #include <wtf/HashSet.h> @@ -81,10 +81,7 @@ int DOMTimer::install(ScriptExecutionContext* context, PassOwnPtr<ScheduledActio // or if it is a one-time timer and it has fired (DOMTimer::fired). DOMTimer* timer = new DOMTimer(context, action, timeout, singleShot); -#if ENABLE(INSPECTOR) - if (InspectorTimelineAgent* timelineAgent = InspectorTimelineAgent::retrieve(context)) - timelineAgent->didInstallTimer(timer->m_timeoutId, timeout, singleShot); -#endif + InspectorInstrumentation::didInstallTimer(context, timer->m_timeoutId, timeout, singleShot); return timer->m_timeoutId; } @@ -97,10 +94,7 @@ void DOMTimer::removeById(ScriptExecutionContext* context, int timeoutId) if (timeoutId <= 0) return; -#if ENABLE(INSPECTOR) - if (InspectorTimelineAgent* timelineAgent = InspectorTimelineAgent::retrieve(context)) - timelineAgent->didRemoveTimer(timeoutId); -#endif + InspectorInstrumentation::didRemoveTimer(context, timeoutId); delete context->findTimeout(timeoutId); } @@ -110,10 +104,7 @@ void DOMTimer::fired() ScriptExecutionContext* context = scriptExecutionContext(); timerNestingLevel = m_nestingLevel; -#if ENABLE(INSPECTOR) - if (InspectorTimelineAgent* timelineAgent = InspectorTimelineAgent::retrieve(context)) - timelineAgent->willFireTimer(m_timeoutId); -#endif + InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireTimer(context, m_timeoutId); // Simple case for non-one-shot timers. if (isActive()) { @@ -125,10 +116,9 @@ void DOMTimer::fired() // No access to member variables after this point, it can delete the timer. m_action->execute(context); -#if ENABLE(INSPECTOR) - if (InspectorTimelineAgent* timelineAgent = InspectorTimelineAgent::retrieve(context)) - timelineAgent->didFireTimer(); -#endif + + InspectorInstrumentation::didFireTimer(cookie); + return; } @@ -140,10 +130,7 @@ void DOMTimer::fired() action->execute(context); -#if ENABLE(INSPECTOR) - if (InspectorTimelineAgent* timelineAgent = InspectorTimelineAgent::retrieve(context)) - timelineAgent->didFireTimer(); -#endif + InspectorInstrumentation::didFireTimer(cookie); timerNestingLevel = 0; } diff --git a/WebCore/page/DOMTimer.h b/WebCore/page/DOMTimer.h index c1d8d9e..4fc6aae 100644 --- a/WebCore/page/DOMTimer.h +++ b/WebCore/page/DOMTimer.h @@ -34,8 +34,6 @@ namespace WebCore { - class InspectorTimelineAgent; - class DOMTimer : public SuspendableTimer { public: virtual ~DOMTimer(); diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp index 200b82a..1c811cc 100644 --- a/WebCore/page/DOMWindow.cpp +++ b/WebCore/page/DOMWindow.cpp @@ -62,7 +62,7 @@ #include "IDBFactory.h" #include "IDBFactoryBackendInterface.h" #include "InspectorController.h" -#include "InspectorTimelineAgent.h" +#include "InspectorInstrumentation.h" #include "KURL.h" #include "Location.h" #include "StyleMedia.h" @@ -86,7 +86,7 @@ #include <algorithm> #include <wtf/CurrentTime.h> #include <wtf/MathExtras.h> -#include <wtf/text/CString.h> +#include <wtf/text/StringConcatenate.h> #if ENABLE(FILE_SYSTEM) #include "AsyncFileSystem.h" @@ -700,7 +700,7 @@ void DOMWindow::pageDestroyed() } #if ENABLE(INDEXED_DATABASE) -IDBFactory* DOMWindow::indexedDB() const +IDBFactory* DOMWindow::webkitIndexedDB() const { if (m_idbFactory) return m_idbFactory.get(); @@ -740,7 +740,7 @@ void DOMWindow::requestFileSystem(int type, long long size, PassRefPtr<FileSyste return; } - LocalFileSystem::localFileSystem().requestFileSystem(document, fileSystemType, size, FileSystemCallbacks::create(successCallback, errorCallback, document)); + LocalFileSystem::localFileSystem().requestFileSystem(document, fileSystemType, size, FileSystemCallbacks::create(successCallback, errorCallback, document), false); } COMPILE_ASSERT(static_cast<int>(DOMWindow::TEMPORARY) == static_cast<int>(AsyncFileSystem::Temporary), enum_mismatch); @@ -798,8 +798,8 @@ void DOMWindow::postMessageTimerFired(PostMessageTimer* t) if (timer->targetOrigin()) { // Check target origin now since the target document may have changed since the simer was scheduled. if (!timer->targetOrigin()->isSameSchemeHostPort(document()->securityOrigin())) { - String message = String::format("Unable to post message to %s. Recipient has origin %s.\n", - timer->targetOrigin()->toString().utf8().data(), document()->securityOrigin()->toString().utf8().data()); + String message = makeString("Unable to post message to ", timer->targetOrigin()->toString(), + ". Recipient has origin ", document()->securityOrigin()->toString(), ".\n"); console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, message, 0, String()); return; } @@ -993,11 +993,8 @@ String DOMWindow::atob(const String& encodedString, ExceptionCode& ec) return String(); } - Vector<char> in; - in.append(encodedString.characters(), encodedString.length()); Vector<char> out; - - if (!base64Decode(in, out)) { + if (!base64Decode(encodedString, out, FailOnInvalidCharacter)) { ec = INVALID_CHARACTER_ERR; return String(); } @@ -1541,15 +1538,6 @@ void DOMWindow::dispatchLoadEvent() #endif } -#if ENABLE(INSPECTOR) -InspectorTimelineAgent* DOMWindow::inspectorTimelineAgent() -{ - if (frame() && frame()->page()) - return frame()->page()->inspectorTimelineAgent(); - return 0; -} -#endif - bool DOMWindow::dispatchEvent(PassRefPtr<Event> prpEvent, PassRefPtr<EventTarget> prpTarget) { RefPtr<EventTarget> protect = this; @@ -1559,23 +1547,11 @@ bool DOMWindow::dispatchEvent(PassRefPtr<Event> prpEvent, PassRefPtr<EventTarget event->setCurrentTarget(this); event->setEventPhase(Event::AT_TARGET); -#if ENABLE(INSPECTOR) - Page* inspectedPage = InspectorTimelineAgent::instanceCount() && frame() ? frame()->page() : 0; - if (inspectedPage) { - if (InspectorTimelineAgent* timelineAgent = hasEventListeners(event->type()) ? inspectedPage->inspectorTimelineAgent() : 0) - timelineAgent->willDispatchEvent(*event); - else - inspectedPage = 0; - } -#endif + InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchEventOnWindow(frame(), *event, this); bool result = fireEventListeners(event.get()); -#if ENABLE(INSPECTOR) - if (inspectedPage) - if (InspectorTimelineAgent* timelineAgent = inspectedPage->inspectorTimelineAgent()) - timelineAgent->didDispatchEvent(); -#endif + InspectorInstrumentation::didDispatchEventOnWindow(cookie); return result; } @@ -1616,12 +1592,12 @@ EventTargetData* DOMWindow::ensureEventTargetData() } #if ENABLE(BLOB) -String DOMWindow::createBlobURL(Blob* blob) +String DOMWindow::createObjectURL(Blob* blob) { return scriptExecutionContext()->createPublicBlobURL(blob).string(); } -void DOMWindow::revokeBlobURL(const String& blobURLString) +void DOMWindow::revokeObjectURL(const String& blobURLString) { scriptExecutionContext()->revokePublicBlobURL(KURL(KURL(), blobURLString)); } diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h index 6fd3775..2156791 100644 --- a/WebCore/page/DOMWindow.h +++ b/WebCore/page/DOMWindow.h @@ -57,7 +57,6 @@ namespace WebCore { class Frame; class History; class IDBFactory; - class InspectorTimelineAgent; class Location; class StyleMedia; class Navigator; @@ -235,7 +234,7 @@ namespace WebCore { void pageDestroyed(); #if ENABLE(INDEXED_DATABASE) - IDBFactory* indexedDB() const; + IDBFactory* webkitIndexedDB() const; #endif #if ENABLE(FILE_SYSTEM) @@ -393,8 +392,8 @@ namespace WebCore { DOMApplicationCache* optionalApplicationCache() const { return m_applicationCache.get(); } #endif #if ENABLE(BLOB) - String createBlobURL(Blob*); - void revokeBlobURL(const String&); + String createObjectURL(Blob*); + void revokeObjectURL(const String&); #endif using RefCounted<DOMWindow>::ref; @@ -407,7 +406,6 @@ namespace WebCore { virtual void derefEventTarget() { deref(); } virtual EventTargetData* eventTargetData(); virtual EventTargetData* ensureEventTargetData(); - InspectorTimelineAgent* inspectorTimelineAgent(); RefPtr<SecurityOrigin> m_securityOrigin; KURL m_url; diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl index f7f9a85..cb504b9 100644 --- a/WebCore/page/DOMWindow.idl +++ b/WebCore/page/DOMWindow.idl @@ -38,7 +38,6 @@ module window { CustomNativeConverter, CustomPutFunction, EventTarget, - OmitConstructor, ExtendsDOMGlobalObject, GenerateNativeConverter, LegacyParent=JSDOMWindowBase @@ -173,26 +172,26 @@ module window { readonly attribute [EnabledAtRuntime] NotificationCenter webkitNotifications; #endif #if defined(ENABLE_INDEXED_DATABASE) && ENABLE_INDEXED_DATABASE - readonly attribute [EnabledAtRuntime] IDBFactory indexedDB; - - attribute [EnabledAtRuntime] IDBCursorConstructor IDBCursor; - attribute [EnabledAtRuntime] IDBDatabaseConstructor IDBDatabase; - attribute [EnabledAtRuntime] IDBDatabaseErrorConstructor IDBDatabaseError; - attribute [EnabledAtRuntime] IDBDatabaseExceptionConstructor IDBDatabaseException; - attribute [EnabledAtRuntime] IDBErrorEventConstructor IDBErrorEvent; - attribute [EnabledAtRuntime] IDBEventConstructor IDBEvent; - attribute [EnabledAtRuntime] IDBFactoryConstructor IDBFactory; - attribute [EnabledAtRuntime] IDBIndexConstructor IDBIndex; - attribute [EnabledAtRuntime] IDBKeyRangeConstructor IDBKeyRange; - attribute [EnabledAtRuntime] IDBObjectStoreConstructor IDBObjectStore; - attribute [EnabledAtRuntime] IDBRequestConstructor IDBRequest; - attribute [EnabledAtRuntime] IDBSuccessEventConstructor IDBSuccessEvent; - attribute [EnabledAtRuntime] IDBTransactionConstructor IDBTransaction; + readonly attribute [EnabledAtRuntime] IDBFactory webkitIndexedDB; + + attribute [EnabledAtRuntime] IDBCursorConstructor webkitIDBCursor; + attribute [EnabledAtRuntime] IDBDatabaseConstructor webkitIDBDatabase; + attribute [EnabledAtRuntime] IDBDatabaseErrorConstructor webkitIDBDatabaseError; + attribute [EnabledAtRuntime] IDBDatabaseExceptionConstructor webkitIDBDatabaseException; + attribute [EnabledAtRuntime] IDBErrorEventConstructor webkitIDBErrorEvent; + attribute [EnabledAtRuntime] IDBEventConstructor webkitIDBEvent; + attribute [EnabledAtRuntime] IDBFactoryConstructor webkitIDBFactory; + attribute [EnabledAtRuntime] IDBIndexConstructor webkitIDBIndex; + attribute [EnabledAtRuntime] IDBKeyRangeConstructor webkitIDBKeyRange; + attribute [EnabledAtRuntime] IDBObjectStoreConstructor webkitIDBObjectStore; + attribute [EnabledAtRuntime] IDBRequestConstructor webkitIDBRequest; + attribute [EnabledAtRuntime] IDBSuccessEventConstructor webkitIDBSuccessEvent; + attribute [EnabledAtRuntime] IDBTransactionConstructor webkitIDBTransaction; #endif #if defined(ENABLE_FILE_SYSTEM) && ENABLE_FILE_SYSTEM const unsigned short TEMPORARY = 0; const unsigned short PERSISTENT = 1; - [EnabledAtRuntime] void requestFileSystem(in unsigned short type, in long long size, in [Callback, Optional] FileSystemCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback); + [EnabledAtRuntime=FileSystem] void requestFileSystem(in unsigned short type, in long long size, in [Callback, Optional] FileSystemCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback); attribute [EnabledAtRuntime=FileSystem] FlagsConstructor Flags; #endif @@ -488,14 +487,14 @@ module window { attribute DOMStringMapConstructor DOMStringMap; - attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] ArrayBufferConstructor ArrayBuffer; // Usable with new operator - attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] Int8ArrayConstructor Int8Array; // Usable with new operator - attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] Uint8ArrayConstructor Uint8Array; // Usable with new operator - attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] Int16ArrayConstructor Int16Array; // Usable with new operator - attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] Uint16ArrayConstructor Uint16Array; // Usable with new operator - attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] Int32ArrayConstructor Int32Array; // Usable with new operator - attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] Uint32ArrayConstructor Uint32Array; // Usable with new operator - attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] Float32ArrayConstructor Float32Array; // Usable with new operator + attribute [JSCCustomGetter,Conditional=3D_CANVAS|BLOB,EnabledAtRuntime] ArrayBufferConstructor ArrayBuffer; // Usable with new operator + attribute [JSCCustomGetter,Conditional=3D_CANVAS|BLOB,EnabledAtRuntime] Int8ArrayConstructor Int8Array; // Usable with new operator + attribute [JSCCustomGetter,Conditional=3D_CANVAS|BLOB,EnabledAtRuntime] Uint8ArrayConstructor Uint8Array; // Usable with new operator + attribute [JSCCustomGetter,Conditional=3D_CANVAS|BLOB,EnabledAtRuntime] Int16ArrayConstructor Int16Array; // Usable with new operator + attribute [JSCCustomGetter,Conditional=3D_CANVAS|BLOB,EnabledAtRuntime] Uint16ArrayConstructor Uint16Array; // Usable with new operator + attribute [JSCCustomGetter,Conditional=3D_CANVAS|BLOB,EnabledAtRuntime] Int32ArrayConstructor Int32Array; // Usable with new operator + attribute [JSCCustomGetter,Conditional=3D_CANVAS|BLOB,EnabledAtRuntime] Uint32ArrayConstructor Uint32Array; // Usable with new operator + attribute [JSCCustomGetter,Conditional=3D_CANVAS|BLOB,EnabledAtRuntime] Float32ArrayConstructor Float32Array; // Usable with new operator attribute EventConstructor Event; attribute BeforeLoadEventConstructor BeforeLoadEvent; @@ -765,8 +764,8 @@ module window { attribute [Conditional=BLOB] BlobBuilderConstructor BlobBuilder; #if defined(ENABLE_BLOB) && ENABLE_BLOB - [ConvertNullStringTo=Undefined] DOMString createBlobURL(in Blob blob); - void revokeBlobURL(in DOMString blobURL); + [ConvertNullStringTo=Undefined] DOMString createObjectURL(in Blob blob); + void revokeObjectURL(in DOMString blobURL); #endif #endif // defined(LANGUAGE_JAVASCRIPT) diff --git a/WebCore/page/FocusController.cpp b/WebCore/page/FocusController.cpp index 1ac50cb..622bf39 100644 --- a/WebCore/page/FocusController.cpp +++ b/WebCore/page/FocusController.cpp @@ -298,7 +298,7 @@ bool FocusController::advanceFocusDirectionally(FocusDirection direction, Keyboa if (!focusedNode) { // Just move to the first focusable node. FocusDirection tabDirection = (direction == FocusDirectionUp || direction == FocusDirectionLeft) ? - FocusDirectionForward : FocusDirectionBackward; + FocusDirectionBackward : FocusDirectionForward; // 'initialFocus' is set to true so the chrome is not focused. return advanceFocusInDocumentOrder(tabDirection, event, true); } diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp index 9817e87..1b476a0 100755..100644 --- a/WebCore/page/Frame.cpp +++ b/WebCore/page/Frame.cpp @@ -153,7 +153,7 @@ inline Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoader : m_page(page) , m_treeNode(this, parentFromOwnerElement(ownerElement)) , m_loader(this, frameLoaderClient) - , m_redirectScheduler(this) + , m_navigationScheduler(this) , m_ownerElement(ownerElement) , m_script(this) , m_editor(this) @@ -292,6 +292,9 @@ void Frame::setDocument(PassRefPtr<Document> newDoc) // Update the cached 'document' property, which is now stale. m_script.updateDocument(); + + if (m_page) + m_page->updateViewportArguments(); } #if ENABLE(ORIENTATION_EVENTS) @@ -344,35 +347,25 @@ static RegularExpression* createRegExpForLabels(const Vector<String>& labels) String Frame::searchForLabelsAboveCell(RegularExpression* regExp, HTMLTableCellElement* cell, size_t* resultDistanceFromStartOfCell) { - RenderObject* cellRenderer = cell->renderer(); - - if (cellRenderer && cellRenderer->isTableCell()) { - RenderTableCell* tableCellRenderer = toRenderTableCell(cellRenderer); - RenderTableCell* cellAboveRenderer = tableCellRenderer->table()->cellAbove(tableCellRenderer); - - if (cellAboveRenderer) { - HTMLTableCellElement* aboveCell = - static_cast<HTMLTableCellElement*>(cellAboveRenderer->node()); - - if (aboveCell) { - // search within the above cell we found for a match - size_t lengthSearched = 0; - for (Node* n = aboveCell->firstChild(); n; n = n->traverseNextNode(aboveCell)) { - if (n->isTextNode() && n->renderer() && n->renderer()->style()->visibility() == VISIBLE) { - // For each text chunk, run the regexp - String nodeString = n->nodeValue(); - int pos = regExp->searchRev(nodeString); - if (pos >= 0) { - if (resultDistanceFromStartOfCell) - *resultDistanceFromStartOfCell = lengthSearched; - return nodeString.substring(pos, regExp->matchedLength()); - } - lengthSearched += nodeString.length(); - } + HTMLTableCellElement* aboveCell = cell->cellAbove(); + if (aboveCell) { + // search within the above cell we found for a match + size_t lengthSearched = 0; + for (Node* n = aboveCell->firstChild(); n; n = n->traverseNextNode(aboveCell)) { + if (n->isTextNode() && n->renderer() && n->renderer()->style()->visibility() == VISIBLE) { + // For each text chunk, run the regexp + String nodeString = n->nodeValue(); + int pos = regExp->searchRev(nodeString); + if (pos >= 0) { + if (resultDistanceFromStartOfCell) + *resultDistanceFromStartOfCell = lengthSearched; + return nodeString.substring(pos, regExp->matchedLength()); } + lengthSearched += nodeString.length(); } } } + // Any reason in practice to search all cells in that are above cell? if (resultDistanceFromStartOfCell) *resultDistanceFromStartOfCell = notFound; diff --git a/WebCore/page/Frame.h b/WebCore/page/Frame.h index c09c330..b48f5c8 100644 --- a/WebCore/page/Frame.h +++ b/WebCore/page/Frame.h @@ -93,7 +93,7 @@ namespace WebCore { Editor* editor() const; EventHandler* eventHandler() const; FrameLoader* loader() const; - RedirectScheduler* redirectScheduler() const; + NavigationScheduler* navigationScheduler() const; SelectionController* selection() const; FrameTree* tree() const; AnimationController* animation() const; @@ -194,7 +194,7 @@ namespace WebCore { Page* m_page; mutable FrameTree m_treeNode; mutable FrameLoader m_loader; - mutable RedirectScheduler m_redirectScheduler; + mutable NavigationScheduler m_navigationScheduler; mutable RefPtr<DOMWindow> m_domWindow; HashSet<DOMWindow*> m_liveFormerWindows; @@ -252,9 +252,9 @@ namespace WebCore { return &m_loader; } - inline RedirectScheduler* Frame::redirectScheduler() const + inline NavigationScheduler* Frame::navigationScheduler() const { - return &m_redirectScheduler; + return &m_navigationScheduler; } inline FrameView* Frame::view() const diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp index 9a4daa7..660cdfb 100644 --- a/WebCore/page/FrameView.cpp +++ b/WebCore/page/FrameView.cpp @@ -45,7 +45,7 @@ #include "HTMLFrameSetElement.h" #include "HTMLNames.h" #include "HTMLPlugInImageElement.h" -#include "InspectorTimelineAgent.h" +#include "InspectorInstrumentation.h" #include "OverflowEvent.h" #include "RenderEmbeddedObject.h" #include "RenderLayer.h" @@ -387,9 +387,9 @@ void FrameView::updateCanHaveScrollbars() ScrollbarMode vMode; scrollbarModes(hMode, vMode); if (hMode == ScrollbarAlwaysOff && vMode == ScrollbarAlwaysOff) - m_canHaveScrollbars = false; + setCanHaveScrollbars(false); else - m_canHaveScrollbars = true; + setCanHaveScrollbars(true); } PassRefPtr<Scrollbar> FrameView::createScrollbar(ScrollbarOrientation orientation) @@ -486,6 +486,58 @@ void FrameView::applyOverflowToViewport(RenderObject* o, ScrollbarMode& hMode, S m_viewportRenderer = o; } +void FrameView::calculateScrollbarModesForLayout(ScrollbarMode& hMode, ScrollbarMode& vMode) +{ + if (m_canHaveScrollbars) { + hMode = ScrollbarAuto; + vMode = ScrollbarAuto; + } else { + hMode = ScrollbarAlwaysOff; + vMode = ScrollbarAlwaysOff; + } + + if (!m_layoutRoot) { + Document* document = m_frame->document(); + Node* documentElement = document->documentElement(); + RenderObject* rootRenderer = documentElement ? documentElement->renderer() : 0; + Node* body = document->body(); + if (body && body->renderer()) { + if (body->hasTagName(framesetTag) && m_frame->settings() && !m_frame->settings()->frameFlatteningEnabled()) { + body->renderer()->setChildNeedsLayout(true); + vMode = ScrollbarAlwaysOff; + hMode = ScrollbarAlwaysOff; + } else if (body->hasTagName(bodyTag)) { + if (!m_firstLayout && m_size.height() != layoutHeight() && body->renderer()->enclosingBox()->stretchesToViewport()) + body->renderer()->setChildNeedsLayout(true); + // It's sufficient to just check the X overflow, + // since it's illegal to have visible in only one direction. + RenderObject* o = rootRenderer->style()->overflowX() == OVISIBLE && document->documentElement()->hasTagName(htmlTag) ? body->renderer() : rootRenderer; + applyOverflowToViewport(o, hMode, vMode); + } + } else if (rootRenderer) { +#if ENABLE(SVG) + if (documentElement->isSVGElement()) { + if (!m_firstLayout && (m_size.width() != layoutWidth() || m_size.height() != layoutHeight())) + rootRenderer->setChildNeedsLayout(true); + } else + applyOverflowToViewport(rootRenderer, hMode, vMode); +#else + applyOverflowToViewport(rootRenderer, hMode, vMode); +#endif + } +#ifdef INSTRUMENT_LAYOUT_SCHEDULING + if (m_firstLayout && !document->ownerElement()) + printf("Elapsed time before first layout: %d\n", document->elapsedTime()); +#endif + } + + HTMLFrameOwnerElement* owner = m_frame->ownerElement(); + if (owner && (owner->scrollingMode() == ScrollbarAlwaysOff)) { + hMode = ScrollbarAlwaysOff; + vMode = ScrollbarAlwaysOff; + } +} + #if USE(ACCELERATED_COMPOSITING) void FrameView::updateCompositingLayers() { @@ -626,10 +678,7 @@ void FrameView::layout(bool allowSubtree) if (isPainting()) return; -#if ENABLE(INSPECTOR) - if (InspectorTimelineAgent* timelineAgent = inspectorTimelineAgent()) - timelineAgent->willLayout(); -#endif + InspectorInstrumentationCookie cookie = InspectorInstrumentation::willLayout(m_frame.get()); if (!allowSubtree && m_layoutRoot) { m_layoutRoot->markContainingBlocksForLayout(false); @@ -683,6 +732,7 @@ void FrameView::layout(bool allowSubtree) ScrollbarMode hMode; ScrollbarMode vMode; +<<<<<<< HEAD if (m_canHaveScrollbars) { hMode = ScrollbarAuto; vMode = ScrollbarAuto; @@ -726,6 +776,10 @@ void FrameView::layout(bool allowSubtree) printf("Elapsed time before first layout: %d\n", document->elapsedTime()); #endif } +======= + + calculateScrollbarModesForLayout(hMode, vMode); +>>>>>>> webkit.org at r70209 m_doFullRepaint = !subtree && (m_firstLayout || toRenderView(root)->printing()); @@ -860,10 +914,7 @@ void FrameView::layout(bool allowSubtree) ASSERT(m_enqueueEvents); } -#if ENABLE(INSPECTOR) - if (InspectorTimelineAgent* timelineAgent = inspectorTimelineAgent()) - timelineAgent->didLayout(); -#endif + InspectorInstrumentation::didLayout(cookie); m_nestedLayoutCount--; } @@ -1970,10 +2021,7 @@ void FrameView::paintContents(GraphicsContext* p, const IntRect& rect) if (!frame()) return; -#if ENABLE(INSPECTOR) - if (InspectorTimelineAgent* timelineAgent = inspectorTimelineAgent()) - timelineAgent->willPaint(rect); -#endif + InspectorInstrumentationCookie cookie = InspectorInstrumentation::willPaint(m_frame.get(), rect); Document* document = frame()->document(); @@ -1993,7 +2041,7 @@ void FrameView::paintContents(GraphicsContext* p, const IntRect& rect) fillWithRed = true; if (fillWithRed) - p->fillRect(rect, Color(0xFF, 0, 0), DeviceColorSpace); + p->fillRect(rect, Color(0xFF, 0, 0), ColorSpaceDeviceRGB); #endif bool isTopLevelPainter = !sCurrentPaintTimeStamp; @@ -2047,10 +2095,7 @@ void FrameView::paintContents(GraphicsContext* p, const IntRect& rect) if (isTopLevelPainter) sCurrentPaintTimeStamp = 0; -#if ENABLE(INSPECTOR) - if (InspectorTimelineAgent* timelineAgent = inspectorTimelineAgent()) - timelineAgent->didPaint(); -#endif + InspectorInstrumentation::didPaint(cookie); } void FrameView::setPaintBehavior(PaintBehavior behavior) diff --git a/WebCore/page/FrameView.h b/WebCore/page/FrameView.h index 22c05be..1518233 100644 --- a/WebCore/page/FrameView.h +++ b/WebCore/page/FrameView.h @@ -25,9 +25,9 @@ #ifndef FrameView_h #define FrameView_h -#include "Frame.h" // Only used by FrameView::inspectorTimelineAgent() +#include "Frame.h" #include "IntSize.h" -#include "Page.h" // Only used by FrameView::inspectorTimelineAgent() +#include "Page.h" #include "RenderObject.h" // For PaintBehavior #include "ScrollView.h" #include <wtf/Forward.h> @@ -38,7 +38,6 @@ namespace WebCore { class Color; class Event; class FrameViewPrivate; -class InspectorTimelineAgent; class IntRect; class Node; class PlatformMouseEvent; @@ -259,6 +258,7 @@ private: bool hasFixedObjects() const { return m_fixedObjectCount > 0; } void applyOverflowToViewport(RenderObject*, ScrollbarMode& hMode, ScrollbarMode& vMode); + void calculateScrollbarModesForLayout(ScrollbarMode& hMode, ScrollbarMode& vMode); void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); @@ -293,10 +293,6 @@ private: void scrollToAnchor(); void scrollPositionChanged(); -#if ENABLE(INSPECTOR) - InspectorTimelineAgent* inspectorTimelineAgent() const; -#endif - bool hasCustomScrollbars() const; virtual void updateScrollCorner(); @@ -386,13 +382,6 @@ private: static double s_deferredRepaintDelayIncrementDuringLoading; }; -#if ENABLE(INSPECTOR) -inline InspectorTimelineAgent* FrameView::inspectorTimelineAgent() const -{ - return m_frame->page() ? m_frame->page()->inspectorTimelineAgent() : 0; -} -#endif - } // namespace WebCore #endif // FrameView_h diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp index 44e28fa..de01b66 100644 --- a/WebCore/page/Geolocation.cpp +++ b/WebCore/page/Geolocation.cpp @@ -718,7 +718,7 @@ void Geolocation::handlePendingPermissionNotifiers() namespace WebCore { -void Geolocation::clearWatch(int watchId) {} +void Geolocation::clearWatch(int) {} void Geolocation::disconnectFrame() {} diff --git a/WebCore/page/GroupSettings.cpp b/WebCore/page/GroupSettings.cpp index 58ab74d..0762861 100644 --- a/WebCore/page/GroupSettings.cpp +++ b/WebCore/page/GroupSettings.cpp @@ -30,6 +30,7 @@ namespace WebCore { GroupSettings::GroupSettings() : m_localStorageQuotaBytes(5 * 1024 * 1024) // Suggested by the HTML5 spec. + , m_indexedDBQuotaBytes(5 * 1024 * 1024) { } @@ -43,4 +44,10 @@ void GroupSettings::setIndexedDBDatabasePath(const String& path) m_indexedDBDatabasePath = path; } +void GroupSettings::setIndexedDBQuotaBytes(int64_t quota) +{ + m_indexedDBQuotaBytes = quota; +} + + } // namespace WebCore diff --git a/WebCore/page/GroupSettings.h b/WebCore/page/GroupSettings.h index 62a5dd2..fb6f6b5 100644 --- a/WebCore/page/GroupSettings.h +++ b/WebCore/page/GroupSettings.h @@ -43,6 +43,9 @@ public: void setLocalStorageQuotaBytes(unsigned); unsigned localStorageQuotaBytes() const { return m_localStorageQuotaBytes; } + void setIndexedDBQuotaBytes(int64_t); + int64_t indexedDBQuotaBytes() const { return m_indexedDBQuotaBytes; } + void setIndexedDBDatabasePath(const String&); const String& indexedDBDatabasePath() const { return m_indexedDBDatabasePath; } @@ -51,6 +54,7 @@ private: unsigned m_localStorageQuotaBytes; String m_indexedDBDatabasePath; + int64_t m_indexedDBQuotaBytes; }; } // namespace WebCore diff --git a/WebCore/page/History.cpp b/WebCore/page/History.cpp index 337f5b2..3d463b6 100644 --- a/WebCore/page/History.cpp +++ b/WebCore/page/History.cpp @@ -63,21 +63,21 @@ void History::back() { if (!m_frame) return; - m_frame->redirectScheduler()->scheduleHistoryNavigation(-1); + m_frame->navigationScheduler()->scheduleHistoryNavigation(-1); } void History::forward() { if (!m_frame) return; - m_frame->redirectScheduler()->scheduleHistoryNavigation(1); + m_frame->navigationScheduler()->scheduleHistoryNavigation(1); } void History::go(int distance) { if (!m_frame) return; - m_frame->redirectScheduler()->scheduleHistoryNavigation(distance); + m_frame->navigationScheduler()->scheduleHistoryNavigation(distance); } KURL History::urlForState(const String& urlString) diff --git a/WebCore/page/Location.cpp b/WebCore/page/Location.cpp index c02304c..78809e3 100644 --- a/WebCore/page/Location.cpp +++ b/WebCore/page/Location.cpp @@ -138,6 +138,16 @@ String Location::hash() const return fragmentIdentifier.isEmpty() ? "" : "#" + fragmentIdentifier; } +String Location::getParameter(const String& name) const +{ + if (!m_frame) + return String(); + + ParsedURLParameters parameters; + url().copyParsedQueryTo(parameters); + return parameters.get(name); +} + String Location::toString() const { if (!m_frame) diff --git a/WebCore/page/Location.h b/WebCore/page/Location.h index a4bc407..c62f5aa 100644 --- a/WebCore/page/Location.h +++ b/WebCore/page/Location.h @@ -59,6 +59,8 @@ namespace WebCore { String toString() const; + String getParameter(const String&) const; + private: Location(Frame*); diff --git a/WebCore/page/Location.idl b/WebCore/page/Location.idl index 1668e05..76340d9 100644 --- a/WebCore/page/Location.idl +++ b/WebCore/page/Location.idl @@ -62,6 +62,8 @@ module window { readonly attribute DOMString origin; #endif + DOMString getParameter(in DOMString name); + #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT [DontEnum, Custom, V8OnInstance, V8ReadOnly] DOMString toString(); #endif diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp index 379d3f3..5609e28 100644 --- a/WebCore/page/Page.cpp +++ b/WebCore/page/Page.cpp @@ -20,7 +20,6 @@ #include "config.h" #include "Page.h" -#include "DeviceMotionController.h" #include "BackForwardController.h" #include "BackForwardList.h" #include "Base64.h" @@ -30,6 +29,7 @@ #include "ContextMenuClient.h" #include "ContextMenuController.h" #include "DOMWindow.h" +#include "DeviceMotionController.h" #include "DeviceOrientationController.h" #include "DragController.h" #include "EditorClient.h" @@ -46,7 +46,6 @@ #include "HTMLElement.h" #include "HistoryItem.h" #include "InspectorController.h" -#include "InspectorTimelineAgent.h" #include "Logging.h" #include "MediaCanStartListener.h" #include "Navigator.h" @@ -55,6 +54,7 @@ #include "PluginData.h" #include "PluginHalter.h" #include "PluginView.h" +#include "PluginViewBase.h" #include "ProgressTracker.h" #include "RenderTheme.h" #include "RenderWidget.h" @@ -72,6 +72,10 @@ #include <wtf/StdLibExtras.h> #include <wtf/text/StringHash.h> +#if ENABLE(ACCELERATED_2D_CANVAS) +#include "SharedGraphicsContext3D.h" +#endif + #if ENABLE(DOM_STORAGE) #include "StorageArea.h" #include "StorageNamespace.h" @@ -434,6 +438,15 @@ void Page::scheduleForcedStyleRecalcForAllPages() frame->document()->scheduleForcedStyleRecalc(); } +void Page::updateViewportArguments() +{ + if (!mainFrame() || !mainFrame()->document() || mainFrame()->document()->viewportArguments() == m_viewportArguments) + return; + + m_viewportArguments = mainFrame()->document()->viewportArguments(); + chrome()->dispatchViewportDataDidChange(m_viewportArguments); +} + void Page::refreshPlugins(bool reload) { if (!allPages) @@ -639,22 +652,17 @@ void Page::userStyleSheetLocationChanged() m_didLoadUserStyleSheet = false; m_userStyleSheet = String(); m_userStyleSheetModificationTime = 0; - + // Data URLs with base64-encoded UTF-8 style sheets are common. We can process them // synchronously and avoid using a loader. - if (url.protocolIs("data") && url.string().startsWith("data:text/css;charset=utf-8;base64,")) { + if (url.protocolIsData() && url.string().startsWith("data:text/css;charset=utf-8;base64,")) { m_didLoadUserStyleSheet = true; - - const unsigned prefixLength = 35; - Vector<char> encodedData(url.string().length() - prefixLength); - for (unsigned i = prefixLength; i < url.string().length(); ++i) - encodedData[i - prefixLength] = static_cast<char>(url.string()[i]); Vector<char> styleSheetAsUTF8; - if (base64Decode(encodedData, styleSheetAsUTF8)) + if (base64Decode(decodeURLEscapeSequences(url.string().substring(35)), styleSheetAsUTF8, IgnoreWhitespace)) m_userStyleSheet = String::fromUTF8(styleSheetAsUTF8.data(), styleSheetAsUTF8.size()); } - + for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) { if (frame->document()) frame->document()->updatePageUserSheet(); @@ -773,6 +781,18 @@ void Page::setDebugger(JSC::Debugger* debugger) frame->script()->attachDebugger(m_debugger); } +SharedGraphicsContext3D* Page::sharedGraphicsContext3D() +{ +#if ENABLE(ACCELERATED_2D_CANVAS) + if (!m_sharedGraphicsContext3D) + m_sharedGraphicsContext3D = SharedGraphicsContext3D::create(chrome()); + + return m_sharedGraphicsContext3D.get(); +#else + return 0; +#endif +} + #if ENABLE(DOM_STORAGE) StorageNamespace* Page::sessionStorage(bool optionalCreate) { @@ -838,13 +858,6 @@ bool Page::javaScriptURLsAreAllowed() const return m_javaScriptURLsAreAllowed; } -#if ENABLE(INSPECTOR) -InspectorTimelineAgent* Page::inspectorTimelineAgent() const -{ - return m_inspectorController->timelineAgent(); -} -#endif - #if ENABLE(INPUT_SPEECH) SpeechInput* Page::speechInput() { @@ -861,8 +874,7 @@ void Page::privateBrowsingStateChanged() // Collect the PluginViews in to a vector to ensure that action the plug-in takes // from below privateBrowsingStateChanged does not affect their lifetime. - - Vector<RefPtr<PluginView>, 32> pluginViews; + Vector<RefPtr<PluginViewBase>, 32> pluginViewBases; for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) { FrameView* view = frame->view(); if (!view) @@ -874,14 +886,13 @@ void Page::privateBrowsingStateChanged() HashSet<RefPtr<Widget> >::const_iterator end = children->end(); for (HashSet<RefPtr<Widget> >::const_iterator it = children->begin(); it != end; ++it) { Widget* widget = (*it).get(); - if (!widget->isPluginView()) - continue; - pluginViews.append(static_cast<PluginView*>(widget)); + if (widget->isPluginViewBase()) + pluginViewBases.append(static_cast<PluginViewBase*>(widget)); } } - for (size_t i = 0; i < pluginViews.size(); i++) - pluginViews[i]->privateBrowsingStateChanged(privateBrowsingEnabled); + for (size_t i = 0; i < pluginViewBases.size(); ++i) + pluginViewBases[i]->privateBrowsingStateChanged(privateBrowsingEnabled); } void Page::pluginAllowedRunTimeChanged() diff --git a/WebCore/page/Page.h b/WebCore/page/Page.h index 8f01faa..6ff64cf 100644 --- a/WebCore/page/Page.h +++ b/WebCore/page/Page.h @@ -23,6 +23,7 @@ #include "FrameLoaderTypes.h" #include "PlatformString.h" +#include "ViewportArguments.h" #include <wtf/Forward.h> #include <wtf/HashSet.h> #include <wtf/Noncopyable.h> @@ -60,7 +61,6 @@ namespace WebCore { class HistoryItem; class InspectorClient; class InspectorController; - class InspectorTimelineAgent; class MediaCanStartListener; class Node; class PageGroup; @@ -72,6 +72,7 @@ namespace WebCore { class VisibleSelection; class SelectionController; class Settings; + class SharedGraphicsContext3D; class SpeechInput; class SpeechInputClient; @@ -127,6 +128,9 @@ namespace WebCore { RenderTheme* theme() const { return m_theme.get(); }; + ViewportArguments viewportArguments() const { return m_viewportArguments; } + void updateViewportArguments(); + static void refreshPlugins(bool reload); PluginData* pluginData() const; @@ -259,6 +263,8 @@ namespace WebCore { static void allVisitedStateChanged(PageGroup*); static void visitedStateChanged(PageGroup*, LinkHash visitedHash); + SharedGraphicsContext3D* sharedGraphicsContext3D(); + #if ENABLE(DOM_STORAGE) StorageNamespace* sessionStorage(bool optionalCreate = true); void setSessionStorage(PassRefPtr<StorageNamespace>); @@ -282,10 +288,6 @@ namespace WebCore { void setJavaScriptURLsAreAllowed(bool); bool javaScriptURLsAreAllowed() const; -#if ENABLE(INSPECTOR) - InspectorTimelineAgent* inspectorTimelineAgent() const; -#endif - // Don't allow more than a certain number of frames in a page. // This seems like a reasonable upper bound, and otherwise mutually // recursive frameset pages can quickly bring the program to its knees @@ -304,6 +306,11 @@ namespace WebCore { OwnPtr<Chrome> m_chrome; OwnPtr<SelectionController> m_dragCaretController; + +#if ENABLE(ACCELERATED_2D_CANVAS) + RefPtr<SharedGraphicsContext3D> m_sharedGraphicsContext3D; +#endif + #if ENABLE(DRAG_SUPPORT) OwnPtr<DragController> m_dragController; #endif @@ -383,6 +390,8 @@ namespace WebCore { #endif ViewMode m_viewMode; + + ViewportArguments m_viewportArguments; }; } // namespace WebCore diff --git a/WebCore/page/PrintContext.cpp b/WebCore/page/PrintContext.cpp index 8cc7dd6..7acca96 100644 --- a/WebCore/page/PrintContext.cpp +++ b/WebCore/page/PrintContext.cpp @@ -26,7 +26,7 @@ #include "FrameView.h" #include "RenderLayer.h" #include "RenderView.h" -#include <wtf/text/CString.h> +#include <wtf/text/StringConcatenate.h> using namespace WebCore; @@ -210,18 +210,18 @@ String PrintContext::pageProperty(Frame* frame, const char* propertyName, int pa if (!strcmp(propertyName, "margin-left")) { if (style->marginLeft().isAuto()) return String("auto"); - return String::format("%d", style->marginLeft().rawValue()); + return String::number(style->marginLeft().rawValue()); } if (!strcmp(propertyName, "line-height")) - return String::format("%d", style->lineHeight().rawValue()); + return String::number(style->lineHeight().rawValue()); if (!strcmp(propertyName, "font-size")) - return String::format("%d", style->fontDescription().computedPixelSize()); + return String::number(style->fontDescription().computedPixelSize()); if (!strcmp(propertyName, "font-family")) - return String::format("%s", style->fontDescription().family().family().string().utf8().data()); + return style->fontDescription().family().family().string(); if (!strcmp(propertyName, "size")) - return String::format("%d %d", style->pageSize().width().rawValue(), style->pageSize().height().rawValue()); + return makeString(String::number(style->pageSize().width().rawValue()), ' ', String::number(style->pageSize().height().rawValue())); - return String::format("pageProperty() unimplemented for: %s", propertyName); + return makeString("pageProperty() unimplemented for: ", propertyName); } bool PrintContext::isPageBoxVisible(Frame* frame, int pageNumber) @@ -233,7 +233,10 @@ String PrintContext::pageSizeAndMarginsInPixels(Frame* frame, int pageNumber, in { IntSize pageSize(width, height); frame->document()->pageSizeAndMarginsInPixels(pageNumber, pageSize, marginTop, marginRight, marginBottom, marginLeft); - return String::format("(%d, %d) %d %d %d %d", pageSize.width(), pageSize.height(), marginTop, marginRight, marginBottom, marginLeft); + + // We don't have a makeString() function that takes up to 12 arguments, if this is a hot function, we can provide one. + return makeString('(', String::number(pageSize.width()), ", ", String::number(pageSize.height()), ") ") + + makeString(String::number(marginTop), ' ', String::number(marginRight), ' ', String::number(marginBottom), ' ', String::number(marginLeft)); } int PrintContext::numberOfPages(Frame* frame, const FloatSize& pageSizeInPixels) @@ -268,7 +271,7 @@ void PrintContext::spoolAllPagesWithBoundaries(Frame* frame, GraphicsContext& gr int totalHeight = pageRects.size() * (pageSizeInPixels.height() + 1) - 1; // Fill the whole background by white. - graphicsContext.setFillColor(Color(255, 255, 255), DeviceColorSpace); + graphicsContext.setFillColor(Color(255, 255, 255), ColorSpaceDeviceRGB); graphicsContext.fillRect(FloatRect(0, 0, pageWidth, totalHeight)); graphicsContext.save(); @@ -280,8 +283,8 @@ void PrintContext::spoolAllPagesWithBoundaries(Frame* frame, GraphicsContext& gr // Draw a line for a page boundary if this isn't the first page. if (pageIndex > 0) { graphicsContext.save(); - graphicsContext.setStrokeColor(Color(0, 0, 255), DeviceColorSpace); - graphicsContext.setFillColor(Color(0, 0, 255), DeviceColorSpace); + graphicsContext.setStrokeColor(Color(0, 0, 255), ColorSpaceDeviceRGB); + graphicsContext.setFillColor(Color(0, 0, 255), ColorSpaceDeviceRGB); graphicsContext.drawLine(IntPoint(0, currentHeight), IntPoint(pageWidth, currentHeight)); graphicsContext.restore(); diff --git a/WebCore/page/Screen.cpp b/WebCore/page/Screen.cpp index d2bb60f..bddc030 100644 --- a/WebCore/page/Screen.cpp +++ b/WebCore/page/Screen.cpp @@ -81,18 +81,18 @@ unsigned Screen::pixelDepth() const return static_cast<unsigned>(screenDepth(m_frame->view())); } -unsigned Screen::availLeft() const +int Screen::availLeft() const { if (!m_frame) return 0; - return static_cast<unsigned>(screenAvailableRect(m_frame->view()).x()); + return static_cast<int>(screenAvailableRect(m_frame->view()).x()); } -unsigned Screen::availTop() const +int Screen::availTop() const { if (!m_frame) return 0; - return static_cast<unsigned>(screenAvailableRect(m_frame->view()).y()); + return static_cast<int>(screenAvailableRect(m_frame->view()).y()); } unsigned Screen::availHeight() const diff --git a/WebCore/page/Screen.h b/WebCore/page/Screen.h index 2c84abd..5716d46 100644 --- a/WebCore/page/Screen.h +++ b/WebCore/page/Screen.h @@ -48,8 +48,8 @@ namespace WebCore { unsigned width() const; unsigned colorDepth() const; unsigned pixelDepth() const; - unsigned availLeft() const; - unsigned availTop() const; + int availLeft() const; + int availTop() const; unsigned availHeight() const; unsigned availWidth() const; diff --git a/WebCore/page/Screen.idl b/WebCore/page/Screen.idl index cd181eb..50f87ee 100644 --- a/WebCore/page/Screen.idl +++ b/WebCore/page/Screen.idl @@ -34,8 +34,8 @@ module window { readonly attribute unsigned long width; readonly attribute unsigned long colorDepth; readonly attribute unsigned long pixelDepth; - readonly attribute unsigned long availLeft; - readonly attribute unsigned long availTop; + readonly attribute long availLeft; + readonly attribute long availTop; readonly attribute unsigned long availHeight; readonly attribute unsigned long availWidth; }; diff --git a/WebCore/page/SecurityOrigin.cpp b/WebCore/page/SecurityOrigin.cpp index 6001983..f0e999f 100644 --- a/WebCore/page/SecurityOrigin.cpp +++ b/WebCore/page/SecurityOrigin.cpp @@ -267,7 +267,7 @@ bool SecurityOrigin::taintsCanvas(const KURL& url) const // we special case data URLs below. If we change to match HTML5 w.r.t. // data URL security, then we can remove this function in favor of // !canRequest. - if (url.protocolIs("data")) + if (url.protocolIsData()) return false; return true; diff --git a/WebCore/page/Timing.cpp b/WebCore/page/Timing.cpp index f65322b..8a0de2a 100644 --- a/WebCore/page/Timing.cpp +++ b/WebCore/page/Timing.cpp @@ -100,7 +100,7 @@ unsigned long long Timing::unloadEventEnd() const return toIntegerMilliseconds(timing->unloadEventEnd); } - + unsigned long long Timing::redirectStart() const { DocumentLoadTiming* timing = documentLoadTiming(); @@ -109,7 +109,7 @@ unsigned long long Timing::redirectStart() const return toIntegerMilliseconds(timing->redirectStart); } - + unsigned long long Timing::redirectEnd() const { DocumentLoadTiming* timing = documentLoadTiming(); @@ -218,12 +218,7 @@ unsigned long long Timing::requestStart() const unsigned long long Timing::requestEnd() const { - ResourceLoadTiming* timing = resourceLoadTiming(); - if (!timing) - return 0; - - ASSERT(timing->sendEnd >= 0); - return resourceLoadTimeRelativeToAbsolute(timing->sendEnd); + return responseStart(); } unsigned long long Timing::responseStart() const diff --git a/WebCore/page/XSSAuditor.cpp b/WebCore/page/XSSAuditor.cpp index 0e6cc65..1940d52 100644 --- a/WebCore/page/XSSAuditor.cpp +++ b/WebCore/page/XSSAuditor.cpp @@ -41,8 +41,7 @@ #include "Settings.h" #include "TextResourceDecoder.h" #include <wtf/text/CString.h> - -using namespace WTF; +#include <wtf/text/StringConcatenate.h> namespace WebCore { @@ -203,7 +202,7 @@ bool XSSAuditor::canLoadObject(const String& url) const task.allowRequestIfNoIllegalURICharacters = true; if (findInRequest(task)) { - String consoleMessage = String::format("Refused to load an object. URL found within request: \"%s\".\n", url.utf8().data()); + String consoleMessage = makeString("Refused to load an object. URL found within request: \"", url, "\".\n"); m_frame->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage, 1, String()); return false; } @@ -340,7 +339,7 @@ bool XSSAuditor::findInRequest(const FindTask& task) const case XSSProtectionBlockEnabled: if (blockFrame) { blockFrame->loader()->stopAllLoaders(); - blockFrame->redirectScheduler()->scheduleLocationChange(blankURL(), String()); + blockFrame->navigationScheduler()->scheduleLocationChange(blankURL(), String()); } break; default: @@ -392,7 +391,7 @@ bool XSSAuditor::findInRequest(Frame* frame, const FindTask& task) const } else canonicalizedString = task.string; - if (frame->document()->url().protocolIs("data")) + if (frame->document()->url().protocolIsData()) return false; canonicalizedString = canonicalize(canonicalizedString); diff --git a/WebCore/page/chromium/EventHandlerChromium.cpp b/WebCore/page/chromium/EventHandlerChromium.cpp index 6bf907e..9b40fb3 100644 --- a/WebCore/page/chromium/EventHandlerChromium.cpp +++ b/WebCore/page/chromium/EventHandlerChromium.cpp @@ -128,8 +128,8 @@ bool EventHandler::eventActivatedView(const PlatformMouseEvent& event) const PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const { - RefPtr<ChromiumDataObject> dataObject = ChromiumDataObject::create(); - return ClipboardChromium::create(Clipboard::DragAndDrop, dataObject.get(), ClipboardWritable, m_frame); + RefPtr<ChromiumDataObjectLegacy> dataObject = ChromiumDataObjectLegacy::create(Clipboard::DragAndDrop); + return ClipboardChromium::create(Clipboard::DragAndDrop, ChromiumDataObject::create(dataObject), ClipboardWritable, m_frame); } void EventHandler::focusDocumentView() diff --git a/WebCore/page/mac/WebCoreViewFactory.h b/WebCore/page/mac/WebCoreViewFactory.h index 9191abe..7af75cb 100644 --- a/WebCore/page/mac/WebCoreViewFactory.h +++ b/WebCore/page/mac/WebCoreViewFactory.h @@ -28,8 +28,6 @@ @protocol WebCoreViewFactory -- (NSString *)defaultLanguageCode; - - (BOOL)objectIsTextMarker:(id)object; - (BOOL)objectIsTextMarkerRange:(id)object; |