https://bugs.webkit.org/show_bug.cgi?id=91267
Patch by Yongxin Dai <yodai@rim.com> on 2012-07-16
Reviewed by Antonio Gomes.
Input fields host node is by spec non-editable unless the field itself has content editable enabled.
We enable selection if the shadow tree for the input field is selectable.
PR # 173450
Reviewed Internally by Mike Fenton.
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::webContext):
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::webContext):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122725
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
- if (!nodeAllowSelectionOverride && !node->canStartSelection())
- context.resetFlag(Platform::WebContext::IsSelectable);
-
if (node->isHTMLElement()) {
HTMLImageElement* imageElement = 0;
HTMLMediaElement* mediaElement = 0;
if (node->isHTMLElement()) {
HTMLImageElement* imageElement = 0;
HTMLMediaElement* mediaElement = 0;
context.setText(curText->wholeText().utf8().data());
}
context.setText(curText->wholeText().utf8().data());
}
+ bool canStartSelection = node->canStartSelection();
+
if (node->isElementNode()) {
Element* element = static_cast<Element*>(node->shadowAncestorNode());
if (DOMSupport::isTextBasedContentEditableElement(element)) {
if (node->isElementNode()) {
Element* element = static_cast<Element*>(node->shadowAncestorNode());
if (DOMSupport::isTextBasedContentEditableElement(element)) {
+ if (!canStartSelection) {
+ // Input fields host node is by spec non-editable unless the field itself has content editable enabled.
+ // Enable selection if the shadow tree for the input field is selectable.
+ Node* nodeUnderFinger = m_touchEventHandler->lastFatFingersResult().isValid() ? m_touchEventHandler->lastFatFingersResult().node(FatFingersResult::ShadowContentAllowed) : 0;
+ if (nodeUnderFinger)
+ canStartSelection = nodeUnderFinger->canStartSelection();
+ }
context.setFlag(Platform::WebContext::IsInput);
if (element->hasTagName(HTMLNames::inputTag))
context.setFlag(Platform::WebContext::IsSingleLine);
context.setFlag(Platform::WebContext::IsInput);
if (element->hasTagName(HTMLNames::inputTag))
context.setFlag(Platform::WebContext::IsSingleLine);
+ if (!nodeAllowSelectionOverride && !canStartSelection)
+ context.resetFlag(Platform::WebContext::IsSelectable);
+
if (node->isFocusable())
context.setFlag(Platform::WebContext::IsFocusable);
if (node->isFocusable())
context.setFlag(Platform::WebContext::IsFocusable);
+2012-07-16 Yongxin Dai <yodai@rim.com>
+
+ [BlackBerry] Text selection with touch hold does not start on text field in some cases
+ https://bugs.webkit.org/show_bug.cgi?id=91267
+
+ Reviewed by Antonio Gomes.
+
+ Input fields host node is by spec non-editable unless the field itself has content editable enabled.
+ We enable selection if the shadow tree for the input field is selectable.
+ PR # 173450
+
+ Reviewed Internally by Mike Fenton.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::webContext):
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::webContext):
+
2012-07-15 Jonathan Dong <jonathan.dong@torchmobile.com.cn>
[BlackBerry] Move icon database to application data directory.
2012-07-15 Jonathan Dong <jonathan.dong@torchmobile.com.cn>
[BlackBerry] Move icon database to application data directory.