Commit 85c21c11 authored by hyatt's avatar hyatt

Fix for bug 8705, readonly text fields should not get focus rings. ...

        Fix for bug 8705, readonly text fields should not get focus rings.  Add a rule to that effect to
        html4.css and then also add readonly as a special case for style sharing so that we can retain the
        performance boost from sharing styles on inputs.

        Reviewed by bdash

        * css/cssstyleselector.cpp:
        (WebCore::CSSStyleSelector::canShareStyleWithElement):
        (WebCore::CSSStyleSelector::checkOneSelector):
        * css/html4.css:



git-svn-id: svn://svn.chromium.org/blink/trunk@18798 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent f40f272b
2007-01-11 David Hyatt <hyatt@apple.com>
Fix for bug 8705, readonly text fields should not get focus rings. Add a rule to that effect to
html4.css and then also add readonly as a special case for style sharing so that we can retain the
performance boost from sharing styles on inputs.
Reviewed by bdash
* css/cssstyleselector.cpp:
(WebCore::CSSStyleSelector::canShareStyleWithElement):
(WebCore::CSSStyleSelector::checkOneSelector):
* css/html4.css:
2007-01-11 David Hyatt <hyatt@apple.com>
Fix for bug 11595. Autoscrolling of layers didn't really work at all unless the layer was coincidentally
......
......@@ -696,7 +696,8 @@ bool CSSStyleSelector::canShareStyleWithElement(Node* n)
(s->isIndeterminate() == element->isIndeterminate()) &&
(s->isChecked() == element->isChecked()) &&
(s != s->document()->getCSSTarget() && element != element->document()->getCSSTarget()) &&
(s->getAttribute(typeAttr) == element->getAttribute(typeAttr))) {
(s->getAttribute(typeAttr) == element->getAttribute(typeAttr)) &&
(s->getAttribute(readonlyAttr) == element->getAttribute(readonlyAttr))) {
bool classesMatch = true;
if (s->hasClass()) {
const AtomicString& class1 = element->getAttribute(classAttr);
......@@ -1341,8 +1342,8 @@ bool CSSStyleSelector::checkOneSelector(CSSSelector* sel, Element* e, bool isSub
}
else if (sel->match == CSSSelector::Id)
return e->hasID() && e->getIDAttribute() == sel->value;
else if (style && (e != element || !styledElement || (!styledElement->isMappedAttribute(sel->attr) && sel->attr != typeAttr))) {
style->setAffectedByAttributeSelectors(); // Special-case the "type" attribute so input form controls can share style.
else if (style && (e != element || !styledElement || (!styledElement->isMappedAttribute(sel->attr) && sel->attr != typeAttr && sel->attr != readonlyAttr))) {
style->setAffectedByAttributeSelectors(); // Special-case the "type" and "readonly" attributes so input form controls can share style.
m_selectorAttrs.add(sel->attr.localName().impl());
}
......
......@@ -544,11 +544,8 @@ wbr {
outline: auto 5px -webkit-focus-ring-color
}
html:focus, body:focus {
outline: none
}
html:focus, body:focus {
/* Read-only text fields do not show a focus ring but do still receive focus */
html:focus, body:focus, input[readonly]:focus {
outline: none
}
......@@ -568,7 +565,7 @@ input[type="submit"]:focus,
input[type="file"]::-webkit-file-upload-button:focus {
outline-offset: 0
}
a:-webkit-any-link {
color: -webkit-link;
text-decoration: underline;
......
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