Commit 04f92d1b authored by dbates@webkit.org's avatar dbates@webkit.org

[iOS] WebCore fails to build with newer versions of clang

https://bugs.webkit.org/show_bug.cgi?id=122161

Reviewed by Darin Adler.

* editing/FrameSelection.cpp: Add ENABLE(TEXT_CARET)-guard around shouldStopBlinkingDueToTypingCommand().
* page/EventHandler.cpp: Add !PLATFORM(IOS)-guard around constants cursorUpdateInterval and maximumCursorSize;
also add touch event/gesture event guard around shouldGesturesTriggerActive().
* platform/network/cf/ResourceResponseCFNet.cpp: Remove unused function filenameHasSaneExtension.
* platform/network/mac/ResourceResponseMac.mm: Only define static variables commonHeaderFields when building
without CFNetwork; also remove variable numCommonHeaderFields, instead use WTF_ARRAY_LENGTH(commonHeaderFields)
to compute the size of the fixed-sized array commonHeaderFields.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d318100a
2013-10-01 Daniel Bates <dabates@apple.com>
[iOS] WebCore fails to build with newer versions of clang
https://bugs.webkit.org/show_bug.cgi?id=122161
Reviewed by Darin Adler.
* editing/FrameSelection.cpp: Add ENABLE(TEXT_CARET)-guard around shouldStopBlinkingDueToTypingCommand().
* page/EventHandler.cpp: Add !PLATFORM(IOS)-guard around constants cursorUpdateInterval and maximumCursorSize;
also add touch event/gesture event guard around shouldGesturesTriggerActive().
* platform/network/cf/ResourceResponseCFNet.cpp: Remove unused function filenameHasSaneExtension.
* platform/network/mac/ResourceResponseMac.mm: Only define static variables commonHeaderFields when building
without CFNetwork; also remove variable numCommonHeaderFields, instead use WTF_ARRAY_LENGTH(commonHeaderFields)
to compute the size of the fixed-sized array commonHeaderFields.
2013-10-01 Brendan Long <b.long@cablelabs.com>
[GStreamer] Support "chapter" text tracks
......@@ -1746,10 +1746,12 @@ bool FrameSelection::isFocusedAndActive() const
return m_focused && m_frame->page() && m_frame->page()->focusController().isActive();
}
#if ENABLE(TEXT_CARET)
inline static bool shouldStopBlinkingDueToTypingCommand(Frame* frame)
{
return frame->editor().lastEditCommand() && frame->editor().lastEditCommand()->shouldStopCaretBlinking();
}
#endif
void FrameSelection::updateAppearance()
{
......
......@@ -146,11 +146,14 @@ const double fakeMouseMoveDurationThreshold = 0.01;
const double fakeMouseMoveShortInterval = 0.1;
const double fakeMouseMoveLongInterval = 0.25;
#if !PLATFORM(IOS)
// The amount of time to wait for a cursor update on style and layout changes
// Set to 50Hz, no need to be faster than common screen refresh rate
const double cursorUpdateInterval = 0.02;
const int maximumCursorSize = 128;
#endif
#if ENABLE(MOUSE_CURSOR_SCALE)
// It's pretty unlikely that a scale of less than one would ever be used. But all we really
// need to ensure here is that the scale isn't so small that integer overflow can occur when
......@@ -283,6 +286,7 @@ static inline bool scrollNode(float delta, ScrollGranularity granularity, Scroll
return enclosingBox->scroll(delta < 0 ? negativeDirection : positiveDirection, granularity, absDelta, stopElement);
}
#if (ENABLE(TOUCH_EVENTS) && !PLATFORM(IOS)) || ENABLE(GESTURE_EVENTS)
static inline bool shouldGesturesTriggerActive()
{
// If the platform we're on supports GestureTapDown and GestureTapCancel then we'll
......@@ -290,6 +294,7 @@ static inline bool shouldGesturesTriggerActive()
// know in advance what event types are supported.
return false;
}
#endif
#if !PLATFORM(MAC)
......
......@@ -60,15 +60,6 @@ CFURLResponseRef ResourceResponse::cfURLResponse() const
return m_cfResponse.get();
}
static inline bool filenameHasSaneExtension(const String& filename)
{
int dot = filename.find('.');
// The dot can't be the first or last character in the filename.
int length = filename.length();
return dot > 0 && dot < length - 1;
}
void ResourceResponse::platformLazyInit(InitLevel initLevel)
{
if (m_initLevel > initLevel)
......
......@@ -45,11 +45,6 @@ using namespace std;
namespace WebCore {
static NSString* const commonHeaderFields[] = {
@"Age", @"Cache-Control", @"Content-Type", @"Date", @"Etag", @"Expires", @"Last-Modified", @"Pragma"
};
static const int numCommonHeaderFields = sizeof(commonHeaderFields) / sizeof(AtomicString*);
void ResourceResponse::initNSURLResponse() const
{
// Work around a mistake in the NSURLResponse class - <rdar://problem/6875219>.
......@@ -96,6 +91,10 @@ ResourceResponse::ResourceResponse(NSURLResponse* nsResponse)
#else
static NSString* const commonHeaderFields[] = {
@"Age", @"Cache-Control", @"Content-Type", @"Date", @"Etag", @"Expires", @"Last-Modified", @"Pragma"
};
NSURLResponse *ResourceResponse::nsURLResponse() const
{
if (!m_nsResponse && !m_isNull)
......@@ -132,7 +131,7 @@ void ResourceResponse::platformLazyInit(InitLevel initLevel)
NSDictionary *headers = [httpResponse allHeaderFields];
for (int i = 0; i < numCommonHeaderFields; i++) {
for (unsigned i = 0; i < WTF_ARRAY_LENGTH(commonHeaderFields); ++i) {
if (NSString* headerValue = [headers objectForKey:commonHeaderFields[i]])
m_httpHeaderFields.set([commonHeaderFields[i] UTF8String], headerValue);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment