Commit a41f4b6b authored by jonlee@apple.com's avatar jonlee@apple.com

Clicking on the cancel button on readonly and disabled search fields darkens...

Clicking on the cancel button on readonly and disabled search fields darkens as if the search field was editable
https://bugs.webkit.org/show_bug.cgi?id=69886
<rdar://problem/10070187>

Reviewed by Adele Peterson.

.:

* ManualTests/search-cancel-button.html: Added.

Source/WebCore:

Tests: ManualTests/search-cancel-button.html

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSearchFieldCancelButton): If the input is readonly and/or disabled, force the cell to
render without highlight.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104332 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d3ee8b30
2012-01-04 Jon Lee <jonlee@apple.com>
Clicking on the cancel button on readonly and disabled search fields darkens as if the search field was editable
https://bugs.webkit.org/show_bug.cgi?id=69886
<rdar://problem/10070187>
Reviewed by Adele Peterson.
* ManualTests/search-cancel-button.html: Added.
2012-01-06 Simon Hausmann <simon.hausmann@nokia.com>
[Qt] Fix compilation of app code against QtWebKit master header file
......
<!DOCTYPE html>
<html>
<body>
<p>https://bugs.webkit.org/show_bug.cgi?id=69886 - Clicking on the cancel button on readonly and disabled search fields darkens as if the search field was editable</p>
<p>Clicking on the disabled/readonly search inputs should not render the cancel button dark when you click on them.</p>
<p>Normal search:<br/><input type=search value="This is a string of long text." /></p>
<p>Disabled search:<br/><input type=search value="This is a string of long text." disabled /></p>
<p>Readonly search:<br/><input type=search value="This is a string of long text." readonly /></p>
<p>Disabled and readonly search:<br/><input type=search value="This is a string of long text." disabled readonly /></p>
</body>
</html>
\ No newline at end of file
2012-01-04 Jon Lee <jonlee@apple.com>
Clicking on the cancel button on readonly and disabled search fields darkens as if the search field was editable
https://bugs.webkit.org/show_bug.cgi?id=69886
<rdar://problem/10070187>
Reviewed by Adele Peterson.
Tests: ManualTests/search-cancel-button.html
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSearchFieldCancelButton): If the input is readonly and/or disabled, force the cell to
render without highlight.
2012-01-06 Simon Fraser <simon.fraser@apple.com>
Mitigate scrollbar differences when running pixel tests
......@@ -1511,7 +1511,9 @@ void RenderThemeMac::adjustSearchFieldStyle(CSSStyleSelector* selector, RenderSt
bool RenderThemeMac::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
Node* input = o->node()->shadowAncestorNode();
Element* input = toElement(o->node()->shadowAncestorNode());
ASSERT(input);
if (!input->renderer()->isBox())
return false;
......@@ -1520,8 +1522,12 @@ bool RenderThemeMac::paintSearchFieldCancelButton(RenderObject* o, const PaintIn
NSSearchFieldCell* search = this->search();
updateActiveState([search cancelButtonCell], o);
updatePressedState([search cancelButtonCell], o);
if (input->isEnabledFormControl() && !input->isReadOnlyFormControl()) {
updateActiveState([search cancelButtonCell], o);
updatePressedState([search cancelButtonCell], o);
}
else if ([[search cancelButtonCell] isHighlighted])
[[search cancelButtonCell] setHighlighted:NO];
GraphicsContextStateSaver stateSaver(*paintInfo.context);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment