Title: [91550] trunk
- Revision
- 91550
- Author
- [email protected]
- Date
- 2011-07-21 20:31:27 -0700 (Thu, 21 Jul 2011)
Log Message
REGRESSION(r90971): Placeholder and search cancel button are visible even in elements with visibility:hidden.
https://bugs.webkit.org/show_bug.cgi?id=65001
Reviewed by Dimitri Glazkov.
Source/WebCore:
Tests: fast/forms/placeholder-in-invisible-elements.html
fast/forms/search-cancel-in-invisible-elements.html
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::placeholderShouldBeVisible):
Don't show the placeholder if the 'visibility' property of the owner element is 'hidden.'
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::visibilityForCancelButton): ditto.
LayoutTests:
* fast/forms/placeholder-in-invisible-elements-expected.html: Added.
* fast/forms/placeholder-in-invisible-elements.html: Added.
* fast/forms/search-cancel-in-invisible-elements-expected.html: Added.
* fast/forms/search-cancel-in-invisible-elements.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (91549 => 91550)
--- trunk/LayoutTests/ChangeLog 2011-07-22 03:27:30 UTC (rev 91549)
+++ trunk/LayoutTests/ChangeLog 2011-07-22 03:31:27 UTC (rev 91550)
@@ -1,3 +1,15 @@
+2011-07-21 Kent Tamura <[email protected]>
+
+ REGRESSION(r90971): Placeholder and search cancel button are visible even in elements with visibility:hidden.
+ https://bugs.webkit.org/show_bug.cgi?id=65001
+
+ Reviewed by Dimitri Glazkov.
+
+ * fast/forms/placeholder-in-invisible-elements-expected.html: Added.
+ * fast/forms/placeholder-in-invisible-elements.html: Added.
+ * fast/forms/search-cancel-in-invisible-elements-expected.html: Added.
+ * fast/forms/search-cancel-in-invisible-elements.html: Added.
+
2011-07-21 Shinya Kawanaka <[email protected]>
The input[type="number"] with step="any" should not suffer from step mismatch.
Added: trunk/LayoutTests/fast/forms/placeholder-in-invisible-elements-expected.html (0 => 91550)
--- trunk/LayoutTests/fast/forms/placeholder-in-invisible-elements-expected.html (rev 0)
+++ trunk/LayoutTests/fast/forms/placeholder-in-invisible-elements-expected.html 2011-07-22 03:31:27 UTC (rev 91550)
@@ -0,0 +1,3 @@
+<!DOCTYPE html>
+<html>
+</html>
Property changes on: trunk/LayoutTests/fast/forms/placeholder-in-invisible-elements-expected.html
___________________________________________________________________
Added: svn:eol-style
Added: trunk/LayoutTests/fast/forms/placeholder-in-invisible-elements.html (0 => 91550)
--- trunk/LayoutTests/fast/forms/placeholder-in-invisible-elements.html (rev 0)
+++ trunk/LayoutTests/fast/forms/placeholder-in-invisible-elements.html 2011-07-22 03:31:27 UTC (rev 91550)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<body>
+<input placeholder=placeholder style="visibility:hidden"> <br>
+<input placeholder=placeholder style="display:none"> <br>
+<input placeholder=placeholder style="opacity:0"> <br>
+<textarea placeholder=placeholder style="visibility:hidden"></textarea> <br>
+<textarea placeholder=placeholder style="display:none"></textarea> <br>
+<textarea placeholder=placeholder style="opacity:0"></textarea> <br>
+
+<input placeholder=placeholder id=i>
+<script>
+document.getElementById('i').style.visibility = 'hidden';
+</script>
+</body>
+</html>
Property changes on: trunk/LayoutTests/fast/forms/placeholder-in-invisible-elements.html
___________________________________________________________________
Added: svn:eol-style
Added: trunk/LayoutTests/fast/forms/search-cancel-in-invisible-elements-expected.html (0 => 91550)
--- trunk/LayoutTests/fast/forms/search-cancel-in-invisible-elements-expected.html (rev 0)
+++ trunk/LayoutTests/fast/forms/search-cancel-in-invisible-elements-expected.html 2011-07-22 03:31:27 UTC (rev 91550)
@@ -0,0 +1,3 @@
+<!DOCTYPE html>
+<html>
+</html>
Property changes on: trunk/LayoutTests/fast/forms/search-cancel-in-invisible-elements-expected.html
___________________________________________________________________
Added: svn:eol-style
Added: trunk/LayoutTests/fast/forms/search-cancel-in-invisible-elements.html (0 => 91550)
--- trunk/LayoutTests/fast/forms/search-cancel-in-invisible-elements.html (rev 0)
+++ trunk/LayoutTests/fast/forms/search-cancel-in-invisible-elements.html 2011-07-22 03:31:27 UTC (rev 91550)
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<body>
+<input type=search value=q style="visibility:hidden"> <br>
+<input type=search value=q style="display:none"> <br>
+<input type=search value=q style="opacity:0"> <br>
+<input type=search value=q id=s>
+<script>
+document.getElementById('s').style.visibility = 'hidden';
+</script>
+</body>
+</html>
Property changes on: trunk/LayoutTests/fast/forms/search-cancel-in-invisible-elements.html
___________________________________________________________________
Added: svn:eol-style
Modified: trunk/Source/WebCore/ChangeLog (91549 => 91550)
--- trunk/Source/WebCore/ChangeLog 2011-07-22 03:27:30 UTC (rev 91549)
+++ trunk/Source/WebCore/ChangeLog 2011-07-22 03:31:27 UTC (rev 91550)
@@ -1,3 +1,19 @@
+2011-07-21 Kent Tamura <[email protected]>
+
+ REGRESSION(r90971): Placeholder and search cancel button are visible even in elements with visibility:hidden.
+ https://bugs.webkit.org/show_bug.cgi?id=65001
+
+ Reviewed by Dimitri Glazkov.
+
+ Tests: fast/forms/placeholder-in-invisible-elements.html
+ fast/forms/search-cancel-in-invisible-elements.html
+
+ * html/HTMLTextFormControlElement.cpp:
+ (WebCore::HTMLTextFormControlElement::placeholderShouldBeVisible):
+ Don't show the placeholder if the 'visibility' property of the owner element is 'hidden.'
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::visibilityForCancelButton): ditto.
+
2011-07-21 Shinya Kawanaka <[email protected]>
The input[type="number"] with step="any" should not suffer from step mismatch.
Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (91549 => 91550)
--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp 2011-07-22 03:27:30 UTC (rev 91549)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp 2011-07-22 03:31:27 UTC (rev 91550)
@@ -135,7 +135,8 @@
&& isEmptyValue()
&& isEmptySuggestedValue()
&& !isPlaceholderEmpty()
- && (document()->focusedNode() != this || (renderer() && renderer()->theme()->shouldShowPlaceholderWhenFocused()));
+ && (document()->focusedNode() != this || (renderer() && renderer()->theme()->shouldShowPlaceholderWhenFocused()))
+ && (!renderer() || renderer()->style()->visibility() == VISIBLE);
}
void HTMLTextFormControlElement::updatePlaceholderVisibility(bool placeholderValueChanged)
Modified: trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp (91549 => 91550)
--- trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp 2011-07-22 03:27:30 UTC (rev 91549)
+++ trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp 2011-07-22 03:31:27 UTC (rev 91550)
@@ -539,7 +539,7 @@
EVisibility RenderTextControlSingleLine::visibilityForCancelButton() const
{
- return inputElement()->value().isEmpty() ? HIDDEN : VISIBLE;
+ return (style()->visibility() == HIDDEN || inputElement()->value().isEmpty()) ? HIDDEN : VISIBLE;
}
const AtomicString& RenderTextControlSingleLine::autosaveName() const
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes