Title: [177502] trunk/Source/WebKit2
Revision
177502
Author
[email protected]
Date
2014-12-18 10:23:18 -0800 (Thu, 18 Dec 2014)

Log Message

Attempt to fix the iOS build after <http://trac.webkit.org/changeset/177486>
(https://bugs.webkit.org/show_bug.cgi?id=139755)

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::selectWithGesture): Wrap return value of Range::create() in RefPtr<Range>()
to make the the compiler happy since it wants clauses of the ternary operator to have the same data type
and Ref<Range> object does not support nullptr.
(WebKit::WebPage::selectWordBackward): Substitute Ref::ptr() for PassRefPtr::get().
(WebKit::WebPage::moveSelectionByOffset): Ditto.
(WebKit::WebPage::selectPositionAtPoint): Ditto.
(WebKit::WebPage::selectPositionAtBoundaryWithDirection): Ditto.
(WebKit::WebPage::requestDictationContext): Ditto.
(WebKit::computeAutocorrectionContext): Ditto.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (177501 => 177502)


--- trunk/Source/WebKit2/ChangeLog	2014-12-18 17:44:18 UTC (rev 177501)
+++ trunk/Source/WebKit2/ChangeLog	2014-12-18 18:23:18 UTC (rev 177502)
@@ -1,3 +1,19 @@
+2014-12-18  Daniel Bates  <[email protected]>
+
+        Attempt to fix the iOS build after <http://trac.webkit.org/changeset/177486>
+        (https://bugs.webkit.org/show_bug.cgi?id=139755)
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::selectWithGesture): Wrap return value of Range::create() in RefPtr<Range>()
+        to make the the compiler happy since it wants clauses of the ternary operator to have the same data type
+        and Ref<Range> object does not support nullptr.
+        (WebKit::WebPage::selectWordBackward): Substitute Ref::ptr() for PassRefPtr::get().
+        (WebKit::WebPage::moveSelectionByOffset): Ditto.
+        (WebKit::WebPage::selectPositionAtPoint): Ditto.
+        (WebKit::WebPage::selectPositionAtBoundaryWithDirection): Ditto.
+        (WebKit::WebPage::requestDictationContext): Ditto.
+        (WebKit::computeAutocorrectionContext): Ditto.
+
 2014-12-18  Antti Koivisto  <[email protected]>
 
         Remove alwaysUseBaselineOfPrimaryFont setting

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (177501 => 177502)


--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-12-18 17:44:18 UTC (rev 177501)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-12-18 18:23:18 UTC (rev 177502)
@@ -889,7 +889,7 @@
         switch (wkGestureState) {
         case GestureRecognizerState::Began:
             range = wordRangeFromPosition(position);
-            m_currentWordRange = range ? Range::create(*frame.document(), range->startPosition(), range->endPosition()) : nullptr;
+            m_currentWordRange = range ? RefPtr<Range>(Range::create(*frame.document(), range->startPosition(), range->endPosition())) : nullptr;
             break;
         case GestureRecognizerState::Changed:
             if (!m_currentWordRange)
@@ -1533,7 +1533,7 @@
     VisiblePosition position = frame.selection().selection().start();
     VisiblePosition startPosition = positionOfNextBoundaryOfGranularity(position, WordGranularity, DirectionBackward);
     if (startPosition.isNotNull() && startPosition != position)
-        frame.selection().setSelectedRange(Range::create(*frame.document(), startPosition, position).get(), position.affinity(), true);
+        frame.selection().setSelectedRange(Range::create(*frame.document(), startPosition, position).ptr(), position.affinity(), true);
 }
 
 void WebPage::moveSelectionByOffset(int32_t offset, uint64_t callbackID)
@@ -1551,7 +1551,7 @@
             break;
     }
     if (position.isNotNull() && startPosition != position)
-        frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).get(), position.affinity(), true);
+        frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).ptr(), position.affinity(), true);
     send(Messages::WebPageProxy::VoidCallback(callbackID));
 }
 
@@ -1568,7 +1568,7 @@
     VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point);
     
     if (position.isNotNull())
-        frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).get(), position.affinity(), true);
+        frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).ptr(), position.affinity(), true);
     send(Messages::WebPageProxy::VoidCallback(callbackID));
 }
 
@@ -1580,7 +1580,7 @@
     if (position.isNotNull()) {
         position = positionOfNextBoundaryOfGranularity(position, static_cast<WebCore::TextGranularity>(granularity), static_cast<SelectionDirection>(direction));
         if (position.isNotNull())
-            frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).get(), UPSTREAM, true);
+            frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).ptr(), UPSTREAM, true);
     }
     send(Messages::WebPageProxy::VoidCallback(callbackID));
 }
@@ -1691,7 +1691,7 @@
             lastPosition = currentPosition;
         }
         if (lastPosition.isNotNull() && lastPosition != startPosition)
-            contextBefore = plainTextReplacingNoBreakSpace(Range::create(*frame.document(), lastPosition, startPosition).get());
+            contextBefore = plainTextReplacingNoBreakSpace(Range::create(*frame.document(), lastPosition, startPosition).ptr());
     }
 
     String contextAfter;
@@ -1705,7 +1705,7 @@
             lastPosition = currentPosition;
         }
         if (lastPosition.isNotNull() && lastPosition != endPosition)
-            contextAfter = plainTextReplacingNoBreakSpace(Range::create(*frame.document(), endPosition, lastPosition).get());
+            contextAfter = plainTextReplacingNoBreakSpace(Range::create(*frame.document(), endPosition, lastPosition).ptr());
     }
 
     send(Messages::WebPageProxy::DictationContextCallback(selectedText, contextBefore, contextAfter, callbackID));
@@ -1905,14 +1905,14 @@
                 previousPosition = startOfWord(positionOfNextBoundaryOfGranularity(currentPosition, WordGranularity, DirectionBackward));
                 if (previousPosition.isNull())
                     break;
-                String currentWord = plainTextReplacingNoBreakSpace(Range::create(*frame.document(), previousPosition, currentPosition).get());
+                String currentWord = plainTextReplacingNoBreakSpace(Range::create(*frame.document(), previousPosition, currentPosition).ptr());
                 totalContextLength += currentWord.length();
                 if (totalContextLength >= maxContextLength)
                     break;
                 currentPosition = previousPosition;
             }
             if (currentPosition.isNotNull() && currentPosition != startPosition) {
-                contextBefore = plainTextReplacingNoBreakSpace(Range::create(*frame.document(), currentPosition, startPosition).get());
+                contextBefore = plainTextReplacingNoBreakSpace(Range::create(*frame.document(), currentPosition, startPosition).ptr());
                 if (atBoundaryOfGranularity(currentPosition, ParagraphGranularity, DirectionBackward))
                     contextBefore = ASCIILiteral("\n ") + contextBefore;
             }
@@ -1923,7 +1923,7 @@
             if (!atBoundaryOfGranularity(endPosition, WordGranularity, DirectionForward) && withinTextUnitOfGranularity(endPosition, WordGranularity, DirectionForward))
                 nextPosition = positionOfNextBoundaryOfGranularity(endPosition, WordGranularity, DirectionForward);
             if (nextPosition.isNotNull())
-                contextAfter = plainTextReplacingNoBreakSpace(Range::create(*frame.document(), endPosition, nextPosition).get());
+                contextAfter = plainTextReplacingNoBreakSpace(Range::create(*frame.document(), endPosition, nextPosition).ptr());
         }
     }
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to