Unreviewed, rolling out r173340 and r173342.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 6 Sep 2014 07:02:43 +0000 (07:02 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 6 Sep 2014 07:02:43 +0000 (07:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=136596

Broke many tests (Requested by ap on #webkit).

Reverted changesets:

"Remove PLATFORM(IOS) from WebCore/editing (Part 3)."
https://bugs.webkit.org/show_bug.cgi?id=136474
http://trac.webkit.org/changeset/173340

"Build fix after r173340."
http://trac.webkit.org/changeset/173342

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173351 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/editing/TextAffinity.h
Source/WebCore/editing/cocoa/HTMLConverter.mm
Source/WebCore/page/mac/WebCoreFrameView.h
Source/WebCore/platform/ios/ScrollViewIOS.mm
Source/WebCore/platform/ios/wak/WAKScrollView.mm
Source/WebCore/platform/mac/ScrollViewMac.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebEditorClient.h
Source/WebKit/mac/WebView/WebFrameView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm
Source/WebKit2/WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm

index 8ae30da..b8e7a25 100644 (file)
@@ -1,3 +1,19 @@
+2014-09-05  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r173340 and r173342.
+        https://bugs.webkit.org/show_bug.cgi?id=136596
+
+        Broke many tests (Requested by ap on #webkit).
+
+        Reverted changesets:
+
+        "Remove PLATFORM(IOS) from WebCore/editing (Part 3)."
+        https://bugs.webkit.org/show_bug.cgi?id=136474
+        http://trac.webkit.org/changeset/173340
+
+        "Build fix after r173340."
+        http://trac.webkit.org/changeset/173342
+
 2014-09-05  Joseph Pecoraro  <pecoraro@apple.com>
 
         Use WTFString::split(char) in more places
index 2e3c1e1..5d22691 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2014 Apple Inc.  All rights reserved.
+ * Copyright (C) 2004 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #ifndef TextAffinity_h
 #define TextAffinity_h
 
+#ifdef __OBJC__
+#if !PLATFORM(IOS)
+#include <AppKit/NSTextView.h>
+#else
+#include "WAKAppKitStubs.h"
+#endif // !PLATFORM(IOS)
+#endif
+
 namespace WebCore {
 
+// These match the AppKit values for these concepts.
+// From NSTextView.h:
+// NSSelectionAffinityUpstream = 0
+// NSSelectionAffinityDownstream = 1
 enum EAffinity { UPSTREAM = 0, DOWNSTREAM = 1 };
 
 } // namespace WebCore
 
+#ifdef __OBJC__
+
+inline NSSelectionAffinity kit(WebCore::EAffinity affinity)
+{
+    return static_cast<NSSelectionAffinity>(affinity);
+}
+
+inline WebCore::EAffinity core(NSSelectionAffinity affinity)
+{
+    return static_cast<WebCore::EAffinity>(affinity);
+}
+
+#endif
+
 #endif // TextAffinity_h
index 518e4fa..6d4d68e 100644 (file)
@@ -62,8 +62,6 @@
 
 #if PLATFORM(IOS)
 
-#import "WAKAppKitStubs.h"
-
 SOFT_LINK_FRAMEWORK(UIKit)
 SOFT_LINK_CLASS(UIKit, UIColor)
 
index dec55bf..fffef8f 100644 (file)
@@ -28,8 +28,7 @@
 // WTF_PLATFORM_IOS
 #ifdef __cplusplus
 namespace WebCore {
-class Frame;
-class IntPoint;
+    class Frame;
 }
 #endif
 
@@ -38,13 +37,13 @@ class IntPoint;
 #ifdef __cplusplus
 - (void)setScrollingModes:(WebCore::ScrollbarMode)hMode vertical:(WebCore::ScrollbarMode)vMode andLock:(BOOL)lock;
 - (void)scrollingModes:(WebCore::ScrollbarMode*)hMode vertical:(WebCore::ScrollbarMode*)vMode;
-- (void)setScrollOrigin:(WebCore::IntPoint)origin updatePositionAtAll:(BOOL)updatePositionAtAll immediately:(BOOL)updatePositionImmediately;
-- (WebCore::IntPoint)scrollOrigin;
 #else
 - (void)setScrollingModes:(int)hMode vertical:(int)vMode andLock:(BOOL)lock;
 - (void)scrollingModes:(int*)hMode vertical:(int*)vMode;
 #endif
 - (void)setScrollBarsSuppressed:(BOOL)suppressed repaintOnUnsuppress:(BOOL)repaint;
+- (void)setScrollOrigin:(NSPoint)origin updatePositionAtAll:(BOOL)updatePositionAtAll immediately:(BOOL)updatePositionImmediately;
+- (NSPoint)scrollOrigin;
 @end
 
 @protocol WebCoreFrameView
index 43b8824..5ee90bb 100644 (file)
@@ -243,7 +243,9 @@ void ScrollView::platformSetScrollbarsSuppressed(bool repaintOnUnsuppress)
 void ScrollView::platformSetScrollPosition(const IntPoint& scrollPoint)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    [documentView() scrollPoint:NSMakePoint(max(-[scrollView() scrollOrigin].x(), scrollPoint.x()), max(-[scrollView() scrollOrigin].y(), scrollPoint.y()))];
+    NSPoint floatPoint = scrollPoint;
+    NSPoint tempPoint = { max(-[scrollView() scrollOrigin].x, floatPoint.x), max(-[scrollView() scrollOrigin].y, floatPoint.y) };  // Don't use NSMakePoint to work around 4213314.
+    [documentView() scrollPoint:tempPoint];
     END_BLOCK_OBJC_EXCEPTIONS;
 }
 
@@ -305,7 +307,7 @@ void ScrollView::platformSetScrollbarOverlayStyle(ScrollbarOverlayStyle)
 void ScrollView::platformSetScrollOrigin(const IntPoint& origin, bool updatePositionAll, bool updatePositionSynchronously)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    [scrollView() setScrollOrigin:origin updatePositionAtAll:updatePositionAll immediately:updatePositionSynchronously];
+    [scrollView() setScrollOrigin:static_cast<CGPoint>(origin) updatePositionAtAll:updatePositionAll immediately:updatePositionSynchronously];
     END_BLOCK_OBJC_EXCEPTIONS;
 }
 
index 41dc879..78e6132 100644 (file)
@@ -28,7 +28,6 @@
 
 #if PLATFORM(IOS)
 
-#import "IntPoint.h"
 #import "WAKAppKitStubs.h"
 #import "WAKClipView.h"
 #import "WAKViewInternal.h"
@@ -233,7 +232,7 @@ static void _notificationCallback(WKViewRef v, WKViewNotificationType type, void
     UNUSED_PARAM(repaint);
 }
 
-- (void)setScrollOrigin:(WebCore::IntPoint)scrollOrigin updatePositionAtAll:(BOOL)updatePositionAtAll immediately:(BOOL)updatePositionImmediately
+- (void)setScrollOrigin:(NSPoint)scrollOrigin updatePositionAtAll:(BOOL)updatePositionAtAll immediately:(BOOL)updatePositionImmediately
 {
     UNUSED_PARAM(updatePositionAtAll);
     UNUSED_PARAM(updatePositionImmediately);
@@ -242,12 +241,12 @@ static void _notificationCallback(WKViewRef v, WKViewNotificationType type, void
     // so we don't have to check for equivalence here.
     _scrollOrigin = scrollOrigin;
 
-    [_documentView setBoundsOrigin:NSMakePoint(-scrollOrigin.x(), -scrollOrigin.y())];
+    [_documentView setBoundsOrigin:NSMakePoint(-scrollOrigin.x, -scrollOrigin.y)];
 }
 
-- (WebCore::IntPoint)scrollOrigin
+- (NSPoint)scrollOrigin
 {
-    return WebCore::IntPoint(_scrollOrigin);
+    return _scrollOrigin;
 }
 
 #pragma mark -
index a737c94..ee29934 100644 (file)
@@ -201,7 +201,8 @@ void ScrollView::platformSetScrollbarsSuppressed(bool repaintOnUnsuppress)
 void ScrollView::platformSetScrollPosition(const IntPoint& scrollPoint)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    NSPoint tempPoint = NSMakePoint(std::max(-[scrollView() scrollOrigin].x(), scrollPoint.x()), std::max(-[scrollView() scrollOrigin].y(), scrollPoint.y()));
+    NSPoint floatPoint = scrollPoint;
+    NSPoint tempPoint = { std::max(-[scrollView() scrollOrigin].x, floatPoint.x), std::max(-[scrollView() scrollOrigin].y, floatPoint.y) };  // Don't use NSMakePoint to work around 4213314.
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
     // AppKit has the inset factored into all of its scroll positions. In WebCore, we use positions that ignore
index 4282c7c..aa105ad 100644 (file)
@@ -1,3 +1,19 @@
+2014-09-05  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r173340 and r173342.
+        https://bugs.webkit.org/show_bug.cgi?id=136596
+
+        Broke many tests (Requested by ap on #webkit).
+
+        Reverted changesets:
+
+        "Remove PLATFORM(IOS) from WebCore/editing (Part 3)."
+        https://bugs.webkit.org/show_bug.cgi?id=136474
+        http://trac.webkit.org/changeset/173340
+
+        "Build fix after r173340."
+        http://trac.webkit.org/changeset/173342
+
 2014-09-05  Enrica Casucci  <enrica@apple.com>
 
         Build fix after r173340.
index 632e0b9..2fc2b9c 100644 (file)
 #import <wtf/Vector.h>
 #import <wtf/text/StringView.h>
 
-#if PLATFORM(IOS)
-#import <WebCore/WAKAppKitStubs.h>
-#endif
-
 @class WebView;
 @class WebEditorUndoTarget;
 
@@ -180,32 +176,6 @@ private:
 #endif
 };
 
-#if PLATFORM(COCOA)
-inline NSSelectionAffinity kit(WebCore::EAffinity affinity)
-{
-    switch (affinity) {
-    case WebCore::EAffinity::UPSTREAM:
-        return NSSelectionAffinityUpstream;
-    case WebCore::EAffinity::DOWNSTREAM:
-        return NSSelectionAffinityDownstream;
-    }
-    ASSERT_NOT_REACHED();
-    return NSSelectionAffinityUpstream;
-}
-
-inline WebCore::EAffinity core(NSSelectionAffinity affinity)
-{
-    switch (affinity) {
-    case NSSelectionAffinityUpstream:
-        return WebCore::EAffinity::UPSTREAM;
-    case NSSelectionAffinityDownstream:
-        return WebCore::EAffinity::DOWNSTREAM;
-    }
-    ASSERT_NOT_REACHED();
-    return WebCore::EAffinity::UPSTREAM;
-}
-#endif
-
 #if PLATFORM(IOS)
 
 inline bool WebEditorClient::isGrammarCheckingEnabled()
index bb8f279..653a77e 100644 (file)
@@ -669,8 +669,8 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
     if (![self _isScrollable])
         return NO;
     NSPoint point = [(NSView *)[[self _scrollView] documentView] frame].origin;
-    point.x += [[self _scrollView] scrollOrigin].x();
-    point.y += [[self _scrollView] scrollOrigin].y();
+    point.x += [[self _scrollView] scrollOrigin].x;
+    point.y += [[self _scrollView] scrollOrigin].y;
     return [[self _contentView] _scrollTo:&point animate:YES];
 }
 
@@ -700,9 +700,9 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
     
     // Reset the position opposite to the block progression direction.
     if (isVertical)
-        point.x += [[self _scrollView] scrollOrigin].x();
+        point.x += [[self _scrollView] scrollOrigin].x;
     else
-        point.y += [[self _scrollView] scrollOrigin].y();
+        point.y += [[self _scrollView] scrollOrigin].y;
     return [[self _contentView] _scrollTo:&point animate:YES];
 }
 
index 3522a40..861a668 100644 (file)
@@ -1,3 +1,19 @@
+2014-09-05  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r173340 and r173342.
+        https://bugs.webkit.org/show_bug.cgi?id=136596
+
+        Broke many tests (Requested by ap on #webkit).
+
+        Reverted changesets:
+
+        "Remove PLATFORM(IOS) from WebCore/editing (Part 3)."
+        https://bugs.webkit.org/show_bug.cgi?id=136474
+        http://trac.webkit.org/changeset/173340
+
+        "Build fix after r173340."
+        http://trac.webkit.org/changeset/173342
+
 2014-09-05  Joseph Pecoraro  <pecoraro@apple.com>
 
         Use WTFString::split(char) in more places
index 511861b..20a5e1c 100644 (file)
 #import "WKDOMDocument.h"
 #import "WKDOMText.h"
 
-#if PLATFORM(IOS)
-#import <WebCore/WAKAppKitStubs.h>
-#endif
-
 namespace WebKit {
 
 template<typename WebCoreType, typename WKDOMType>
index 9e436cb..ddcf1b2 100644 (file)
     return m_page->pageScaleFactor();
 }
 
-- (id)accessibilityHitTest:(WebCore::IntPoint)point
+- (id)accessibilityHitTest:(NSPoint)point
 {
     if (!m_page)
         return nil;
     
-    WebCore::IntPoint convertedPoint = m_page->accessibilityScreenToRootView(point);
+    WebCore::IntPoint convertedPoint = m_page->accessibilityScreenToRootView(WebCore::IntPoint(point));
     return [[self accessibilityRootObjectWrapper] accessibilityHitTest:convertedPoint];
 }