diff options
author | Steve Block <steveblock@google.com> | 2010-02-15 12:23:52 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-02-16 11:48:32 +0000 |
commit | 8a0914b749bbe7da7768e07a7db5c6d4bb09472b (patch) | |
tree | 73f9065f370435d6fde32ae129d458a8c77c8dff /WebCore/page | |
parent | bf14be70295513b8076f3fa47a268a7e42b2c478 (diff) | |
download | external_webkit-8a0914b749bbe7da7768e07a7db5c6d4bb09472b.zip external_webkit-8a0914b749bbe7da7768e07a7db5c6d4bb09472b.tar.gz external_webkit-8a0914b749bbe7da7768e07a7db5c6d4bb09472b.tar.bz2 |
Merge webkit.org at r54731 : Initial merge by git
Change-Id: Ia79977b6cf3b0b00c06ef39419989b28e57e4f4a
Diffstat (limited to 'WebCore/page')
-rw-r--r-- | WebCore/page/Console.cpp | 13 | ||||
-rw-r--r-- | WebCore/page/Console.idl | 3 | ||||
-rw-r--r-- | WebCore/page/DOMWindow.idl | 2 | ||||
-rw-r--r-- | WebCore/page/DragController.cpp | 14 | ||||
-rw-r--r-- | WebCore/page/FrameView.cpp | 15 | ||||
-rw-r--r-- | WebCore/page/PrintContext.cpp | 13 | ||||
-rw-r--r-- | WebCore/page/PrintContext.h | 3 | ||||
-rw-r--r-- | WebCore/page/SecurityOrigin.cpp | 9 | ||||
-rw-r--r-- | WebCore/page/SecurityOrigin.h | 1 | ||||
-rw-r--r-- | WebCore/page/Settings.cpp | 6 | ||||
-rw-r--r-- | WebCore/page/Settings.h | 8 | ||||
-rw-r--r-- | WebCore/page/brew/FrameBrew.cpp | 38 | ||||
-rw-r--r-- | WebCore/page/chromium/ChromeClientChromium.h | 30 | ||||
-rw-r--r-- | WebCore/page/win/FrameCGWin.cpp | 2 |
14 files changed, 116 insertions, 41 deletions
diff --git a/WebCore/page/Console.cpp b/WebCore/page/Console.cpp index 13595a1..99b3106 100644 --- a/WebCore/page/Console.cpp +++ b/WebCore/page/Console.cpp @@ -320,7 +320,7 @@ void Console::profile(const String& title, ScriptCallStack* callStack) if (!page) return; -#if ENABLE(INSPECTOR) && USE(JSC) +#if ENABLE(INSPECTOR) InspectorController* controller = page->inspectorController(); // FIXME: log a console message when profiling is disabled. if (!controller->profilerEnabled()) @@ -329,7 +329,7 @@ void Console::profile(const String& title, ScriptCallStack* callStack) String resolvedTitle = title; if (title.isNull()) // no title so give it the next user initiated profile title. -#if ENABLE(INSPECTOR) && USE(JSC) +#if ENABLE(INSPECTOR) resolvedTitle = controller->getCurrentUserInitiatedProfileName(true); #else resolvedTitle = ""; @@ -337,7 +337,7 @@ void Console::profile(const String& title, ScriptCallStack* callStack) ScriptProfiler::start(callStack->state(), resolvedTitle); -#if ENABLE(INSPECTOR) && USE(JSC) +#if ENABLE(INSPECTOR) const ScriptCallFrame& lastCaller = callStack->at(0); controller->addStartProfilingMessageToConsole(resolvedTitle, lastCaller.lineNumber(), lastCaller.sourceURL()); #endif @@ -349,10 +349,7 @@ void Console::profileEnd(const String& title, ScriptCallStack* callStack) if (!page) return; - if (!this->page()) - return; - -#if ENABLE(INSPECTOR) && USE(JSC) +#if ENABLE(INSPECTOR) InspectorController* controller = page->inspectorController(); if (!controller->profilerEnabled()) return; @@ -364,7 +361,7 @@ void Console::profileEnd(const String& title, ScriptCallStack* callStack) m_profiles.append(profile); -#if ENABLE(INSPECTOR) && USE(JSC) +#if ENABLE(INSPECTOR) const ScriptCallFrame& lastCaller = callStack->at(0); controller->addProfile(profile, lastCaller.lineNumber(), lastCaller.sourceURL()); #endif diff --git a/WebCore/page/Console.idl b/WebCore/page/Console.idl index b3c0c24..c08fcc0 100644 --- a/WebCore/page/Console.idl +++ b/WebCore/page/Console.idl @@ -30,7 +30,8 @@ module window { interface [OmitConstructor] Console { -#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER + // Not enabled in V8 because it requires request-reply style. +#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER && !(defined(V8_BINDING) && V8_BINDING) readonly attribute [CustomGetter] Array profiles; #endif diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl index 626d9c4..a4b72d2 100644 --- a/WebCore/page/DOMWindow.idl +++ b/WebCore/page/DOMWindow.idl @@ -442,6 +442,7 @@ module window { attribute [CustomGetter] HTMLOptionElementConstructor Option; // Usable with new operator attribute CanvasRenderingContext2DConstructor CanvasRenderingContext2D; + attribute ImageDataConstructor ImageData; attribute [Conditional=3D_CANVAS] WebGLRenderingContextConstructor WebGLRenderingContext; attribute TextMetricsConstructor TextMetrics; @@ -721,3 +722,4 @@ module window { }; } + diff --git a/WebCore/page/DragController.cpp b/WebCore/page/DragController.cpp index bde38bc..c9769df 100644 --- a/WebCore/page/DragController.cpp +++ b/WebCore/page/DragController.cpp @@ -697,10 +697,16 @@ bool DragController::startDrag(Frame* src, Clipboard* clipboard, DragOperation s } doSystemDrag(dragImage, dragLoc, mouseDraggedPoint, clipboard, src, true); } else if (isSelected && (m_dragSourceAction & DragSourceActionSelection)) { - RefPtr<Range> selectionRange = src->selection()->toNormalizedRange(); - ASSERT(selectionRange); - if (!clipboard->hasData()) - clipboard->writeRange(selectionRange.get(), src); + if (!clipboard->hasData()) { + if (isNodeInTextFormControl(src->selection()->start().node())) + clipboard->writePlainText(src->selectedText()); + else { + RefPtr<Range> selectionRange = src->selection()->toNormalizedRange(); + ASSERT(selectionRange); + + clipboard->writeRange(selectionRange.get(), src); + } + } m_client->willPerformDragSourceAction(DragSourceActionSelection, dragOrigin, clipboard); if (!dragImage) { dragImage = createDragImageForSelection(src); diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp index 33d6457..d3ff143 100644 --- a/WebCore/page/FrameView.cpp +++ b/WebCore/page/FrameView.cpp @@ -615,7 +615,7 @@ void FrameView::layout(bool allowSubtree) RenderObject* rootRenderer = documentElement ? documentElement->renderer() : 0; Node* body = document->body(); if (body && body->renderer()) { - if (body->hasTagName(framesetTag)) { + if (body->hasTagName(framesetTag) && !m_frame->settings()->frameSetFlatteningEnabled()) { body->renderer()->setChildNeedsLayout(true); vMode = ScrollbarAlwaysOff; hMode = ScrollbarAlwaysOff; @@ -632,9 +632,11 @@ void FrameView::layout(bool allowSubtree) if (documentElement->isSVGElement()) { if (!m_firstLayout && (m_size.width() != layoutWidth() || m_size.height() != layoutHeight())) rootRenderer->setChildNeedsLayout(true); - } -#endif + } else + applyOverflowToViewport(rootRenderer, hMode, vMode); +#else applyOverflowToViewport(rootRenderer, hMode, vMode); +#endif } #ifdef INSTRUMENT_LAYOUT_SCHEDULING if (m_firstLayout && !document->ownerElement()) @@ -1167,10 +1169,17 @@ void FrameView::scheduleRelayout() if (!m_frame->document()->shouldScheduleLayout()) return; +<<<<<<< HEAD #if defined(FLATTEN_IFRAME) || defined(FLATTEN_FRAMESET) if (m_frame->ownerRenderer()) m_frame->ownerRenderer()->setNeedsLayoutAndPrefWidthsRecalc(); #endif +======= + // When frameset flattening is enabled, the contents of the frame affects layout of the parent frames. + // Also invalidate parent frame starting from the owner element of this frame. + if (m_frame->settings()->frameSetFlatteningEnabled() && m_frame->ownerRenderer()) + m_frame->ownerRenderer()->setNeedsLayout(true, true); +>>>>>>> webkit.org at r54731 int delay = m_frame->document()->minimumLayoutDelay(); if (m_layoutTimer.isActive() && m_delayedLayout && !delay) diff --git a/WebCore/page/PrintContext.cpp b/WebCore/page/PrintContext.cpp index 4c902a9..31c8777 100644 --- a/WebCore/page/PrintContext.cpp +++ b/WebCore/page/PrintContext.cpp @@ -184,7 +184,20 @@ int PrintContext::pageNumberForElement(Element* element, const FloatSize& pageSi if (page.x() <= left && left < page.right() && page.y() <= top && top < page.bottom()) return pageNumber; } + printContext.end(); return -1; } +int PrintContext::numberOfPages(Frame* frame, const FloatSize& pageSizeInPixels) +{ + frame->document()->updateLayout(); + + FloatRect pageRect(FloatPoint(0, 0), pageSizeInPixels); + PrintContext printContext(frame); + printContext.begin(pageRect.width()); + printContext.computePageRectsWithPageSize(pageSizeInPixels, 1); + printContext.end(); + return printContext.pageCount(); +} + } diff --git a/WebCore/page/PrintContext.h b/WebCore/page/PrintContext.h index 38b28c4..ec15b84 100644 --- a/WebCore/page/PrintContext.h +++ b/WebCore/page/PrintContext.h @@ -39,7 +39,7 @@ public: int pageCount() const; const IntRect& pageRect(int pageNumber) const; - const Vector<IntRect>& pageRects() const { return m_pageRects; } + const Vector<IntRect>& pageRects() const { return m_pageRects; } void computePageRects(const FloatRect& printRect, float headerHeight, float footerHeight, float userScaleFactor, float& outPageHeight); @@ -53,6 +53,7 @@ public: // Used by layout tests. static int pageNumberForElement(Element*, const FloatSize& pageSizeInPixels); + static int numberOfPages(Frame*, const FloatSize& pageSizeInPixels); protected: void computePageRectsWithPageSize(const FloatSize& pageSizeInPixels, float userScaleFactor); diff --git a/WebCore/page/SecurityOrigin.cpp b/WebCore/page/SecurityOrigin.cpp index b2a1c89..af63637 100644 --- a/WebCore/page/SecurityOrigin.cpp +++ b/WebCore/page/SecurityOrigin.cpp @@ -286,15 +286,6 @@ void SecurityOrigin::grantUniversalAccess() m_universalAccess = true; } -void SecurityOrigin::setSandboxFlags(SandboxFlags flags) -{ - // Although you might think that we should set m_isUnique based on - // SandboxOrigin, that's not actually the right behavior. We're supposed to - // freeze the origin of a document when it is created, even if the sandbox - // flags change after that point in time. - m_sandboxFlags = flags; -} - bool SecurityOrigin::isLocal() const { return shouldTreatURLSchemeAsLocal(m_protocol); diff --git a/WebCore/page/SecurityOrigin.h b/WebCore/page/SecurityOrigin.h index 71681d7..b441474 100644 --- a/WebCore/page/SecurityOrigin.h +++ b/WebCore/page/SecurityOrigin.h @@ -114,7 +114,6 @@ public: // WARNING: This is an extremely powerful ability. Use with caution! void grantUniversalAccess(); - void setSandboxFlags(SandboxFlags); bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } bool canAccessDatabase() const { return !isUnique(); } diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp index e57fccf..7b5da91 100644 --- a/WebCore/page/Settings.cpp +++ b/WebCore/page/Settings.cpp @@ -107,6 +107,7 @@ Settings::Settings(Page* page) , m_authorAndUserStylesEnabled(true) , m_needsSiteSpecificQuirks(false) , m_fontRenderingMode(0) + , m_frameSetFlatteningEnabled(false) , m_webArchiveDebugModeEnabled(false) , m_localFileContentSniffingEnabled(false) , m_inApplicationChromeMode(false) @@ -621,6 +622,11 @@ void Settings::setNeedsSiteSpecificQuirks(bool needsQuirks) m_needsSiteSpecificQuirks = needsQuirks; } +void Settings::setFrameSetFlatteningEnabled(bool frameSetFlatteningEnabled) +{ + m_frameSetFlatteningEnabled = frameSetFlatteningEnabled; +} + void Settings::setWebArchiveDebugModeEnabled(bool enabled) { m_webArchiveDebugModeEnabled = enabled; diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h index 8a553de..74d07e6 100644 --- a/WebCore/page/Settings.h +++ b/WebCore/page/Settings.h @@ -223,6 +223,7 @@ namespace WebCore { void setDeveloperExtrasEnabled(bool); bool developerExtrasEnabled() const { return m_developerExtrasEnabled; } +<<<<<<< HEAD #ifdef ANDROID_META_SUPPORT void resetMetadataSettings(); @@ -262,6 +263,12 @@ namespace WebCore { bool supportMultipleWindows() const { return m_supportMultipleWindows; } void setSupportMultipleWindows(bool support) { m_supportMultipleWindows = support; } #endif +======= + + void setFrameSetFlatteningEnabled(bool); + bool frameSetFlatteningEnabled() const { return m_frameSetFlatteningEnabled; } + +>>>>>>> webkit.org at r54731 void setAuthorAndUserStylesEnabled(bool); bool authorAndUserStylesEnabled() const { return m_authorAndUserStylesEnabled; } @@ -435,6 +442,7 @@ namespace WebCore { bool m_authorAndUserStylesEnabled : 1; bool m_needsSiteSpecificQuirks : 1; unsigned m_fontRenderingMode : 1; + bool m_frameSetFlatteningEnabled : 1; bool m_webArchiveDebugModeEnabled : 1; bool m_localFileContentSniffingEnabled : 1; bool m_inApplicationChromeMode : 1; diff --git a/WebCore/page/brew/FrameBrew.cpp b/WebCore/page/brew/FrameBrew.cpp new file mode 100644 index 0000000..a590544 --- /dev/null +++ b/WebCore/page/brew/FrameBrew.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2010 Company 100, Inc. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "Frame.h" + +#include "NotImplemented.h" + +namespace WebCore { + +DragImageRef Frame::dragImageForSelection() +{ + notImplemented(); + return 0; +} + +} diff --git a/WebCore/page/chromium/ChromeClientChromium.h b/WebCore/page/chromium/ChromeClientChromium.h index f6689d3..fc42250 100644 --- a/WebCore/page/chromium/ChromeClientChromium.h +++ b/WebCore/page/chromium/ChromeClientChromium.h @@ -35,20 +35,24 @@ #include <wtf/Forward.h> namespace WebCore { - class IntRect; - class PopupContainer; +class AccessibilityObject; +class IntRect; +class PopupContainer; - // Contains Chromium-specific extensions to the ChromeClient. Only put - // things here that don't make sense for other ports. - class ChromeClientChromium : public ChromeClient { - public: - // Notifies the client of a new popup widget. The client should place - // and size the widget with the given bounds, relative to the screen. - // If handleExternal is true, then drawing and input handling for the - // popup will be handled by the external embedder. - virtual void popupOpened(PopupContainer* popupContainer, const IntRect& bounds, - bool focusOnShow, bool handleExternal) = 0; - }; +// Contains Chromium-specific extensions to the ChromeClient. Only put +// things here that don't make sense for other ports. +class ChromeClientChromium : public ChromeClient { +public: + // Notifies the client of a new popup widget. The client should place + // and size the widget with the given bounds, relative to the screen. + // If handleExternal is true, then drawing and input handling for the + // popup will be handled by the external embedder. + virtual void popupOpened(PopupContainer* popupContainer, const IntRect& bounds, + bool focusOnShow, bool handleExternal) = 0; + + // Notifies embedder that the state of an accessibility object has changed. + virtual void didChangeAccessibilityObjectState(AccessibilityObject*) = 0; +}; } // namespace WebCore diff --git a/WebCore/page/win/FrameCGWin.cpp b/WebCore/page/win/FrameCGWin.cpp index d9e577b..cce5004 100644 --- a/WebCore/page/win/FrameCGWin.cpp +++ b/WebCore/page/win/FrameCGWin.cpp @@ -45,7 +45,7 @@ static void drawRectIntoContext(IntRect rect, FrameView* view, GraphicsContext* rect.move(-offset.width(), -offset.height()); rect = view->convertToContainingWindow(rect); - gc->concatCTM(TransformationMatrix().translate(-rect.x(), -rect.y())); + gc->concatCTM(AffineTransform().translate(-rect.x(), -rect.y())); view->paint(gc, rect); } |