Skip to content
Permalink
Browse files
[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:

Canonical link: https://commits.webkit.org/143333@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160106 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
aestes committed Dec 4, 2013
1 parent 876b997 commit fecc91746f5658ca9446179a60a83163ffd16d3f
Showing 12 changed files with 182 additions and 145 deletions.
@@ -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
@@ -139,7 +139,7 @@ - (void)webViewDidRestoreFromPageCache:(WebView *)webView
{
}

- (void)webView:(WebView *)webView didReceiveDocTypeForFrame:(WebFrame *)frame
- (void)webViewDidReceiveMobileDocType:(WebView *)webView
{

}
@@ -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 @@ - (CGSize)__web_drawAtPoint:(CGPoint)point
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 @@ - (CGSize)__web_drawAtPoint:(CGPoint)point
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 @@ - (CGSize)__web_drawInRect:(CGRect)rect

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 @@ - (CGSize)__web_drawInRect:(CGRect)rect
} 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 @@ - (CGSize)__web_drawInRect:(CGRect)rect
*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 @@ - (CGSize)__web_drawInRect:(CGRect)rect
// 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;
@@ -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)
@@ -48,7 +48,7 @@ class WebChromeClientIOS : public WebChromeClient {
#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 @@ class WebChromeClientIOS : public WebChromeClient {
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;
@@ -131,9 +131,9 @@
}
#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 @@
[[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)

0 comments on commit fecc917

Please sign in to comment.