summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/win
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-18 13:36:51 +0100
committerSteve Block <steveblock@google.com>2011-05-24 15:38:28 +0100
commit2fc2651226baac27029e38c9d6ef883fa32084db (patch)
treee396d4bf89dcce6ed02071be66212495b1df1dec /Source/WebKit/win
parentb3725cedeb43722b3b175aaeff70552e562d2c94 (diff)
downloadexternal_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.zip
external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.gz
external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.bz2
Merge WebKit at r78450: Initial merge by git.
Change-Id: I6d3e5f1f868ec266a0aafdef66182ddc3f265dc1
Diffstat (limited to 'Source/WebKit/win')
-rw-r--r--Source/WebKit/win/ChangeLog265
-rw-r--r--Source/WebKit/win/DOMHTMLClasses.cpp4
-rw-r--r--Source/WebKit/win/FullscreenVideoController.cpp5
-rw-r--r--Source/WebKit/win/WebCoreStatistics.cpp4
-rw-r--r--Source/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp4
-rw-r--r--Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp5
-rw-r--r--Source/WebKit/win/WebCoreSupport/WebChromeClient.h3
-rw-r--r--Source/WebKit/win/WebCoreSupport/WebDragClient.cpp151
-rw-r--r--Source/WebKit/win/WebCoreSupport/WebDragClient.h1
-rw-r--r--Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp2
-rw-r--r--Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h2
-rw-r--r--Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp14
-rw-r--r--Source/WebKit/win/WebCoreSupport/WebInspectorClient.h13
-rw-r--r--Source/WebKit/win/WebDownload.cpp164
-rw-r--r--Source/WebKit/win/WebDownload.h5
-rw-r--r--Source/WebKit/win/WebDownloadCFNet.cpp17
-rw-r--r--Source/WebKit/win/WebFrame.cpp21
-rw-r--r--Source/WebKit/win/WebFrame.h2
-rw-r--r--Source/WebKit/win/WebHistory.cpp2
-rw-r--r--Source/WebKit/win/WebInspector.cpp9
-rwxr-xr-xSource/WebKit/win/WebKit.vcproj/WebKit.make14
-rw-r--r--Source/WebKit/win/WebKit.vcproj/WebKit.submit.sln4
-rw-r--r--Source/WebKit/win/WebKitGraphics.cpp11
-rw-r--r--Source/WebKit/win/WebPreferences.cpp4
-rw-r--r--Source/WebKit/win/WebScrollBar.cpp14
-rw-r--r--Source/WebKit/win/WebScrollBar.h3
-rw-r--r--Source/WebKit/win/WebView.cpp19
-rw-r--r--Source/WebKit/win/WebView.h8
28 files changed, 376 insertions, 394 deletions
diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog
index 6a3b53c..a24c061 100644
--- a/Source/WebKit/win/ChangeLog
+++ b/Source/WebKit/win/ChangeLog
@@ -1,3 +1,268 @@
+2011-02-11 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ A little more encapsulation for the heap: Removed CollectorHeapIterator
+ https://bugs.webkit.org/show_bug.cgi?id=54298
+
+ * WebCoreStatistics.cpp:
+ (WebCoreStatistics::javaScriptProtectedObjectTypeCounts):
+
+2011-02-09 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: follow up on InspectorAgent split -
+ removing unnecessary methods from InspectorController.
+ https://bugs.webkit.org/show_bug.cgi?id=54093
+
+ * WebInspector.cpp:
+ (WebInspector::showConsole):
+ (WebInspector::toggleProfilingJavaScript):
+
+2011-02-08 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Remove orphan code from old parser
+ https://bugs.webkit.org/show_bug.cgi?id=53984
+
+ * WebCoreSupport/WebChromeClient.h:
+
+2011-02-08 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Adam Roben.
+
+ <rdar://problem/8932077> REGRESSION (5.0.3-ToT): United boarding pass has wrong layout when printed
+
+ Windows never got patched to pass in the page height to WebCore, so when WebCore's pagination got re-written to depend on this
+ value, Windows got broken. Patch setPrinting to be identical to WebKit1 on OS X and to have it take an extra minimum page height
+ argument.
+
+ * WebFrame.cpp:
+ (WebFrame::setPrinting):
+ (WebFrame::setInPrintingMode):
+ * WebFrame.h:
+
+2011-02-02 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: move InspectorController's methods from InspectorAgent to InspectorController.
+
+ https://bugs.webkit.org/show_bug.cgi?id=53169
+
+ Minor change enforced by major changes in WebCore/inspector/InspectorController.
+
+ * WebInspector.cpp:
+ (WebInspector::isTimelineProfilingEnabled):
+
+2011-02-07 Enrica Casucci <enrica@apple.com>
+
+ Reviewed Adam Roben and Darin Adler.
+
+ WebKit2: drag and drop support on Windows.
+ https://bugs.webkit.org/show_bug.cgi?id=52775
+
+ Removed createDragImageForLink from DragClient.
+
+ * WebCoreSupport/WebDragClient.cpp:
+ (WebDragClient::startDrag):
+ * WebCoreSupport/WebDragClient.h:
+
+2011-02-06 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ OwnArraryPtr.h uses deleteOwnedPtr but doesn’t include OwnPtrCommon.h
+ https://bugs.webkit.org/show_bug.cgi?id=52867
+
+ * WebHistory.cpp:
+ (WebHistory::orderedLastVisitedDays): Calls adoptArrayPtr.
+ * WebPreferences.cpp:
+ (WebPreferences::copyWebKitPreferencesToCFPreferences): Ditto.
+
+2011-02-03 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: remove settings related methods from InspectorClient
+ https://bugs.webkit.org/show_bug.cgi?id=53686
+
+ * WebCoreSupport/WebInspectorClient.cpp:
+ (WebInspectorClient::openInspectorFrontend):
+ (WebInspectorFrontendClient::WebInspectorFrontendClient):
+ * WebCoreSupport/WebInspectorClient.h:
+
+2011-02-03 Adam Langley <agl@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Plumb mixed script URL to FrameLoaderClient
+ https://bugs.webkit.org/show_bug.cgi?id=52384
+
+ Regressions covered by http/tests/security/mixedContent/*
+
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::didRunInsecureContent):
+ * WebCoreSupport/WebFrameLoaderClient.h:
+
+2011-02-02 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Removal of right()/bottom(), converting to maxX()/maxY().
+
+ * DOMHTMLClasses.cpp:
+ (DOMHTMLInputElement::rectOnScreen):
+ * WebCoreSupport/EmbeddedWidget.cpp:
+ (EmbeddedWidget::frameRectsChanged):
+ * WebFrame.cpp:
+ (WebFrame::computePageRects):
+ * WebScrollBar.cpp:
+ (WebScrollBar::frameRect):
+ * WebView.cpp:
+ (WebView::addToDirtyRegion):
+ (WebView::visibleContentRect):
+ (WebView::prepareCandidateWindow):
+
+2011-01-31 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Fix the clean Windows build.
+
+ * WebKitGraphics.cpp:
+ (WebDrawText):
+
+2011-01-28 Jon Honeycutt <jhoneycutt@apple.com>
+
+ Downloads in WK2 on Windows should write resume data to bundle
+ https://bugs.webkit.org/show_bug.cgi?id=53282
+ <rdar://problem/8753077>
+
+ Reviewed by Alice Liu.
+
+ * WebDownload.cpp:
+ (WebDownload::bundlePathForTargetPath):
+ Use the new WebCore::DownloadBundle function.
+ (WebDownload::request):
+
+ * WebDownload.h:
+ Removed declarations for functions that were moved to a new location.
+
+ * WebDownloadCFNet.cpp:
+ (WebDownload::initToResumeWithBundle):
+ Use the new WebCore::DownloadBundle function.
+ (WebDownload::cancelForResume):
+ Fix a leak of the resume data CFDataRef by using adoptCF(). Use the new
+ WebCore::DownloadBundle function.
+
+2011-01-28 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ <select> can't display right-to-left (rtl) languages
+ https://bugs.webkit.org/show_bug.cgi?id=19785
+
+ * WebCoreSupport/WebChromeClient.cpp:
+ (WebChromeClient::selectItemAlignmentFollowsMenuWritingDirection): Added.
+ * WebCoreSupport/WebChromeClient.h:
+
+2011-01-27 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Use Document::url() instead of FrameLoader::url().
+ https://bugs.webkit.org/show_bug.cgi?id=41165
+
+ * WebFrame.cpp:
+ (WebFrame::url):
+
+2011-01-27 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Fix scrollbars in Safari's Downloads window and Bookmarks view by
+ implementing two needed functions from ScrollableArea.
+
+ * WebScrollBar.cpp:
+ (WebScrollBar::horizontalScrollbar): Return the WebCore::Scrollbar if
+ we are a horizontal scrollbar.
+ (WebScrollBar::verticalScrollbar): Return the WebCore::Scrollbar if we
+ are a vertical scrollbar.
+ * WebScrollBar.h:
+
+2011-01-27 Adam Roben <aroben@apple.com>
+
+ Trim down #includes in WebView.h
+
+ Rubber-stamped by Steve Falkenburg.
+
+ * WebView.cpp: Moved some #includes here from the header file.
+
+ * WebView.h: Replaced some broader #includes with more specific ones, plus a
+ forward-declaration.
+
+2011-01-25 Steve Falkenburg <sfalken@apple.com>
+
+ Windows production build fix.
+ Build correct configuration of Interfaces for Debug_All.
+
+ * WebKit.vcproj/WebKit.submit.sln:
+
+2011-01-25 Steve Falkenburg <sfalken@apple.com>
+
+ Rubber-stamped by Adam Roben.
+
+ Windows production build fix.
+ Use correct environment variable escaping
+
+ * WebKit.vcproj/WebKit.make:
+
+2011-01-24 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Eric Seidel.
+
+ Change ENABLE_3D_CANVAS to ENABLE_WEBGL
+ https://bugs.webkit.org/show_bug.cgi?id=53041
+
+ * WebView.cpp:
+ (WebView::notifyPreferencesChanged):
+
+2011-01-25 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: remove "attached" state related methods from InspectorAgent
+ https://bugs.webkit.org/show_bug.cgi?id=53086
+
+ * WebCoreSupport/WebInspectorClient.cpp:
+ (WebInspectorFrontendClient::attachWindow):
+ (WebInspectorFrontendClient::detachWindow):
+ (WebInspectorFrontendClient::showWindowWithoutNotifications):
+ * WebCoreSupport/WebInspectorClient.h:
+
+2011-01-24 Adam Roben <aroben@apple.com>
+
+ Windows Production build fix
+
+ * WebKit.vcproj/WebKit.make: Update for move of WebKit into Source.
+
+2011-01-21 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Introduce FontMetrics abstraction
+ https://bugs.webkit.org/show_bug.cgi?id=51456
+
+ * FullscreenVideoController.cpp: Use FontMetrics instead of Font to access the metrics.
+ (FullscreenVideoController::draw):
+ * WebCoreSupport/WebDragClient.cpp: Ditto.
+ (WebDragClient::createDragImageForLink):
+ * WebKitGraphics.cpp: Ditto.
+ (FontMetrics):
+
2011-01-21 Chris Rogers <crogers@google.com>
Reviewed by Darin Fisher.
diff --git a/Source/WebKit/win/DOMHTMLClasses.cpp b/Source/WebKit/win/DOMHTMLClasses.cpp
index 2dd6deb..7fe2748 100644
--- a/Source/WebKit/win/DOMHTMLClasses.cpp
+++ b/Source/WebKit/win/DOMHTMLClasses.cpp
@@ -1314,8 +1314,8 @@ HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::rectOnScreen(
IntRect coreRect = view->contentsToScreen(renderer->absoluteBoundingBoxRect());
rect->left = coreRect.x();
rect->top = coreRect.y();
- rect->right = coreRect.right();
- rect->bottom = coreRect.bottom();
+ rect->right = coreRect.maxX();
+ rect->bottom = coreRect.maxY();
return S_OK;
}
diff --git a/Source/WebKit/win/FullscreenVideoController.cpp b/Source/WebKit/win/FullscreenVideoController.cpp
index ab954f8..6adbcaa 100644
--- a/Source/WebKit/win/FullscreenVideoController.cpp
+++ b/Source/WebKit/win/FullscreenVideoController.cpp
@@ -532,15 +532,16 @@ void FullscreenVideoController::draw()
// the text at the center of the slider.
// Left string
s = timeToString(currentTime());
+ int fontHeight = font.fontMetrics().height();
TextRun leftText(s);
context.setFillColor(Color(textColor), ColorSpaceDeviceRGB);
- context.drawText(font, leftText, IntPoint(windowWidth / 2 - timeSliderWidth / 2 - margin - font.width(leftText), windowHeight - margin - sliderHeight / 2 + font.height() / 4));
+ context.drawText(font, leftText, IntPoint(windowWidth / 2 - timeSliderWidth / 2 - margin - font.width(leftText), windowHeight - margin - sliderHeight / 2 + fontHeight / 4));
// Right string
s = timeToString(currentTime() - duration());
TextRun rightText(s);
context.setFillColor(Color(textColor), ColorSpaceDeviceRGB);
- context.drawText(font, rightText, IntPoint(windowWidth / 2 + timeSliderWidth / 2 + margin, windowHeight - margin - sliderHeight / 2 + font.height() / 4));
+ context.drawText(font, rightText, IntPoint(windowWidth / 2 + timeSliderWidth / 2 + margin, windowHeight - margin - sliderHeight / 2 + fontHeight / 4));
// Copy to the window
BLENDFUNCTION blendFunction = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA};
diff --git a/Source/WebKit/win/WebCoreStatistics.cpp b/Source/WebKit/win/WebCoreStatistics.cpp
index 29feea5..f5c399f 100644
--- a/Source/WebKit/win/WebCoreStatistics.cpp
+++ b/Source/WebKit/win/WebCoreStatistics.cpp
@@ -139,8 +139,8 @@ HRESULT STDMETHODCALLTYPE WebCoreStatistics::javaScriptProtectedObjectTypeCounts
/* [retval][out] */ IPropertyBag2** typeNamesAndCounts)
{
JSLock lock(SilenceAssertionsOnly);
- OwnPtr<HashCountedSet<const char*> > jsObjectTypeNames(JSDOMWindow::commonJSGlobalData()->heap.protectedObjectTypeCounts());
- typedef HashCountedSet<const char*>::const_iterator Iterator;
+ OwnPtr<TypeCountSet> jsObjectTypeNames(JSDOMWindow::commonJSGlobalData()->heap.protectedObjectTypeCounts());
+ typedef TypeCountSet::const_iterator Iterator;
Iterator end = jsObjectTypeNames->end();
HashMap<String, int> typeCountMap;
for (Iterator current = jsObjectTypeNames->begin(); current != end; ++current)
diff --git a/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp b/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
index 371ff3a..fb2b564 100644
--- a/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
+++ b/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
@@ -120,7 +120,7 @@ void EmbeddedWidget::frameRectsChanged()
rgn = ::CreateRectRgn(0, 0, 0, 0);
::SetWindowRgn(m_window, rgn, FALSE);
} else {
- rgn = ::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.right(), m_clipRect.bottom());
+ rgn = ::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.maxX(), m_clipRect.maxY());
::SetWindowRgn(m_window, rgn, TRUE);
}
@@ -128,7 +128,7 @@ void EmbeddedWidget::frameRectsChanged()
::MoveWindow(m_window, m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height(), TRUE);
if (clipToZeroRect) {
- rgn = ::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.right(), m_clipRect.bottom());
+ rgn = ::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.maxX(), m_clipRect.maxY());
::SetWindowRgn(m_window, rgn, TRUE);
}
}
diff --git a/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
index f5cce4e..47ca713 100644
--- a/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
+++ b/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
@@ -862,6 +862,11 @@ bool WebChromeClient::selectItemWritingDirectionIsNatural()
return true;
}
+bool WebChromeClient::selectItemAlignmentFollowsMenuWritingDirection()
+{
+ return false;
+}
+
PassRefPtr<PopupMenu> WebChromeClient::createPopupMenu(PopupMenuClient* client) const
{
return adoptRef(new PopupMenuWin(client));
diff --git a/Source/WebKit/win/WebCoreSupport/WebChromeClient.h b/Source/WebKit/win/WebCoreSupport/WebChromeClient.h
index b6c2525..9298f1c 100644
--- a/Source/WebKit/win/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit/win/WebCoreSupport/WebChromeClient.h
@@ -144,8 +144,6 @@ public:
virtual void formStateDidChange(const WebCore::Node*) { }
- virtual PassOwnPtr<WebCore::HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
-
#if USE(ACCELERATED_COMPOSITING)
// Pass 0 as the GraphicsLayer to detatch the root layer.
virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*);
@@ -175,6 +173,7 @@ public:
#endif
virtual bool selectItemWritingDirectionIsNatural();
+ virtual bool selectItemAlignmentFollowsMenuWritingDirection();
virtual PassRefPtr<WebCore::PopupMenu> createPopupMenu(WebCore::PopupMenuClient*) const;
virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const;
diff --git a/Source/WebKit/win/WebCoreSupport/WebDragClient.cpp b/Source/WebKit/win/WebCoreSupport/WebDragClient.cpp
index 184df95..c232867 100644
--- a/Source/WebKit/win/WebCoreSupport/WebDragClient.cpp
+++ b/Source/WebKit/win/WebCoreSupport/WebDragClient.cpp
@@ -35,39 +35,11 @@
#include <WebCore/ClipboardWin.h>
#include <WebCore/DragController.h>
#include <WebCore/DragData.h>
-#include <WebCore/Font.h>
-#include <WebCore/FontDescription.h>
-#include <WebCore/FontSelector.h>
#include <WebCore/FrameView.h>
#include <WebCore/GraphicsContext.h>
#include <WebCore/Page.h>
-#include <WebCore/Settings.h>
-#include <WebCore/StringTruncator.h>
-#include <WebCore/TextRun.h>
-#include <WebCore/WebCoreTextRenderer.h>
#pragma warning(pop)
-namespace WebCore {
- HBITMAP allocImage(HDC dc, IntSize size, PlatformGraphicsContext** targetRef);
- void deallocContext(PlatformGraphicsContext* target);
-}
-
-
-#define DRAG_LABEL_BORDER_X 4
-// Keep border_y in synch with DragController::LinkDragBorderInset
-#define DRAG_LABEL_BORDER_Y 2
-#define DRAG_LABEL_RADIUS 5
-#define DRAG_LABEL_BORDER_Y_OFFSET 2
-
-#define MIN_DRAG_LABEL_WIDTH_BEFORE_CLIP 120
-
-// Observation says max size is 200x200
-#define MAX_DRAG_LABEL_WIDTH 200
-#define MAX_DRAG_LABEL_STRING_WIDTH (MAX_DRAG_LABEL_WIDTH - 2 * DRAG_LABEL_BORDER_X)
-
-#define DRAG_LINK_LABEL_FONT_SIZE 11
-#define DRAG_LINK_URL_FONT_SIZE 10
-
using namespace WebCore;
static DWORD draggingSourceOperationMaskToDragCursors(DragOperation op)
@@ -197,129 +169,6 @@ void WebDragClient::startDrag(DragImageRef image, const IntPoint& imageOrigin, c
}
}
-static Font dragLabelFont(int size, bool bold, FontRenderingMode renderingMode)
-{
- NONCLIENTMETRICS metrics;
- metrics.cbSize = sizeof(metrics);
- SystemParametersInfo(SPI_GETNONCLIENTMETRICS, metrics.cbSize, &metrics, 0);
- FontDescription desc;
- desc.setWeight(bold ? FontWeightBold : FontWeightNormal);
- FontFamily family;
- family.setFamily(metrics.lfSmCaptionFont.lfFaceName);
- desc.setFamily(family);
- desc.setSpecifiedSize((float)size);
- desc.setComputedSize((float)size);
- desc.setRenderingMode(renderingMode);
- Font result = Font(desc, 0, 0);
- result.update(0);
- return result;
-}
-
-DragImageRef WebDragClient::createDragImageForLink(KURL& url, const String& inLabel, Frame* frame)
-{
- // This is more or less an exact match for the Mac OS X code.
-
- const Font* labelFont;
- const Font* urlFont;
-
- if (frame->settings() && frame->settings()->fontRenderingMode() == AlternateRenderingMode) {
- static const Font alternateRenderingModeLabelFont = dragLabelFont(DRAG_LINK_LABEL_FONT_SIZE, true, AlternateRenderingMode);
- static const Font alternateRenderingModeURLFont = dragLabelFont(DRAG_LINK_URL_FONT_SIZE, false, AlternateRenderingMode);
- labelFont = &alternateRenderingModeLabelFont;
- urlFont = &alternateRenderingModeURLFont;
- } else {
- static const Font normalRenderingModeLabelFont = dragLabelFont(DRAG_LINK_LABEL_FONT_SIZE, true, NormalRenderingMode);
- static const Font normalRenderingModeURLFont = dragLabelFont(DRAG_LINK_URL_FONT_SIZE, false, NormalRenderingMode);
- labelFont = &normalRenderingModeLabelFont;
- urlFont = &normalRenderingModeURLFont;
- }
-
- bool drawURLString = true;
- bool clipURLString = false;
- bool clipLabelString = false;
-
- String urlString = url.string();
- String label = inLabel;
- if (label.isEmpty()) {
- drawURLString = false;
- label = urlString;
- }
-
- //First step in drawing the link drag image width
- TextRun labelRun(label.impl());
- TextRun urlRun(urlString.impl());
- IntSize labelSize(labelFont->width(labelRun), labelFont->ascent() + labelFont->descent());
-
- if (labelSize.width() > MAX_DRAG_LABEL_STRING_WIDTH){
- labelSize.setWidth(MAX_DRAG_LABEL_STRING_WIDTH);
- clipLabelString = true;
- }
-
- IntSize urlStringSize;
- IntSize imageSize(labelSize.width() + DRAG_LABEL_BORDER_X * 2,
- labelSize.height() + DRAG_LABEL_BORDER_Y * 2);
-
- if (drawURLString) {
- urlStringSize.setWidth(urlFont->width(urlRun));
- urlStringSize.setHeight(urlFont->ascent() + urlFont->descent());
- imageSize.setHeight(imageSize.height() + urlStringSize.height());
- if (urlStringSize.width() > MAX_DRAG_LABEL_STRING_WIDTH) {
- imageSize.setWidth(MAX_DRAG_LABEL_WIDTH);
- clipURLString = true;
- } else {
- imageSize.setWidth(std::max(labelSize.width(), urlStringSize.width()) + DRAG_LABEL_BORDER_X * 2);
- }
- }
-
- // We now know how big the image needs to be, so we create and
- // fill the background
- HBITMAP image = 0;
- HDC dc = GetDC(0);
- HDC workingDC = CreateCompatibleDC(dc);
- if (!workingDC) {
- ReleaseDC(0, dc);
- return 0;
- }
-
- PlatformGraphicsContext* contextRef;
- image = allocImage(workingDC, imageSize, &contextRef);
- if (!image) {
- DeleteDC(workingDC);
- ReleaseDC(0, dc);
- return 0;
- }
-
- ::SelectObject(workingDC, image);
- GraphicsContext context(contextRef);
- // On Mac alpha is {0.7, 0.7, 0.7, 0.8}, however we can't control alpha
- // for drag images on win, so we use 1
- static const Color backgroundColor(140, 140, 140);
- static const IntSize radii(DRAG_LABEL_RADIUS, DRAG_LABEL_RADIUS);
- IntRect rect(0, 0, imageSize.width(), imageSize.height());
- context.fillRoundedRect(rect, radii, radii, radii, radii, backgroundColor, ColorSpaceDeviceRGB);
-
- // Draw the text
- static const Color topColor(0, 0, 0, 255); //original alpha = 0.75
- static const Color bottomColor(255, 255, 255, 127); //original alpha = 0.5
- if (drawURLString) {
- if (clipURLString)
- urlString = StringTruncator::rightTruncate(urlString, imageSize.width() - (DRAG_LABEL_BORDER_X * 2.0f), *urlFont, false);
- IntPoint textPos(DRAG_LABEL_BORDER_X, imageSize.height() - (DRAG_LABEL_BORDER_Y_OFFSET + urlFont->descent()));
- WebCoreDrawDoubledTextAtPoint(context, urlString, textPos, *urlFont, topColor, bottomColor);
- }
-
- if (clipLabelString)
- label = StringTruncator::rightTruncate(label, imageSize.width() - (DRAG_LABEL_BORDER_X * 2.0f), *labelFont, false);
-
- IntPoint textPos(DRAG_LABEL_BORDER_X, DRAG_LABEL_BORDER_Y + labelFont->pixelSize());
- WebCoreDrawDoubledTextAtPoint(context, label, textPos, *labelFont, topColor, bottomColor);
-
- deallocContext(contextRef);
- DeleteDC(workingDC);
- ReleaseDC(0, dc);
- return image;
-}
-
void WebDragClient::dragControllerDestroyed()
{
delete this;
diff --git a/Source/WebKit/win/WebCoreSupport/WebDragClient.h b/Source/WebKit/win/WebCoreSupport/WebDragClient.h
index da2d208..303edd6 100644
--- a/Source/WebKit/win/WebCoreSupport/WebDragClient.h
+++ b/Source/WebKit/win/WebCoreSupport/WebDragClient.h
@@ -39,7 +39,6 @@ public:
virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint&);
virtual void willPerformDragSourceAction(WebCore::DragSourceAction, const WebCore::IntPoint&, WebCore::Clipboard*);
virtual void startDrag(WebCore::DragImageRef, const WebCore::IntPoint&, const WebCore::IntPoint&, WebCore::Clipboard*, WebCore::Frame*, bool);
- virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL&, const WTF::String&, WebCore::Frame*);
private:
WebView* m_webView;
};
diff --git a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
index 7fd2b98..710fec2 100644
--- a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -628,7 +628,7 @@ void WebFrameLoaderClient::didDisplayInsecureContent()
frameLoadDelegatePriv2->didDisplayInsecureContent(webView);
}
-void WebFrameLoaderClient::didRunInsecureContent(SecurityOrigin* origin)
+void WebFrameLoaderClient::didRunInsecureContent(SecurityOrigin* origin, const KURL& insecureURL)
{
COMPtr<IWebSecurityOrigin> webSecurityOrigin = WebSecurityOrigin::createInstance(origin);
diff --git a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
index 573b58f..5fada31 100644
--- a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
+++ b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
@@ -99,7 +99,7 @@ public:
virtual void dispatchDidChangeBackForwardIndex() const;
virtual void didDisplayInsecureContent();
- virtual void didRunInsecureContent(WebCore::SecurityOrigin*);
+ virtual void didRunInsecureContent(WebCore::SecurityOrigin*, const WebCore::KURL&);
virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
virtual void setTitle(const WTF::String& title, const WebCore::KURL&);
diff --git a/Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp b/Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
index 76ebc8f..2922485 100644
--- a/Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
+++ b/Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
@@ -173,7 +173,7 @@ void WebInspectorClient::openInspectorFrontend(InspectorController* inspectorCon
return;
m_frontendPage = core(frontendWebView.get());
- WebInspectorFrontendClient* frontendClient = new WebInspectorFrontendClient(m_inspectedWebView, m_inspectedWebViewHwnd, frontendHwnd, frontendWebView, frontendWebViewHwnd, this);
+ WebInspectorFrontendClient* frontendClient = new WebInspectorFrontendClient(m_inspectedWebView, m_inspectedWebViewHwnd, frontendHwnd, frontendWebView, frontendWebViewHwnd, this, createFrontendSettings());
m_frontendPage->inspectorController()->setInspectorFrontendClient(frontendClient);
m_frontendHwnd = frontendHwnd;
}
@@ -206,8 +206,8 @@ void WebInspectorClient::updateHighlight()
m_highlight->update();
}
-WebInspectorFrontendClient::WebInspectorFrontendClient(WebView* inspectedWebView, HWND inspectedWebViewHwnd, HWND frontendHwnd, const COMPtr<WebView>& frontendWebView, HWND frontendWebViewHwnd, WebInspectorClient* inspectorClient)
- : InspectorFrontendClientLocal(inspectedWebView->page()->inspectorController(), core(frontendWebView.get()))
+WebInspectorFrontendClient::WebInspectorFrontendClient(WebView* inspectedWebView, HWND inspectedWebViewHwnd, HWND frontendHwnd, const COMPtr<WebView>& frontendWebView, HWND frontendWebViewHwnd, WebInspectorClient* inspectorClient, PassOwnPtr<Settings> settings)
+ : InspectorFrontendClientLocal(inspectedWebView->page()->inspectorController(), core(frontendWebView.get()), settings)
, m_inspectedWebView(inspectedWebView)
, m_inspectedWebViewHwnd(inspectedWebViewHwnd)
, m_inspectorClient(inspectorClient)
@@ -271,8 +271,7 @@ void WebInspectorFrontendClient::attachWindow()
if (m_attached)
return;
- // FIXME: This flag can be saved to the flags storage directly.
- m_inspectedWebView->page()->inspectorController()->setInspectorStartsAttached(true);
+ m_inspectorClient->setInspectorStartsAttached(true);
closeWindowWithoutNotifications();
showWindowWithoutNotifications();
@@ -283,8 +282,7 @@ void WebInspectorFrontendClient::detachWindow()
if (!m_attached)
return;
- // FIXME: This flag can be saved to the flags storage directly.
- m_inspectedWebView->page()->inspectorController()->setInspectorStartsAttached(false);
+ m_inspectorClient->setInspectorStartsAttached(false);
closeWindowWithoutNotifications();
showWindowWithoutNotifications();
@@ -365,7 +363,7 @@ void WebInspectorFrontendClient::showWindowWithoutNotifications()
else {
// If no preference is set - default to an attached window. This is important for inspector LayoutTests.
// FIXME: This flag can be fetched directly from the flags storage.
- shouldAttach = m_inspectedWebView->page()->inspectorController()->inspectorStartsAttached();
+ shouldAttach = m_inspectorClient->inspectorStartsAttached();
if (shouldAttach && !canAttachWindow())
shouldAttach = false;
diff --git a/Source/WebKit/win/WebCoreSupport/WebInspectorClient.h b/Source/WebKit/win/WebCoreSupport/WebInspectorClient.h
index 0c38247..a059559 100644
--- a/Source/WebKit/win/WebCoreSupport/WebInspectorClient.h
+++ b/Source/WebKit/win/WebCoreSupport/WebInspectorClient.h
@@ -34,6 +34,7 @@
#include <WebCore/InspectorFrontendClientLocal.h>
#include <WebCore/PlatformString.h>
#include <WebCore/WindowMessageListener.h>
+#include <wtf/Forward.h>
#include <wtf/OwnPtr.h>
#include <windows.h>
@@ -58,11 +59,13 @@ public:
virtual void highlight(WebCore::Node*);
virtual void hideHighlight();
- virtual void populateSetting(const WTF::String& key, WTF::String* value);
- virtual void storeSetting(const WTF::String& key, const WTF::String& value);
-
virtual bool sendMessageToFrontend(const WTF::String&);
+ bool inspectorStartsAttached();
+ void setInspectorStartsAttached(bool);
+
+ void releaseFrontendPage();
+
void updateHighlight();
void frontendClosing()
{
@@ -70,9 +73,9 @@ public:
releaseFrontendPage();
}
- void releaseFrontendPage();
private:
~WebInspectorClient();
+ WTF::PassOwnPtr<WebCore::InspectorFrontendClientLocal::Settings> createFrontendSettings();
WebView* m_inspectedWebView;
WebCore::Page* m_frontendPage;
@@ -84,7 +87,7 @@ private:
class WebInspectorFrontendClient : public WebCore::InspectorFrontendClientLocal, WebCore::WindowMessageListener {
public:
- WebInspectorFrontendClient(WebView* inspectedWebView, HWND inspectedWebViewHwnd, HWND frontendHwnd, const COMPtr<WebView>& frotnendWebView, HWND frontendWebViewHwnd, WebInspectorClient* inspectorClient);
+ WebInspectorFrontendClient(WebView* inspectedWebView, HWND inspectedWebViewHwnd, HWND frontendHwnd, const COMPtr<WebView>& frotnendWebView, HWND frontendWebViewHwnd, WebInspectorClient*, WTF::PassOwnPtr<Settings>);
virtual void frontendLoaded();
diff --git a/Source/WebKit/win/WebDownload.cpp b/Source/WebKit/win/WebDownload.cpp
index fc72232..45e36cc 100644
--- a/Source/WebKit/win/WebDownload.cpp
+++ b/Source/WebKit/win/WebDownload.cpp
@@ -38,12 +38,9 @@
#include "WebURLResponse.h"
#include <wtf/text/CString.h>
-#include <io.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
#pragma warning(push, 0)
#include <WebCore/BString.h>
+#include <WebCore/DownloadBundle.h>
#include <WebCore/NotImplemented.h>
#include <WebCore/ResourceError.h>
#include <WebCore/ResourceHandle.h>
@@ -55,18 +52,6 @@
using namespace WebCore;
-// Download Bundle file utilities ----------------------------------------------------------------
-const String& WebDownload::bundleExtension()
-{
- DEFINE_STATIC_LOCAL(const String, bundleExtension, (".download"));
- return bundleExtension;
-}
-
-UInt32 WebDownload::bundleMagicNumber()
-{
- return 0xDECAF4EA;
-}
-
// WebDownload ----------------------------------------------------------------
WebDownload::WebDownload()
@@ -165,7 +150,7 @@ HRESULT STDMETHODCALLTYPE WebDownload::bundlePathForTargetPath(
if (bundle[bundle.length()-1] == '/')
bundle.truncate(1);
- bundle += bundleExtension();
+ bundle += DownloadBundle::fileExtension();
*bundlePath = SysAllocStringLen(bundle.characters(), bundle.length());
if (!*bundlePath)
return E_FAIL;
@@ -182,148 +167,3 @@ HRESULT STDMETHODCALLTYPE WebDownload::request(
}
return S_OK;
}
-
-// Download Bundle file utilities ----------------------------------------------------------------
-
-CFDataRef WebDownload::extractResumeDataFromBundle(const String& bundlePath)
-{
- if (bundlePath.isEmpty()) {
- LOG_ERROR("Cannot create resume data from empty download bundle path");
- return 0;
- }
-
- // Open a handle to the bundle file
- String nullifiedPath = bundlePath;
- FILE* bundle = 0;
- if (_wfopen_s(&bundle, nullifiedPath.charactersWithNullTermination(), TEXT("r+b")) || !bundle) {
- LOG_ERROR("Failed to open file %s to get resume data", bundlePath.ascii().data());
- return 0;
- }
-
- CFDataRef result = 0;
- Vector<UInt8> footerBuffer;
-
- // Stat the file to get its size
- struct _stat64 fileStat;
- if (_fstat64(_fileno(bundle), &fileStat))
- goto exit;
-
- // Check for the bundle magic number at the end of the file
- fpos_t footerMagicNumberPosition = fileStat.st_size - 4;
- ASSERT(footerMagicNumberPosition >= 0);
- if (footerMagicNumberPosition < 0)
- goto exit;
- if (fsetpos(bundle, &footerMagicNumberPosition))
- goto exit;
-
- UInt32 footerMagicNumber = 0;
- if (fread(&footerMagicNumber, 4, 1, bundle) != 1) {
- LOG_ERROR("Failed to read footer magic number from the bundle - errno(%i)", errno);
- goto exit;
- }
-
- if (footerMagicNumber != bundleMagicNumber()) {
- LOG_ERROR("Footer's magic number does not match 0x%X - errno(%i)", bundleMagicNumber(), errno);
- goto exit;
- }
-
- // Now we're *reasonably* sure this is a .download bundle we actually wrote.
- // Get the length of the resume data
- fpos_t footerLengthPosition = fileStat.st_size - 8;
- ASSERT(footerLengthPosition >= 0);
- if (footerLengthPosition < 0)
- goto exit;
-
- if (fsetpos(bundle, &footerLengthPosition))
- goto exit;
-
- UInt32 footerLength = 0;
- if (fread(&footerLength, 4, 1, bundle) != 1) {
- LOG_ERROR("Failed to read ResumeData length from the bundle - errno(%i)", errno);
- goto exit;
- }
-
- // Make sure theres enough bytes to read in for the resume data, and perform the read
- fpos_t footerStartPosition = fileStat.st_size - 8 - footerLength;
- ASSERT(footerStartPosition >= 0);
- if (footerStartPosition < 0)
- goto exit;
- if (fsetpos(bundle, &footerStartPosition))
- goto exit;
-
- footerBuffer.resize(footerLength);
- if (fread(footerBuffer.data(), 1, footerLength, bundle) != footerLength) {
- LOG_ERROR("Failed to read ResumeData from the bundle - errno(%i)", errno);
- goto exit;
- }
-
- // CFURLDownload will seek to the appropriate place in the file (before our footer) and start overwriting from there
- // However, say we were within a few hundred bytes of the end of a download when it was paused -
- // The additional footer extended the length of the file beyond its final length, and there will be junk data leftover
- // at the end. Therefore, now that we've retrieved the footer data, we need to truncate it.
- if (errno_t resizeError = _chsize_s(_fileno(bundle), footerStartPosition)) {
- LOG_ERROR("Failed to truncate the resume footer off the end of the file - errno(%i)", resizeError);
- goto exit;
- }
-
- // Finally, make the resume data. Now, it is possible by some twist of fate the bundle magic number
- // was naturally at the end of the file and its not actually a valid bundle. That, or someone engineered
- // it that way to try to attack us. In that cause, this CFData will successfully create but when we
- // actually try to start the CFURLDownload using this bogus data, it will fail and we will handle that gracefully
- result = CFDataCreate(0, footerBuffer.data(), footerLength);
-exit:
- fclose(bundle);
- return result;
-}
-
-HRESULT WebDownload::appendResumeDataToBundle(CFDataRef resumeData, const String& bundlePath)
-{
- if (!resumeData) {
- LOG_ERROR("Invalid resume data to write to bundle path");
- return E_FAIL;
- }
- if (bundlePath.isEmpty()) {
- LOG_ERROR("Cannot write resume data to empty download bundle path");
- return E_FAIL;
- }
-
- String nullifiedPath = bundlePath;
- FILE* bundle = 0;
- if (_wfopen_s(&bundle, nullifiedPath.charactersWithNullTermination(), TEXT("ab")) || !bundle) {
- LOG_ERROR("Failed to open file %s to append resume data", bundlePath.ascii().data());
- return E_FAIL;
- }
-
- HRESULT hr = E_FAIL;
-
- const UInt8* resumeBytes = CFDataGetBytePtr(resumeData);
- ASSERT(resumeBytes);
- if (!resumeBytes)
- goto exit;
-
- UInt32 resumeLength = CFDataGetLength(resumeData);
- ASSERT(resumeLength > 0);
- if (resumeLength < 1)
- goto exit;
-
- if (fwrite(resumeBytes, 1, resumeLength, bundle) != resumeLength) {
- LOG_ERROR("Failed to write resume data to the bundle - errno(%i)", errno);
- goto exit;
- }
-
- if (fwrite(&resumeLength, 4, 1, bundle) != 1) {
- LOG_ERROR("Failed to write footer length to the bundle - errno(%i)", errno);
- goto exit;
- }
-
- const UInt32& magic = bundleMagicNumber();
- if (fwrite(&magic, 4, 1, bundle) != 1) {
- LOG_ERROR("Failed to write footer magic number to the bundle - errno(%i)", errno);
- goto exit;
- }
-
- hr = S_OK;
-exit:
- fclose(bundle);
- return hr;
-}
diff --git a/Source/WebKit/win/WebDownload.h b/Source/WebKit/win/WebDownload.h
index bbb645e..3e8e734 100644
--- a/Source/WebKit/win/WebDownload.h
+++ b/Source/WebKit/win/WebDownload.h
@@ -122,11 +122,6 @@ public:
#endif
protected:
- static CFDataRef extractResumeDataFromBundle(const WTF::String&);
- static HRESULT appendResumeDataToBundle(CFDataRef, const WTF::String&);
- static const WTF::String& bundleExtension();
- static UInt32 bundleMagicNumber();
-
ULONG m_refCount;
WTF::String m_destination;
diff --git a/Source/WebKit/win/WebDownloadCFNet.cpp b/Source/WebKit/win/WebDownloadCFNet.cpp
index a199315..5a1f1bc 100644
--- a/Source/WebKit/win/WebDownloadCFNet.cpp
+++ b/Source/WebKit/win/WebDownloadCFNet.cpp
@@ -48,6 +48,7 @@
#include <WebCore/AuthenticationCF.h>
#include <WebCore/BString.h>
#include <WebCore/CredentialStorage.h>
+#include <WebCore/DownloadBundle.h>
#include <WebCore/LoaderRunLoopCF.h>
#include <WebCore/ResourceError.h>
#include <WebCore/ResourceHandle.h>
@@ -167,8 +168,8 @@ HRESULT STDMETHODCALLTYPE WebDownload::initToResumeWithBundle(
{
LOG(Download, "Attempting resume of download bundle %s", String(bundlePath, SysStringLen(bundlePath)).ascii().data());
- RetainPtr<CFDataRef> resumeData(AdoptCF, extractResumeDataFromBundle(String(bundlePath, SysStringLen(bundlePath))));
-
+ RetainPtr<CFDataRef> resumeData(AdoptCF, DownloadBundle::extractResumeData(String(bundlePath, SysStringLen(bundlePath))));
+
if (!resumeData)
return E_FAIL;
@@ -194,9 +195,9 @@ HRESULT STDMETHODCALLTYPE WebDownload::initToResumeWithBundle(
m_bundlePath = String(bundlePath, SysStringLen(bundlePath));
// Attempt to remove the ".download" extension from the bundle for the final file destination
// Failing that, we clear m_destination and will ask the delegate later once the download starts
- if (m_bundlePath.endsWith(bundleExtension(), false)) {
+ if (m_bundlePath.endsWith(DownloadBundle::fileExtension(), false)) {
m_destination = m_bundlePath.threadsafeCopy();
- m_destination.truncate(m_destination.length() - bundleExtension().length());
+ m_destination.truncate(m_destination.length() - DownloadBundle::fileExtension().length());
} else
m_destination = String();
@@ -249,14 +250,14 @@ HRESULT STDMETHODCALLTYPE WebDownload::cancelForResume()
CFURLDownloadSetDeletesUponFailure(m_download.get(), false);
CFURLDownloadCancel(m_download.get());
- resumeData = CFURLDownloadCopyResumeData(m_download.get());
+ resumeData.adoptCF(CFURLDownloadCopyResumeData(m_download.get()));
if (!resumeData) {
LOG(Download, "WebDownload - Unable to create resume data for download (%p)", this);
goto exit;
}
- appendResumeDataToBundle(resumeData.get(), m_bundlePath);
-
+ DownloadBundle::appendResumeData(resumeData.get(), m_bundlePath);
+
exit:
m_download = 0;
return hr;
@@ -288,7 +289,7 @@ HRESULT STDMETHODCALLTYPE WebDownload::setDestination(
return E_FAIL;
m_destination = String(path, SysStringLen(path));
- m_bundlePath = m_destination + bundleExtension();
+ m_bundlePath = m_destination + DownloadBundle::fileExtension();
CFURLRef pathURL = MarshallingHelpers::PathStringToFileCFURLRef(m_bundlePath);
CFURLDownloadSetDestination(m_download.get(), pathURL, !!allowOverwrite);
diff --git a/Source/WebKit/win/WebFrame.cpp b/Source/WebKit/win/WebFrame.cpp
index 05ee075..80b91cd 100644
--- a/Source/WebKit/win/WebFrame.cpp
+++ b/Source/WebKit/win/WebFrame.cpp
@@ -703,7 +703,7 @@ KURL WebFrame::url() const
if (!coreFrame)
return KURL();
- return coreFrame->loader()->url();
+ return coreFrame->document()->url();
}
HRESULT STDMETHODCALLTYPE WebFrame::stopLoading( void)
@@ -1966,11 +1966,11 @@ static IntRect printerRect(HDC printDC)
GetDeviceCaps(printDC, PHYSICALHEIGHT) - 2 * GetDeviceCaps(printDC, PHYSICALOFFSETY));
}
-void WebFrame::setPrinting(bool printing, float minPageWidth, float maxPageWidth, bool adjustViewSize)
+void WebFrame::setPrinting(bool printing, float minPageWidth, float maxPageWidth, float minPageHeight, bool adjustViewSize)
{
Frame* coreFrame = core(this);
ASSERT(coreFrame);
- coreFrame->setPrinting(printing, FloatSize(minPageWidth, 0), maxPageWidth / minPageWidth, adjustViewSize ? Frame::AdjustViewSize : Frame::DoNotAdjustViewSize);
+ coreFrame->setPrinting(printing, FloatSize(minPageWidth, minPageHeight), maxPageWidth / minPageWidth, adjustViewSize ? Frame::AdjustViewSize : Frame::DoNotAdjustViewSize);
}
HRESULT STDMETHODCALLTYPE WebFrame::setInPrintingMode(
@@ -1990,20 +1990,25 @@ HRESULT STDMETHODCALLTYPE WebFrame::setInPrintingMode(
// according to the paper size
float minLayoutWidth = 0.0f;
float maxLayoutWidth = 0.0f;
+ float minLayoutHeight = 0.0f;
if (m_inPrintingMode && !coreFrame->document()->isFrameSet()) {
if (!printDC) {
ASSERT_NOT_REACHED();
return E_POINTER;
}
- const int desiredHorizontalPixelsPerInch = 72;
+ const int desiredPixelsPerInch = 72;
+ IntRect printRect = printerRect(printDC);
int paperHorizontalPixelsPerInch = ::GetDeviceCaps(printDC, LOGPIXELSX);
- int paperWidth = printerRect(printDC).width() * desiredHorizontalPixelsPerInch / paperHorizontalPixelsPerInch;
+ int paperWidth = printRect.width() * desiredPixelsPerInch / paperHorizontalPixelsPerInch;
+ int paperVerticalPixelsPerInch = ::GetDeviceCaps(printDC, LOGPIXELSY);
+ int paperHeight = printRect.height() * desiredPixelsPerInch / paperVerticalPixelsPerInch;
minLayoutWidth = paperWidth * PrintingMinimumShrinkFactor;
maxLayoutWidth = paperWidth * PrintingMaximumShrinkFactor;
+ minLayoutHeight = paperHeight * PrintingMinimumShrinkFactor;
}
- setPrinting(m_inPrintingMode, minLayoutWidth, maxLayoutWidth, true);
+ setPrinting(m_inPrintingMode, minLayoutWidth, maxLayoutWidth, minLayoutHeight, true);
if (!m_inPrintingMode)
m_pageRects.clear();
@@ -2066,8 +2071,8 @@ const Vector<WebCore::IntRect>& WebFrame::computePageRects(HDC printDC)
IntRect adjustedRect = IntRect(
pageRect.x() + marginRect.x(),
pageRect.y() + marginRect.y(),
- pageRect.width() - marginRect.x() - marginRect.right(),
- pageRect.height() - marginRect.y() - marginRect.bottom());
+ pageRect.width() - marginRect.x() - marginRect.maxX(),
+ pageRect.height() - marginRect.y() - marginRect.maxY());
computePageRectsForFrame(coreFrame, adjustedRect, headerHeight, footerHeight, 1.0,m_pageRects, m_pageHeight);
diff --git a/Source/WebKit/win/WebFrame.h b/Source/WebKit/win/WebFrame.h
index bdc28ab..0095590 100644
--- a/Source/WebKit/win/WebFrame.h
+++ b/Source/WebKit/win/WebFrame.h
@@ -384,7 +384,7 @@ protected:
void loadHTMLString(BSTR string, BSTR baseURL, BSTR unreachableURL);
void loadData(PassRefPtr<WebCore::SharedBuffer>, BSTR mimeType, BSTR textEncodingName, BSTR baseURL, BSTR failingURL);
const Vector<WebCore::IntRect>& computePageRects(HDC printDC);
- void setPrinting(bool printing, float minPageWidth, float maxPageWidth, bool adjustViewSize);
+ void setPrinting(bool printing, float minPageWidth, float maxPageWidth, float minPageHeight, bool adjustViewSize);
void headerAndFooterHeights(float*, float*);
WebCore::IntRect printerMarginRect(HDC);
void spoolPage (PlatformGraphicsContext* pctx, WebCore::GraphicsContext* spoolCtx, HDC printDC, IWebUIDelegate*, float headerHeight, float footerHeight, UINT page, UINT pageCount);
diff --git a/Source/WebKit/win/WebHistory.cpp b/Source/WebKit/win/WebHistory.cpp
index 5383a0c..4caa554 100644
--- a/Source/WebKit/win/WebHistory.cpp
+++ b/Source/WebKit/win/WebHistory.cpp
@@ -476,7 +476,7 @@ HRESULT STDMETHODCALLTYPE WebHistory::orderedLastVisitedDays(
*count = dateCount;
if (!m_orderedLastVisitedDays) {
- m_orderedLastVisitedDays.set(new DATE[dateCount]);
+ m_orderedLastVisitedDays = adoptArrayPtr(new DATE[dateCount]);
DateToEntriesMap::const_iterator::Keys end = m_entriesByDate.end().keys();
int i = 0;
for (DateToEntriesMap::const_iterator::Keys it = m_entriesByDate.begin().keys(); it != end; ++it, ++i)
diff --git a/Source/WebKit/win/WebInspector.cpp b/Source/WebKit/win/WebInspector.cpp
index c3823b2..ec35099 100644
--- a/Source/WebKit/win/WebInspector.cpp
+++ b/Source/WebKit/win/WebInspector.cpp
@@ -110,7 +110,7 @@ HRESULT STDMETHODCALLTYPE WebInspector::showConsole()
{
if (m_webView)
if (Page* page = m_webView->page())
- page->inspectorController()->showPanel(InspectorController::ConsolePanel);
+ page->inspectorController()->showConsole();
return S_OK;
}
@@ -205,10 +205,9 @@ HRESULT STDMETHODCALLTYPE WebInspector::toggleProfilingJavaScript()
InspectorController* inspector = page->inspectorController();
- if (inspector->isRecordingUserInitiatedProfile()) {
+ if (inspector->isRecordingUserInitiatedProfile())
inspector->stopUserInitiatedProfiling();
- inspector->showPanel(InspectorController::ProfilesPanel);
- } else
+ else
inspector->startUserInitiatedProfiling();
return S_OK;
@@ -277,7 +276,7 @@ HRESULT STDMETHODCALLTYPE WebInspector::isTimelineProfilingEnabled(BOOL* isEnabl
if (!page)
return S_OK;
- *isEnabled = page->inspectorController()->timelineAgent() != 0;
+ *isEnabled = page->inspectorController()->timelineProfilerEnabled();
return S_OK;
}
diff --git a/Source/WebKit/win/WebKit.vcproj/WebKit.make b/Source/WebKit/win/WebKit.vcproj/WebKit.make
index ef8e7a6..b777d2f 100755
--- a/Source/WebKit/win/WebKit.vcproj/WebKit.make
+++ b/Source/WebKit/win/WebKit.vcproj/WebKit.make
@@ -8,12 +8,12 @@ install:
set WebKitLibrariesDir=$(SRCROOT)\AppleInternal
set WebKitOutputDir=$(OBJROOT)
set ConfigurationBuildDir=$(OBJROOT)\$(BUILDSTYLE)
- set WebKitVSPropsRedirectionDir=$(SRCROOT)\AppleInternal\tools\vsprops\OpenSource\1\2\3\
+ set WebKitVSPropsRedirectionDir=$(SRCROOT)\AppleInternal\tools\vsprops\OpenSource\1\2\3\4\
set PRODUCTION=1
devenv "WebKit.submit.sln" /rebuild $(BUILDSTYLE)
- -xcopy "$(ConfigurationBuildDir)\bin\*.exe" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y
- xcopy "$(ConfigurationBuildDir)\bin\*.pdb" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y
- -xcopy "$(ConfigurationBuildDir)\bin\*.dll" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y
- xcopy "$(ConfigurationBuildDir)\include\*" "$(DSTROOT)\AppleInternal\include\" /e/v/i/h/y
- xcopy "$(ConfigurationBuildDir)\lib\*" "$(DSTROOT)\AppleInternal\lib\" /e/v/i/h/y
- xcopy "$(ConfigurationBuildDir)\bin\WebKit.resources\*" "$(DSTROOT)\AppleInternal\bin\WebKit.resources" /e/v/i/h/y
+ -xcopy "%ConfigurationBuildDir%\bin\*.exe" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y
+ xcopy "%ConfigurationBuildDir%\bin\*.pdb" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y
+ -xcopy "%ConfigurationBuildDir%\bin\*.dll" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y
+ xcopy "%ConfigurationBuildDir%\include\*" "$(DSTROOT)\AppleInternal\include\" /e/v/i/h/y
+ xcopy "%ConfigurationBuildDir%\lib\*" "$(DSTROOT)\AppleInternal\lib\" /e/v/i/h/y
+ xcopy "%ConfigurationBuildDir%\bin\WebKit.resources\*" "$(DSTROOT)\AppleInternal\bin\WebKit.resources" /e/v/i/h/y
diff --git a/Source/WebKit/win/WebKit.vcproj/WebKit.submit.sln b/Source/WebKit/win/WebKit.vcproj/WebKit.submit.sln
index c4830fc..8f431f1 100644
--- a/Source/WebKit/win/WebKit.vcproj/WebKit.submit.sln
+++ b/Source/WebKit/win/WebKit.vcproj/WebKit.submit.sln
@@ -38,8 +38,8 @@ Global
{B8437A41-67BC-4769-9452-45203827F821}.Release_LTCG|Win32.Build.0 = Release_LTCG|Win32
{B8437A41-67BC-4769-9452-45203827F821}.Release|Win32.ActiveCfg = Release|Win32
{B8437A41-67BC-4769-9452-45203827F821}.Release|Win32.Build.0 = Release|Win32
- {91762BE2-87EF-4F5A-A480-48B90EB3F406}.Debug_All|Win32.ActiveCfg = Debug|Win32
- {91762BE2-87EF-4F5A-A480-48B90EB3F406}.Debug_All|Win32.Build.0 = Debug|Win32
+ {91762BE2-87EF-4F5A-A480-48B90EB3F406}.Debug_All|Win32.ActiveCfg = Debug_All|Win32
+ {91762BE2-87EF-4F5A-A480-48B90EB3F406}.Debug_All|Win32.Build.0 = Debug_All|Win32
{91762BE2-87EF-4F5A-A480-48B90EB3F406}.Debug|Win32.ActiveCfg = Debug|Win32
{91762BE2-87EF-4F5A-A480-48B90EB3F406}.Debug|Win32.Build.0 = Debug|Win32
{91762BE2-87EF-4F5A-A480-48B90EB3F406}.Release_LTCG|Win32.ActiveCfg = Release_LTCG|Win32
diff --git a/Source/WebKit/win/WebKitGraphics.cpp b/Source/WebKit/win/WebKitGraphics.cpp
index 5343608..1907050 100644
--- a/Source/WebKit/win/WebKitGraphics.cpp
+++ b/Source/WebKit/win/WebKitGraphics.cpp
@@ -32,7 +32,6 @@
#include "WebPreferences.h"
#pragma warning(push, 0)
-#include <WebCore/CharacterNames.h>
#include <WebCore/Font.h>
#include <WebCore/FontDescription.h>
#include <WebCore/FontSelector.h>
@@ -40,6 +39,7 @@
#include <WebCore/PlatformString.h>
#include <WebCore/StringTruncator.h>
#include <WebCore/WebCoreTextRenderer.h>
+#include <wtf/unicode/CharacterNames.h>
#include <CoreGraphics/CoreGraphics.h>
#pragma warning(pop)
@@ -105,7 +105,7 @@ void WebDrawText(WebTextRenderInfo* info)
GraphicsContext context(info->cgContext);
String drawString(info->text, info->length);
if (info->drawAsPassword)
- drawString = drawString.impl()->secure(WebCore::bullet);
+ drawString = drawString.impl()->secure(WTF::Unicode::bullet);
context.save();
@@ -133,15 +133,16 @@ void FontMetrics(const WebFontDescription& description, int* ascent, int* descen
return;
Font font(makeFont(description));
+ const WebCore::FontMetrics& fontMetrics(font.fontMetrics());
if (ascent)
- *ascent = font.ascent();
+ *ascent = fontMetrics.ascent();
if (descent)
- *descent = font.descent();
+ *descent = fontMetrics.descent();
if (lineSpacing)
- *lineSpacing = font.lineSpacing();
+ *lineSpacing = fontMetrics.lineSpacing();
}
unsigned CenterTruncateStringToWidth(LPCTSTR text, int length, const WebFontDescription& description, float width, WCHAR* buffer)
diff --git a/Source/WebKit/win/WebPreferences.cpp b/Source/WebKit/win/WebPreferences.cpp
index a962471..01cab2b 100644
--- a/Source/WebKit/win/WebPreferences.cpp
+++ b/Source/WebKit/win/WebPreferences.cpp
@@ -463,8 +463,8 @@ void WebPreferences::copyWebKitPreferencesToCFPreferences(CFDictionaryRef dict)
CFStringRef didRemoveDefaultsKey = CFSTR(WebKitDidMigrateDefaultSettingsFromSafari3BetaPreferenceKey);
bool omitDefaults = !booleanValueForPreferencesValue(CFDictionaryGetValue(dict, didRemoveDefaultsKey));
- OwnArrayPtr<CFTypeRef> keys(new CFTypeRef[count]);
- OwnArrayPtr<CFTypeRef> values(new CFTypeRef[count]);
+ OwnArrayPtr<CFTypeRef> keys = adoptArrayPtr(new CFTypeRef[count]);
+ OwnArrayPtr<CFTypeRef> values = adoptArrayPtr(new CFTypeRef[count]);
CFDictionaryGetKeysAndValues(dict, keys.get(), values.get());
for (int i = 0; i < count; ++i) {
diff --git a/Source/WebKit/win/WebScrollBar.cpp b/Source/WebKit/win/WebScrollBar.cpp
index 45bc8f3..9f0131b 100644
--- a/Source/WebKit/win/WebScrollBar.cpp
+++ b/Source/WebKit/win/WebScrollBar.cpp
@@ -174,9 +174,9 @@ HRESULT STDMETHODCALLTYPE WebScrollBar::frameRect(
return E_POINTER;
IntRect rect = m_scrollBar->frameRect();
bounds->left = rect.x();
- bounds->right = rect.right();
+ bounds->right = rect.maxX();
bounds->top = rect.y();
- bounds->bottom = rect.bottom();
+ bounds->bottom = rect.maxY();
return S_OK;
}
@@ -275,3 +275,13 @@ void WebScrollBar::invalidateScrollbarRect(Scrollbar*, const IntRect& rect)
RECT r = rect;
::InvalidateRect(m_containingWindow, &r, false);
}
+
+Scrollbar* WebScrollBar::horizontalScrollbar() const
+{
+ return m_scrollBar->orientation() == HorizontalScrollbar ? m_scrollBar.get() : 0;
+}
+
+Scrollbar* WebScrollBar::verticalScrollbar() const
+{
+ return m_scrollBar->orientation() == VerticalScrollbar ? m_scrollBar.get() : 0;
+}
diff --git a/Source/WebKit/win/WebScrollBar.h b/Source/WebKit/win/WebScrollBar.h
index ca44e8b..39457d4 100644
--- a/Source/WebKit/win/WebScrollBar.h
+++ b/Source/WebKit/win/WebScrollBar.h
@@ -123,6 +123,9 @@ protected:
virtual bool scrollbarCornerPresent() const { return false; }
+ virtual WebCore::Scrollbar* horizontalScrollbar() const;
+ virtual WebCore::Scrollbar* verticalScrollbar() const;
+
ULONG m_refCount;
HWND m_containingWindow;
int m_currentPosition;
diff --git a/Source/WebKit/win/WebView.cpp b/Source/WebKit/win/WebView.cpp
index da88be4..a85b23d 100644
--- a/Source/WebKit/win/WebView.cpp
+++ b/Source/WebKit/win/WebView.cpp
@@ -152,6 +152,11 @@
#include <WebKitSystemInterface/WebKitSystemInterface.h>
#endif
+#if USE(ACCELERATED_COMPOSITING)
+#include <WebCore/CACFLayerTreeHost.h>
+#include <WebCore/PlatformCALayer.h>
+#endif
+
#include <ShlObj.h>
#include <comutil.h>
#include <dimm.h>
@@ -797,7 +802,7 @@ void WebView::addToDirtyRegion(const IntRect& dirtyRect)
#endif
HRGN newRegion = ::CreateRectRgn(dirtyRect.x(), dirtyRect.y(),
- dirtyRect.right(), dirtyRect.bottom());
+ dirtyRect.maxX(), dirtyRect.maxY());
addToDirtyRegion(newRegion);
}
@@ -4806,9 +4811,9 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
settings->setWebAudioEnabled(true);
#endif // ENABLE(WEB_AUDIO)
-#if ENABLE(3D_CANVAS)
+#if ENABLE(WEBGL)
settings->setWebGLEnabled(true);
-#endif // ENABLE(3D_CANVAS)
+#endif // ENABLE(WEBGL)
hr = prefsPrivate->isDNSPrefetchingEnabled(&enabled);
if (FAILED(hr))
@@ -4975,8 +4980,8 @@ HRESULT STDMETHODCALLTYPE WebView::visibleContentRect(
FloatRect visibleContent = m_page->mainFrame()->view()->visibleContentRect();
rect->left = (LONG) visibleContent.x();
rect->top = (LONG) visibleContent.y();
- rect->right = (LONG) visibleContent.right();
- rect->bottom = (LONG) visibleContent.bottom();
+ rect->right = (LONG) visibleContent.maxX();
+ rect->bottom = (LONG) visibleContent.maxY();
return S_OK;
}
@@ -5340,9 +5345,9 @@ void WebView::prepareCandidateWindow(Frame* targetFrame, HIMC hInputContext)
form.ptCurrentPos.x = caret.x();
form.ptCurrentPos.y = caret.y() + caret.height();
form.rcArea.top = caret.y();
- form.rcArea.bottom = caret.bottom();
+ form.rcArea.bottom = caret.maxY();
form.rcArea.left = caret.x();
- form.rcArea.right = caret.right();
+ form.rcArea.right = caret.maxX();
IMMDict::dict().setCandidateWindow(hInputContext, &form);
}
diff --git a/Source/WebKit/win/WebView.h b/Source/WebKit/win/WebView.h
index 1a993c6..ddfb6db 100644
--- a/Source/WebKit/win/WebView.h
+++ b/Source/WebKit/win/WebView.h
@@ -40,8 +40,12 @@
#include <wtf/RefPtr.h>
#if USE(ACCELERATED_COMPOSITING)
-#include <WebCore/CACFLayerTreeHost.h>
-#include <WebCore/PlatformCALayer.h>
+#include <WebCore/CACFLayerTreeHostClient.h>
+#include <WebCore/GraphicsLayerClient.h>
+
+namespace WebCore {
+ class CACFLayerTreeHost;
+}
#endif
class FullscreenVideoController;