[iOS] Upstream build fixes in Source/WebKit/ios/
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Dec 2013 19:02:59 +0000 (19:02 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Dec 2013 19:02:59 +0000 (19:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=125230

Reviewed by Sam Weinig.

* DefaultDelegates/WebDefaultUIKitDelegate.m:
(-[WebDefaultUIKitDelegate webViewDidReceiveMobileDocType:]):
* Misc/WebNSStringDrawing.mm:
(needsBidiLayout):
(-[NSString __web_drawAtPoint:forWidth:withFont:ellipsis:letterSpacing:includeEmoji:measureOnly:renderedStringOut:drawUnderline:]):
(-[NSString __web_drawInRect:withFont:ellipsis:alignment:letterSpacing:lineSpacing:includeEmoji:truncationRect:measureOnly:renderedStringOut:drawUnderline:]):
* Misc/WebUIKitSupport.mm:
(WebKitInitialize):
* WebCoreSupport/WebChromeClientIOS.h:
* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::didReceiveMobileDocType):
(WebChromeClientIOS::focusedElementChanged):
* WebCoreSupport/WebFrameIOS.mm:
(-[WebFrame clearSelection]):
(-[WebFrame selectionState]):
(-[WebFrame collapseSelection]):
(-[WebFrame extendSelection:]):
(-[WebFrame selectionRects]):
(-[WebFrame setRangedSelectionWithExtentPoint:]):
(-[WebFrame setRangedSelectionExtentPoint:baseIsStart:allowFlipping:]):
(-[WebFrame setSelectionWithBasePoint:extentPoint:baseIsStart:allowFlipping:]):
(-[WebFrame setSelectionWithFirstPoint:secondPoint:]):
(-[WebFrame ensureRangedSelectionContainsInitialStartPoint:initialEndPoint:]):
(-[WebFrame aggressivelyExpandSelectionToWordContainingCaretSelection]):
(-[WebFrame expandSelectionToSentence]):
(-[WebFrame setBaseWritingDirection:]):
(-[WebFrame moveSelectionToStart]):
(-[WebFrame moveSelectionToEnd]):
(-[WebFrame moveSelectionToPoint:]):
(-[WebFrame setSelectionGranularity:]):
(-[WebFrame smartExtendRangedSelection:]):
(-[WebFrame previousUnperturbedDictationResultBoundaryFromPosition:]):
(-[WebFrame nextUnperturbedDictationResultBoundaryFromPosition:]):
* WebCoreSupport/WebInspectorClientIOS.mm:
(WebInspectorClient::WebInspectorClient):
(WebInspectorClient::didSetSearchingForNode):
(WebInspectorClient::setupRemoteConnection):
(WebInspectorClient::teardownRemoteConnection):
* WebCoreSupport/WebVisiblePosition.mm:
(-[WebVisiblePosition enclosingRangeWithDictationPhraseAlternatives:]):
(-[WebVisiblePosition enclosingRangeWithCorrectionIndicator]):
(-[DOMHTMLInputElement startPosition]):
(-[DOMHTMLInputElement endPosition]):
(-[DOMHTMLTextAreaElement startPosition]):
(-[DOMHTMLTextAreaElement endPosition]):
* WebView/WebPDFViewIOS.mm:
(+[WebPDFView shadowColor]):
(+[WebPDFView backgroundColor]):
(-[WebPDFView _checkPDFTitle]):
* WebView/WebPDFViewPlaceholder.mm:
(-[WebPDFViewPlaceholder simulateClickOnLinkToURL:]):
* WebView/WebUIKitDelegate.h:

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

12 files changed:
Source/WebKit/ios/ChangeLog
Source/WebKit/ios/DefaultDelegates/WebDefaultUIKitDelegate.m
Source/WebKit/ios/Misc/WebNSStringDrawing.mm
Source/WebKit/ios/Misc/WebUIKitSupport.mm
Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.h
Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.mm
Source/WebKit/ios/WebCoreSupport/WebFrameIOS.mm
Source/WebKit/ios/WebCoreSupport/WebInspectorClientIOS.mm
Source/WebKit/ios/WebCoreSupport/WebVisiblePosition.mm
Source/WebKit/ios/WebView/WebPDFViewIOS.mm
Source/WebKit/ios/WebView/WebPDFViewPlaceholder.mm
Source/WebKit/ios/WebView/WebUIKitDelegate.h

index b25d2fdf3f71fd32d058732d865f25f51122221c..612af185c3c3d3d079026533e6f94045ea128c61 100644 (file)
@@ -1,3 +1,63 @@
+2013-12-04  Andy Estes  <aestes@apple.com>
+
+        [iOS] Upstream build fixes in Source/WebKit/ios/
+        https://bugs.webkit.org/show_bug.cgi?id=125230
+
+        Reviewed by Sam Weinig.
+
+        * DefaultDelegates/WebDefaultUIKitDelegate.m:
+        (-[WebDefaultUIKitDelegate webViewDidReceiveMobileDocType:]):
+        * Misc/WebNSStringDrawing.mm:
+        (needsBidiLayout):
+        (-[NSString __web_drawAtPoint:forWidth:withFont:ellipsis:letterSpacing:includeEmoji:measureOnly:renderedStringOut:drawUnderline:]):
+        (-[NSString __web_drawInRect:withFont:ellipsis:alignment:letterSpacing:lineSpacing:includeEmoji:truncationRect:measureOnly:renderedStringOut:drawUnderline:]):
+        * Misc/WebUIKitSupport.mm:
+        (WebKitInitialize):
+        * WebCoreSupport/WebChromeClientIOS.h:
+        * WebCoreSupport/WebChromeClientIOS.mm:
+        (WebChromeClientIOS::didReceiveMobileDocType):
+        (WebChromeClientIOS::focusedElementChanged):
+        * WebCoreSupport/WebFrameIOS.mm:
+        (-[WebFrame clearSelection]):
+        (-[WebFrame selectionState]):
+        (-[WebFrame collapseSelection]):
+        (-[WebFrame extendSelection:]):
+        (-[WebFrame selectionRects]):
+        (-[WebFrame setRangedSelectionWithExtentPoint:]):
+        (-[WebFrame setRangedSelectionExtentPoint:baseIsStart:allowFlipping:]):
+        (-[WebFrame setSelectionWithBasePoint:extentPoint:baseIsStart:allowFlipping:]):
+        (-[WebFrame setSelectionWithFirstPoint:secondPoint:]):
+        (-[WebFrame ensureRangedSelectionContainsInitialStartPoint:initialEndPoint:]):
+        (-[WebFrame aggressivelyExpandSelectionToWordContainingCaretSelection]):
+        (-[WebFrame expandSelectionToSentence]):
+        (-[WebFrame setBaseWritingDirection:]):
+        (-[WebFrame moveSelectionToStart]):
+        (-[WebFrame moveSelectionToEnd]):
+        (-[WebFrame moveSelectionToPoint:]):
+        (-[WebFrame setSelectionGranularity:]):
+        (-[WebFrame smartExtendRangedSelection:]):
+        (-[WebFrame previousUnperturbedDictationResultBoundaryFromPosition:]):
+        (-[WebFrame nextUnperturbedDictationResultBoundaryFromPosition:]):
+        * WebCoreSupport/WebInspectorClientIOS.mm:
+        (WebInspectorClient::WebInspectorClient):
+        (WebInspectorClient::didSetSearchingForNode):
+        (WebInspectorClient::setupRemoteConnection):
+        (WebInspectorClient::teardownRemoteConnection):
+        * WebCoreSupport/WebVisiblePosition.mm:
+        (-[WebVisiblePosition enclosingRangeWithDictationPhraseAlternatives:]):
+        (-[WebVisiblePosition enclosingRangeWithCorrectionIndicator]):
+        (-[DOMHTMLInputElement startPosition]):
+        (-[DOMHTMLInputElement endPosition]):
+        (-[DOMHTMLTextAreaElement startPosition]):
+        (-[DOMHTMLTextAreaElement endPosition]):
+        * WebView/WebPDFViewIOS.mm:
+        (+[WebPDFView shadowColor]):
+        (+[WebPDFView backgroundColor]):
+        (-[WebPDFView _checkPDFTitle]):
+        * WebView/WebPDFViewPlaceholder.mm:
+        (-[WebPDFViewPlaceholder simulateClickOnLinkToURL:]):
+        * WebView/WebUIKitDelegate.h:
+
 2013-12-03  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: Push Remote Inspector debugging connection management into JavaScriptCore
index cd4cabc187a1bde2f277eb5b78e6a0416fb9f11b..9aaa5f0052e79cd5ce70317057a1272396b03149 100644 (file)
@@ -139,7 +139,7 @@ static WebDefaultUIKitDelegate *sharedDelegate = nil;
 {
 }
 
-- (void)webView:(WebView *)webView didReceiveDocTypeForFrame:(WebFrame *)frame
+- (void)webViewDidReceiveMobileDocType:(WebView *)webView
 {
     
 }
index a2783fec1cbafab219a9a8d351798270ccf6095a..5db0d4d92fb51d819fc48c6aecc2a1f4c1c45b0b 100644 (file)
@@ -156,37 +156,37 @@ static float drawAtPoint(const UChar* str, const int runLength, const FloatPoint
     return width;
 }
 
-static bool needsBidiLayout(const UChar *characters, unsigned length, WTF::Unicode::Direction& baseDirection, bool oneParagraph = false)
+static bool needsBidiLayout(const UChar *characters, unsigned length, UCharDirection& baseDirection, bool oneParagraph = false)
 {
     bool foundFirstStrong = false;
     bool result = false;
-    baseDirection = WTF::Unicode::LeftToRight;
+    baseDirection = U_LEFT_TO_RIGHT;
     for (unsigned i = 0; i < length;) {
         UChar32 c;
         U16_NEXT(characters, i, length, c);
-        switch (WTF::Unicode::direction(c)) {
-            case WTF::Unicode::RightToLeft:
-            case WTF::Unicode::RightToLeftArabic:
+        switch (UCharDirection(c)) {
+            case U_RIGHT_TO_LEFT:
+            case U_RIGHT_TO_LEFT_ARABIC:
                 if (!foundFirstStrong) {
                     foundFirstStrong = true;
-                    baseDirection = WTF::Unicode::RightToLeft;
+                    baseDirection = U_RIGHT_TO_LEFT;
                 }
                 // Fall through to rest of strongly directional cases
-            case WTF::Unicode::LeftToRightEmbedding:
-            case WTF::Unicode::LeftToRightOverride:
-            case WTF::Unicode::RightToLeftEmbedding:
-            case WTF::Unicode::RightToLeftOverride:
-            case WTF::Unicode::PopDirectionalFormat:
+            case U_LEFT_TO_RIGHT_EMBEDDING:
+            case U_LEFT_TO_RIGHT_OVERRIDE:
+            case U_RIGHT_TO_LEFT_EMBEDDING:
+            case U_RIGHT_TO_LEFT_OVERRIDE:
+            case U_POP_DIRECTIONAL_FORMAT:
                 result = true;
                 if (foundFirstStrong)
                     return result;
                 break;
-            case WTF::Unicode::LeftToRight:
+            case U_LEFT_TO_RIGHT:
                 foundFirstStrong = true;
                 if (result)
                     return result;
                 break;
-            case WTF::Unicode::BlockSeparator:
+            case U_BLOCK_SEPARATOR:
                 if (oneParagraph)
                     return result;
                 break;
@@ -269,7 +269,7 @@ static bool needsBidiLayout(const UChar *characters, unsigned length, WTF::Unico
         renderer.setLetterSpacing(letterSpacing);
 
     String fullString(self);
-    WTF::Unicode::Direction base = WTF::Unicode::LeftToRight;
+    UCharDirection base = U_LEFT_TO_RIGHT;
     bool stringNeedsBidi = needsBidiLayout(fullString.characters(), fullString.length(), base);
     float stringWidth;
     String s = (width >= FLT_MAX && !measureOnly) ? fullString : applyEllipsisStyle(fullString, ellipsisStyle, width, renderer, shouldDisableWordRounding() ? StringTruncator::DisableRoundingHacks : StringTruncator::EnableRoundingHacks, &stringWidth);
@@ -280,7 +280,7 @@ static bool needsBidiLayout(const UChar *characters, unsigned length, WTF::Unico
         context.setEmojiDrawingEnabled(includeEmoji);
 
         if (stringNeedsBidi) {
-            BidiStatus status(base, base, base, BidiContext::create((base == WTF::Unicode::LeftToRight) ? 0 : 1, base, false));
+            BidiStatus status(base, base, base, BidiContext::create((base == U_LEFT_TO_RIGHT) ? 0 : 1, base, false));
             // FIXME: For proper bidi rendering, we need to pass the whole string, rather than the truncated string.
             // Otherwise, weak/neutral characters on either side of the ellipsis may pick up the wrong direction
             // if there are strong characters ellided.
@@ -401,11 +401,11 @@ static bool needsBidiLayout(const UChar *characters, unsigned length, WTF::Unico
 
     BOOL lastLine = NO;
     BOOL finishedLastLine = NO;
-    WTF::Unicode::Direction base;
+    UCharDirection base;
     BOOL paragraphNeedsBidi = needsBidiLayout(buffer, length, base, true);
     BidiStatus status;
     if (paragraphNeedsBidi)
-        status = BidiStatus(base, base, base, BidiContext::create((base == WTF::Unicode::LeftToRight) ? 0 : 1, base, false));
+        status = BidiStatus(base, base, base, BidiContext::create((base == U_LEFT_TO_RIGHT) ? 0 : 1, base, false));
 
     int lengthRemaining = length;
     
@@ -601,7 +601,7 @@ static bool needsBidiLayout(const UChar *characters, unsigned length, WTF::Unico
                 } else {
                     ellipsisResult = applyEllipsisStyle(lastLine, ellipsisStyle, rect.size.width, renderer, shouldDisableWordRounding() ? StringTruncator::DisableRoundingHacks : StringTruncator::EnableRoundingHacks, &lastLineWidth, insertEllipsis, customTruncationElementWidth, forceTruncation);
                     if (truncationRect && (ellipsisResult != lastLine || droppingLines)
-                        && lastLineWidth && base == WTF::Unicode::RightToLeft)
+                        && lastLineWidth && base == U_RIGHT_TO_LEFT)
                         textPoint.x += truncationRect->size.width;
                 }
                 CGContextRef cgContext = WKGetCurrentGraphicsContext();
@@ -619,7 +619,7 @@ static bool needsBidiLayout(const UChar *characters, unsigned length, WTF::Unico
                         *truncationRect = CGRectNull;
                     } else {
                         truncationRect->origin = textPoint;
-                        truncationRect->origin.x += (base == WTF::Unicode::RightToLeft) ? (-truncationRect->size.width) : lineWidth;
+                        truncationRect->origin.x += (base == U_RIGHT_TO_LEFT) ? (-truncationRect->size.width) : lineWidth;
                         truncationRect->origin.y -= ascent;
                         truncationRect->size.height = ascent - GSFontGetDescent(font);
                     }
@@ -656,7 +656,7 @@ static bool needsBidiLayout(const UChar *characters, unsigned length, WTF::Unico
             // Redetermine whether the succeeding paragraph needs bidi layout, and if so, determine the base direction
             paragraphNeedsBidi = needsBidiLayout(startOfLine, lengthRemaining, base, true);
             if (paragraphNeedsBidi)
-                status = BidiStatus(base, base, base, BidiContext::create((base == WTF::Unicode::LeftToRight) ? 0 : 1, base, false));
+                status = BidiStatus(base, base, base, BidiContext::create((base == U_LEFT_TO_RIGHT) ? 0 : 1, base, false));
         }
         maxLineWidth = max(maxLineWidth, lineWidth);
         cursor.y += lineSpacing;
index 29048d5d1789aacfc79c77aeff3dcb5809145aca..0b97078f207b84964c76eb012d146d0cbb82b1df 100644 (file)
@@ -74,7 +74,7 @@ void WebKitInitialize(void)
     
     // This needs to be called before any requests are made in the process, <rdar://problem/9691871>
     WebCore::initializeHTTPConnectionSettingsOnStartup();
-    WebCore::enableKURLSchemeCanonicalization(linkedOnOrAfterIOS5());
+    WebCore::enableURLSchemeCanonicalization(linkedOnOrAfterIOS5());
 }
 
 void WebKitSetIsClassic(BOOL flag)
index d0e4c547efa877e3cccabc4faef43175bf4ff17a..a12f02fd1d2a165e287eb0b95a768ab1e4a5b578 100644 (file)
@@ -48,7 +48,7 @@ public:
 #if ENABLE(TOUCH_EVENTS)
     virtual void didPreventDefaultForEvent() OVERRIDE;
 #endif
-    virtual void didReceiveDocType(WebCore::Frame*) OVERRIDE;
+    virtual void didReceiveMobileDocType() OVERRIDE;
     virtual void setNeedsScrollNotifications(WebCore::Frame*, bool) OVERRIDE;
     virtual void observedContentChange(WebCore::Frame*) OVERRIDE;
     virtual void clearContentChangeObservers(WebCore::Frame*) OVERRIDE;
@@ -85,7 +85,7 @@ public:
     virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const OVERRIDE;
 
     virtual void webAppOrientationsUpdated() OVERRIDE;
-    virtual void focusedNodeChanged(WebCore::Node*) OVERRIDE;
+    virtual void focusedElementChanged(WebCore::Element*) OVERRIDE;
 
 private:
     int m_formNotificationSuppressions;
index 683db47dee230e4ed26efa0490c5421ad5a98610..bff59fa986ad706f9a554f62c8393349f879a138 100644 (file)
@@ -131,9 +131,9 @@ void WebChromeClientIOS::didPreventDefaultForEvent()
 }
 #endif
 
-void WebChromeClientIOS::didReceiveDocType(WebCore::Frame* frame)
+void WebChromeClientIOS::didReceiveMobileDocType()
 {
-    [[webView() _UIKitDelegateForwarder] webView:webView() didReceiveDocTypeForFrame:kit(frame)];
+    [[webView() _UIKitDelegateForwarder] webViewDidReceiveMobileDocType:webView() ];
 }
 
 void WebChromeClientIOS::setNeedsScrollNotifications(WebCore::Frame* frame, bool flag)
@@ -290,18 +290,18 @@ void WebChromeClientIOS::webAppOrientationsUpdated()
     [[webView() _UIDelegateForwarder] webViewSupportedOrientationsUpdated:webView()];
 }
 
-void WebChromeClientIOS::focusedNodeChanged(Node* node)
+void WebChromeClientIOS::focusedElementChanged(Element* element)
 {
-    if (!node)
+    if (!element)
         return;
-    if (!node->hasTagName(HTMLNames::inputTag))
+    if (!isHTMLInputElement(element))
         return;
 
-    HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(node);
+    HTMLInputElement* inputElement = toHTMLInputElement(element);
     if (!inputElement->isText())
         return;
 
-    CallFormDelegate(webView(), @selector(didFocusTextField:inFrame:), kit(inputElement), kit(inputElement->document()->frame()));
+    CallFormDelegate(webView(), @selector(didFocusTextField:inFrame:), kit(inputElement), kit(inputElement->document().frame()));
 }
 
 #endif // PLATFORM(IOS)
index 5dff6f0fe9c1d9f2de4a1e1193a5efb4462d0791..24d1603a8cf6dc292304cd6616a8bf17afa59080 100644 (file)
@@ -98,31 +98,25 @@ using namespace WebCore;
 {
     Frame *frame = [self coreFrame];
     if (frame)
-        frame->selection()->clearCurrentSelection();    
+        frame->selection().clearCurrentSelection();
     
 }
 
 - (WebTextSelectionState)selectionState
 {
-    WebTextSelectionState state;
-    
+    WebTextSelectionState state = WebTextSelectionStateNone;
+
     Frame *frame = [self coreFrame];
-    FrameSelection* frameSelection = frame->selection();
-    
-    if (!frameSelection) {
-        state = WebTextSelectionStateNone;
-    } else if (frameSelection->isCaret()) {
+    FrameSelection& frameSelection = frame->selection();
+
+    if (frameSelection.isCaret())
         state = WebTextSelectionStateCaret;
-    } else if (frameSelection->isRange()) {
+    else if (frameSelection.isRange())
         state = WebTextSelectionStateRange;
-    } else {
-        state = WebTextSelectionStateNone;
-    }
-    
+
     return state;
 }
 
-
 - (BOOL)hasSelection
 {
     WebTextSelectionState state = [self selectionState];
@@ -190,9 +184,9 @@ using namespace WebCore;
 {
     if ([self selectionState] == WebTextSelectionStateRange) {
         Frame *frame = [self coreFrame];
-        FrameSelection* frameSelection = frame->selection();
-        VisiblePosition end(frameSelection->end());
-        frameSelection->moveTo(end);
+        FrameSelection& frameSelection = frame->selection();
+        VisiblePosition end(frameSelection.end());
+        frameSelection.moveTo(end);
     }
 }
 
@@ -200,13 +194,13 @@ using namespace WebCore;
 {
     if ([self selectionState] == WebTextSelectionStateRange) {
         Frame *frame = [self coreFrame];
-        FrameSelection* frameSelection = frame->selection();
+        FrameSelection& frameSelection = frame->selection();
         if (start) {
-            VisiblePosition start = startOfWord(frameSelection->start());
-            frameSelection->moveTo(start, frameSelection->end());
+            VisiblePosition start = startOfWord(frameSelection.start());
+            frameSelection.moveTo(start, frameSelection.end());
         } else {
-            VisiblePosition end = endOfWord(frameSelection->end());
-            frameSelection->moveTo(frameSelection->start(), end);
+            VisiblePosition end = endOfWord(frameSelection.end());
+            frameSelection.moveTo(frameSelection.start(), end);
         }
     }    
 }
@@ -250,7 +244,7 @@ using namespace WebCore;
         return nil;
 
     Frame *frame = [self coreFrame];
-    Range *range = frame->selection()->toNormalizedRange().get();
+    Range *range = frame->selection().toNormalizedRange().get();
     return [self selectionRectsForCoreRange:range];
 }
 
@@ -307,7 +301,7 @@ using namespace WebCore;
 - (void)setRangedSelectionWithExtentPoint:(CGPoint)point
 {    
     Frame *frame = [self coreFrame];
-    FrameSelection* frameSelection = frame->selection();
+    FrameSelection& frameSelection = frame->selection();
     VisiblePosition pos = [self visiblePositionForPoint:point];
     VisibleSelection base = frame->rangedSelectionBase();
     
@@ -318,13 +312,13 @@ using namespace WebCore;
     VisiblePosition end(base.end());    
     
     if (pos < start) {        
-        frameSelection->moveTo(pos, end);
+        frameSelection.moveTo(pos, end);
     } 
     else if (pos > end) {
-        frameSelection->moveTo(start, pos);
+        frameSelection.moveTo(start, pos);
     } 
     else {
-        frameSelection->moveTo(start, end);
+        frameSelection.moveTo(start, end);
     }
 }
 
@@ -347,7 +341,7 @@ using namespace WebCore;
     VisiblePosition extent([self visiblePositionForPoint:extentPoint]);
     
     if (rangedSelectionBase.isRange() && baseStart < extent && extent < baseEnd) {
-        frame->selection()->moveTo(baseStart, baseEnd);
+        frame->selection().moveTo(baseStart, baseEnd);
         return NO;
     }    
     
@@ -411,7 +405,7 @@ using namespace WebCore;
             extent = base.previous();
     }
     
-    frame->selection()->moveTo(base, extent);
+    frame->selection().moveTo(base, extent);
 
     return didFlipStartEnd ? !baseIsStart : baseIsStart;
 }
@@ -427,7 +421,7 @@ using namespace WebCore;
     // least as long as a single, logical selection session continues).
 
     Frame *frame = [self coreFrame];
-    FrameSelection* frameSelection = frame->selection();
+    FrameSelection& frameSelection = frame->selection();
     VisiblePosition base([self visiblePositionForPoint:basePoint]);
     VisiblePosition extent([self visiblePositionForPoint:extentPoint]);
 
@@ -454,7 +448,7 @@ using namespace WebCore;
             extent = base.previous();
     }
 
-    frameSelection->moveTo(base, extent);
+    frameSelection.moveTo(base, extent);
 
     return didFlipStartEnd ? !baseIsStart : baseIsStart;
 }
@@ -471,8 +465,8 @@ using namespace WebCore;
     VisiblePosition first([self visiblePositionForPoint:firstPoint]);
     VisiblePosition second([self visiblePositionForPoint:secondPoint]);
     Frame *frame = [self coreFrame];
-    FrameSelection* frameSelection = frame->selection();
-    frameSelection->moveTo(first, second);
+    FrameSelection& frameSelection = frame->selection();
+    frameSelection.moveTo(first, second);
 }
 
 - (void)ensureRangedSelectionContainsInitialStartPoint:(CGPoint)initialStartPoint initialEndPoint:(CGPoint)initialEndPoint
@@ -481,47 +475,47 @@ using namespace WebCore;
     // longer contains these points. This is the desirable behavior when the
     // user does the tap-and-a-half + drag operation.
     Frame *frame = [self coreFrame];
-    FrameSelection* frameSelection = frame->selection();
+    FrameSelection& frameSelection = frame->selection();
     Position ensureStart([self visiblePositionForPoint:initialStartPoint].deepEquivalent());
     Position ensureEnd([self visiblePositionForPoint:initialEndPoint].deepEquivalent());
-    if (frameSelection->start() > ensureStart) {
-        frameSelection->moveTo(ensureStart, frameSelection->end());
+    if (frameSelection.start() > ensureStart) {
+        frameSelection.moveTo(ensureStart, frameSelection.end());
     }
-    else if (frameSelection->end() < ensureEnd) {
-        frameSelection->moveTo(frameSelection->start(), ensureEnd);
+    else if (frameSelection.end() < ensureEnd) {
+        frameSelection.moveTo(frameSelection.start(), ensureEnd);
     }
 }
 
 - (void)aggressivelyExpandSelectionToWordContainingCaretSelection
 {
     Frame *frame = [self coreFrame];
-    FrameSelection* frameSelection = frame->selection();
-    VisiblePosition end(frameSelection->end());
+    FrameSelection& frameSelection = frame->selection();
+    VisiblePosition end(frameSelection.end());
     if (end == endOfDocument(end) && end != startOfDocument(end) && end == startOfLine(end)) {
-        frameSelection->moveTo(end.previous(), end);
+        frameSelection.moveTo(end.previous(), end);
     }
 
     [self expandSelectionToWordContainingCaretSelection];
 
     // This is a temporary hack until we get the improvements
     // I'm working on for RTL selection.
-    if (frameSelection->granularity() == WordGranularity) {
-        frameSelection->moveTo(frameSelection->start(), frameSelection->end());
+    if (frameSelection.granularity() == WordGranularity) {
+        frameSelection.moveTo(frameSelection.start(), frameSelection.end());
     }
     
-    if (frameSelection->isCaret()) {
-        VisiblePosition pos(frameSelection->end());
+    if (frameSelection.isCaret()) {
+        VisiblePosition pos(frameSelection.end());
         if (isStartOfLine(pos) && isEndOfLine(pos)) {
             VisiblePosition next(pos.next());
             if (next.isNotNull()) {
-                frameSelection->moveTo(end, next);
+                frameSelection.moveTo(end, next);
             }
         }
         else {
             while (pos.isNotNull()) {
                 VisiblePosition wordStart(startOfWord(pos));
                 if (wordStart != pos) {
-                    frameSelection->moveTo(wordStart, frameSelection->end());
+                    frameSelection.moveTo(wordStart, frameSelection.end());
                     break;
                 }
                 pos = pos.previous();
@@ -533,11 +527,11 @@ using namespace WebCore;
 - (void)expandSelectionToSentence
 {
     Frame *frame = [self coreFrame];
-    FrameSelection* frameSelection = frame->selection();
-    VisiblePosition pos = frameSelection->start();
+    FrameSelection& frameSelection = frame->selection();
+    VisiblePosition pos = frameSelection.start();
     VisiblePosition start = startOfSentence(pos);
     VisiblePosition end = endOfSentence(pos);
-    frameSelection->moveTo(start, end);    
+    frameSelection.moveTo(start, end);    
 }
 
 - (WKWritingDirection)selectionBaseWritingDirection
@@ -581,7 +575,7 @@ using namespace WebCore;
     WKWritingDirection originalDirection = [self selectionBaseWritingDirection];
 
     Frame *frame = [self coreFrame];
-    if (!frame->selection()->isContentEditable())
+    if (!frame->selection().isContentEditable())
         return;
     
     WritingDirection wcDirection = LeftToRightWritingDirection;
@@ -608,25 +602,25 @@ using namespace WebCore;
 - (void)moveSelectionToStart
 {
     Frame *frame = [self coreFrame];
-    FrameSelection* frameSelection = frame->selection();
-    VisiblePosition start = startOfDocument(frameSelection->selection().start());
-    frameSelection->moveTo(start);
+    FrameSelection& frameSelection = frame->selection();
+    VisiblePosition start = startOfDocument(frameSelection.selection().start());
+    frameSelection.moveTo(start);
 }
 
 - (void)moveSelectionToEnd
 {
     Frame *frame = [self coreFrame];
-    FrameSelection* frameSelection = frame->selection();
-    VisiblePosition end =  endOfDocument(frameSelection->selection().end());
-    frameSelection->moveTo(end);
+    FrameSelection& frameSelection = frame->selection();
+    VisiblePosition end =  endOfDocument(frameSelection.selection().end());
+    frameSelection.moveTo(end);
 }
 
 - (void)moveSelectionToPoint:(CGPoint)point
 {
     Frame *frame = [self coreFrame];
-    FrameSelection* frameSelection = frame->selection();
+    FrameSelection& frameSelection = frame->selection();
     VisiblePosition pos = [self _visiblePositionForPoint:point];
-    frameSelection->moveTo(pos);
+    frameSelection.moveTo(pos);
 }
 
 - (void)setSelectionGranularity:(WebTextGranularity)granularity
@@ -653,8 +647,8 @@ using namespace WebCore;
             ASSERT_NOT_REACHED();
             break;
     }
-    FrameSelection* frameSelection = _private->coreFrame->selection();
-    frameSelection->setSelection(frameSelection->selection(), wcGranularity);
+    FrameSelection& frameSelection = _private->coreFrame->selection();
+    frameSelection.setSelection(frameSelection.selection(), wcGranularity);
 }
 
 static inline bool isAlphaNumericCharacter(UChar32 c)
@@ -777,17 +771,17 @@ static VisiblePosition SimpleSmartExtendEnd(const VisiblePosition& start, const
         return;
     
     Frame *frame = [self coreFrame];
-    FrameSelection* frameSelection = frame->selection();
-    EAffinity affinity = frameSelection->selection().affinity();
-    VisiblePosition start(frameSelection->start(), affinity);
-    VisiblePosition end(frameSelection->end(), affinity);
+    FrameSelection& frameSelection = frame->selection();
+    EAffinity affinity = frameSelection.selection().affinity();
+    VisiblePosition start(frameSelection.start(), affinity);
+    VisiblePosition end(frameSelection.end(), affinity);
     VisiblePosition base(frame->rangedSelectionBase().base());  // should equal start or end
 
     // Base must equal start or end
     if (base != start && base != end)
         return;
 
-    VisiblePosition extent(frameSelection->selection().extent(), affinity);
+    VisiblePosition extent(frameSelection.selection().extent(), affinity);
     
     // We don't yet support smart extension for languages which
     // require context for word boundary.
@@ -812,7 +806,7 @@ static VisiblePosition SimpleSmartExtendEnd(const VisiblePosition& start, const
     }
 
     if (smartExtent.isNotNull() && smartExtent != extent)
-        frameSelection->moveTo(base, smartExtent);
+        frameSelection.moveTo(base, smartExtent);
 
 }
 
@@ -857,10 +851,8 @@ static VisiblePosition SimpleSmartExtendEnd(const VisiblePosition& start, const
     if (currentVisiblePosition.isNull())
         return position;
     
-    Document* document = currentVisiblePosition.deepEquivalent().anchorNode()->document();
-    if (!document)
-        return position;
-    
+    Document& document = currentVisiblePosition.deepEquivalent().anchorNode()->document();
+
     id uikitDelegate = [[self webView] _UIKitDelegate];
     if (![uikitDelegate respondsToSelector:@selector(isUnperturbedDictationResultMarker:)])
         return position;
@@ -880,7 +872,7 @@ static VisiblePosition SimpleSmartExtendEnd(const VisiblePosition& start, const
         
         RefPtr<Range> graphemeRange = Range::create(document, previousVisiblePosition.deepEquivalent(), currentVisiblePosition.deepEquivalent());
         
-        Vector<DocumentMarker*> markers = document->markers()->markersInRange(graphemeRange.get(), DocumentMarker::DictationResult);
+        Vector<DocumentMarker*> markers = document.markers().markersInRange(graphemeRange.get(), DocumentMarker::DictationResult);
         if (markers.isEmpty())
             return currentWebVisiblePosition;
         
@@ -915,9 +907,7 @@ static VisiblePosition SimpleSmartExtendEnd(const VisiblePosition& start, const
     if (currentVisiblePosition.isNull())
         return position;
     
-    Document* document = currentVisiblePosition.deepEquivalent().anchorNode()->document();
-    if (!document)
-        return position;
+    Document& document = currentVisiblePosition.deepEquivalent().anchorNode()->document();
     
     id uikitDelegate = [[self webView] _UIKitDelegate];
     if (![uikitDelegate respondsToSelector:@selector(isUnperturbedDictationResultMarker:)])
@@ -938,7 +928,7 @@ static VisiblePosition SimpleSmartExtendEnd(const VisiblePosition& start, const
         
         RefPtr<Range> graphemeRange = Range::create(document, currentVisiblePosition.deepEquivalent(), nextVisiblePosition.deepEquivalent());
         
-        Vector<DocumentMarker*> markers = document->markers()->markersInRange(graphemeRange.get(), DocumentMarker::DictationResult);
+        Vector<DocumentMarker*> markers = document.markers().markersInRange(graphemeRange.get(), DocumentMarker::DictationResult);
         if (markers.isEmpty())
             return currentWebVisiblePosition;
         
index ca75d1f769f006fc0a259d589ca50193ea732c1d..0d34ddd07a1d9f59d6e3dfadba835bb75e9cb019 100644 (file)
@@ -32,7 +32,6 @@
 
 #import "WebFrameInternal.h"
 #import "WebInspector.h"
-#import "WebNSNotificationCenterExtras.h"
 #import "WebNodeHighlighter.h"
 #import "WebViewInternal.h"
 #import <WebCore/InspectorController.h>
@@ -46,7 +45,7 @@ using namespace WebCore;
 
 WebInspectorClient::WebInspectorClient(WebView *webView)
     : m_webView(webView)
-    , m_highlighter(AdoptNS, [[WebNodeHighlighter alloc] initWithInspectedWebView:webView])
+    , m_highlighter(adoptNS([[WebNodeHighlighter alloc] initWithInspectedWebView:webView]))
     , m_frontendPage(0)
     , m_frontendClient(0)
 {
@@ -92,14 +91,12 @@ void WebInspectorClient::hideHighlight()
 void WebInspectorClient::didSetSearchingForNode(bool enabled)
 {
     WebInspector *inspector = [m_webView inspector];
-
-    if (enabled)
-        [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:WebInspectorDidStartSearchingForNode object:inspector];
-    else
-        [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:WebInspectorDidStopSearchingForNode object:inspector];
+    NSString *notificationName = enabled ? WebInspectorDidStartSearchingForNode : WebInspectorDidStopSearchingForNode;
+    dispatch_async(dispatch_get_main_queue(), ^{
+        [[NSNotificationCenter defaultCenter] postNotificationName:notificationName object:inspector];
+    });
 }
 
-
 #pragma mark -
 #pragma mark WebInspectorFrontendClient Implementation
 
@@ -123,7 +120,6 @@ void WebInspectorFrontendClient::setAttachedWindowWidth(unsigned) { }
 void WebInspectorFrontendClient::setToolbarHeight(unsigned) { }
 void WebInspectorFrontendClient::inspectedURLChanged(const String&) { }
 void WebInspectorFrontendClient::updateWindowTitle() const { }
-void WebInspectorFrontendClient::save(const String&, const String&, bool) { }
 void WebInspectorFrontendClient::append(const String&, const String&) { }
 
 #endif // PLATFORM(IOS)
index e8482db795d6cad3a5d81b2f304ab428d99730e3..c5d7b4e61b1f4159498fb251ae2e9c7a01585e8d 100644 (file)
@@ -418,19 +418,14 @@ static inline SelectionDirection toSelectionDirection(WebTextAdjustmentDirection
     unsigned offset = o;
     
     Node* node = p.deepEquivalent().anchorNode();
-    Document* document = node->document();
-    if (!document)
-        return nil;
+    Document& document = node->document();
     
-    const Vector<DocumentMarker*>& markers = document->markers()->markersFor(node);
+    const Vector<DocumentMarker*>& markers = document.markers().markersFor(node, DocumentMarker::MarkerTypes(DocumentMarker::DictationPhraseWithAlternatives));
     if (markers.isEmpty())
         return nil;
         
     for (size_t i = 0; i < markers.size(); i++) {
         const DocumentMarker* marker = markers[i];
-        if (marker->type() != DocumentMarker::DictationPhraseWithAlternatives)
-            continue;
-            
         if (marker->startOffset() <= offset && marker->endOffset() >= offset) {
             const Vector<String>& markerAlternatives = marker->alternatives();
             *alternatives = [NSMutableArray arrayWithCapacity:markerAlternatives.size()];
@@ -457,21 +452,16 @@ static inline SelectionDirection toSelectionDirection(WebTextAdjustmentDirection
     unsigned offset = o;
     
     Node* node = p.deepEquivalent().anchorNode();
-    Document* document = node->document();
-    if (!document)
-        return nil;
+    Document& document = node->document();
     
-    const Vector<DocumentMarker>& markers = document->markers()->markersForNode(node);
+    const Vector<DocumentMarker*>& markers = document.markers().markersFor(node, DocumentMarker::MarkerTypes(DocumentMarker::Spelling));
     if (markers.isEmpty())
         return nil;
     
     for (size_t i = 0; i < markers.size(); i++) {
-        const DocumentMarker& marker = markers[i];
-        if (marker.type() != DocumentMarker::Spelling)
-            continue;
-        
-        if (marker.startOffset() <= offset && marker.endOffset() >= offset) {
-            RefPtr<Range> range = Range::create(document, node, marker.startOffset(), node, marker.endOffset());
+        const DocumentMarker* marker = markers[i];
+        if (marker->startOffset() <= offset && marker->endOffset() >= offset) {
+            RefPtr<Range> range = Range::create(document, node, marker->startOffset(), node, marker->endOffset());
             return kit(range.get());
         }
     }
@@ -587,7 +577,7 @@ static inline SelectionDirection toSelectionDirection(WebTextAdjustmentDirection
         return [super startPosition];
     
     RenderTextControl *textControl = toRenderTextControl(object);
-    VisiblePosition visiblePosition = textControl->visiblePositionForIndex(0);
+    VisiblePosition visiblePosition = textControl->textFormControlElement().visiblePositionForIndex(0);
     return [WebVisiblePosition _wrapVisiblePosition:visiblePosition];
 }
 
@@ -599,7 +589,7 @@ static inline SelectionDirection toSelectionDirection(WebTextAdjustmentDirection
         return [super endPosition];
     
     RenderTextControl *textControl = toRenderTextControl(object);
-    VisiblePosition visiblePosition = textControl->visiblePositionForIndex(textControl->textFormControlElement()->value().length());
+    VisiblePosition visiblePosition = textControl->textFormControlElement().visiblePositionForIndex(textControl->textFormControlElement().value().length());
     return [WebVisiblePosition _wrapVisiblePosition:visiblePosition];
 }
 
@@ -615,7 +605,7 @@ static inline SelectionDirection toSelectionDirection(WebTextAdjustmentDirection
         return [super startPosition];
     
     RenderTextControl *textControl = toRenderTextControl(object);
-    VisiblePosition visiblePosition = textControl->visiblePositionForIndex(0);
+    VisiblePosition visiblePosition = textControl->textFormControlElement().visiblePositionForIndex(0);
     return [WebVisiblePosition _wrapVisiblePosition:visiblePosition];
 }
 
@@ -627,7 +617,7 @@ static inline SelectionDirection toSelectionDirection(WebTextAdjustmentDirection
         return [super endPosition];
     
     RenderTextControl *textControl = toRenderTextControl(object);
-    VisiblePosition visiblePosition = textControl->visiblePositionForIndex(textControl->textFormControlElement()->value().length());
+    VisiblePosition visiblePosition = textControl->textFormControlElement().visiblePositionForIndex(textControl->textFormControlElement().value().length());
     return [WebVisiblePosition _wrapVisiblePosition:visiblePosition];
 }
 
index 55c5ef52a898364c4b55f8fe97f30be848cecef2..e86156a369e5256f9bfbcdadd2ce4958bfc05386 100644 (file)
@@ -73,14 +73,14 @@ static const float PAGE_HEIGHT_INSET    = 4.0 * 2.0;
 
 + (CGColorRef)shadowColor
 {
-    DEFINE_STATIC_LOCAL(RetainPtr<CGColorRef>, shadowColor, (AdoptCF, createCGColorWithDeviceWhite(0.0, 2.0 / 3.0)));
-    return shadowColor.get();
+    static CGColorRef shadowColor = createCGColorWithDeviceWhite(0, 2.0 / 3);
+    return shadowColor;
 }
 
 + (CGColorRef)backgroundColor
 {
-    DEFINE_STATIC_LOCAL(RetainPtr<CGColorRef>, backgroundColor, (AdoptCF, createCGColorWithDeviceWhite(204.0 / 255.0, 1.0)));
-    return backgroundColor.get();
+    static CGColorRef backgroundColor = createCGColorWithDeviceWhite(204.0 / 255, 1);
+    return backgroundColor;
 }
 
 // This is a secret protocol for WebDataSource and WebFrameView to offer us the opportunity to do something different 
@@ -289,7 +289,7 @@ static const float PAGE_HEIGHT_INSET    = 4.0 * 2.0;
     if ([title length]) {
         [_title release];
         _title = [title copy];
-        core([self _frame])->loader()->client()->dispatchDidReceiveTitle(StringWithDirection(title, LTR));
+        core([self _frame])->loader().client().dispatchDidReceiveTitle(StringWithDirection(title, LTR));
     }
 }
 
index 07673fce9800f72709abbeafea599d69448659c2..a7c74f4e6143ce05dcc9c8d5f94d2c7c7a1908dc 100644 (file)
@@ -48,6 +48,7 @@
 #import <WebKit/WebNSViewExtras.h>
 #import <WebKit/WebPDFDocumentExtras.h>
 #import <WebKit/WebViewPrivate.h>
+#import <wtf/CurrentTime.h>
 #import <wtf/Vector.h>
 
 using namespace WebCore;
@@ -487,11 +488,11 @@ static const float PAGE_HEIGHT_INSET = 4.0f * 2.0f;
         return;
 
     // Construct an event to simulate a click.
-    RefPtr<Event> event = MouseEvent::create(eventNames().clickEvent, true, true, 0, 1, 0, 0, 0, 0, false, false, false, false, 0, 0, 0, true);
+    RefPtr<Event> event = MouseEvent::create(eventNames().clickEvent, true, true, currentTime(), 0, 1, 0, 0, 0, 0, false, false, false, false, 0, 0, 0, true);
 
     // Call to the frame loader because this is where our security checks are made.
     Frame* frame = core([_dataSource webFrame]);
-    frame->loader()->loadFrameRequest(FrameLoadRequest(frame->document()->securityOrigin(), ResourceRequest(URL)), false, false, event.get(), 0, MaybeSendReferrer);
+    frame->loader().loadFrameRequest(FrameLoadRequest(frame->document()->securityOrigin(), ResourceRequest(URL)), false, false, event.get(), 0, MaybeSendReferrer);
 }
 
 @end
index 06acf34b5f0259e332ec72a3c36b9786d39c156d..ddd6586bd0f2bafc9ca2f3e7387eeafd1c5d6d98 100644 (file)
@@ -46,7 +46,7 @@
 - (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame;
 - (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
 - (void)webView:(WebView *)sender didChangeLocationWithinPageForFrame:(WebFrame *)frame;
-- (void)webView:(WebView *)webView didReceiveDocTypeForFrame:(WebFrame *)frame;
+- (void)webViewDidReceiveMobileDocType:(WebView *)webView;
 - (void)webView:(WebView *)aWebView didReceiveViewportArguments:(NSDictionary *)arguments;
 - (void)webView:(WebView *)aWebView needsScrollNotifications:(NSNumber *)aNumber forFrame:(WebFrame *)aFrame;
 - (void)webView:(WebView *)webView saveStateToHistoryItem:(WebHistoryItem *)item forFrame:(WebFrame *)frame;