Commit d0cf0353 authored by darin's avatar darin

LayoutTests:

        Reviewed by Hyatt.

        - Test for http://bugzilla.opendarwin.org/show_bug.cgi?id=7327
          REGRESSION (r12869): :hover subselector does not work in quirks mode

        * fast/css/hover-subselector-expected.checksum: Added.
        * fast/css/hover-subselector-expected.png: Added.
        * fast/css/hover-subselector-expected.txt: Added.
        * fast/css/hover-subselector.html: Added.

WebCore:

        Test: fast/css/hover-subselector.html

        Reviewed by Hyatt.

        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7327
          REGRESSION (r12869): :hover subselector does not work in quirks mode

        * css/cssstyleselector.h:
        * css/cssstyleselector.cpp:
        (WebCore::CSSStyleSelector::checkSelector): Pass flag to indicate sub-selector.
        (WebCore::CSSStyleSelector::checkOneSelector): Apply the *:hover and *:active quirks only
        when there are no sub-selectors.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@13069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e477fd62
2006-03-01 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by Hyatt.
- Test for http://bugzilla.opendarwin.org/show_bug.cgi?id=7327
REGRESSION (r12869): :hover subselector does not work in quirks mode
* fast/css/hover-subselector-expected.checksum: Added.
* fast/css/hover-subselector-expected.png: Added.
* fast/css/hover-subselector-expected.txt: Added.
* fast/css/hover-subselector.html: Added.
2006-02-28 Justin Garcia <justin.garcia@apple.com>
Reviewed by mjs
......
f05a518d2d99841c147333a2795f8aab
\ No newline at end of file
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
layer at (0,0) size 800x600
RenderCanvas at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x576
RenderBlock {DIV} at (0,0) size 784x18
RenderInline {SPAN} at (0,0) size 225x18 [color=#FF0000]
RenderText {TEXT} at (0,0) size 225x18
text run at (0,0) width 225: "This should turn red when hovered."
RenderText {TEXT} at (0,0) size 0x0
RenderBlock {HR} at (0,26) size 784x2 [border: (1px inset #000000)]
RenderBlock {P} at (0,44) size 784x36
RenderText {TEXT} at (0,0) size 53x18
text run at (0,0) width 53: "Test for "
RenderInline {I} at (0,0) size 779x36
RenderInline {A} at (0,0) size 348x18 [color=#0000EE]
RenderText {TEXT} at (53,0) size 348x18
text run at (53,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7327"
RenderText {TEXT} at (401,0) size 779x36
text run at (401,0) width 378: " REGRESSION (r12869): :hover subselector does not work"
text run at (0,18) width 94: "in quirks mode"
RenderText {TEXT} at (94,18) size 98x18
text run at (94,18) width 98: ". This tests that "
RenderInline {CODE} at (0,0) size 96x15
RenderText {TEXT} at (192,20) size 96x15
text run at (192,20) width 96: "span#t:hover"
RenderText {TEXT} at (288,18) size 170x18
text run at (288,18) width 170: " matches the hovered span."
caret: position 1 of child 0 {TEXT} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
<html>
<head>
<title></title>
<style type="text/css">
span#t:hover { color: red; }
</style>
<script type="text/javascript">
function test()
{
if (!window.eventSender)
return;
eventSender.mouseMoveTo(0, 0);
document.body.offsetTop; // force layout
eventSender.mouseMoveTo(16, 16); // hover
eventSender.mouseDown(); // get noticed
eventSender.mouseUp();
}
</script>
</head>
<body onload="test()">
<div>
<span id="t">This should turn red when hovered.</span>
</div>
<hr>
<p>
Test for
<i><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=7327">http://bugzilla.opendarwin.org/show_bug.cgi?id=7327</a>
REGRESSION (r12869): :hover subselector does not work in quirks mode</i>.
This tests that <code>span#t:hover</code> matches the hovered span.
</p>
</body>
</html>
2006-03-01 Mitz Pettel <opendarwin.org@mitzpettel.com>
Test: fast/css/hover-subselector.html
Reviewed by Hyatt.
- fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7327
REGRESSION (r12869): :hover subselector does not work in quirks mode
* css/cssstyleselector.h:
* css/cssstyleselector.cpp:
(WebCore::CSSStyleSelector::checkSelector): Pass flag to indicate sub-selector.
(WebCore::CSSStyleSelector::checkOneSelector): Apply the *:hover and *:active quirks only
when there are no sub-selectors.
2006-03-01 Maciej Stachowiak <mjs@apple.com>
Rubber stamped by Hyatt.
......
......@@ -1156,7 +1156,7 @@ bool CSSStyleSelector::checkSelector(CSSSelector* sel, ElementImpl *e)
// a selector is invalid if something follows :first-xxx
if (elem == element && dynamicPseudo != RenderStyle::NOPSEUDO)
return false;
if (!checkOneSelector(sel, elem))
if (!checkOneSelector(sel, elem, true))
return false;
break;
}
......@@ -1184,7 +1184,7 @@ bool CSSStyleSelector::checkSelector(CSSSelector* sel, ElementImpl *e)
return true;
}
bool CSSStyleSelector::checkOneSelector(CSSSelector *sel, ElementImpl *e)
bool CSSStyleSelector::checkOneSelector(CSSSelector* sel, ElementImpl* e, bool isSubSelector)
{
if(!e)
return false;
......@@ -1392,7 +1392,7 @@ bool CSSStyleSelector::checkOneSelector(CSSSelector *sel, ElementImpl *e)
case CSSSelector::PseudoHover: {
// If we're in quirks mode, then hover should never match anchors with no
// href and *:hover should not match anything. This is important for sites like wsj.com.
if (strictParsing || (sel->hasTag() && !e->hasTagName(aTag)) || e->isLink()) {
if (strictParsing || isSubSelector || sel->relation == CSSSelector::SubSelector || (sel->hasTag() && !e->hasTagName(aTag)) || e->isLink()) {
if (element == e && style)
style->setAffectedByHoverRules(true);
if (e->renderer()) {
......@@ -1423,7 +1423,7 @@ bool CSSStyleSelector::checkOneSelector(CSSSelector *sel, ElementImpl *e)
case CSSSelector::PseudoActive:
// If we're in quirks mode, then :active should never match anchors with no
// href and *:active should not match anything.
if (strictParsing || (sel->hasTag() && !e->hasTagName(aTag)) || e->isLink()) {
if (strictParsing || isSubSelector || sel->relation == CSSSelector::SubSelector || (sel->hasTag() && !e->hasTagName(aTag)) || e->isLink()) {
if (element == e && style)
style->setAffectedByActiveRules(true);
else if (e->renderer())
......
......@@ -135,7 +135,7 @@ class StyledElementImpl;
bool checkSelector(CSSSelector* selector, ElementImpl *e);
/* checks if the selector matches the given Element */
bool checkOneSelector(CSSSelector *selector, ElementImpl *e);
bool checkOneSelector(CSSSelector*, ElementImpl*, bool isSubSelector = false);
/* This function fixes up the default font size if it detects that the
current generic font family has changed. -dwh */
......
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