Unreviewed, rolling out r156185.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Sep 2013 23:59:19 +0000 (23:59 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Sep 2013 23:59:19 +0000 (23:59 +0000)
http://trac.webkit.org/changeset/156185
https://bugs.webkit.org/show_bug.cgi?id=121727

Caused a lot of crashes in tests (Requested by ap on #webkit).

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::recalcStyle):
(WebCore::Document::updateLayout):
* dom/Document.h:

LayoutTests:

* 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@156210 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/dom/HTMLDocument/active-element-gets-unfocusable-expected.txt [deleted file]
LayoutTests/fast/dom/HTMLDocument/active-element-gets-unfocusable.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h

index df99d71da22e500ce56357ee2c33c91c18c36e62..f4849f04a87d96ade7d930fb23aba12f00fc00c4 100644 (file)
@@ -1,3 +1,14 @@
+2013-09-20  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r156185.
+        http://trac.webkit.org/changeset/156185
+        https://bugs.webkit.org/show_bug.cgi?id=121727
+
+        Caused a lot of crashes in tests (Requested by ap on #webkit).
+
+        * fast/dom/HTMLDocument/active-element-gets-unfocusable-expected.txt: Removed.
+        * fast/dom/HTMLDocument/active-element-gets-unfocusable.html: Removed.
+
 2013-09-20  Mario Sanchez Prada  <mario.prada@samsung.com>
 
         [ATK] Do not expose aria-help in ATK based platforms
diff --git a/LayoutTests/fast/dom/HTMLDocument/active-element-gets-unfocusable-expected.txt b/LayoutTests/fast/dom/HTMLDocument/active-element-gets-unfocusable-expected.txt
deleted file mode 100644 (file)
index 4e180bf..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-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
-
diff --git a/LayoutTests/fast/dom/HTMLDocument/active-element-gets-unfocusable.html b/LayoutTests/fast/dom/HTMLDocument/active-element-gets-unfocusable.html
deleted file mode 100644 (file)
index 78b47b1..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html>
-<body>
-<script src="../../js/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="../../js/resources/js-test-post.js"></script>
-</body>
index a088358d41f251a3afd5acfe1407b240b09498b8..d829e6dbe5cf374b1886daf108703d0d0086328a 100644 (file)
@@ -1,3 +1,17 @@
+2013-09-20  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r156185.
+        http://trac.webkit.org/changeset/156185
+        https://bugs.webkit.org/show_bug.cgi?id=121727
+
+        Caused a lot of crashes in tests (Requested by ap on #webkit).
+
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        (WebCore::Document::recalcStyle):
+        (WebCore::Document::updateLayout):
+        * dom/Document.h:
+
 2013-09-20  Dean Jackson  <dino@apple.com>
 
         Shaders that fail to compile should be marked as such
index fc77c031ddb26f202d5ed78ac0ab60b4d82fa477..80fc029ead94a5f3ac712d4d454516f94108e08a 100644 (file)
@@ -439,7 +439,6 @@ Document::Document(Frame* frame, const KURL& url, unsigned documentClasses)
     , m_titleSetExplicitly(false)
     , m_markers(adoptPtr(new DocumentMarkerController))
     , m_updateFocusAppearanceTimer(this, &Document::updateFocusAppearanceTimerFired)
-    , m_resetHiddenFocusElementTimer(this, &Document::resetHiddenFocusElementTimer)
     , m_cssTarget(0)
     , m_processingLoadEvent(false)
     , m_loadEventFinished(false)
@@ -1828,9 +1827,6 @@ void Document::recalcStyle(Style::Change change)
     // to check if any other elements ended up under the mouse pointer due to re-layout.
     if (m_hoveredElement && !m_hoveredElement->renderer())
         frameView.frame().eventHandler().dispatchFakeMouseMoveEventSoon();
-
-    // Style change may reset the focus, e.g. display: none, visibility: hidden.
-    resetHiddenFocusElementSoon();
 }
 
 void Document::updateStyleIfNeeded()
@@ -1869,9 +1865,6 @@ void Document::updateLayout()
     // 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.
@@ -4693,12 +4686,6 @@ void Document::cancelFocusAppearanceUpdate()
     m_updateFocusAppearanceTimer.stop();
 }
 
-void Document::resetHiddenFocusElementSoon()
-{
-    if (!m_resetHiddenFocusElementTimer.isActive() && m_focusedElement && !m_focusedElement->isFocusable())
-        m_resetHiddenFocusElementTimer.startOneShot(0);
-}
-
 void Document::updateFocusAppearanceTimerFired(Timer<Document>*)
 {
     Element* element = focusedElement();
@@ -4710,12 +4697,6 @@ void Document::updateFocusAppearanceTimerFired(Timer<Document>*)
         element->updateFocusAppearance(m_updateFocusAppearanceRestoresSelection);
 }
 
-void Document::resetHiddenFocusElementTimer(Timer<Document>*)
-{
-    if (m_focusedElement && !m_focusedElement->isFocusable())
-        setFocusedElement(0);
-}
-
 void Document::attachRange(Range* range)
 {
     ASSERT(!m_ranges.contains(range));
index 74f48e9cf810562e6da6122e1b713e1215934812..9d12e5eead39b8edabf8140e10673ced4744d951 100644 (file)
@@ -918,9 +918,7 @@ public:
 
     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);
@@ -1227,8 +1225,6 @@ private:
     void updateFocusAppearanceTimerFired(Timer<Document>*);
     void updateBaseURL();
 
-    void resetHiddenFocusElementTimer(Timer<Document>*);
-
     void buildAccessKeyMap(TreeScope* root);
 
     void createStyleResolver();
@@ -1380,7 +1376,6 @@ private:
     const OwnPtr<DocumentMarkerController> m_markers;
     
     Timer<Document> m_updateFocusAppearanceTimer;
-    Timer<Document> m_resetHiddenFocusElementTimer;
 
     Element* m_cssTarget;