Modified: trunk/Source/WebKit/blackberry/ChangeLog (149805 => 149806)
--- trunk/Source/WebKit/blackberry/ChangeLog 2013-05-09 14:26:28 UTC (rev 149805)
+++ trunk/Source/WebKit/blackberry/ChangeLog 2013-05-09 15:11:56 UTC (rev 149806)
@@ -1,3 +1,22 @@
+2013-05-09 Mike Fenton <[email protected]>
+
+ [BlackBerry] Style updates required based on new check-webkit-style
+ https://bugs.webkit.org/show_bug.cgi?id=115857
+
+ Reviewed by Rob Buis.
+
+ Styles fixes required for InputHandler based on updated
+ check-webkit-style.
+
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::spellCheckingRequestProcessed):
+ (BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible):
+ (BlackBerry::WebKit::InputHandler::ensureFocusPluginElementVisible):
+ (BlackBerry::WebKit::InputHandler::setPopupListIndexes):
+ (BlackBerry::WebKit::InputHandler::firstSpanInString):
+ (BlackBerry::WebKit::InputHandler::setTextAttributes):
+ * WebKitSupport/InputHandler.h:
+
2013-05-08 Eli Fidler <[email protected]>
[BlackBerry] Fix usage of BlackBerry::Platform::String
Modified: trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp (149805 => 149806)
--- trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp 2013-05-09 14:26:28 UTC (rev 149805)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp 2013-05-09 15:11:56 UTC (rev 149806)
@@ -701,7 +701,7 @@
textCheckingResult.length = 0;
span_t* span = spannableString->spans;
- for (unsigned int i = 0; i < spannableString->spans_count; i++) {
+ for (unsigned i = 0; i < spannableString->spans_count; i++) {
if (!span)
break;
if (span->end < span->start) {
@@ -1353,8 +1353,9 @@
// The scroll location we should go to given the zoom required, could be adjusted later.
WebCore::FloatPoint offset(selectionFocusRect.location().x() - m_webPage->scrollPosition().x(), selectionFocusRect.location().y() - m_webPage->scrollPosition().y());
double inverseScale = zoomScaleRequired / m_webPage->currentScale();
- WebCore::IntPoint destinationScrollLocation = WebCore::IntPoint(max(0, static_cast<int>(roundf(selectionFocusRect.location().x() - offset.x() / inverseScale))),
- max(0, static_cast<int>(roundf(selectionFocusRect.location().y() - offset.y() / inverseScale))));
+ WebCore::IntPoint destinationScrollLocation = WebCore::IntPoint(
+ max(0, static_cast<int>(roundf(selectionFocusRect.location().x() - offset.x() / inverseScale))),
+ max(0, static_cast<int>(roundf(selectionFocusRect.location().y() - offset.y() / inverseScale))));
if (elementFrame != mainFrame) { // Element is in a subframe.
// Remove any scroll offset within the subframe to get the point relative to the main frame.
@@ -1420,9 +1421,7 @@
static const int s_focusRectPaddingSize = Graphics::Screen::primaryScreen()->heightInMMToPixels(12);
selectionFocusRect.inflate(std::ceilf(viewportAccessor->documentFromPixelContents(Platform::FloatSize(0, s_focusRectPaddingSize)).height()));
- WebCore::IntRect revealRect(layer->getRectToExpose(actualScreenRect, selectionFocusRect,
- horizontalScrollAlignment,
- verticalScrollAlignment));
+ WebCore::IntRect revealRect(layer->getRectToExpose(actualScreenRect, selectionFocusRect, horizontalScrollAlignment, verticalScrollAlignment));
// Don't constrain scroll position when animation finishes.
shouldConstrainScrollingToContentEdge = false;
@@ -1496,8 +1495,8 @@
// is at the center of the screen. FIXME: If the element was partially on screen
// we might want to just bring the offscreen portion into view, someone needs
// to decide if that's the behavior we want or not.
- WebCore::IntPoint pos(selectionFocusRect.center().x() - actualScreenRect.width() / 2,
- selectionFocusRect.center().y() - actualScreenRect.height() / 2);
+ WebCore::IntPoint pos(selectionFocusRect.center());
+ pos.move(-actualScreenRect.width() / 2, -actualScreenRect.height() / 2);
mainFrameView->setScrollPosition(pos);
}
@@ -2045,7 +2044,7 @@
HTMLSelectElement* selectElement = static_cast<HTMLSelectElement*>(m_currentFocusElement.get());
const WTF::Vector<HTMLElement*>& items = selectElement->listItems();
- if (items.size() != static_cast<unsigned int>(size))
+ if (items.size() != static_cast<unsigned>(size))
return;
HTMLOptionElement* option;
@@ -2354,7 +2353,7 @@
span_t* InputHandler::firstSpanInString(spannable_string_t* spannableString, SpannableStringAttribute attrib)
{
span_t* span = spannableString->spans;
- for (unsigned int i = 0; i < spannableString->spans_count; i++) {
+ for (unsigned i = 0; i < spannableString->spans_count; i++) {
if (span->attributes_mask & attrib)
return span;
span++;
@@ -2491,12 +2490,12 @@
{
// Apply the attributes to the field.
span_t* span = spannableString->spans;
- for (unsigned int i = 0; i < spannableString->spans_count; i++) {
- unsigned int startPosition = insertionPoint + span->start;
+ for (unsigned i = 0; i < spannableString->spans_count; i++) {
+ unsigned startPosition = insertionPoint + span->start;
// The end point includes the character that it is before. Ie, 0, 0
// applies to the first character as the end point includes the character
// at the position. This means the endPosition is always +1.
- unsigned int endPosition = insertionPoint + span->end + 1;
+ unsigned endPosition = insertionPoint + span->end + 1;
if (endPosition < startPosition || endPosition > elementText().length())
return false;
Modified: trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.h (149805 => 149806)
--- trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.h 2013-05-09 14:26:28 UTC (rev 149805)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.h 2013-05-09 15:11:56 UTC (rev 149806)
@@ -71,9 +71,11 @@
~InputHandler();
enum FocusElementType { TextEdit, TextPopup /* Date/Time & Color */, SelectPopup, Plugin };
- enum CaretScrollType { CenterAlways = BlackBerry::Platform::Settings::ScrollAdjustmentCenterAlways,
- CenterIfNeeded = BlackBerry::Platform::Settings::ScrollAdjustmentCenterIfNeeded,
- EdgeIfNeeded = BlackBerry::Platform::Settings::ScrollAdjustmentEdgeIfNeeded };
+ enum CaretScrollType {
+ CenterAlways = BlackBerry::Platform::Settings::ScrollAdjustmentCenterAlways,
+ CenterIfNeeded = BlackBerry::Platform::Settings::ScrollAdjustmentCenterIfNeeded,
+ EdgeIfNeeded = BlackBerry::Platform::Settings::ScrollAdjustmentEdgeIfNeeded
+ };
bool isInputModeEnabled() const;
void setInputModeEnabled(bool active = true);