Commit 9ba14c60 authored by ch.dumez@samsung.com's avatar ch.dumez@samsung.com

Remove impossible conditions from SelectorChecker::checkOne()

Remove impossible conditions from SelectorChecker::checkOne(). The code is in
an if "(selector.m_match == CSSSelector::PseudoClass)" check scope so it is
impossible for "selector.m_match == CSSSelector::Tag" to ever be true in
the two conditions that are removed.

This is based the following WebKit revision by benjamin@webkit.org:
http://trac.webkit.org/changeset/156380

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/328443003

git-svn-id: svn://svn.chromium.org/blink/trunk@175839 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent f8e428d4
......@@ -787,7 +787,7 @@ bool SelectorChecker::checkOne(const SelectorCheckingContext& context, const Sib
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 (m_strictParsing || context.isSubSelector || (selector.m_match == CSSSelector::Tag && selector.tagQName() != anyQName() && !isHTMLAnchorElement(element)) || element.isLink()) {
if (m_strictParsing || context.isSubSelector || element.isLink()) {
if (m_mode == ResolvingStyle) {
if (context.elementStyle)
context.elementStyle->setAffectedByHover();
......@@ -801,7 +801,7 @@ bool SelectorChecker::checkOne(const SelectorCheckingContext& context, const Sib
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 (m_strictParsing || context.isSubSelector || (selector.m_match == CSSSelector::Tag && selector.tagQName() != anyQName() && !isHTMLAnchorElement(element)) || element.isLink()) {
if (m_strictParsing || context.isSubSelector || element.isLink()) {
if (m_mode == ResolvingStyle) {
if (context.elementStyle)
context.elementStyle->setAffectedByActive();
......
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