https://bugs.webkit.org/show_bug.cgi?id=133196
Reviewed by Geoffrey Garen.
Source/WebCore:
Fixed the bug by rolling out r156252.
When the user taps on the status on facebook.com, the page focuses a textarea,
which is then made momentarily invisible by setting display:none.
The page then removes display:none later and expects the textarea to be still focused.
With r156252, the focus is removed after the page sets display:none and the keyboard disappears.
Since the focus is never reset on the textarea, the user can never type in anything.
The specification may need to change here given that this (rather odd) behavior/expectation exists
on one of the most popular websites on the Web.
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::recalcStyle):
(WebCore::Document::updateLayout):
(WebCore::Document::resetHiddenFocusElementSoon): Deleted.
(WebCore::Document::resetHiddenFocusElementTimer): Deleted.
* dom/Document.h:
LayoutTests:
Removed the test added by r156252.
* fast/dom/HTMLDocument/active-element-gets-unfocusable-expected.txt: Removed.
* fast/dom/HTMLDocument/active-element-gets-unfocusable.html: Removed.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169244
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-05-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Can't type in status in facebook.com on iOS Safari because keyboard disappears
+ https://bugs.webkit.org/show_bug.cgi?id=133196
+
+ Reviewed by Geoffrey Garen.
+
+ Removed the test added by r156252.
+
+ * fast/dom/HTMLDocument/active-element-gets-unfocusable-expected.txt: Removed.
+ * fast/dom/HTMLDocument/active-element-gets-unfocusable.html: Removed.
+
2014-05-22 Myles C. Maxfield <mmaxfield@apple.com>
http/tests/security/xss-DENIED-xsl-document-redirect.xml fails with NetworkProcess
+++ /dev/null
-Making a focused element invisible should make it blur.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-===> Setting display:none
-Event: blur
-PASS document.activeElement is document.body
-PASS The focusTarget element lost focus.
-
-===> Setting visibility:hidden
-Event: blur
-PASS document.activeElement is document.body
-PASS The focusTarget element lost focus.
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<body>
-<script src="../../../resources/js-test-pre.js"></script>
-
-<div id="f1">
- <div tabindex="1" id="div1"></div>
-</div>
-
-<script type="text/javascript">
-description('Making a focused element invisible should make it blur.');
-jsTestIsAsync = true;
-var focusTarget = document.getElementById('div1');
-var testStage = 0;
-var testTimeout = 0;
-
-document.body.onload = function() {
- focusTarget.focus();
-
- shouldBe('document.activeElement', 'focusTarget', true);
- debug('===> Setting display:none');
- setTimeout("f1.style.display = 'none'",0);
-
- testTimeout = setTimeout(function() {
- testFailed('Timeout: Didn\'t loose focus.');
- finishJSTest();
- }, 1000);
-};
-
-focusTarget.addEventListener('blur', function() {
- debug('Event: blur');
- shouldBe('document.activeElement', 'document.body');
- testPassed('The focusTarget element lost focus.');
-
- debug('');
- if (testStage++ == 0) {
- f1.style.display = 'block';
- focusTarget.focus();
- shouldBe('document.activeElement', 'focusTarget', true);
- debug('===> Setting visibility:hidden');
- setTimeout("f1.style.visibility = 'hidden'",0);
- } else {
- clearTimeout(testTimeout);
- finishJSTest();
- }
-}, false);
-
-</script>
-<script src="../../../resources/js-test-post.js"></script>
-</body>
+2014-05-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Can't type in status in facebook.com on iOS Safari because keyboard disappears
+ https://bugs.webkit.org/show_bug.cgi?id=133196
+
+ Reviewed by Geoffrey Garen.
+
+ Fixed the bug by rolling out r156252.
+
+ When the user taps on the status on facebook.com, the page focuses a textarea,
+ which is then made momentarily invisible by setting display:none.
+ The page then removes display:none later and expects the textarea to be still focused.
+
+ With r156252, the focus is removed after the page sets display:none and the keyboard disappears.
+ Since the focus is never reset on the textarea, the user can never type in anything.
+
+ The specification may need to change here given that this (rather odd) behavior/expectation exists
+ on one of the most popular websites on the Web.
+
+ * dom/Document.cpp:
+ (WebCore::Document::Document):
+ (WebCore::Document::recalcStyle):
+ (WebCore::Document::updateLayout):
+ (WebCore::Document::resetHiddenFocusElementSoon): Deleted.
+ (WebCore::Document::resetHiddenFocusElementTimer): Deleted.
+ * dom/Document.h:
+
2014-05-22 Myles C. Maxfield <mmaxfield@apple.com>
http/tests/security/xss-DENIED-xsl-document-redirect.xml fails with NetworkProcess
, m_titleSetExplicitly(false)
, m_markers(std::make_unique<DocumentMarkerController>())
, m_updateFocusAppearanceTimer(this, &Document::updateFocusAppearanceTimerFired)
- , m_resetHiddenFocusElementTimer(this, &Document::resetHiddenFocusElementTimer)
, m_cssTarget(nullptr)
, m_processingLoadEvent(false)
, m_loadEventFinished(false)
// to check if any other elements ended up under the mouse pointer due to re-layout.
if (m_hoveredElement && !m_hoveredElement->renderer())
frameView.frame().mainFrame().eventHandler().dispatchFakeMouseMoveEventSoon();
-
- // Style change may reset the focus, e.g. display: none, visibility: hidden.
- resetHiddenFocusElementSoon();
}
void Document::updateStyleIfNeeded()
// Only do a layout if changes have occurred that make it necessary.
if (frameView && renderView() && (frameView->layoutPending() || renderView()->needsLayout()))
frameView->layout();
-
- // Active focus element's isFocusable() state may change after Layout. e.g. width: 0px or height: 0px.
- resetHiddenFocusElementSoon();
}
// FIXME: This is a bad idea and needs to be removed eventually.
m_updateFocusAppearanceTimer.stop();
}
-void Document::resetHiddenFocusElementSoon()
-{
- if (!m_resetHiddenFocusElementTimer.isActive() && m_focusedElement)
- m_resetHiddenFocusElementTimer.startOneShot(0);
-}
-
void Document::updateFocusAppearanceTimerFired(Timer<Document>&)
{
Element* element = focusedElement();
element->updateFocusAppearance(m_updateFocusAppearanceRestoresSelection);
}
-void Document::resetHiddenFocusElementTimer(Timer<Document>&)
-{
- if (view() && view()->needsLayout())
- return;
-
- if (m_focusedElement && !m_focusedElement->isFocusable())
- setFocusedElement(nullptr);
-}
-
void Document::attachRange(Range* range)
{
ASSERT(!m_ranges.contains(range));
void updateFocusAppearanceSoon(bool restorePreviousSelection);
void cancelFocusAppearanceUpdate();
- void resetHiddenFocusElementSoon();
-
// Extension for manipulating canvas drawing contexts for use in CSS
CanvasRenderingContext* getCSSCanvasContext(const String& type, const String& name, int width, int height);
HTMLCanvasElement* getCSSCanvasElement(const String& name);
void updateFocusAppearanceTimerFired(Timer<Document>&);
void updateBaseURL();
- void resetHiddenFocusElementTimer(Timer<Document>&);
-
void buildAccessKeyMap(TreeScope* root);
void createStyleResolver();
const std::unique_ptr<DocumentMarkerController> m_markers;
Timer<Document> m_updateFocusAppearanceTimer;
- Timer<Document> m_resetHiddenFocusElementTimer;
Element* m_cssTarget;