Diff
Modified: trunk/LayoutTests/ChangeLog (191479 => 191480)
--- trunk/LayoutTests/ChangeLog 2015-10-22 21:54:11 UTC (rev 191479)
+++ trunk/LayoutTests/ChangeLog 2015-10-22 22:14:08 UTC (rev 191480)
@@ -1,3 +1,18 @@
+2015-10-22 Daniel Bates <[email protected]>
+
+ Unreviewed, rolling out r191113.
+
+ Rollout r144451 since it regressed the visibility of the
+ search cancel button when a search field is empty or showing
+ placeholder text. Further investigation is needed.
+
+ Reverted changeset:
+
+ "[iOS] DOM click event may not be dispatched when page has
+ :active style and <input type="search">"
+ https://bugs.webkit.org/show_bug.cgi?id=144451
+ http://trac.webkit.org/changeset/191113
+
2015-10-22 Brady Eidson <[email protected]>
Skip a racey test until it can be made proper.
Deleted: trunk/LayoutTests/fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field-expected.txt (191479 => 191480)
--- trunk/LayoutTests/fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field-expected.txt 2015-10-22 21:54:11 UTC (rev 191479)
+++ trunk/LayoutTests/fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field-expected.txt 2015-10-22 22:14:08 UTC (rev 191480)
@@ -1,9 +0,0 @@
-Test that an element, with an onclick handler and an empty ontouchstart attribute, in an <iframe> on a page with a search field and specifies an :active pseudo-class for <body> receives a DOM click event when tapped. To run this test by hand, click the blue square below.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-PASS clicked blue square
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: trunk/LayoutTests/fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html (191479 => 191480)
--- trunk/LayoutTests/fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html 2015-10-22 21:54:11 UTC (rev 191479)
+++ trunk/LayoutTests/fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html 2015-10-22 22:14:08 UTC (rev 191480)
@@ -1,72 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-<style>
-body:active {
- /* Must be non-empty. */
- -webkit-tap-highlight-color: yellow;
-}
-</style>
-<script>
-window.jsTestIsAsync = true;
-
-function notifyPass()
-{
- testPassed("clicked blue square");
-
- var testContainer = document.getElementById("test-container");
- testContainer.parentNode.removeChild(testContainer);
- finishJSTest();
-}
-
-function runTest()
-{
- if (!window.testRunner)
- return;
- var iframe = document.getElementById("iframe");
- var square = iframe.contentDocument.getElementById("square");
- var x = iframe.offsetLeft + square.offsetLeft + Math.floor(square.offsetWidth / 2);
- var y = iframe.offsetTop + square.offsetTop + Math.floor(square.offsetHeight / 2);
- if (testRunner.runUIScript && window.TouchEvent)
- testRunner.runUIScript("(function() { uiController.singleTapAtPoint(" + x + ", " + y + "); })()");
- else if (window.eventSender) {
- eventSender.mouseMoveTo(x, y);
- eventSender.mouseDown();
- eventSender.mouseUp();
- }
-}
-</script>
-</head>
-<body>
-<div id="description"></div>
-<div id="test-container">
- <p><input type="search" placeholder="Do not click me"></p>
- <iframe id="iframe" width="128" height="128" _onload_="runTest()" srcdoc='
- <style>
- body {
- margin: 0;
- padding 0;
- }
- #square {
- -webkit-box-align: center;
- -webkit-box-pack: center;
- -webkit-user-select: none;
- background-color: blue;
- color: white;
- cursor: pointer;
- display: -webkit-box;
- height: 128px;
- width: 128px;
- }
- </style>
- <div id="square" _ontouchstart_="" _onclick_="window.parent.notifyPass()">Click me</div><!-- Intentionally empty attribute ontouchstart. -->
- '></iframe>
-</div>
-<div id="console"></div>
-<script>
-description("Test that an element, with an onclick handler and an empty ontouchstart attribute, in an <iframe> on a page with a search field and specifies an <code>:active</code> pseudo-class for <body> receives a DOM click event when tapped. To run this test by hand, click the blue square below.");
-</script>
-<script src=""
-</body>
-</html>
Deleted: trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled-expected.html (191479 => 191480)
--- trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled-expected.html 2015-10-22 21:54:11 UTC (rev 191479)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled-expected.html 2015-10-22 22:14:08 UTC (rev 191480)
@@ -1,7 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<p>This tests that the search cancel button renders when the field becomes disabled (no change).</p>
-<input type="search" value="search" disabled>
-</body>
-</html>
Deleted: trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled.html (191479 => 191480)
--- trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled.html 2015-10-22 21:54:11 UTC (rev 191479)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled.html 2015-10-22 22:14:08 UTC (rev 191480)
@@ -1,24 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<p>This tests that the search cancel button renders when the field becomes disabled (no change).</p>
-<input type="search" id="search" value="search">
-<script>
-if (window.testRunner)
- testRunner.waitUntilDone();
-
-var search = document.getElementById("search");
-
-function makeFieldDisabledAndNotifyDone()
-{
- search.disabled = true;
- if (window.internals)
- internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
- if (window.testRunner)
- testRunner.notifyDone();
-}
-
-window.setTimeout(makeFieldDisabledAndNotifyDone, 0);
-</script>
-</body>
-</html>
Deleted: trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly-expected.html (191479 => 191480)
--- trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly-expected.html 2015-10-22 21:54:11 UTC (rev 191479)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly-expected.html 2015-10-22 22:14:08 UTC (rev 191480)
@@ -1,7 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<p>This tests that the search cancel button renders when the field becomes read only (no change).</p>
-<input type="search" value="search" readonly>
-</body>
-</html>
Deleted: trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly.html (191479 => 191480)
--- trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly.html 2015-10-22 21:54:11 UTC (rev 191479)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly.html 2015-10-22 22:14:08 UTC (rev 191480)
@@ -1,24 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<p>This tests that the search cancel button renders when the field becomes read only (no change).</p>
-<input type="search" id="search" value="search">
-<script>
-if (window.testRunner)
- testRunner.waitUntilDone();
-
-var search = document.getElementById("search");
-
-function makeFieldReadOnlyAndNotifyDone()
-{
- search.readOnly = true;
- if (window.internals)
- internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
- if (window.testRunner)
- testRunner.notifyDone();
-}
-
-window.setTimeout(makeFieldReadOnlyAndNotifyDone, 0);
-</script>
-</body>
-</html>
Deleted: trunk/LayoutTests/fast/forms/search/search-cancel-in-formerly-invisible-element-expected.html (191479 => 191480)
--- trunk/LayoutTests/fast/forms/search/search-cancel-in-formerly-invisible-element-expected.html 2015-10-22 21:54:11 UTC (rev 191479)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-in-formerly-invisible-element-expected.html 2015-10-22 22:14:08 UTC (rev 191480)
@@ -1,6 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<input type="search" value="search">
-</body>
-</html>
Deleted: trunk/LayoutTests/fast/forms/search/search-cancel-in-formerly-invisible-element.html (191479 => 191480)
--- trunk/LayoutTests/fast/forms/search/search-cancel-in-formerly-invisible-element.html 2015-10-22 21:54:11 UTC (rev 191479)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-in-formerly-invisible-element.html 2015-10-22 22:14:08 UTC (rev 191480)
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<input type="search" id="search" value="search" style="visibility: hidden">
-<script>
-document.getElementById("search").style.visibility = "visible";
-</script>
-</body>
-</html>
Deleted: trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-hidden-expected.html (191479 => 191480)
--- trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-hidden-expected.html 2015-10-22 21:54:11 UTC (rev 191479)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-hidden-expected.html 2015-10-22 22:14:08 UTC (rev 191480)
@@ -1,15 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<style>
-.width-200px {
- width: 200px;
-}
-</style>
-<body>
-<p>Tests that the search cancel button is not shown after changing the visibility of <input type="search"> from hidden to visible to hidden. This test passed if you do not see the search cancel button in the blue outlined box (below).</p>
-<div class="width-200px" style="border: 1px solid blue">
- <input type="search" value="search" class="width-200px" style="visibility: hidden">
-</div>
-</body>
-</html>
Deleted: trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-hidden.html (191479 => 191480)
--- trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-hidden.html 2015-10-22 21:54:11 UTC (rev 191479)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-hidden.html 2015-10-22 22:14:08 UTC (rev 191480)
@@ -1,30 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<style>
-.width-200px {
- width: 200px;
-}
-</style>
-<script>
-if (window.testRunner)
- testRunner.waitUntilDone();
-</script>
-</head>
-<body>
-<p>Tests that the search cancel button is not shown after changing the visibility of <input type="search"> from hidden to visible to hidden. This test passed if you do not see the search cancel button in the blue outlined box (below).</p>
-<div class="width-200px" style="border: 1px solid blue">
- <input type="search" id="search" value="search" class="width-200px" style="visibility: hidden">
-</div>
-<script>
-var search = document.getElementById("search");
-search.style.visibility = "visible";
-function done() {
- search.style.visibility = "hidden";
- if (window.testRunner)
- testRunner.notifyDone();
-}
-window.setTimeout(done, 0);
-</script>
-</body>
-</html>
Deleted: trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-visible-expected.html (191479 => 191480)
--- trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-visible-expected.html 2015-10-22 21:54:11 UTC (rev 191479)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-visible-expected.html 2015-10-22 22:14:08 UTC (rev 191480)
@@ -1,15 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<style>
-.width-200px {
- width: 200px;
-}
-</style>
-<body>
-<p>Tests that the search cancel button is not shown after changing the visibility of <input type="search"> from visible to hidden to visible. This test passed if you see the search cancel button in the blue outlined box (below).</p>
-<div class="width-200px" style="border: 1px solid blue">
- <input type="search" value="search" class="width-200px">
-</div>
-</body>
-</html>
Deleted: trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-visible.html (191479 => 191480)
--- trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-visible.html 2015-10-22 21:54:11 UTC (rev 191479)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-visible.html 2015-10-22 22:14:08 UTC (rev 191480)
@@ -1,30 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<style>
-.width-200px {
- width: 200px;
-}
-</style>
-<script>
-if (window.testRunner)
- testRunner.waitUntilDone();
-</script>
-</head>
-<body>
-<p>Tests that the search cancel button is not shown after changing the visibility of <input type="search"> from visible to hidden to visible. This test passed if you see the search cancel button in the blue outlined box (below).</p>
-<div class="width-200px" style="border: 1px solid blue">
- <input type="search" id="search" value="search" class="width-200px">
-</div>
-<script>
-var search = document.getElementById("search");
-search.style.visibility = "hidden";
-function done() {
- search.style.visibility = "visible";
- if (window.testRunner)
- testRunner.notifyDone();
-}
-window.setTimeout(done, 0);
-</script>
-</body>
-</html>
Modified: trunk/Source/WebCore/ChangeLog (191479 => 191480)
--- trunk/Source/WebCore/ChangeLog 2015-10-22 21:54:11 UTC (rev 191479)
+++ trunk/Source/WebCore/ChangeLog 2015-10-22 22:14:08 UTC (rev 191480)
@@ -1,3 +1,18 @@
+2015-10-22 Daniel Bates <[email protected]>
+
+ Unreviewed, rolling out r191113.
+
+ Rollout r144451 since it regressed the visibility of the
+ search cancel button when a search field is empty or showing
+ placeholder text. Further investigation is needed.
+
+ Reverted changeset:
+
+ "[iOS] DOM click event may not be dispatched when page has
+ :active style and <input type="search">"
+ https://bugs.webkit.org/show_bug.cgi?id=144451
+ http://trac.webkit.org/changeset/191113
+
2015-10-22 Simon Fraser <[email protected]>
Add ways to log to log channels via a functional syntax, and via a TextStream
Modified: trunk/Source/WebCore/rendering/RenderSearchField.cpp (191479 => 191480)
--- trunk/Source/WebCore/rendering/RenderSearchField.cpp 2015-10-22 21:54:11 UTC (rev 191479)
+++ trunk/Source/WebCore/rendering/RenderSearchField.cpp 2015-10-22 22:14:08 UTC (rev 191480)
@@ -52,6 +52,8 @@
RenderSearchField::RenderSearchField(HTMLInputElement& element, Ref<RenderStyle>&& style)
: RenderTextControlSingleLine(element, WTF::move(style))
+ , m_searchPopupIsVisible(false)
+ , m_searchPopup(0)
{
ASSERT(element.isSearchField());
}
@@ -165,22 +167,27 @@
m_searchPopup->popupMenu()->updateFromElement();
}
-void RenderSearchField::updateCancelButtonVisibility()
+void RenderSearchField::updateCancelButtonVisibility() const
{
RenderElement* cancelButtonRenderer = cancelButtonElement()->renderer();
if (!cancelButtonRenderer)
return;
- bool wasCancelButtonVisible = m_isCancelButtonVisible;
- m_isCancelButtonVisible = style().visibility() == VISIBLE && !inputElement().value().isEmpty();
- if (wasCancelButtonVisible == m_isCancelButtonVisible)
+ const RenderStyle& curStyle = cancelButtonRenderer->style();
+ EVisibility buttonVisibility = visibilityForCancelButton();
+ if (curStyle.visibility() == buttonVisibility)
return;
- auto cancelButtonStyle = RenderStyle::clone(&cancelButtonRenderer->style());
- cancelButtonStyle.get().setVisibility(m_isCancelButtonVisible ? VISIBLE : HIDDEN);
+ auto cancelButtonStyle = RenderStyle::clone(&curStyle);
+ cancelButtonStyle.get().setVisibility(buttonVisibility);
cancelButtonRenderer->setStyle(WTF::move(cancelButtonStyle));
}
+EVisibility RenderSearchField::visibilityForCancelButton() const
+{
+ return (style().visibility() == HIDDEN || inputElement().value().isEmpty()) ? HIDDEN : VISIBLE;
+}
+
const AtomicString& RenderSearchField::autosaveName() const
{
return inputElement().fastGetAttribute(autosaveAttr);
Modified: trunk/Source/WebCore/rendering/RenderSearchField.h (191479 => 191480)
--- trunk/Source/WebCore/rendering/RenderSearchField.h 2015-10-22 21:54:11 UTC (rev 191479)
+++ trunk/Source/WebCore/rendering/RenderSearchField.h 2015-10-22 22:14:08 UTC (rev 191480)
@@ -36,7 +36,7 @@
RenderSearchField(HTMLInputElement&, Ref<RenderStyle>&&);
virtual ~RenderSearchField();
- void updateCancelButtonVisibility();
+ void updateCancelButtonVisibility() const;
void addSearchResult();
void stopSearchEventTimer();
@@ -50,6 +50,7 @@
virtual LayoutUnit computeControlLogicalHeight(LayoutUnit lineHeight, LayoutUnit nonContentHeight) const override;
virtual LayoutUnit computeLogicalHeightLimit() const override;
virtual void updateFromElement() override;
+ EVisibility visibilityForCancelButton() const;
const AtomicString& autosaveName() const;
// PopupMenuClient methods
@@ -84,8 +85,7 @@
HTMLElement* resultsButtonElement() const;
HTMLElement* cancelButtonElement() const;
- bool m_searchPopupIsVisible { false };
- bool m_isCancelButtonVisible { false };
+ bool m_searchPopupIsVisible;
RefPtr<SearchPopupMenu> m_searchPopup;
Vector<RecentSearch> m_recentSearches;
};