summaryrefslogtreecommitdiffstats
path: root/WebKit/mac/WebView
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/mac/WebView')
-rw-r--r--WebKit/mac/WebView/WebFrameView.mm6
-rw-r--r--WebKit/mac/WebView/WebPDFDocumentExtras.h8
-rw-r--r--WebKit/mac/WebView/WebPDFDocumentExtras.mm14
-rw-r--r--WebKit/mac/WebView/WebPDFRepresentation.mm12
-rw-r--r--WebKit/mac/WebView/WebPreferenceKeysPrivate.h1
-rw-r--r--WebKit/mac/WebView/WebPreferences.mm11
-rw-r--r--WebKit/mac/WebView/WebPreferencesPrivate.h3
-rw-r--r--WebKit/mac/WebView/WebView.mm1
8 files changed, 24 insertions, 32 deletions
diff --git a/WebKit/mac/WebView/WebFrameView.mm b/WebKit/mac/WebView/WebFrameView.mm
index 565e64d..b6b1941 100644
--- a/WebKit/mac/WebView/WebFrameView.mm
+++ b/WebKit/mac/WebView/WebFrameView.mm
@@ -201,7 +201,7 @@ enum {
- (float)_verticalPageScrollDistance
{
float height = [[self _contentView] bounds].size.height;
- return max(height * cFractionToStepWhenPaging, 1.f);
+ return max<float>(height * Scrollbar::minFractionToStepWhenPaging(), height - Scrollbar::maxOverlapBetweenPages());
}
static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCClass, NSArray *supportTypes)
@@ -342,7 +342,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
[scrollView setHasVerticalScroller:NO];
[scrollView setHasHorizontalScroller:NO];
[scrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
- [scrollView setLineScroll:cScrollbarPixelsPerLineStep];
+ [scrollView setLineScroll:Scrollbar::pixelsPerLineStep()];
[self addSubview:scrollView];
// Don't call our overridden version of setNextKeyView here; we need to make the standard NSView
@@ -613,7 +613,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
- (float)_horizontalPageScrollDistance
{
float width = [[self _contentView] bounds].size.width;
- return max(width * cFractionToStepWhenPaging, 1.f);
+ return max<float>(width * Scrollbar::minFractionToStepWhenPaging(), width - Scrollbar::maxOverlapBetweenPages());
}
- (BOOL)_pageVertically:(BOOL)up
diff --git a/WebKit/mac/WebView/WebPDFDocumentExtras.h b/WebKit/mac/WebView/WebPDFDocumentExtras.h
index 5a33ccf..0dce43e 100644
--- a/WebKit/mac/WebView/WebPDFDocumentExtras.h
+++ b/WebKit/mac/WebView/WebPDFDocumentExtras.h
@@ -23,10 +23,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <PDFKit/PDFDocument.h>
+@class PDFDocument;
-@interface PDFDocument (WebPDFDocumentExtras)
-- (NSArray *)_web_allScripts;
-@end
-
-void addWebPDFDocumentExtras(Class);
+NSArray *allScriptsInPDFDocument(PDFDocument *);
diff --git a/WebKit/mac/WebView/WebPDFDocumentExtras.mm b/WebKit/mac/WebView/WebPDFDocumentExtras.mm
index ec580ec..b7043df 100644
--- a/WebKit/mac/WebView/WebPDFDocumentExtras.mm
+++ b/WebKit/mac/WebView/WebPDFDocumentExtras.mm
@@ -68,10 +68,10 @@ static void getAllValuesInPDFNameTree(CGPDFDictionaryRef tree, Vector<CGPDFObjec
appendValuesInPDFNameSubtreeToVector(tree, allValues);
}
-static NSArray *web_PDFDocumentAllScripts(id self, SEL _cmd)
+NSArray *allScriptsInPDFDocument(PDFDocument *document)
{
NSMutableArray *scripts = [NSMutableArray array];
- CGPDFDocumentRef pdfDocument = [self documentRef];
+ CGPDFDocumentRef pdfDocument = [document documentRef];
if (!pdfDocument)
return scripts;
@@ -129,13 +129,3 @@ static NSArray *web_PDFDocumentAllScripts(id self, SEL _cmd)
return scripts;
}
-
-void addWebPDFDocumentExtras(Class pdfDocumentClass)
-{
-#ifndef BUILDING_ON_TIGER
- class_addMethod(pdfDocumentClass, @selector(_web_allScripts), (IMP)web_PDFDocumentAllScripts, "@@:");
-#else
- static struct objc_method_list methodList = { 0, 1, { @selector(_web_allScripts), (char*)"@@:", (IMP)web_PDFDocumentAllScripts } };
- class_addMethods(pdfDocumentClass, &methodList);
-#endif
-}
diff --git a/WebKit/mac/WebView/WebPDFRepresentation.mm b/WebKit/mac/WebView/WebPDFRepresentation.mm
index 924bda8..36449f3 100644
--- a/WebKit/mac/WebView/WebPDFRepresentation.mm
+++ b/WebKit/mac/WebView/WebPDFRepresentation.mm
@@ -70,16 +70,6 @@
return PDFDocumentClass;
}
-+ (void)initialize
-{
- if (self != [WebPDFRepresentation class])
- return;
-
- Class pdfDocumentClass = [self PDFDocumentClass];
- if (pdfDocumentClass)
- addWebPDFDocumentExtras(pdfDocumentClass);
-}
-
- (void)setDataSource:(WebDataSource *)dataSource;
{
}
@@ -136,7 +126,7 @@
PDFDocument *doc = [[[[self class] PDFDocumentClass] alloc] initWithData:data];
[view setPDFDocument:doc];
- NSArray *scripts = [doc _web_allScripts];
+ NSArray *scripts = allScriptsInPDFDocument(doc);
[doc release];
doc = nil;
diff --git a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
index 7085cec..b8e912e 100644
--- a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
+++ b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
@@ -90,6 +90,7 @@
#define WebKitWebGLEnabledPreferenceKey @"WebKitWebGLEnabled"
#define WebKitUsesProxiedOpenPanelPreferenceKey @"WebKitUsesProxiedOpenPanel"
#define WebKitPluginAllowedRunTimePreferenceKey @"WebKitPluginAllowedRunTime"
+#define WebKitFrameSetFlatteningEnabledPreferenceKey @"WebKitFrameSetFlatteningEnabled"
// These are private both because callers should be using the cover methods and because the
// cover methods themselves are private.
diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm
index d06cc13..a1176a9 100644
--- a/WebKit/mac/WebView/WebPreferences.mm
+++ b/WebKit/mac/WebView/WebPreferences.mm
@@ -356,6 +356,7 @@ static WebCacheModel cacheModelForMainBundle(void)
[NSNumber numberWithBool:NO], WebKitWebGLEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitUsesProxiedOpenPanelPreferenceKey,
[NSNumber numberWithUnsignedInt:4], WebKitPluginAllowedRunTimePreferenceKey,
+ [NSNumber numberWithBool:NO], WebKitFrameSetFlatteningEnabledPreferenceKey,
nil];
// This value shouldn't ever change, which is assumed in the initialization of WebKitPDFDisplayModePreferenceKey above
@@ -1204,6 +1205,16 @@ static NSString *classIBCreatorID = nil;
return [self _setIntegerValue:allowedRunTime forKey:WebKitPluginAllowedRunTimePreferenceKey];
}
+- (BOOL)isFrameSetFlatteningEnabled
+{
+ return [self _boolValueForKey:WebKitFrameSetFlatteningEnabledPreferenceKey];
+}
+
+- (void)setFrameSetFlatteningEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitFrameSetFlatteningEnabledPreferenceKey];
+}
+
- (void)didRemoveFromWebView
{
ASSERT(_private->numWebViews);
diff --git a/WebKit/mac/WebView/WebPreferencesPrivate.h b/WebKit/mac/WebView/WebPreferencesPrivate.h
index 20c98b2..7c84d8d 100644
--- a/WebKit/mac/WebView/WebPreferencesPrivate.h
+++ b/WebKit/mac/WebView/WebPreferencesPrivate.h
@@ -113,6 +113,9 @@ extern NSString *WebPreferencesRemovedNotification;
- (unsigned)pluginAllowedRunTime;
- (void)setPluginAllowedRunTime:(unsigned)allowedRunTime;
+- (BOOL)isFrameSetFlatteningEnabled;
+- (void)setFrameSetFlatteningEnabled:(BOOL)flag;
+
// zero means do AutoScale
- (float)PDFScaleFactor;
- (void)setPDFScaleFactor:(float)scale;
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index e583bb5..4b449de 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -1334,6 +1334,7 @@ static bool fastDocumentTeardownEnabled()
settings->setPluginAllowedRunTime([preferences pluginAllowedRunTime]);
settings->setWebGLEnabled([preferences webGLEnabled]);
settings->setLoadDeferringEnabled(shouldEnableLoadDeferring());
+ settings->setFrameSetFlatteningEnabled([preferences isFrameSetFlatteningEnabled]);
}
static inline IMP getMethod(id o, SEL s)