Commit 061700e7 authored by hyatt's avatar hyatt

Fix :hover performance regression on wsj.com. Moving my

	<a name="foo"> quirk down into the :hover rule  matching code,
	so that we'll know never to apply :hover to anchorless <a>s.

        Reviewed by gramps

        * khtml/css/cssstyleselector.cpp:
        * khtml/rendering/render_object.cpp:
        (RenderObject::setHoverAndActive):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent aa81b2bb
2003-01-20 David Hyatt <hyatt@apple.com>
Fix :hover performance regression on wsj.com. Moving my
<a name="foo"> quirk down into the :hover rule matching code,
so that we'll know never to apply :hover to anchorless <a>s.
Reviewed by gramps
* khtml/css/cssstyleselector.cpp:
* khtml/rendering/render_object.cpp:
(RenderObject::setHoverAndActive):
2003-01-20 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
......
2003-01-20 David Hyatt <hyatt@apple.com>
Fix :hover performance regression on wsj.com. Moving my
<a name="foo"> quirk down into the :hover rule matching code,
so that we'll know never to apply :hover to anchorless <a>s.
Reviewed by gramps
* khtml/css/cssstyleselector.cpp:
* khtml/rendering/render_object.cpp:
(RenderObject::setHoverAndActive):
2003-01-20 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
......
......@@ -805,16 +805,21 @@ bool CSSStyleSelector::checkOneSelector(DOM::CSSSelector *sel, DOM::ElementImpl
if ( pseudoState == PseudoVisited )
return true;
break;
case CSSSelector::PseudoHover:
if (element == e)
style->setAffectedByHoverRules(true);
if (e->renderer()) {
if (element != e)
e->renderer()->style()->setAffectedByHoverRules(true);
if (e->renderer()->mouseInside())
return true;
case CSSSelector::PseudoHover: {
// If we're in quirks mode, then hover should never match anchors with no
// href. This is important for sites like wsj.com.
if (strictParsing || e->id() != ID_A || e->hasAnchor()) {
if (element == e)
style->setAffectedByHoverRules(true);
if (e->renderer()) {
if (element != e)
e->renderer()->style()->setAffectedByHoverRules(true);
if (e->renderer()->mouseInside())
return true;
}
}
break;
}
case CSSSelector::PseudoFocus:
if (e && e->focused()) {
return true;
......
......@@ -1136,15 +1136,12 @@ void RenderObject::setHoverAndActive(NodeInfo& info, bool oldinside, bool inside
{
DOM::NodeImpl* elt = element();
if (elt) {
bool strictMode = (elt->getDocument()->parseMode() == DocumentImpl::Strict);
if (strictMode || elt->id() != ID_A || elt->hasAnchor()) {
bool oldactive = elt->active();
if (oldactive != (inside && info.active() && elt == info.innerNode()))
elt->setActive(inside && info.active() && elt == info.innerNode());
if ((oldinside != mouseInside() && style()->affectedByHoverRules()) ||
(oldactive != elt->active() && style()->affectedByActiveRules()))
elt->setChanged();
}
bool oldactive = elt->active();
if (oldactive != (inside && info.active() && elt == info.innerNode()))
elt->setActive(inside && info.active() && elt == info.innerNode());
if ((oldinside != mouseInside() && style()->affectedByHoverRules()) ||
(oldactive != elt->active() && style()->affectedByActiveRules()))
elt->setChanged();
}
}
......
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