diff options
Diffstat (limited to 'Source/WebCore/platform/blackberry')
14 files changed, 296 insertions, 77 deletions
diff --git a/Source/WebCore/platform/blackberry/AsyncFileSystemBlackBerry.cpp b/Source/WebCore/platform/blackberry/AsyncFileSystemBlackBerry.cpp index 74060a66c..2ee2b6070 100644 --- a/Source/WebCore/platform/blackberry/AsyncFileSystemBlackBerry.cpp +++ b/Source/WebCore/platform/blackberry/AsyncFileSystemBlackBerry.cpp @@ -40,8 +40,7 @@ PassOwnPtr<AsyncFileSystem> AsyncFileSystem::create() return adoptPtr(new AsyncFileSystemBlackBerry()); } -// FIXME: Add FileSystemType parameter. -void AsyncFileSystem::openFileSystem(const String& basePath, const String& storageIdentifier, bool, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void AsyncFileSystem::openFileSystem(const String& basePath, const String& storageIdentifier, FileSystemType, bool, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { UNUSED_PARAM(basePath); UNUSED_PARAM(storageIdentifier); diff --git a/Source/WebCore/platform/blackberry/AuthenticationChallengeManager.cpp b/Source/WebCore/platform/blackberry/AuthenticationChallengeManager.cpp new file mode 100644 index 000000000..f7e8fd088 --- /dev/null +++ b/Source/WebCore/platform/blackberry/AuthenticationChallengeManager.cpp @@ -0,0 +1,243 @@ +/* + * Copyright (C) 2012 Research In Motion Limited. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "config.h" +#include "AuthenticationChallengeManager.h" + +#include "Credential.h" +#include "KURL.h" +#include "PageClientBlackBerry.h" +#include "ProtectionSpace.h" + +#include <BlackBerryPlatformAssert.h> +#include <BlackBerryPlatformLog.h> +#include <wtf/Assertions.h> +#include <wtf/HashMap.h> +#include <wtf/Vector.h> +#include <wtf/text/CString.h> + +namespace WebCore { + +typedef HashMap<PageClientBlackBerry*, bool> PageVisibilityMap; + +struct ChallengeInfo { + ChallengeInfo(const KURL&, const ProtectionSpace&, const Credential&, AuthenticationChallengeClient*, PageClientBlackBerry*); + + KURL url; + ProtectionSpace space; + Credential credential; + AuthenticationChallengeClient* authClient; + PageClientBlackBerry* pageClient; + bool blocked; +}; + +ChallengeInfo::ChallengeInfo(const KURL& aUrl, const ProtectionSpace& aSpace, const Credential& aCredential, + AuthenticationChallengeClient* anAuthClient, PageClientBlackBerry* aPageClient) + : url(aUrl) + , space(aSpace) + , credential(aCredential) + , authClient(anAuthClient) + , pageClient(aPageClient) + , blocked(false) +{ +} + +class AuthenticationChallengeManagerPrivate { +public: + AuthenticationChallengeManagerPrivate(); + + bool resumeAuthenticationChallenge(PageClientBlackBerry*); + void startAuthenticationChallenge(ChallengeInfo*); + bool pageExists(PageClientBlackBerry*); + + ChallengeInfo* m_activeChallenge; + PageVisibilityMap m_pageVisibilityMap; + Vector<OwnPtr<ChallengeInfo> > m_challenges; +}; + +AuthenticationChallengeManagerPrivate::AuthenticationChallengeManagerPrivate() + : m_activeChallenge(0) +{ +} + +bool AuthenticationChallengeManagerPrivate::resumeAuthenticationChallenge(PageClientBlackBerry* client) +{ + ASSERT(!m_activeChallenge); + + for (size_t i = 0; i < m_challenges.size(); ++i) { + if (m_challenges[i]->pageClient == client && m_challenges[i]->blocked) { + startAuthenticationChallenge(m_challenges[i].get()); + return true; + } + } + + return false; +} + +void AuthenticationChallengeManagerPrivate::startAuthenticationChallenge(ChallengeInfo* info) +{ + m_activeChallenge = info; + m_activeChallenge->blocked = false; + m_activeChallenge->pageClient->authenticationChallenge(m_activeChallenge->url, m_activeChallenge->space, m_activeChallenge->credential); +} + +bool AuthenticationChallengeManagerPrivate::pageExists(PageClientBlackBerry* client) +{ + return m_pageVisibilityMap.find(client) != m_pageVisibilityMap.end(); +} + +AuthenticationChallengeManager::AuthenticationChallengeManager() + : d(adoptPtr(new AuthenticationChallengeManagerPrivate)) +{ +} + +void AuthenticationChallengeManager::pageCreated(PageClientBlackBerry* client) +{ + d->m_pageVisibilityMap.add(client, true); +} + +void AuthenticationChallengeManager::pageDeleted(PageClientBlackBerry* client) +{ + d->m_pageVisibilityMap.remove(client); + + if (d->m_activeChallenge && d->m_activeChallenge->pageClient == client) + d->m_activeChallenge = 0; + + Vector<OwnPtr<ChallengeInfo> > existing; + d->m_challenges.swap(existing); + + for (size_t i = 0; i < existing.size(); ++i) { + if (existing[i]->pageClient != client) + d->m_challenges.append(existing[i].release()); + } +} + +void AuthenticationChallengeManager::pageVisibilityChanged(PageClientBlackBerry* client, bool visible) +{ + PageVisibilityMap::iterator iter = d->m_pageVisibilityMap.find(client); + + ASSERT(iter != d->m_pageVisibilityMap.end()); + if (iter == d->m_pageVisibilityMap.end()) { + d->m_pageVisibilityMap.add(client, visible); + return; + } + + if (iter->second == visible) + return; + + iter->second = visible; + if (!visible) + return; + + if (d->m_activeChallenge) + return; + + d->resumeAuthenticationChallenge(client); +} + +void AuthenticationChallengeManager::authenticationChallenge(const KURL& url, const ProtectionSpace& space, + const Credential& credential, AuthenticationChallengeClient* authClient, PageClientBlackBerry* pageClient) +{ + BLACKBERRY_ASSERT(authClient); + BLACKBERRY_ASSERT(pageClient); + + ChallengeInfo* info = new ChallengeInfo(url, space, credential, authClient, pageClient); + d->m_challenges.append(adoptPtr(info)); + + if (d->m_activeChallenge || !pageClient->isVisible()) { + info->blocked = true; + return; + } + + d->startAuthenticationChallenge(info); +} + +void AuthenticationChallengeManager::cancelAuthenticationChallenge(AuthenticationChallengeClient* client) +{ + BLACKBERRY_ASSERT(client); + + if (d->m_activeChallenge && d->m_activeChallenge->authClient == client) + d->m_activeChallenge = 0; + + Vector<OwnPtr<ChallengeInfo> > existing; + d->m_challenges.swap(existing); + + ChallengeInfo* next = 0; + PageClientBlackBerry* page = 0; + + for (size_t i = 0; i < existing.size(); ++i) { + if (existing[i]->authClient != client) { + if (page && !next && existing[i]->pageClient == page) + next = existing[i].get(); + d->m_challenges.append(existing[i].release()); + } else if (d->m_activeChallenge == existing[i].get()) + page = existing[i]->pageClient; + } + + if (next) + d->startAuthenticationChallenge(next); +} + +void AuthenticationChallengeManager::notifyChallengeResult(const KURL& url, const ProtectionSpace& space, + AuthenticationChallengeResult result, const Credential& credential) +{ + d->m_activeChallenge = 0; + + Vector<OwnPtr<ChallengeInfo> > existing; + d->m_challenges.swap(existing); + + ChallengeInfo* next = 0; + PageClientBlackBerry* page = 0; + + for (size_t i = 0; i < existing.size(); ++i) { + if (existing[i]->space != space) { + if (page && !next && existing[i]->pageClient == page) + next = existing[i].get(); + d->m_challenges.append(existing[i].release()); + } else { + page = existing[i]->pageClient; + existing[i]->authClient->notifyChallengeResult(existing[i]->url, space, result, credential); + + // After calling notifyChallengeResult(), page could be destroyed or something. + if (!d->pageExists(page) || !page->isVisible()) + page = 0; + } + } + + if (next) + d->startAuthenticationChallenge(next); +} + +// Keep following code at the end of this file!!! +static AuthenticationChallengeManager* s_manager = 0; + +AuthenticationChallengeManager* AuthenticationChallengeManager::instance() +{ + ASSERT(s_manager); + return s_manager; +} + +void AuthenticationChallengeManager::init() +{ + ASSERT(!s_manager); + s_manager = new AuthenticationChallengeManager(); +} + +// No more code after this line, all new code should come before s_manager declaration!!! + +} // namespace WebCore diff --git a/Source/WebCore/platform/blackberry/AuthenticationChallengeManager.h b/Source/WebCore/platform/blackberry/AuthenticationChallengeManager.h index 52224f511..a5d51e272 100644 --- a/Source/WebCore/platform/blackberry/AuthenticationChallengeManager.h +++ b/Source/WebCore/platform/blackberry/AuthenticationChallengeManager.h @@ -19,8 +19,13 @@ #ifndef AuthenticationChallengeManager_h #define AuthenticationChallengeManager_h +#include <wtf/OwnPtr.h> + +class PageClientBlackBerry; + namespace WebCore { +class AuthenticationChallengeManagerPrivate; class Credential; class KURL; class ProtectionSpace; @@ -35,6 +40,27 @@ public: virtual void notifyChallengeResult(const KURL&, const ProtectionSpace&, AuthenticationChallengeResult, const Credential&) = 0; }; +class AuthenticationChallengeManager { +public: + static void init(); + static AuthenticationChallengeManager* instance(); + + void pageCreated(PageClientBlackBerry*); + void pageDeleted(PageClientBlackBerry*); + void pageVisibilityChanged(PageClientBlackBerry*, bool visible); + + void authenticationChallenge(const KURL&, const ProtectionSpace&, const Credential&, AuthenticationChallengeClient*, PageClientBlackBerry*); + void cancelAuthenticationChallenge(AuthenticationChallengeClient*); + void notifyChallengeResult(const KURL&, const ProtectionSpace&, AuthenticationChallengeResult, const Credential&); + +private: + AuthenticationChallengeManager(); + ~AuthenticationChallengeManager(); + + OwnPtr<AuthenticationChallengeManagerPrivate> d; +}; + + } // namespace WebCore #endif // AuthenticationChallengeManager_h diff --git a/Source/WebCore/platform/blackberry/ClipboardBlackBerry.cpp b/Source/WebCore/platform/blackberry/ClipboardBlackBerry.cpp index 2a31be862..ade22ef47 100644 --- a/Source/WebCore/platform/blackberry/ClipboardBlackBerry.cpp +++ b/Source/WebCore/platform/blackberry/ClipboardBlackBerry.cpp @@ -78,13 +78,13 @@ bool ClipboardBlackBerry::setData(const String& type, const String& text) return true; } -HashSet<String> ClipboardBlackBerry::types() const +ListHashSet<String> ClipboardBlackBerry::types() const { if (policy() != ClipboardReadable && policy() != ClipboardTypesReadable) - return HashSet<String>(); + return ListHashSet<String>(); // We use hardcoded list here since there seems to be no API to get the list. - HashSet<String> ret; + ListHashSet<String> ret; ret.add("text/plain"); ret.add("text/html"); ret.add("text/url"); diff --git a/Source/WebCore/platform/blackberry/ClipboardBlackBerry.h b/Source/WebCore/platform/blackberry/ClipboardBlackBerry.h index 17effce0f..37da514b0 100644 --- a/Source/WebCore/platform/blackberry/ClipboardBlackBerry.h +++ b/Source/WebCore/platform/blackberry/ClipboardBlackBerry.h @@ -39,7 +39,7 @@ public: bool setData(const String& type, const String& data); // extensions beyond IE's API - virtual HashSet<String> types() const; + virtual ListHashSet<String> types() const; virtual PassRefPtr<FileList> files() const; virtual DragImageRef createDragImage(IntPoint&) const; virtual void declareAndWriteDragImage(Element*, const KURL&, const String& title, Frame*); diff --git a/Source/WebCore/platform/blackberry/CookieManager.cpp b/Source/WebCore/platform/blackberry/CookieManager.cpp index db012bfb4..f2554941b 100644 --- a/Source/WebCore/platform/blackberry/CookieManager.cpp +++ b/Source/WebCore/platform/blackberry/CookieManager.cpp @@ -179,7 +179,7 @@ String CookieManager::generateHtmlFragmentForCookies() Vector<ParsedCookie*> cookieCandidates; for (HashMap<String, CookieMap*>::iterator it = m_managerMap.begin(); it != m_managerMap.end(); ++it) - it->second->getAllChildCookies(&cookieCandidates); + it->value->getAllChildCookies(&cookieCandidates); String result; ParsedCookie* cookie = 0; @@ -317,7 +317,7 @@ void CookieManager::removeAllCookies(BackingStoreRemovalPolicy backingStoreRemov HashMap<String, CookieMap*>::iterator first = m_managerMap.begin(); HashMap<String, CookieMap*>::iterator end = m_managerMap.end(); for (HashMap<String, CookieMap*>::iterator it = first; it != end; ++it) - it->second->deleteAllCookiesAndDomains(); + it->value->deleteAllCookiesAndDomains(); if (backingStoreRemoval == RemoveFromBackingStore) m_cookieBackingStore->removeAll(); diff --git a/Source/WebCore/platform/blackberry/CookieMap.cpp b/Source/WebCore/platform/blackberry/CookieMap.cpp index bbe9a7ced..af485b54c 100644 --- a/Source/WebCore/platform/blackberry/CookieMap.cpp +++ b/Source/WebCore/platform/blackberry/CookieMap.cpp @@ -172,7 +172,7 @@ ParsedCookie* CookieMap::removeOldestCookie() CookieLog("CookieMap - looking into subdomains"); for (HashMap<String, CookieMap*>::iterator it = m_subdomains.begin(); it != m_subdomains.end(); ++it) { - oldestCookie = it->second->removeOldestCookie(); + oldestCookie = it->value->removeOldestCookie(); if (oldestCookie) break; } @@ -214,7 +214,7 @@ void CookieMap::getAllChildCookies(Vector<ParsedCookie*>* stackOfCookies) CookieLog("CookieMap - getAllChildCookies in Map - %s", getName().utf8().data()); getAllCookies(stackOfCookies); for (HashMap<String, CookieMap*>::iterator it = m_subdomains.begin(); it != m_subdomains.end(); ++it) - it->second->getAllChildCookies(stackOfCookies); + it->value->getAllChildCookies(stackOfCookies); } } // namespace WebCore diff --git a/Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp b/Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp index 83339efd4..6d7b3a389 100644 --- a/Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp +++ b/Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp @@ -21,6 +21,7 @@ #include "IntSize.h" #include "NotImplemented.h" +#include <BlackBerryPlatformString.h> #include <LocaleHandler.h> #include <LocalizeResource.h> #include <wtf/Vector.h> diff --git a/Source/WebCore/platform/blackberry/MIMETypeRegistryBlackBerry.cpp b/Source/WebCore/platform/blackberry/MIMETypeRegistryBlackBerry.cpp index 44c6d8ec0..06d010d4a 100644 --- a/Source/WebCore/platform/blackberry/MIMETypeRegistryBlackBerry.cpp +++ b/Source/WebCore/platform/blackberry/MIMETypeRegistryBlackBerry.cpp @@ -31,18 +31,19 @@ #include "NotImplemented.h" #include <BlackBerryPlatformCommonFunctions.h> +#include <BlackBerryPlatformString.h> #include <wtf/text/CString.h> namespace WebCore { String MIMETypeRegistry::getMIMETypeForExtension(const String& extension) { - return String(BlackBerry::Platform::getMIMETypeForExtension(extension.lower().utf8().data()).c_str()); + return BlackBerry::Platform::getMIMETypeForExtension(extension.lower()); } String MIMETypeRegistry::getPreferredExtensionForMIMEType(const String& type) { - return String(BlackBerry::Platform::getPreferredExtensionForMIMEType(type.lower().utf8().data()).c_str()); + return BlackBerry::Platform::getPreferredExtensionForMIMEType(type.lower()); } bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&) diff --git a/Source/WebCore/platform/blackberry/PageClientBlackBerry.h b/Source/WebCore/platform/blackberry/PageClientBlackBerry.h index bdb2f1607..f2c7c0e65 100644 --- a/Source/WebCore/platform/blackberry/PageClientBlackBerry.h +++ b/Source/WebCore/platform/blackberry/PageClientBlackBerry.h @@ -72,7 +72,7 @@ public: virtual int showAlertDialog(BlackBerry::WebKit::WebPageClient::AlertType) = 0; virtual bool isActive() const = 0; virtual bool isVisible() const = 0; - virtual void authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&, const WebCore::Credential&, WebCore::AuthenticationChallengeClient*) = 0; + virtual void authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&, const WebCore::Credential&) = 0; virtual SaveCredentialType notifyShouldSaveCredential(bool) = 0; virtual void syncProxyCredential(const WebCore::Credential&) = 0; }; diff --git a/Source/WebCore/platform/blackberry/PasteboardBlackBerry.cpp b/Source/WebCore/platform/blackberry/PasteboardBlackBerry.cpp index 24d200774..c82afad48 100644 --- a/Source/WebCore/platform/blackberry/PasteboardBlackBerry.cpp +++ b/Source/WebCore/platform/blackberry/PasteboardBlackBerry.cpp @@ -63,9 +63,9 @@ void Pasteboard::writeClipboard(Clipboard*) void Pasteboard::writeSelection(Range* selectedRange, bool, Frame* frame) { - std::string text = frame->editor()->selectedText().utf8().data(); - std::string html = createMarkup(selectedRange, 0, AnnotateForInterchange).utf8().data(); - std::string url = frame->document()->url().string().utf8().data(); + WTF::String text = frame->editor()->selectedText(); + WTF::String html = createMarkup(selectedRange, 0, AnnotateForInterchange); + WTF::String url = frame->document()->url().string(); BlackBerry::Platform::Clipboard::write(text, html, url); } @@ -73,17 +73,17 @@ void Pasteboard::writeSelection(Range* selectedRange, bool, Frame* frame) void Pasteboard::writeURL(KURL const& url, String const&, Frame*) { ASSERT(!url.isEmpty()); - BlackBerry::Platform::Clipboard::writeURL(url.string().utf8().data()); + BlackBerry::Platform::Clipboard::writeURL(url.string()); } void Pasteboard::writePlainText(const String& text, SmartReplaceOption) { - BlackBerry::Platform::Clipboard::writePlainText(text.utf8().data()); + BlackBerry::Platform::Clipboard::writePlainText(text); } String Pasteboard::plainText(Frame*) { - return String::fromUTF8(BlackBerry::Platform::Clipboard::readPlainText().c_str()); + return BlackBerry::Platform::Clipboard::readPlainText(); } PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefPtr<Range> context, bool allowPlainText, bool& chosePlainText) @@ -93,10 +93,10 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP // Note: We are able to check if the format exists prior to reading but the check & the early return // path of get_clipboard_data are the exact same, so just use get_clipboard_data and validate the // return value to determine if the data was present. - String html = String::fromUTF8(BlackBerry::Platform::Clipboard::readHTML().c_str()); + String html = BlackBerry::Platform::Clipboard::readHTML(); RefPtr<DocumentFragment> fragment; if (!html.isEmpty()) { - String url = String::fromUTF8(BlackBerry::Platform::Clipboard::readURL().c_str()); + String url = BlackBerry::Platform::Clipboard::readURL(); if (fragment = createFragmentFromMarkup(frame->document(), html, url, DisallowScriptingContent)) return fragment.release(); } @@ -104,7 +104,7 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP if (!allowPlainText) return 0; - String text = String::fromUTF8(BlackBerry::Platform::Clipboard::readPlainText().c_str()); + String text = BlackBerry::Platform::Clipboard::readPlainText(); if (fragment = createFragmentFromText(context.get(), text)) { chosePlainText = true; return fragment.release(); diff --git a/Source/WebCore/platform/blackberry/PlatformKeyboardEventBlackBerry.cpp b/Source/WebCore/platform/blackberry/PlatformKeyboardEventBlackBerry.cpp index 4914305ba..8dc2e0243 100644 --- a/Source/WebCore/platform/blackberry/PlatformKeyboardEventBlackBerry.cpp +++ b/Source/WebCore/platform/blackberry/PlatformKeyboardEventBlackBerry.cpp @@ -452,7 +452,7 @@ PlatformKeyboardEvent::PlatformKeyboardEvent(const BlackBerry::Platform::Keyboar if (event.character() == KEYCODE_BACK_TAB) m_modifiers |= ShiftKey; // BackTab should be treated as Shift + Tab. - BlackBerry::Platform::log(BlackBerry::Platform::LogLevelInfo, "Keyboard event received text=%lc, keyIdentifier=%s, windowsVirtualKeyCode=%d", event.character(), m_keyIdentifier.latin1().data(), m_windowsVirtualKeyCode); + BBLOG(BlackBerry::Platform::LogLevelInfo, "Keyboard event received text=%lc, keyIdentifier=%s, windowsVirtualKeyCode=%d", event.character(), m_keyIdentifier.latin1().data(), m_windowsVirtualKeyCode); } bool PlatformKeyboardEvent::currentCapsLockState() diff --git a/Source/WebCore/platform/blackberry/ReadOnlyLatin1String.h b/Source/WebCore/platform/blackberry/ReadOnlyLatin1String.h deleted file mode 100644 index 613dbda86..000000000 --- a/Source/WebCore/platform/blackberry/ReadOnlyLatin1String.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2012 Research In Motion Limited. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef ReadOnlyLatin1String_h -#define ReadOnlyLatin1String_h - -#include <wtf/text/CString.h> -#include <wtf/text/WTFString.h> - -namespace WebCore { - -class ReadOnlyLatin1String { -public: - explicit ReadOnlyLatin1String(const String& string) - { - if (string.is8Bit()) - m_string = string; - else { - ASSERT(string.containsOnlyLatin1()); - m_cstring = string.latin1(); - } - } - - const char* data() const { return m_string.isNull() ? m_cstring.data() : reinterpret_cast<const char*>(m_string.characters8()); } - - size_t length() const { return m_string.isNull() ? m_cstring.length() : m_string.length(); } - -private: - String m_string; - CString m_cstring; -}; - -} // namespace WebCore - -#endif diff --git a/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp b/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp index a9c09a119..b7019ff1d 100644 --- a/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp +++ b/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp @@ -314,14 +314,13 @@ void RenderThemeBlackBerry::adjustSearchFieldStyle(StyleResolver*, RenderStyle* void RenderThemeBlackBerry::adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle* style, Element*) const { - static const float defaultControlFontPixelSize = 13; - static const float defaultCancelButtonSize = 9; + static const float defaultControlFontPixelSize = 10; + static const float defaultCancelButtonSize = 13; static const float minCancelButtonSize = 5; - static const float maxCancelButtonSize = 21; // Scale the button size based on the font size float fontScale = style->fontSize() / defaultControlFontPixelSize; - int cancelButtonSize = lroundf(std::min(std::max(minCancelButtonSize, defaultCancelButtonSize * fontScale), maxCancelButtonSize)); + int cancelButtonSize = lroundf(std::max(minCancelButtonSize, defaultCancelButtonSize * fontScale)); Length length(cancelButtonSize, Fixed); style->setWidth(length); style->setHeight(length); |